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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4c5f6982cecb28d8daeff4f7d7ee18c79b6c4ec
4
- data.tar.gz: 64d61d6b1133d955a56bf634fc258e5c41b406dd
3
+ metadata.gz: d599d440f2533c2cbe89b0417da49adc8d6e759c
4
+ data.tar.gz: 9d670362bbcabbc26995eab9a445f64878a58865
5
5
  SHA512:
6
- metadata.gz: 147f2067fa53c583e2de82d7fc28e3ea397356e143733e0775aa5982cf65625a3e441edd2f120b625befd91f18d67c86c4d35822e5d800adeaf115a79e457aaf
7
- data.tar.gz: c8817c7ef94b9d1a1634b31cb31768cd8c06c094c504176e11c004be5f69332f40e0946b617bcc0e4df45b50478b14a45a0f4898518e4965548bdbd0b57cbc2b
6
+ metadata.gz: 47d5a83edba3f61c5f7ea0ea9699ef9d25f09a16e3d454b2f467f3895de8554f001d926283eaa1ea91ed98579a8d83dcf6b30e199493ec289960699424f05cd7
7
+ data.tar.gz: ee5c953e573f73376e75793dfbe0a8e5f6fd9f56620598ad726beff9db4621b4fd067f0efea9968381633e54c5e88f8cfd9910b8a113eada9e8ce7c20b163b82
checksums.yaml.gz.sig CHANGED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- muflax (0.2.0)
4
+ muflax (0.2.1)
5
5
  activesupport (~> 5)
6
6
  awesome_print
7
7
  debug_inspector
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "muflax"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
 
5
5
  s.authors = ["muflax"]
6
6
  s.summary = "muflax standard library"
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.0
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-05 00:00:00.000000000 Z
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
- n��+� ����F��i��&�s�V ��2'�(��ဲ���ߎL���k���UH@\x)�7J}���A�.�ETؽ�˓C�"��2��v��vbn<К;Z6��ֲ�'N�PdҀ��;����":#M^ ��Lc�~�"3߾x^3��)E��Nh: ��I�N����Psy��_�t�����a�stiRH<$.�z^a�,��#gb���T|`�$�K���w��EQ����2�Q%������YM\Y�鲻�R懙�?�
1
+ ��R��^�9X�Ȥj�� �A/��y1Z1�;�f ��/�T��5�!+��g��/
2
+ W���k�Y���eD�