query_string_interface 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +3 -9
- data/Gemfile.lock +36 -44
- data/lib/query_string_interface/filter.rb +2 -2
- data/lib/query_string_interface/sorting_filters.rb +3 -3
- data/lib/query_string_interface/version.rb +1 -1
- metadata +23 -7
data/Gemfile
CHANGED
|
@@ -2,16 +2,10 @@ source "http://rubygems.org"
|
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
-
gem "rake"
|
|
5
|
+
gem "rake"
|
|
6
6
|
gem "i18n"
|
|
7
7
|
gem "tzinfo"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :mri_19 do
|
|
14
|
-
gem "ruby-debug19", :require => 'ruby-debug' if RUBY_VERSION < "1.9.3"
|
|
15
|
-
gem 'simplecov', :require => false
|
|
16
|
-
end
|
|
9
|
+
gem "debugger"
|
|
10
|
+
gem 'simplecov', :require => false
|
|
17
11
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,63 +1,55 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
query_string_interface (0.
|
|
4
|
+
query_string_interface (0.6.0)
|
|
5
5
|
activesupport (>= 3.0.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: http://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activesupport (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ruby_core_source (>= 0.1.4)
|
|
20
|
-
multi_json (1.0.4)
|
|
21
|
-
rake (0.8.7)
|
|
22
|
-
rbx-require-relative (0.0.5)
|
|
23
|
-
rspec (2.7.0)
|
|
24
|
-
rspec-core (~> 2.7.0)
|
|
25
|
-
rspec-expectations (~> 2.7.0)
|
|
26
|
-
rspec-mocks (~> 2.7.0)
|
|
27
|
-
rspec-core (2.7.1)
|
|
28
|
-
rspec-expectations (2.7.0)
|
|
29
|
-
diff-lcs (~> 1.1.2)
|
|
30
|
-
rspec-mocks (2.7.0)
|
|
31
|
-
ruby-debug (0.10.4)
|
|
32
|
-
columnize (>= 0.1)
|
|
33
|
-
ruby-debug-base (~> 0.10.4.0)
|
|
34
|
-
ruby-debug-base (0.10.4)
|
|
35
|
-
linecache (>= 0.3)
|
|
36
|
-
ruby-debug-base19 (0.11.25)
|
|
37
|
-
columnize (>= 0.3.1)
|
|
38
|
-
linecache19 (>= 0.5.11)
|
|
39
|
-
ruby_core_source (>= 0.1.4)
|
|
40
|
-
ruby-debug19 (0.11.6)
|
|
10
|
+
activesupport (4.0.0)
|
|
11
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
12
|
+
minitest (~> 4.2)
|
|
13
|
+
multi_json (~> 1.3)
|
|
14
|
+
thread_safe (~> 0.1)
|
|
15
|
+
tzinfo (~> 0.3.37)
|
|
16
|
+
atomic (1.1.10)
|
|
17
|
+
columnize (0.3.6)
|
|
18
|
+
debugger (1.6.0)
|
|
41
19
|
columnize (>= 0.3.1)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
debugger-linecache (~> 1.2.0)
|
|
21
|
+
debugger-ruby_core_source (~> 1.2.1)
|
|
22
|
+
debugger-linecache (1.2.0)
|
|
23
|
+
debugger-ruby_core_source (1.2.3)
|
|
24
|
+
diff-lcs (1.2.4)
|
|
25
|
+
i18n (0.6.4)
|
|
26
|
+
minitest (4.7.5)
|
|
27
|
+
multi_json (1.7.7)
|
|
28
|
+
rake (10.1.0)
|
|
29
|
+
rspec (2.13.0)
|
|
30
|
+
rspec-core (~> 2.13.0)
|
|
31
|
+
rspec-expectations (~> 2.13.0)
|
|
32
|
+
rspec-mocks (~> 2.13.0)
|
|
33
|
+
rspec-core (2.13.1)
|
|
34
|
+
rspec-expectations (2.13.0)
|
|
35
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
36
|
+
rspec-mocks (2.13.1)
|
|
37
|
+
simplecov (0.7.1)
|
|
38
|
+
multi_json (~> 1.0)
|
|
39
|
+
simplecov-html (~> 0.7.1)
|
|
40
|
+
simplecov-html (0.7.1)
|
|
41
|
+
thread_safe (0.1.0)
|
|
42
|
+
atomic
|
|
43
|
+
tzinfo (0.3.37)
|
|
51
44
|
|
|
52
45
|
PLATFORMS
|
|
53
46
|
ruby
|
|
54
47
|
|
|
55
48
|
DEPENDENCIES
|
|
49
|
+
debugger
|
|
56
50
|
i18n
|
|
57
51
|
query_string_interface!
|
|
58
|
-
rake
|
|
52
|
+
rake
|
|
59
53
|
rspec (>= 2.6.0)
|
|
60
|
-
ruby-debug
|
|
61
|
-
ruby-debug19
|
|
62
54
|
simplecov
|
|
63
55
|
tzinfo
|
|
@@ -70,8 +70,8 @@ module QueryStringInterface
|
|
|
70
70
|
|
|
71
71
|
private
|
|
72
72
|
def parsed_attribute
|
|
73
|
-
if raw_attribute.respond_to?(:
|
|
74
|
-
raw_attribute.
|
|
73
|
+
if raw_attribute.respond_to?(:name)
|
|
74
|
+
raw_attribute.name.to_s
|
|
75
75
|
elsif or_attribute?
|
|
76
76
|
'$or'
|
|
77
77
|
elsif raw_attribute =~ QueryStringInterface::ATTRIBUTE_REGEX
|
|
@@ -27,8 +27,8 @@ module QueryStringInterface
|
|
|
27
27
|
|
|
28
28
|
private
|
|
29
29
|
def replace(filter)
|
|
30
|
-
if filter.respond_to?(:
|
|
31
|
-
replaced_item_for filter.
|
|
30
|
+
if filter.respond_to?(:name) && filter.respond_to?(:operator)
|
|
31
|
+
replaced_item_for filter.name, filter.operator == 1 ? :asc : :desc
|
|
32
32
|
elsif filter.is_a?(String) or filter.is_a?(Symbol)
|
|
33
33
|
if match = matches?(filter)
|
|
34
34
|
replaced_item_for match[1], match[2]
|
|
@@ -48,4 +48,4 @@ module QueryStringInterface
|
|
|
48
48
|
filter.match(SORTING_FIELD_REGEXP)
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
|
-
end
|
|
51
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: query_string_interface
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2013-06-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
16
|
-
requirement:
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,10 +21,15 @@ dependencies:
|
|
|
21
21
|
version: 3.0.0
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements:
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 3.0.0
|
|
25
30
|
- !ruby/object:Gem::Dependency
|
|
26
31
|
name: rspec
|
|
27
|
-
requirement:
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
28
33
|
none: false
|
|
29
34
|
requirements:
|
|
30
35
|
- - ! '>='
|
|
@@ -32,7 +37,12 @@ dependencies:
|
|
|
32
37
|
version: 2.6.0
|
|
33
38
|
type: :development
|
|
34
39
|
prerelease: false
|
|
35
|
-
version_requirements:
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 2.6.0
|
|
36
46
|
description: This gem extracts params given as a hash to structured data, that can
|
|
37
47
|
be used when creating queries
|
|
38
48
|
email:
|
|
@@ -69,15 +79,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
69
79
|
- - ! '>='
|
|
70
80
|
- !ruby/object:Gem::Version
|
|
71
81
|
version: '0'
|
|
82
|
+
segments:
|
|
83
|
+
- 0
|
|
84
|
+
hash: 984341770598898315
|
|
72
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
86
|
none: false
|
|
74
87
|
requirements:
|
|
75
88
|
- - ! '>='
|
|
76
89
|
- !ruby/object:Gem::Version
|
|
77
90
|
version: '0'
|
|
91
|
+
segments:
|
|
92
|
+
- 0
|
|
93
|
+
hash: 984341770598898315
|
|
78
94
|
requirements: []
|
|
79
95
|
rubyforge_project: query_string_interface
|
|
80
|
-
rubygems_version: 1.8.
|
|
96
|
+
rubygems_version: 1.8.25
|
|
81
97
|
signing_key:
|
|
82
98
|
specification_version: 3
|
|
83
99
|
summary: Extracts query string params to a structured data, suitable to use for model
|