cistern 1.0.1.pre1 → 1.0.1.pre2

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
  SHA1:
3
- metadata.gz: 15bb9aa35d55e41dc2e66076eaf53f2076b0e4c7
4
- data.tar.gz: ceeb2689d73eb0b70e2bce8b6daa1ff5722946cd
3
+ metadata.gz: b2c500e105441500ed5017e6ee8cfa638b37b36b
4
+ data.tar.gz: 761e5cd59044b2e7a265c84fdedd46fb3014ab57
5
5
  SHA512:
6
- metadata.gz: 4181a54a9463ce8812c03407ea8a6a4eb20ecaf4d029ff403b54c3608b2e5c24975898b96ae7c21c1bc828f25a5f88a88cb37c71357f3e95058b7499a098a6e4
7
- data.tar.gz: 12b76be5eb062a20126fdceb227e899ab93c27861a1a69dde37811572302b0c3a9e2aed008b978bd99fc95669540e143cfb0841d8d589f2d76de669cb5ea5db3
6
+ metadata.gz: 023a5ef716628b5638eb310e81007caaf1619f187130cf3db81be5f76bba0709f891dcdf20692b25f60d3e9a6caa69ffb47ec4d515c0728e70123d10bf7dbdb6
7
+ data.tar.gz: 687f06ca53ab11ffda153ac1b28a63af4871766160bff0d794a25be28036aea4f4053d20bf0d8ff966936d24744081a0a7e01c354be7a74ae38fe2e4539ca3e6
@@ -7,11 +7,11 @@ module Cistern::Collection
7
7
  ].to_set # :nodoc:
8
8
 
9
9
  def self.service_collection(service, klass)
10
- plural_name = Cistern::String.underscore(Cistern::String.demodulize(klass.name))
10
+ plural_name = service.collection_method(klass)
11
11
 
12
12
  service.const_get(:Collections).module_eval <<-EOS, __FILE__, __LINE__
13
13
  def #{plural_name}(attributes={})
14
- #{klass.name}.new(attributes.merge(service: self))
14
+ #{klass.name}.new(attributes.merge(service: self))
15
15
  end
16
16
  EOS
17
17
  end
@@ -99,6 +99,12 @@ class Cistern::Service
99
99
  @collections ||= []
100
100
  end
101
101
 
102
+ def collection_method(klass)
103
+ relative_demodulized = klass.name.gsub("#{self.name}::", "").gsub("::", "")
104
+
105
+ Cistern::String.underscore(relative_demodulized)
106
+ end
107
+
102
108
  def models
103
109
  @models ||= []
104
110
  end
@@ -1,3 +1,3 @@
1
1
  module Cistern
2
- VERSION = "1.0.1.pre1"
2
+ VERSION = "1.0.1.pre2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cistern
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.pre1
4
+ version: 1.0.1.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: API client framework extracted from Fog
14
14
  email: