compositor 0.1.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -0
- data/lib/compositor/renderer/iterator.rb +5 -1
- data/lib/compositor/renderer/merged.rb +3 -1
- data/lib/compositor/version.rb +1 -1
- metadata +15 -26
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5a22d9af52777bc34a8306ebcb637174e4beba07
|
4
|
+
data.tar.gz: d753d0cca7e3eb16dabfd5052451d52ba116b3d5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 974cb5f1d7c61401334417e1f7368018e0c4c330f66de51d02de24ef52f7f35e82eaaf7ead667f3547cecbd8bb51a25687fee3821e907f2fa28c7d4263534060
|
7
|
+
data.tar.gz: 04c56d82916f48214ce344ba88e18cde58d821f879964c4e49daff936fe615f5869db5b3e7525a81e2e8932e83bc17598cd664432becbcf8a08ea5c0ad6f65f5
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
Compositor
|
2
2
|
=====
|
3
3
|
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/compositor.png)](http://badge.fury.io/rb/compositor)
|
4
5
|
[![Build status](https://secure.travis-ci.org/wanelo/compositor.png)](http://travis-ci.org/wanelo/compositor)
|
5
6
|
|
6
7
|
A Composite Design Pattern with a neat DSL for constructing trees of objects in order to render them as a Hash, and subsequently
|
@@ -4,9 +4,11 @@ module Compositor
|
|
4
4
|
def render
|
5
5
|
return {} if collection.nil? or collection.size == 0
|
6
6
|
return collection.first.to_hash if collection.length == 1
|
7
|
-
|
7
|
+
result = {}
|
8
|
+
collection.each do |hash|
|
8
9
|
result.merge!(hash.to_hash)
|
9
10
|
end
|
11
|
+
result
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/compositor/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compositor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Konstantin Gredeskoul
|
@@ -10,70 +9,62 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-11-16 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: oj
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '0'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rspec
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: guard-rspec
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - '>='
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '0'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - '>='
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '0'
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rb-fsevent
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - '>='
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: '0'
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - '>='
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: '0'
|
79
70
|
description: Composite design pattern with a convenient DSL for building JSON/Hashes
|
@@ -118,27 +109,26 @@ files:
|
|
118
109
|
- spec/support/sample_dsl.rb
|
119
110
|
homepage: https://github.com/wanelo/compositor
|
120
111
|
licenses: []
|
112
|
+
metadata: {}
|
121
113
|
post_install_message:
|
122
114
|
rdoc_options: []
|
123
115
|
require_paths:
|
124
116
|
- lib
|
125
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
-
none: false
|
127
118
|
requirements:
|
128
|
-
- -
|
119
|
+
- - '>='
|
129
120
|
- !ruby/object:Gem::Version
|
130
121
|
version: '0'
|
131
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
-
none: false
|
133
123
|
requirements:
|
134
|
-
- -
|
124
|
+
- - '>='
|
135
125
|
- !ruby/object:Gem::Version
|
136
126
|
version: '0'
|
137
127
|
requirements: []
|
138
128
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.
|
129
|
+
rubygems_version: 2.1.11
|
140
130
|
signing_key:
|
141
|
-
specification_version:
|
131
|
+
specification_version: 4
|
142
132
|
summary: Composite design pattern with a convenient DSL for building JSON/Hashes of
|
143
133
|
complex objects
|
144
134
|
test_files:
|
@@ -151,4 +141,3 @@ test_files:
|
|
151
141
|
- spec/compositor/performance_spec.rb
|
152
142
|
- spec/spec_helper.rb
|
153
143
|
- spec/support/sample_dsl.rb
|
154
|
-
has_rdoc:
|