muflax 0.2.0 → 0.2.1
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
- checksums.yaml.gz.sig +0 -0
- data/Gemfile.lock +1 -1
- data/lib/muflax/value.rb +39 -0
- data/muflax.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d599d440f2533c2cbe89b0417da49adc8d6e759c
|
|
4
|
+
data.tar.gz: 9d670362bbcabbc26995eab9a445f64878a58865
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47d5a83edba3f61c5f7ea0ea9699ef9d25f09a16e3d454b2f467f3895de8554f001d926283eaa1ea91ed98579a8d83dcf6b30e199493ec289960699424f05cd7
|
|
7
|
+
data.tar.gz: ee5c953e573f73376e75793dfbe0a8e5f6fd9f56620598ad726beff9db4621b4fd067f0efea9968381633e54c5e88f8cfd9910b8a113eada9e8ce7c20b163b82
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/Gemfile.lock
CHANGED
data/lib/muflax/value.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# -*- encoding: utf-8 -*-
|
|
3
|
+
# Copyright Stefan Dorn <mail@muflax.com>, 2016
|
|
4
|
+
# License: GNU GPLv3 (or later) <http://www.gnu.org/copyleft/gpl.html>
|
|
5
|
+
|
|
6
|
+
class Value
|
|
7
|
+
def ==(other)
|
|
8
|
+
eql?(other)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def eql?(other)
|
|
12
|
+
self.class == other.class && differences_with(other).empty?
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def inspect
|
|
16
|
+
"#<#{self.class.name} #{self.class.attributes}>"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def to_h
|
|
20
|
+
Hash[to_a]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def recursive_to_h
|
|
24
|
+
Hash[to_a.map{|k, v| [k, Value.coerce_to_h(v)]}]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def to_a
|
|
28
|
+
self.class.attributes.map {|attr| [attr, send(attr)] }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.coerce_to_h(v)
|
|
32
|
+
case
|
|
33
|
+
when v.is_a?(Hash) ; Hash[v.map{|hk, hv| [hk, coerce_to_h(hv)]}]
|
|
34
|
+
when v.respond_to?(:map) ; v.map{|x| coerce_to_h(x)}
|
|
35
|
+
when v && v.respond_to?(:to_h) ; v.to_h
|
|
36
|
+
else ; v
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/muflax.gemspec
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: muflax
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- muflax
|
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
|
28
28
|
UTuVeeTxPBRAkEStqSL/T6ftwAkFee8ORyJjuOJgqTUPfe/qPIe/qQw3RVUesjYb
|
|
29
29
|
pNY9O02iAik7VcnsSGB3oSR6yBKVb8d2pFmbUEPSenyN/hGrJJKFPqqmCO9jhzlY
|
|
30
30
|
-----END CERTIFICATE-----
|
|
31
|
-
date: 2016-09-
|
|
31
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
|
32
32
|
dependencies:
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: activesupport
|
|
@@ -167,6 +167,7 @@ files:
|
|
|
167
167
|
- lib/muflax/objects.rb
|
|
168
168
|
- lib/muflax/regex.rb
|
|
169
169
|
- lib/muflax/string.rb
|
|
170
|
+
- lib/muflax/value.rb
|
|
170
171
|
- muflax.gemspec
|
|
171
172
|
homepage: http://github.com/muflax/ruby-muflax
|
|
172
173
|
licenses:
|
metadata.gz.sig
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
��R��^�9X�Ȥj�� �A/��y1Z1�;�f��/�T��5�!+��g��/
|
|
2
|
+
W���k�Y���eD�
|