cmis-ruby 0.5.23 → 0.5.24

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: 856289cf9e1f5487a8468bbdb5ce0840e871eb9f
4
- data.tar.gz: 9a110ca5f85e0801ba036f5ee2817e0ee9ee934e
3
+ metadata.gz: 2db6a73373ddd663cb964d85058ec38e53f6ef75
4
+ data.tar.gz: e8ad9f1d4ccee4a870e0c524f01613512442b708
5
5
  SHA512:
6
- metadata.gz: 34c6c4229ea641c199f36c5582c5ecf11c7fa1f0b5093aa402d4a3a4cc0effedb5d5f6187fe34a319a5af89dbe1315c960c21e2750a324bd164910459213eead
7
- data.tar.gz: 7be66e7907459373b7f63289eba6a4a50b80e5a366a5a94f557f066626ed5f021c3ccb73cea06d222a6a776f839b25cac5f0f6565033913de20730d61314972f
6
+ metadata.gz: 5af30254eaa230833c5dceda3b51204161dbbd31473e3a9df3bc8f19e1d4e86052e8010bd54695f5668570400501c626a0218e4641ec44449050fbb831000799
7
+ data.tar.gz: 562dd6b72efad5db6b7e2caabb3428112975de9404257ac094ec5c6a9cce8d27bf6c76ce99d20c7f94dbfe94e1475d3c12b27b1ebec96417da4cb3fb5d530bcf
@@ -15,18 +15,12 @@ module CMIS
15
15
  end
16
16
 
17
17
  def build
18
- sec_types = @properties.select { |k, v| v.is_a? Hash }.keys
19
- statement = "select #{@queried_properties} from #{@type_id}"
20
- if sec_types.first # TODO Support multiple secondary types
21
- statement << " join #{sec_types.first} as X on cmis:objectId = X.cmis:objectId"
18
+ @type_id = Array(@type_id)
19
+ statement = "select #{@queried_properties} from #{@type_id[0]}"
20
+ if @type_id[1]
21
+ statement << " join #{@type_id[1]} as X on cmis:objectId = X.cmis:objectId"
22
22
  end
23
- clause = @properties.map do |k, v|
24
- if v.is_a? Hash
25
- v.map { |kk, vv| build_predicate(kk, vv) }
26
- else
27
- build_predicate(k, v)
28
- end
29
- end.flatten.join(' and ')
23
+ clause = @properties.map { |k, v| build_predicate(k, v) }.join(' and ')
30
24
  statement << " where #{clause}" unless clause.empty?
31
25
  statement
32
26
  end
@@ -1,3 +1,3 @@
1
1
  module CMIS
2
- VERSION = '0.5.23'
2
+ VERSION = '0.5.24'
3
3
  end
@@ -11,8 +11,8 @@ module CMIS
11
11
  expect(qs('T', {})).to eq 'select * from T'
12
12
  expect(qs('T', foo: 'bar')).to eq "select * from T where foo = 'bar'"
13
13
  expect(qs('T', bar: 'baz', pif: 'poef')).to eq "select * from T where bar = 'baz' and pif = 'poef'"
14
- expect(qs('T', foo: { bar: 'baz', pif: 'poef' })).to eq "select * from T join foo as X on cmis:objectId = X.cmis:objectId where bar = 'baz' and pif = 'poef'"
15
- expect(qs('T', a: 'b', c: 'd', foo: { bar: 'baz', pif: 'poef' })).to eq "select * from T join foo as X on cmis:objectId = X.cmis:objectId where a = 'b' and c = 'd' and bar = 'baz' and pif = 'poef'"
14
+ expect(qs(['T', 'foo'], bar: 'baz', pif: 'poef')).to eq "select * from T join foo as X on cmis:objectId = X.cmis:objectId where bar = 'baz' and pif = 'poef'"
15
+ expect(qs(['T', 'foo'], a: 'b', c: 'd', bar: 'baz', pif: 'poef')).to eq "select * from T join foo as X on cmis:objectId = X.cmis:objectId where a = 'b' and c = 'd' and bar = 'baz' and pif = 'poef'"
16
16
  end
17
17
  end
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmis-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.23
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenneth Geerts