query-interface-server 1.0.4 → 1.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd050560ba023e3105bcca63c25a537b2cbec376
4
- data.tar.gz: 6cde57ff0ca003036a8fa1ff0736a9e1e279b2c8
3
+ metadata.gz: 6fb550135a6842572fc049da4d88e94c6e869c24
4
+ data.tar.gz: 0be204391a9fd4b5765978125234b2b954e5bdc1
5
5
  SHA512:
6
- metadata.gz: 30ae3762d4eea72df0fd6b55400fee3bfc76773fdfd7fd0a93d33bc0a568cdd6307385800a920b217c4de0ecfc1e711039d65646f9c553cac649a23b400fdb87
7
- data.tar.gz: 6b4dac2e8e472b5b2cb06568b98486f777905e7499d5b6f255707e34cc5b3f520ce483f699222076415abe4a95af74fc6c5333625577cdc14e20a39070f320c3
6
+ metadata.gz: ac6665bc4094a107cce0156af9e97242d8414412fead578918bc9d7d24cf28e17eb9194f6ed39f17a9364527f3cf68ba737230565548d98252272c6f7313251d
7
+ data.tar.gz: 24d9b442c532ab19abaa70ca8f95805a1a671e0de9a19051b0b150238c86d57afc9315b5e96f5b0bd654b3c17d96b17ce2fbe52d39ec4a3cc65302b04533a1c5
data/Gemfile.lock CHANGED
@@ -1,99 +1,106 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (4.0.0)
5
- actionpack (= 4.0.0)
6
- mail (~> 2.5.3)
7
- actionpack (4.0.0)
8
- activesupport (= 4.0.0)
9
- builder (~> 3.1.0)
10
- erubis (~> 2.7.0)
4
+ actionmailer (4.1.1)
5
+ actionpack (= 4.1.1)
6
+ actionview (= 4.1.1)
7
+ mail (~> 2.5.4)
8
+ actionpack (4.1.1)
9
+ actionview (= 4.1.1)
10
+ activesupport (= 4.1.1)
11
11
  rack (~> 1.5.2)
12
12
  rack-test (~> 0.6.2)
13
- activemodel (4.0.0)
14
- activesupport (= 4.0.0)
15
- builder (~> 3.1.0)
16
- activerecord (4.0.0)
17
- activemodel (= 4.0.0)
18
- activerecord-deprecated_finders (~> 1.0.2)
19
- activesupport (= 4.0.0)
20
- arel (~> 4.0.0)
21
- activerecord-deprecated_finders (1.0.3)
22
- activesupport (4.0.0)
23
- i18n (~> 0.6, >= 0.6.4)
24
- minitest (~> 4.2)
25
- multi_json (~> 1.3)
13
+ actionview (4.1.1)
14
+ activesupport (= 4.1.1)
15
+ builder (~> 3.1)
16
+ erubis (~> 2.7.0)
17
+ activemodel (4.1.1)
18
+ activesupport (= 4.1.1)
19
+ builder (~> 3.1)
20
+ activerecord (4.1.1)
21
+ activemodel (= 4.1.1)
22
+ activesupport (= 4.1.1)
23
+ arel (~> 5.0.0)
24
+ activesupport (4.1.1)
25
+ i18n (~> 0.6, >= 0.6.9)
26
+ json (~> 1.7, >= 1.7.7)
27
+ minitest (~> 5.1)
26
28
  thread_safe (~> 0.1)
27
- tzinfo (~> 0.3.37)
28
- arel (4.0.0)
29
- atomic (1.1.10)
29
+ tzinfo (~> 1.1)
30
+ arel (5.0.1.20140414130214)
30
31
  autotest-standalone (4.5.11)
31
- builder (3.1.4)
32
- diff-lcs (1.2.4)
32
+ builder (3.2.2)
33
+ diff-lcs (1.2.5)
34
+ docile (1.1.3)
33
35
  erubis (2.7.0)
34
36
  hike (1.2.3)
35
- i18n (0.6.4)
37
+ i18n (0.6.9)
38
+ json (1.8.1)
36
39
  mail (2.5.4)
37
40
  mime-types (~> 1.16)
38
41
  treetop (~> 1.4.8)
39
- mime-types (1.23)
40
- minitest (4.7.5)
41
- multi_json (1.7.7)
42
- polyglot (0.3.3)
42
+ mime-types (1.25.1)
43
+ minitest (5.3.3)
44
+ multi_json (1.10.0)
45
+ polyglot (0.3.4)
43
46
  rack (1.5.2)
44
47
  rack-test (0.6.2)
45
48
  rack (>= 1.0)
46
- rails (4.0.0)
47
- actionmailer (= 4.0.0)
48
- actionpack (= 4.0.0)
49
- activerecord (= 4.0.0)
50
- activesupport (= 4.0.0)
49
+ rails (4.1.1)
50
+ actionmailer (= 4.1.1)
51
+ actionpack (= 4.1.1)
52
+ actionview (= 4.1.1)
53
+ activemodel (= 4.1.1)
54
+ activerecord (= 4.1.1)
55
+ activesupport (= 4.1.1)
51
56
  bundler (>= 1.3.0, < 2.0)
52
- railties (= 4.0.0)
53
- sprockets-rails (~> 2.0.0)
54
- railties (4.0.0)
55
- actionpack (= 4.0.0)
56
- activesupport (= 4.0.0)
57
+ railties (= 4.1.1)
58
+ sprockets-rails (~> 2.0)
59
+ railties (4.1.1)
60
+ actionpack (= 4.1.1)
61
+ activesupport (= 4.1.1)
57
62
  rake (>= 0.8.7)
58
63
  thor (>= 0.18.1, < 2.0)
59
- rake (10.1.0)
64
+ rake (10.3.1)
60
65
  rspec (2.14.1)
61
66
  rspec-core (~> 2.14.0)
62
67
  rspec-expectations (~> 2.14.0)
63
68
  rspec-mocks (~> 2.14.0)
64
- rspec-core (2.14.2)
65
- rspec-expectations (2.14.0)
69
+ rspec-core (2.14.8)
70
+ rspec-expectations (2.14.5)
66
71
  diff-lcs (>= 1.1.3, < 2.0)
67
- rspec-mocks (2.14.1)
68
- rspec-rails (2.14.0)
72
+ rspec-mocks (2.14.6)
73
+ rspec-rails (2.14.2)
69
74
  actionpack (>= 3.0)
75
+ activemodel (>= 3.0)
70
76
  activesupport (>= 3.0)
71
77
  railties (>= 3.0)
72
78
  rspec-core (~> 2.14.0)
73
79
  rspec-expectations (~> 2.14.0)
74
80
  rspec-mocks (~> 2.14.0)
75
- sequel (4.0.0)
76
- simplecov (0.7.1)
77
- multi_json (~> 1.0)
78
- simplecov-html (~> 0.7.1)
79
- simplecov-html (0.7.1)
80
- sprockets (2.10.0)
81
+ sequel (4.10.0)
82
+ simplecov (0.8.2)
83
+ docile (~> 1.1.0)
84
+ multi_json
85
+ simplecov-html (~> 0.8.0)
86
+ simplecov-html (0.8.0)
87
+ sprockets (2.12.1)
81
88
  hike (~> 1.2)
82
89
  multi_json (~> 1.0)
83
90
  rack (~> 1.0)
84
91
  tilt (~> 1.1, != 1.3.0)
85
- sprockets-rails (2.0.0)
92
+ sprockets-rails (2.1.3)
86
93
  actionpack (>= 3.0)
87
94
  activesupport (>= 3.0)
88
95
  sprockets (~> 2.8)
89
- thor (0.18.1)
90
- thread_safe (0.1.0)
91
- atomic
96
+ thor (0.19.1)
97
+ thread_safe (0.3.3)
92
98
  tilt (1.4.1)
93
- treetop (1.4.14)
99
+ treetop (1.4.15)
94
100
  polyglot
95
101
  polyglot (>= 0.3.1)
96
- tzinfo (0.3.37)
102
+ tzinfo (1.1.0)
103
+ thread_safe (~> 0.1)
97
104
 
98
105
  PLATFORMS
99
106
  ruby
@@ -51,8 +51,7 @@ module QueryInterface
51
51
  def auto_filter(*names)
52
52
  names.each do |name|
53
53
  self.filters[name] = Proc.new do |param|
54
- field = "#{model.table_name}__#{name}".to_sym
55
- filter(field => param)
54
+ filter(Sequel.qualify(model.table_name, name) => param)
56
55
  end
57
56
  end
58
57
  end
@@ -27,31 +27,27 @@ module QueryInterface
27
27
  end
28
28
 
29
29
  def validate(transformation)
30
- contraints = {
30
+ constraints = {
31
31
  filter: :collection, with: :collection,order: :collection,
32
32
  instance: :collection, context: :instance, map_ids: :collection,
33
33
  paginate: :collection, first: :collection, last: :collection, count: :collection
34
34
  }
35
35
  method = transformation['transformation'].to_sym
36
- raise UnknownTransformation, "#{method}" unless contraints.has_key?(method)
36
+ raise UnknownTransformation, "#{method}" unless constraints.has_key?(method)
37
37
  param = transformation['parameter']
38
- unless self.result_type == contraints[method]
38
+ unless self.result_type == constraints[method]
39
39
  raise InvalidContextException, "expected: #{description[:accepts]}, got: #{self.result_type}"
40
40
  end
41
41
  return [method, param]
42
42
  end
43
43
 
44
- def table
45
- self.result.model.table_name
46
- end
47
-
48
44
  def default_order
49
45
  self.order(self.result.model.primary_key.to_s)
50
46
  end
51
47
 
52
48
  def id_selector
53
49
  primary_key = self.result.model.primary_key ? self.result.model.primary_key : :id
54
- "#{self.result.model.table_name}__#{primary_key}".to_sym
50
+ Sequel.qualify(self.result.model.table_name, primary_key)
55
51
  end
56
52
 
57
53
  def filter(param)
@@ -90,7 +86,7 @@ module QueryInterface
90
86
  end
91
87
 
92
88
  def map_ids(param)
93
- self.default_order.select(self.id_selector).map(&:id)
89
+ self.default_order.select_map(self.id_selector)
94
90
  end
95
91
 
96
92
  def count(param)
@@ -1,7 +1,7 @@
1
1
  module QueryInterface
2
2
  module Server
3
3
 
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
5
5
 
6
6
  end
7
7
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.summary = "Server for the radar query interface"
24
24
  s.license = "ISC"
25
25
 
26
- s.add_runtime_dependency(%q<sequel>, '~> 3.48')
26
+ s.add_runtime_dependency(%q<sequel>, '~> 4.10')
27
27
  s.add_development_dependency(%q<rake>, '~> 10.1')
28
28
  s.add_development_dependency(%q<rspec>, '~> 2.14')
29
29
  s.add_development_dependency(%q<rails>, '~> 4.0')
@@ -47,7 +47,7 @@ describe QueryInterface::Server::Transformations do
47
47
  transformations = Foo.instance_variable_get(:@query_transformations)
48
48
  transformations[:filter].keys.should eq([:foo, :bar])
49
49
  transformations[:filter][:foo].should be_a(Proc)
50
- Foo.should_receive(:filter).with(foo_table__bar: 'bar_value')
50
+ Foo.should_receive(:filter).with(Sequel.qualify('foo_table', :bar) => 'bar_value')
51
51
  Foo.instance_exec('bar_value', &transformations[:filter][:bar])
52
52
  end
53
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query-interface-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Kopecky <andreas.kopecky@radarservices.com>
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-04 00:00:00.000000000 Z
13
+ date: 2014-05-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '3.48'
21
+ version: '4.10'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '3.48'
28
+ version: '4.10'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -126,9 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.2.1
129
+ rubygems_version: 2.2.2
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Server for the radar query interface
133
133
  test_files: []
134
- has_rdoc: