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 +4 -4
- data/lib/cistern/collection.rb +2 -2
- data/lib/cistern/service.rb +6 -0
- data/lib/cistern/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c500e105441500ed5017e6ee8cfa638b37b36b
|
4
|
+
data.tar.gz: 761e5cd59044b2e7a265c84fdedd46fb3014ab57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023a5ef716628b5638eb310e81007caaf1619f187130cf3db81be5f76bba0709f891dcdf20692b25f60d3e9a6caa69ffb47ec4d515c0728e70123d10bf7dbdb6
|
7
|
+
data.tar.gz: 687f06ca53ab11ffda153ac1b28a63af4871766160bff0d794a25be28036aea4f4053d20bf0d8ff966936d24744081a0a7e01c354be7a74ae38fe2e4539ca3e6
|
data/lib/cistern/collection.rb
CHANGED
@@ -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 =
|
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
|
-
|
14
|
+
#{klass.name}.new(attributes.merge(service: self))
|
15
15
|
end
|
16
16
|
EOS
|
17
17
|
end
|
data/lib/cistern/service.rb
CHANGED
@@ -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
|
data/lib/cistern/version.rb
CHANGED
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.
|
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:
|
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:
|