search_cop 1.0.6 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/test.yml +42 -0
  3. data/.rubocop.yml +128 -0
  4. data/CHANGELOG.md +36 -5
  5. data/CONTRIBUTING.md +18 -0
  6. data/Gemfile +4 -17
  7. data/README.md +143 -35
  8. data/Rakefile +0 -1
  9. data/docker-compose.yml +18 -0
  10. data/gemfiles/rails5.gemfile +13 -0
  11. data/gemfiles/rails6.gemfile +13 -0
  12. data/lib/search_cop.rb +15 -13
  13. data/lib/search_cop/grammar_parser.rb +3 -4
  14. data/lib/search_cop/hash_parser.rb +23 -17
  15. data/lib/search_cop/helpers.rb +15 -0
  16. data/lib/search_cop/query_builder.rb +2 -4
  17. data/lib/search_cop/query_info.rb +0 -2
  18. data/lib/search_cop/search_scope.rb +8 -5
  19. data/lib/search_cop/version.rb +1 -1
  20. data/lib/search_cop/visitors.rb +0 -2
  21. data/lib/search_cop/visitors/mysql.rb +9 -7
  22. data/lib/search_cop/visitors/postgres.rb +18 -8
  23. data/lib/search_cop/visitors/visitor.rb +13 -6
  24. data/lib/search_cop_grammar.rb +18 -9
  25. data/lib/search_cop_grammar.treetop +6 -4
  26. data/lib/search_cop_grammar/attributes.rb +77 -34
  27. data/lib/search_cop_grammar/nodes.rb +7 -2
  28. data/search_cop.gemspec +9 -10
  29. data/test/and_test.rb +6 -8
  30. data/test/boolean_test.rb +7 -9
  31. data/test/database.yml +4 -1
  32. data/test/date_test.rb +38 -12
  33. data/test/datetime_test.rb +45 -12
  34. data/test/default_operator_test.rb +51 -0
  35. data/test/error_test.rb +2 -4
  36. data/test/float_test.rb +16 -11
  37. data/test/fulltext_test.rb +8 -10
  38. data/test/hash_test.rb +39 -31
  39. data/test/integer_test.rb +9 -11
  40. data/test/not_test.rb +6 -8
  41. data/test/or_test.rb +8 -10
  42. data/test/scope_test.rb +11 -13
  43. data/test/search_cop_test.rb +36 -34
  44. data/test/string_test.rb +67 -19
  45. data/test/test_helper.rb +24 -18
  46. data/test/visitor_test.rb +15 -8
  47. metadata +41 -55
  48. data/.travis.yml +0 -34
  49. data/Appraisals +0 -20
  50. data/gemfiles/3.2.gemfile +0 -26
  51. data/gemfiles/4.0.gemfile +0 -26
  52. data/gemfiles/4.1.gemfile +0 -26
  53. data/gemfiles/4.2.gemfile +0 -26
data/gemfiles/4.0.gemfile DELETED
@@ -1,26 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.0.0"
6
- gem "search_cop", :path => "../"
7
-
8
- platforms :jruby do
9
- gem "activerecord-jdbcmysql-adapter"
10
- gem "activerecord-jdbcsqlite3-adapter"
11
- gem "activerecord-jdbcpostgresql-adapter"
12
- end
13
-
14
- platforms :ruby do
15
- gem "sqlite3"
16
- gem "mysql2"
17
- gem "pg"
18
- end
19
-
20
- platforms :rbx do
21
- gem "racc"
22
- gem "rubysl", "~> 2.0"
23
- gem "psych"
24
- end
25
-
26
- gemspec :path => "../"
data/gemfiles/4.1.gemfile DELETED
@@ -1,26 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.1.0.beta"
6
- gem "search_cop", :path => "../"
7
-
8
- platforms :jruby do
9
- gem "activerecord-jdbcmysql-adapter"
10
- gem "activerecord-jdbcsqlite3-adapter"
11
- gem "activerecord-jdbcpostgresql-adapter"
12
- end
13
-
14
- platforms :ruby do
15
- gem "sqlite3"
16
- gem "mysql2"
17
- gem "pg"
18
- end
19
-
20
- platforms :rbx do
21
- gem "racc"
22
- gem "rubysl", "~> 2.0"
23
- gem "psych"
24
- end
25
-
26
- gemspec :path => "../"
data/gemfiles/4.2.gemfile DELETED
@@ -1,26 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.2.0.beta"
6
- gem "search_cop", :path => "../"
7
-
8
- platforms :jruby do
9
- gem "activerecord-jdbcmysql-adapter"
10
- gem "activerecord-jdbcsqlite3-adapter"
11
- gem "activerecord-jdbcpostgresql-adapter"
12
- end
13
-
14
- platforms :ruby do
15
- gem "sqlite3"
16
- gem "mysql2"
17
- gem "pg"
18
- end
19
-
20
- platforms :rbx do
21
- gem "racc"
22
- gem "rubysl", "~> 2.0"
23
- gem "psych"
24
- end
25
-
26
- gemspec :path => "../"