polaroid 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/polaroid.rb +6 -4
- metadata +26 -16
- checksums.yaml +0 -7
data/lib/polaroid.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Polaroid < Module
|
2
2
|
|
3
|
-
VERSION = "0.0.
|
3
|
+
VERSION = "0.0.4"
|
4
4
|
|
5
5
|
def initialize(*messages)
|
6
6
|
@messages = messages
|
@@ -31,12 +31,14 @@ private #######################################################################
|
|
31
31
|
|
32
32
|
|
33
33
|
module ClassMethods
|
34
|
-
def build_from_snapshot(
|
34
|
+
def build_from_snapshot(snapshot, format = :hash)
|
35
35
|
case format
|
36
36
|
when :hash
|
37
|
-
|
37
|
+
snapshot_hash = snapshot.map.with_object({}) do |(k, v), hash|
|
38
|
+
hash[k.to_sym] = v
|
39
|
+
end
|
38
40
|
when :json
|
39
|
-
snapshot_hash = JSON.parse(
|
41
|
+
snapshot_hash = JSON.parse(snapshot).map.with_object({}) do |(k, v), hash|
|
40
42
|
hash[k.to_sym] = v
|
41
43
|
end
|
42
44
|
end
|
metadata
CHANGED
@@ -1,69 +1,78 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaroid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Paul Kwiatkowski
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.5'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.5'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rake
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '10.0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '10.0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: immutable_struct
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '1.1'
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '1.1'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: json
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ~>
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '1.8'
|
62
70
|
type: :runtime
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ~>
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '1.8'
|
69
78
|
description: Polaroid provides shortcuts to capture the state of a Ruby object, and
|
@@ -76,7 +85,7 @@ executables: []
|
|
76
85
|
extensions: []
|
77
86
|
extra_rdoc_files: []
|
78
87
|
files:
|
79
|
-
-
|
88
|
+
- .gitignore
|
80
89
|
- Gemfile
|
81
90
|
- LICENSE.txt
|
82
91
|
- README.md
|
@@ -86,26 +95,27 @@ files:
|
|
86
95
|
homepage: https://github.com/swifthand/polaroid
|
87
96
|
licenses:
|
88
97
|
- MIT
|
89
|
-
metadata: {}
|
90
98
|
post_install_message:
|
91
99
|
rdoc_options: []
|
92
100
|
require_paths:
|
93
101
|
- lib
|
94
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
95
104
|
requirements:
|
96
|
-
- -
|
105
|
+
- - ! '>='
|
97
106
|
- !ruby/object:Gem::Version
|
98
107
|
version: '0'
|
99
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
100
110
|
requirements:
|
101
|
-
- -
|
111
|
+
- - ! '>='
|
102
112
|
- !ruby/object:Gem::Version
|
103
113
|
version: '0'
|
104
114
|
requirements: []
|
105
115
|
rubyforge_project:
|
106
|
-
rubygems_version:
|
116
|
+
rubygems_version: 1.8.25
|
107
117
|
signing_key:
|
108
|
-
specification_version:
|
118
|
+
specification_version: 3
|
109
119
|
summary: Polaroid provides shortcuts to capture the state of a Ruby object, and can
|
110
120
|
construct a fake object later to mimic that state.
|
111
121
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: bcc0c39513e0b9468561e2d3bcf13e917dda9fb1
|
4
|
-
data.tar.gz: 5f61fe411b563dc1bddef7389edda3684ad6eb78
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 2eed4a6e80f15591b16bec0e972a53439957a44f1595c4dc5930116efcaa44d549c50895c37f8293fb8cc90c53e36d43196f02bc50956e536bf1e882f34496ed
|
7
|
-
data.tar.gz: 32aca9025f1217ad821a220534096465ccbcc697345e512dfa5aec3fda4ced875fe650dcb1c17eb6e0426f30acfd00aade004e402c046e2250599a6f9c0b3718
|