Skip to content

Commit eeabd5e

Browse files
author
Jack Casey
committed
Fix styling for standardrb, gemfiles, exclusions
1 parent f411453 commit eeabd5e

File tree

11 files changed

+68
-18
lines changed

11 files changed

+68
-18
lines changed

.travis.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ env:
2121
- COMMAND=rspec APPRAISAL_INITIALIZED=true
2222
matrix:
2323
exclude:
24+
# Don't run the appraisal version of the specs for the base gemfile
25+
- env: COMMAND=rspec APPRAISAL_INITIALIZED=true
26+
gemfile: Gemfile
27+
# Don't run the standardrb check on any gemfile except the base gemfile
28+
# (but run it for each ruby version)
2429
- env: COMMAND="standardrb --no-fix --format progress"
2530
gemfile: gemfiles/rails_4.gemfile
2631
- env: COMMAND="standardrb --no-fix --format progress"
@@ -32,11 +37,14 @@ matrix:
3237
- env: COMMAND="standardrb --no-fix --format progress"
3338
gemfile: gemfiles/rails_6.gemfile
3439
- env: COMMAND="standardrb --no-fix --format progress"
35-
gemfile: gemfiles/rails_5_graphiti_rails.gemfile
40+
gemfile: gemfiles/rails_5_0_graphiti_rails.gemfile
41+
- env: COMMAND="standardrb --no-fix --format progress"
42+
gemfile: gemfiles/rails_5_1_graphiti_rails.gemfile
43+
- env: COMMAND="standardrb --no-fix --format progress"
44+
gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
3645
- env: COMMAND="standardrb --no-fix --format progress"
3746
gemfile: gemfiles/rails_6_graphiti_rails.gemfile
38-
- env: COMMAND=rspec APPRAISAL_INITIALIZED=true
39-
gemfile: Gemfile
47+
# Don't run the basic versions of the specs for any of the specific gemfiles
4048
- env: COMMAND=rspec
4149
gemfile: gemfiles/rails_4.gemfile
4250
- env: COMMAND=rspec
@@ -55,6 +63,8 @@ matrix:
5563
gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
5664
- env: COMMAND=rspec
5765
gemfile: gemfiles/rails_6_graphiti_rails.gemfile
66+
67+
# Don't run rails 4 egmfile against any rubies (for some reason?)
5868
- gemfile: gemfiles/rails_4.gemfile
5969
rvm: 2.5
6070
- gemfile: gemfiles/rails_4.gemfile

Appraisals

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ appraise "rails-5_2-graphiti-rails" do
5454
end
5555

5656
appraise "rails-6" do
57-
gem "rails", "~> 6.0.0.rc1"
57+
gem "rails", "~> 6.0"
5858
gem "rspec-rails"
5959
gem "sqlite3", "~> 1.4.0"
6060
gem "database_cleaner"

gemfiles/rails_5_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 5.0.0"
5+
gem "rails", "~> 5.0"
66
gem "rspec-rails"
77
gem "sqlite3", "~> 1.3.6"
88
gem "database_cleaner"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 5.0"
6+
gem "rspec-rails"
7+
gem "sqlite3", "~> 1.3.6"
8+
gem "database_cleaner"
9+
gem "rescue_registry", git: "https://github.com/wagenet/rescue_registry.git", branch: "master"
10+
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
11+
12+
group :test do
13+
gem "pry"
14+
gem "pry-byebug", platform: [:mri]
15+
gem "appraisal"
16+
gem "guard"
17+
gem "guard-rspec"
18+
end
19+
20+
gemspec path: "../"

gemfiles/rails_5_1.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 5.1.7"
5+
gem "rails", "~> 5.1"
66
gem "rspec-rails"
77
gem "sqlite3", "~> 1.3.6"
88
gem "database_cleaner"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 5.1"
6+
gem "rspec-rails"
7+
gem "sqlite3", "~> 1.3.6"
8+
gem "database_cleaner"
9+
gem "rescue_registry", git: "https://github.com/wagenet/rescue_registry.git", branch: "master"
10+
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
11+
12+
group :test do
13+
gem "pry"
14+
gem "pry-byebug", platform: [:mri]
15+
gem "appraisal"
16+
gem "guard"
17+
gem "guard-rspec"
18+
end
19+
20+
gemspec path: "../"

gemfiles/rails_6.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 6.0.0"
5+
gem "rails", "~> 6.0"
66
gem "rspec-rails"
77
gem "sqlite3", "~> 1.4.0"
88
gem "database_cleaner"

gemfiles/rails_6_graphiti_rails.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 6.0.0"
5+
gem "rails", "~> 6.0"
66
gem "rspec-rails"
77
gem "sqlite3", "~> 1.4.0"
88
gem "database_cleaner"

lib/graphiti/adapters/active_record.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@ def filter_string_not_eql(scope, attribute, value)
6262
# anyway, we just don't support proper LIKE escaping in those versions.
6363
if ::ActiveRecord.version >= Gem::Version.new("5.0.0")
6464
def filter_string_match(scope, attribute, value, is_not: false)
65-
clause = sanitized_like_for(scope, attribute, value) do |v|
65+
clause = sanitized_like_for(scope, attribute, value) { |v|
6666
"%#{v}%"
67-
end
67+
}
6868
is_not ? scope.where.not(clause) : scope.where(clause)
6969
end
7070

7171
def filter_string_prefix(scope, attribute, value, is_not: false)
72-
clause = sanitized_like_for(scope, attribute, value) do |v|
72+
clause = sanitized_like_for(scope, attribute, value) { |v|
7373
"#{v}%"
74-
end
74+
}
7575
is_not ? scope.where.not(clause) : scope.where(clause)
7676
end
7777

7878
def filter_string_suffix(scope, attribute, value, is_not: false)
79-
clause = sanitized_like_for(scope, attribute, value) do |v|
79+
clause = sanitized_like_for(scope, attribute, value) { |v|
8080
"%#{v}"
81-
end
81+
}
8282
is_not ? scope.where.not(clause) : scope.where(clause)
8383
end
8484
else
@@ -311,11 +311,11 @@ def column_for(scope, name)
311311
def sanitized_like_for(scope, attribute, value, &block)
312312
escape_char = '\\'
313313
column = column_for(scope, attribute)
314-
map = value.map do |v|
314+
map = value.map { |v|
315315
v = v.downcase
316316
v = Sanitizer.sanitize_like(v, escape_char)
317317
block.call v
318-
end
318+
}
319319

320320
column.lower.matches_any(map, escape_char, true)
321321
end

0 commit comments

Comments
 (0)