cistern 2.2.6 → 2.2.7
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 +4 -4
- data/.travis.yml +1 -0
- data/Gemfile +1 -0
- data/lib/cistern/attributes.rb +6 -3
- data/lib/cistern/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db9f936d47b541eb4361e967bffc5d80b4ec5b92
|
|
4
|
+
data.tar.gz: 2d07fb4e39fcdc9fad56a97f526331454a972deb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b38503613ce1b339b64dc5ea3168f0f327a4d93669098d2690d4050d2f60088416255993148e7d3d089d823535ae9f0b10ebdfa97fb638603ad59f98d98a8d19
|
|
7
|
+
data.tar.gz: 62472c37f3d596489c2e1bcae14b0b6934d8363459f8af0ae607de1272cb5ccbbe7eec03e9fb963cb8990fbd1dffa27da1602eb500b0d457783ef255e521ab35
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/lib/cistern/attributes.rb
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
module Cistern::Attributes
|
|
2
|
+
PROTECTED_METHODS = [:cistern, :service, :identity, :collection].freeze
|
|
3
|
+
TRUTHY = ['true', '1'].freeze
|
|
4
|
+
|
|
2
5
|
def self.parsers
|
|
3
6
|
@parsers ||= {
|
|
4
7
|
array: ->(v, _) { [*v] },
|
|
5
|
-
boolean: ->(v, _) {
|
|
8
|
+
boolean: ->(v, _) { TRUTHY.include?(v.to_s.downcase) },
|
|
6
9
|
float: ->(v, _) { v && v.to_f },
|
|
7
10
|
integer: ->(v, _) { v && v.to_i },
|
|
8
11
|
string: ->(v, opts) { (opts[:allow_nil] && v.nil?) ? v : v.to_s },
|
|
@@ -189,7 +192,7 @@ module Cistern::Attributes
|
|
|
189
192
|
end
|
|
190
193
|
|
|
191
194
|
def merge_attributes(new_attributes = {})
|
|
192
|
-
protected_methods = (Cistern::Model.instance_methods -
|
|
195
|
+
protected_methods = (Cistern::Model.instance_methods - PROTECTED_METHODS)
|
|
193
196
|
ignored_attributes = self.class.ignored_attributes
|
|
194
197
|
class_attributes = self.class.attributes
|
|
195
198
|
class_aliases = self.class.aliases
|
|
@@ -268,7 +271,7 @@ module Cistern::Attributes
|
|
|
268
271
|
protected
|
|
269
272
|
|
|
270
273
|
def missing_attributes(args)
|
|
271
|
-
|
|
274
|
+
args.select { |arg| send("#{arg}").nil? }
|
|
272
275
|
end
|
|
273
276
|
|
|
274
277
|
def changed!(attribute, from, to)
|
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: 2.2.
|
|
4
|
+
version: 2.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josh Lane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: API client framework extracted from Fog
|
|
14
14
|
email:
|
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
83
83
|
version: '0'
|
|
84
84
|
requirements: []
|
|
85
85
|
rubyforge_project:
|
|
86
|
-
rubygems_version: 2.5.
|
|
86
|
+
rubygems_version: 2.5.1
|
|
87
87
|
signing_key:
|
|
88
88
|
specification_version: 4
|
|
89
89
|
summary: API client framework
|