compositor 2.0.0 → 2.0.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: 39aa83a1dbde3279e06295e7a5ce005444812d92
4
- data.tar.gz: b36f918486e1adcd5daa2da24676b96a2fac0d26
3
+ metadata.gz: 3c53b568af58b64887c5f17fdcb03e12d0a6ca80
4
+ data.tar.gz: 00eb3ec599013b9b412c69ac522c57737aea2fde
5
5
  SHA512:
6
- metadata.gz: c878fb457203fdd022a49e991d2dee76ac18bb068b7811a196e03e81222a23b73304740efac40a45c6b632561b639a5b04367481841a9419f0e8a4368f050373
7
- data.tar.gz: e6850ec7f0c0fd5a0b4c4eab1eb5ad2a69873db8afefd93ffde011b43c61e7f705251df25deb1957f230a493e0551d6e1f601ea434ab611ad757855c34601ca1
6
+ metadata.gz: cce15dd0a544692b5763d38a568c2126ea4ff9ae8d5019de244dbacd24f9b713124cd4bbc4542dd5d86ca7378f710ef0b3c47c382bb73525ba5592e10f78ac1a
7
+ data.tar.gz: 222782f040a41c9aa9101597e24f719b6865a3b71c6a1c87ad8efe0df3f41d4db93c607dc031a9337e2624c0c900036c1fac20074f17fedc73bff1e1c35b1acc
@@ -5,7 +5,7 @@ module Compositor
5
5
  if @root.is_a?(Symbol)
6
6
  super
7
7
  elsif @root
8
- root_class_name.to_sym
8
+ self.class.original_dsl_name.to_sym
9
9
  else
10
10
  nil
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Compositor
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -26,6 +26,16 @@ describe Compositor::Leaf do
26
26
  {a: "b"}.should == dsl.to_hash
27
27
  end
28
28
 
29
+ describe 'when root is true' do
30
+ it 'returns full root' do
31
+ dsl = Compositor::DSL.create(context) do |dsl|
32
+ dsl.dsl_string root: true
33
+ end
34
+
35
+ { dsl_string: { a: "b" } }.should == dsl.to_hash
36
+ end
37
+ end
38
+
29
39
  it "returns an instance of subclass" do
30
40
  dsl = Compositor::DSL.create(context).dsl_string
31
41
  dsl.should be_kind_of(DslStringCompositor)
@@ -2,9 +2,11 @@ class DslStringCompositor < Compositor::Leaf
2
2
  attr_accessor :string
3
3
 
4
4
  def to_hash
5
- {
5
+ with_root_element do
6
+ {
6
7
  a: "b"
7
- }
8
+ }
9
+ end
8
10
  end
9
11
  end
10
12
 
@@ -18,7 +20,7 @@ class DslIntCompositor < Compositor::Leaf
18
20
  def to_hash
19
21
  with_root_element do
20
22
  {
21
- number: @number
23
+ number: @number
22
24
  }
23
25
  end
24
26
  end
@@ -29,7 +31,7 @@ class DslObjectCompositor < Compositor::Leaf
29
31
 
30
32
  def to_hash
31
33
  {
32
- a: object
34
+ a: object
33
35
  }
34
36
  end
35
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compositor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul