rokaki 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53244b10ca9f4942f648d825156616dfc9057cf8b5c39afa4f995152f8f56091
4
- data.tar.gz: 30b6db3fe0f4c6e68a6b4f628e254c85dcc7b72aa387d1ec91b1f5cd3c674010
3
+ metadata.gz: 7da479ed93b1e8e6aa8e91e080356e71b39061a647960175c49ef0f5a1b90855
4
+ data.tar.gz: 021aaa044351b96fec1566c1e900f816908cc9a7dcd53d7d8b2a547e7d120872
5
5
  SHA512:
6
- metadata.gz: 13df19ccfa76fc0265e7f12c0dacbb7c4dba8b07169db9a3c08c7368fe07cc9f50cbd2ea056490f0c6cff1dbafe550d28998c94ac339b0316d868a95e350a569
7
- data.tar.gz: 164ea95d95555b85ac86cc81fd2b2b9dca2b2245246241c6d52b7f16c8357aaa9e6c67d446b2f79d1213162aa35ece8b420f10545cd448517e32a8802d500e93
6
+ metadata.gz: 6f4b5be13f85b953aced1c4269539d5abe5c2611a22bbc3fdda2c19c8254e872116b51ec235e856015e0574f8439d761d3eb433c6f94499683590084814b560d
7
+ data.tar.gz: fb29f358eca0b1186afd6cb1417538bac16731a8a2c1faf06c9526afd7e00bc93bcbdfd642b1a8912b02fbe39318842e8730a738586e64ed5df5d7915e94a6b2
data/Gemfile.lock CHANGED
@@ -2,6 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  rokaki (0.5.1)
5
+ activesupport
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -17,6 +18,7 @@ GEM
17
18
  minitest (~> 5.1)
18
19
  tzinfo (~> 1.1)
19
20
  zeitwerk (~> 2.1, >= 2.1.8)
21
+ byebug (11.0.1)
20
22
  coderay (1.1.2)
21
23
  concurrent-ruby (1.1.5)
22
24
  diff-lcs (1.3)
@@ -52,6 +54,9 @@ GEM
52
54
  pry (0.12.2)
53
55
  coderay (~> 1.1.0)
54
56
  method_source (~> 0.9.0)
57
+ pry-byebug (3.7.0)
58
+ byebug (~> 11.0)
59
+ pry (~> 0.10)
55
60
  rake (10.5.0)
56
61
  rb-fsevent (0.10.3)
57
62
  rb-inotify (0.10.0)
@@ -87,6 +92,7 @@ DEPENDENCIES
87
92
  guard
88
93
  guard-rspec
89
94
  pry
95
+ pry-byebug
90
96
  rake (~> 10.0)
91
97
  rokaki!
92
98
  rspec (~> 3.0)
data/Guardfile CHANGED
@@ -36,6 +36,7 @@ guard :rspec, cmd: "bundle exec rspec" do
36
36
  watch(rspec.spec_support) { rspec.spec_dir }
37
37
  watch(rspec.spec_files)
38
38
 
39
+ watch(%r{^lib/rokaki/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
39
40
  # Ruby files
40
41
  ruby = dsl.ruby
41
42
  dsl.watch_spec_files_for(ruby.lib_files)
data/LICENSE.txt CHANGED
@@ -19,3 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
22
+
23
+ f007539360
data/README.md CHANGED
@@ -84,9 +84,12 @@ filter = ArticleFilter.new(filters: params[:filters])
84
84
  filtered_results = filter.results
85
85
 
86
86
  ```
87
+ ### Arrays of params
88
+ You can also filter collections of fields, simply pass an array of filter values instead of a single value, eg:- `{ date: '10-10-10', author: { first_name: ['Author1', 'Author2'] } }`.
89
+
87
90
 
88
91
  ### Partial matching
89
- You can use `like` (or, if you use postgres, the case insensitive `ilike`) to perform a partial match on a specific key, there are 3 options:- `:prefix`, `:circumfix` and `:suffix`. There are two syntaxes you can use for this:-
92
+ You can use `like` (or, if you use postgres, the case insensitive `ilike`) to perform a partial match on a specific field, there are 3 options:- `:prefix`, `:circumfix` and `:suffix`. There are two syntaxes you can use for this:-
90
93
 
91
94
  #### 1. The `filter` command syntax
92
95
 
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rokaki
4
+ module FilterModel
5
+ class BasicFilter
6
+ def initialize(keys:, prefix:, infix:, like_semantics:, i_like_semantics:)
7
+ @keys = keys
8
+ @prefix = prefix
9
+ @infix = infix
10
+ @like_semantics = like_semantics
11
+ @i_like_semantics = i_like_semantics
12
+ end
13
+ attr_reader :keys, :prefix, :infix, :like_semantics, :i_like_semantics
14
+ attr_accessor :filter_method, :filter_template
15
+
16
+ def call
17
+ first_key = keys.shift
18
+ filter = "#{prefix}#{first_key}"
19
+ name = first_key
20
+
21
+ keys.each do |key|
22
+ filter += "#{infix}#{key}"
23
+ name += "#{infix}#{key}"
24
+ end
25
+
26
+ @filter_method = "def #{prefix}filter_#{name};" \
27
+ "#{_chain_filter_type(name)} end;"
28
+
29
+ # class_eval filter_method, __FILE__, __LINE__ - 2
30
+
31
+ @filter_template = "@model = #{prefix}filter_#{name} if #{filter};"
32
+ end
33
+
34
+ def _chain_filter_type(key)
35
+ filter = "#{prefix}#{key}"
36
+ query = ''
37
+
38
+ if like_semantics && mode = like_semantics[key]
39
+ query = build_like_query(
40
+ type: 'LIKE',
41
+ query: query,
42
+ filter: filter,
43
+ mode: mode,
44
+ key: key
45
+ )
46
+ elsif i_like_semantics && mode = i_like_semantics[key]
47
+ query = build_like_query(
48
+ type: 'ILIKE',
49
+ query: query,
50
+ filter: filter,
51
+ mode: mode,
52
+ key: key
53
+ )
54
+ else
55
+ query = "@model.where(#{key}: #{filter})"
56
+ end
57
+
58
+ query
59
+ end
60
+
61
+ def build_like_query(type:, query:, filter:, mode:, key:)
62
+ query = "@model.where(\"#{key} #{type} :query\", "
63
+ query += "query: \"%\#{#{filter}}%\")" if mode == :circumfix
64
+ query += "query: \"%\#{#{filter}}\")" if mode == :prefix
65
+ query += "query: \"\#{#{filter}}%\")" if mode == :suffix
66
+ query
67
+ end
68
+ end
69
+ end
70
+ end
71
+
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rokaki
4
+ module FilterModel
5
+ class FilterChain
6
+ def initialize(keys)
7
+ @keys = keys
8
+ @filter_chain = []
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -2,6 +2,10 @@
2
2
 
3
3
  module Rokaki
4
4
  module FilterModel
5
+ # Converts deep hashes into keys
6
+ # effectively drops the leaf values and make's their
7
+ # keys the leaves
8
+ #
5
9
  class LikeKeys
6
10
  def initialize(args)
7
11
  @args = args
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+ require 'active_support/inflector'
3
+
4
+ module Rokaki
5
+ module FilterModel
6
+ class NestedFilter
7
+ def initialize(filter_key_object:, prefix:, infix:, like_semantics:, i_like_semantics:)
8
+ @filter_key_object = filter_key_object
9
+ @prefix = prefix
10
+ @infix = infix
11
+ @like_semantics = like_semantics
12
+ @i_like_semantics = i_like_semantics
13
+ @filter_methods = []
14
+ @filter_templates = []
15
+ end
16
+ attr_reader :filter_key_object, :prefix, :infix, :like_semantics, :i_like_semantics
17
+ attr_accessor :filter_methods, :filter_templates
18
+
19
+ def call # _chain_nested_filter
20
+ filter_key_object.keys.each do |key|
21
+ deep_chain([key], filter_key_object[key])
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def deep_chain(keys, value)
28
+ if value.is_a? Hash
29
+ value.keys.map do |key|
30
+ _keys = keys.dup << key
31
+ deep_chain(_keys, value[key])
32
+ end
33
+ end
34
+
35
+ if value.is_a? Array
36
+ value.each do |av|
37
+ _keys = keys.dup << av
38
+ _build_deep_chain(_keys)
39
+ end
40
+ end
41
+
42
+ if value.is_a? Symbol
43
+ _keys = keys.dup << value
44
+ _build_deep_chain(_keys)
45
+ end
46
+ end
47
+
48
+ def find_like_key(keys)
49
+ return nil unless like_semantics && like_semantics.keys.any?
50
+ current_like_key = like_semantics
51
+ keys.each do |key|
52
+ current_like_key = current_like_key[key]
53
+ end
54
+ current_like_key
55
+ end
56
+
57
+ def find_i_like_key(keys)
58
+ return nil unless like_semantics && i_like_semantics.keys.any?
59
+ current_like_key = i_like_semantics
60
+ keys.each do |key|
61
+ current_like_key = current_like_key[key]
62
+ end
63
+ current_like_key
64
+ end
65
+
66
+ def _build_deep_chain(keys)
67
+ name = '' # prefix.to_s
68
+ count = keys.size - 1
69
+
70
+ joins_before = []
71
+ joins_after = []
72
+ joins = ''
73
+ where_before = []
74
+ where_after = []
75
+ out = ''
76
+ mode = nil
77
+ type = nil
78
+ leaf = nil
79
+
80
+ if mode = find_like_key(keys)
81
+ type = 'LIKE'
82
+ elsif mode = find_i_like_key(keys)
83
+ type = 'ILIKE'
84
+ end
85
+ leaf = keys.pop
86
+
87
+ keys.each_with_index do |key, i|
88
+ if keys.length == 1
89
+ joins_before << ":#{key}"
90
+ else
91
+ if i == 0
92
+ joins_before << "#{key}: "
93
+ elsif (keys.length-1) == i
94
+ joins_before << " :#{key}"
95
+ else
96
+ joins_before << "{ #{key}:"
97
+ joins_after << " }"
98
+ end
99
+ end
100
+
101
+ name += "#{key}#{infix}"
102
+ where_before.push("{ #{key.to_s.pluralize}: ")
103
+ where_after.push(" }")
104
+ end
105
+
106
+ joins = joins_before + joins_after
107
+
108
+ name += "#{leaf}"
109
+ where_middle = ["{ #{leaf}: #{prefix}#{name} }"]
110
+
111
+ where = where_before + where_middle + where_after
112
+ joins = joins.join
113
+ where = where.join
114
+
115
+ if mode
116
+ query = build_like_query(
117
+ type: type,
118
+ query: '',
119
+ filter: "#{prefix}#{name}",
120
+ mode: mode,
121
+ key: keys.last.to_s.pluralize,
122
+ leaf: leaf
123
+ )
124
+
125
+ @filter_methods << "def #{prefix}filter#{infix}#{name};"\
126
+ "@model.joins(#{joins}).#{query}; end;"
127
+
128
+ @filter_templates << "@model = #{prefix}filter#{infix}#{name} if #{prefix}#{name};"
129
+ else
130
+ @filter_methods << "def #{prefix}filter#{infix}#{name};"\
131
+ "@model.joins(#{joins}).where(#{where}); end;"
132
+
133
+ @filter_templates << "@model = #{prefix}filter#{infix}#{name} if #{prefix}#{name};"
134
+ end
135
+ end
136
+
137
+ def build_like_query(type:, query:, filter:, mode:, key:, leaf:)
138
+ query = "where(\"#{key}.#{leaf} #{type} :query\", "
139
+ query += "query: \"%\#{#{filter}}%\")" if mode == :circumfix
140
+ query += "query: \"%\#{#{filter}}\")" if mode == :prefix
141
+ query += "query: \"\#{#{filter}}%\")" if mode == :suffix
142
+ query
143
+ end
144
+
145
+ end
146
+ end
147
+ end
148
+
@@ -21,62 +21,34 @@ module Rokaki
21
21
  end
22
22
 
23
23
  def filters(*filter_keys)
24
- define_filter_keys *filter_keys
24
+ define_filter_keys(*filter_keys)
25
25
 
26
26
  @_chain_filters ||= []
27
27
  filter_keys.each do |filter_key|
28
- _chain_filter([filter_key]) unless filter_key.is_a? Hash
29
- _chain_nested(filter_key) if filter_key.is_a? Hash
30
- end
31
28
 
32
- define_results
33
- end
29
+ # TODO: does the key need casting to an array here?
30
+ _chain_filter(filter_key) unless filter_key.is_a? Hash
34
31
 
35
- def _chain_filter(keys)
36
- first_key = keys.shift
37
- filter = "#{filter_key_prefix}#{first_key}"
38
- name = first_key
32
+ _chain_nested_filter(filter_key) if filter_key.is_a? Hash
39
33
 
40
- keys.each do |key|
41
- filter += "#{filter_key_infix}#{key}"
42
- name += "#{filter_key_infix}#{key}"
43
34
  end
44
35
 
45
- filter_method = "def #{filter_key_prefix}filter_#{name};" \
46
- "#{_chain_filter_type(name)} end;"
47
-
48
- class_eval filter_method, __FILE__, __LINE__ - 2
49
-
50
- @_chain_filters << "@model = #{filter_key_prefix}filter_#{name} if #{filter};"
36
+ define_results # writes out all the generated filters
51
37
  end
52
38
 
53
- def _chain_filter_type(key)
54
- filter = "#{filter_key_prefix}#{key}"
55
- query = ''
56
-
57
- if @_like_semantics && mode = @_like_semantics[key]
58
- query = like_semantics(
59
- type: 'LIKE',
60
- query: query,
61
- filter: filter,
62
- mode: mode,
63
- key: key
64
- )
65
-
66
- elsif @i_like_semantics && mode = @i_like_semantics[key]
67
- query = like_semantics(
68
- type: 'ILIKE',
69
- query: query,
70
- filter: filter,
71
- mode: mode,
72
- key: key
73
- )
74
-
75
- else
76
- query = "@model.where(#{key}: #{filter})"
77
- end
39
+ def _chain_filter(key)
40
+ basic_filter = BasicFilter.new(
41
+ keys: [key],
42
+ prefix: filter_key_prefix,
43
+ infix: filter_key_infix,
44
+ like_semantics: @_like_semantics,
45
+ i_like_semantics: @i_like_semantics
46
+ )
47
+ basic_filter.call
78
48
 
79
- query
49
+ class_eval basic_filter.filter_method, __FILE__, __LINE__ - 2
50
+
51
+ @_chain_filters << basic_filter.filter_template
80
52
  end
81
53
 
82
54
  def like_semantics(type:, query:, filter:, mode:, key:)
@@ -87,40 +59,22 @@ module Rokaki
87
59
  query
88
60
  end
89
61
 
90
- def _build_deep_chain(keys)
91
- name = filter_key_prefix.to_s
92
- count = keys.size - 1
93
-
94
- joins = ''
95
- where = ''
96
- out = ''
97
-
98
- leaf = keys.pop
99
-
100
- keys.each_with_index do |key, _i|
101
- next unless keys.length == 1
102
- name = "#{filter_key_prefix}#{key}#{filter_key_infix}#{leaf}"
103
- joins = ":#{key}"
104
-
105
- where = "{ #{key.to_s.pluralize}: { #{leaf}: #{name} } }"
62
+ def _chain_nested_filter(filters_object)
63
+ nested_filter = NestedFilter.new(
64
+ filter_key_object: filters_object,
65
+ prefix: filter_key_prefix,
66
+ infix: filter_key_infix,
67
+ like_semantics: @_like_semantics,
68
+ i_like_semantics: @i_like_semantics
69
+ )
70
+ nested_filter.call
71
+
72
+ nested_filter.filter_methods.each do |filter_method|
73
+ class_eval filter_method, __FILE__, __LINE__ - 2
106
74
  end
107
75
 
108
- joins = joins += out
109
- where = where += out
110
-
111
- # chain filter here?
112
- #
113
- filter_method = "def #{filter_key_prefix}filter_#{name};"\
114
- "@model.joins(#{joins}).where(#{where}); end;"
115
-
116
- class_eval filter_method, __FILE__, __LINE__ - 2
117
-
118
- @_chain_filters << "@model = #{filter_key_prefix}filter_#{name} if #{name};"
119
- end
120
-
121
- def _chain_nested(filters_object)
122
- filters_object.keys.each do |key|
123
- deep_chain([key], filters_object[key])
76
+ nested_filter.filter_templates.each do |filter_template|
77
+ @_chain_filters << filter_template
124
78
  end
125
79
  end
126
80
 
@@ -138,8 +92,9 @@ module Rokaki
138
92
  @_like_semantics = (@_like_semantics || {}).merge(args)
139
93
 
140
94
  key_builder = LikeKeys.new(args)
95
+ keys = key_builder.call
141
96
 
142
- filters(*key_builder.call)
97
+ filters(*keys)
143
98
  end
144
99
 
145
100
  def ilike(args)
@@ -147,8 +102,9 @@ module Rokaki
147
102
  @i_like_semantics = (@i_like_semantics || {}).merge(args)
148
103
 
149
104
  key_builder = LikeKeys.new(args)
105
+ keys = key_builder.call
150
106
 
151
- filters(*key_builder.call)
107
+ filters(*keys)
152
108
  end
153
109
 
154
110
  def deep_chain(keys, value)
@@ -176,7 +132,7 @@ module Rokaki
176
132
  # filter_model method
177
133
  #
178
134
  def define_results
179
- results_def = 'def results;model;'
135
+ results_def = 'def results; model;'
180
136
  @_chain_filters.each do |item|
181
137
  results_def += item
182
138
  end
@@ -50,7 +50,6 @@ module Rokaki
50
50
  end
51
51
  end
52
52
 
53
-
54
53
  if value.is_a? Array
55
54
  value.each do |av|
56
55
  _keys = keys.dup << av
@@ -1,3 +1,3 @@
1
1
  module Rokaki
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
data/lib/rokaki.rb CHANGED
@@ -4,6 +4,8 @@ require 'rokaki/version'
4
4
  require 'rokaki/filterable'
5
5
  require 'rokaki/filter_model'
6
6
  require 'rokaki/filter_model/like_keys'
7
+ require 'rokaki/filter_model/basic_filter'
8
+ require 'rokaki/filter_model/nested_filter'
7
9
 
8
10
  module Rokaki
9
11
  class Error < StandardError; end
data/rokaki.gemspec CHANGED
@@ -1,39 +1,44 @@
1
- lib = File.expand_path("lib", __dir__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "rokaki/version"
5
+ require 'rokaki/version'
4
6
 
5
7
  Gem::Specification.new do |spec|
6
- spec.name = "rokaki"
8
+ spec.name = 'rokaki'
7
9
  spec.version = Rokaki::VERSION
8
- spec.authors = ["Steve Martin"]
9
- spec.email = ["steve@martian.media"]
10
+ spec.authors = ['Steve Martin']
11
+ spec.email = ['steve@martian.media']
10
12
 
11
- spec.summary = %q{A web request filtering library}
12
- spec.description = %q{A dsl for filtering data in web requests}
13
- spec.homepage = "https://github.com/tevio/rokaki"
14
- spec.license = "MIT"
13
+ spec.summary = 'A web request filtering library'
14
+ spec.description = 'A dsl for filtering data in web requests'
15
+ spec.homepage = 'https://github.com/tevio/rokaki'
16
+ spec.license = 'MIT'
15
17
 
16
18
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
17
19
 
18
- spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata['homepage_uri'] = spec.homepage
19
21
  # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
20
22
  # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
23
 
22
24
  # Specify which files should be added to the gem when it is released.
23
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
27
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
28
  end
27
- spec.bindir = "exe"
29
+ spec.bindir = 'exe'
28
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_development_dependency "bundler", "~> 2.0"
32
- spec.add_development_dependency "rake", "~> 10.0"
33
- spec.add_development_dependency "rspec", "~> 3.0"
34
- spec.add_development_dependency "guard"
35
- spec.add_development_dependency "pry"
36
- spec.add_development_dependency "guard-rspec"
37
- spec.add_development_dependency "activerecord"
38
- spec.add_development_dependency "sqlite3"
31
+ spec.require_paths = ['lib']
32
+
33
+ spec.add_dependency 'activesupport'
34
+
35
+ spec.add_development_dependency 'activerecord'
36
+ spec.add_development_dependency 'bundler', '~> 2.0'
37
+ spec.add_development_dependency 'guard'
38
+ spec.add_development_dependency 'guard-rspec'
39
+ spec.add_development_dependency 'pry'
40
+ spec.add_development_dependency 'pry-byebug'
41
+ spec.add_development_dependency 'rake', '~> 10.0'
42
+ spec.add_development_dependency 'rspec', '~> 3.0'
43
+ spec.add_development_dependency 'sqlite3'
39
44
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rokaki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Martin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
19
+ version: '0'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: guard
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry
70
+ name: guard-rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: guard-rspec
84
+ name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: activerecord
98
+ name: pry-byebug
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '10.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.0'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: sqlite3
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +171,10 @@ files:
143
171
  - bin/setup
144
172
  - lib/rokaki.rb
145
173
  - lib/rokaki/filter_model.rb
174
+ - lib/rokaki/filter_model/basic_filter.rb
175
+ - lib/rokaki/filter_model/filter_chain.rb
146
176
  - lib/rokaki/filter_model/like_keys.rb
177
+ - lib/rokaki/filter_model/nested_filter.rb
147
178
  - lib/rokaki/filterable.rb
148
179
  - lib/rokaki/version.rb
149
180
  - rokaki.gemspec