qor_dsl 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/qor_dsl/node.rb +7 -0
- data/qor_dsl.gemspec +1 -1
- data/test/layout_test.rb +11 -0
- metadata +3 -3
data/lib/qor_dsl/node.rb
CHANGED
@@ -20,6 +20,13 @@ module Qor
|
|
20
20
|
root == self
|
21
21
|
end
|
22
22
|
|
23
|
+
def is_node?(*arguments)
|
24
|
+
result = true
|
25
|
+
result = (config_name.to_s == arguments[0].to_s) if arguments.length >= 1
|
26
|
+
result = result && (name.to_s == arguments[1].to_s) if arguments.length == 2
|
27
|
+
return result
|
28
|
+
end
|
29
|
+
|
23
30
|
def root
|
24
31
|
parent ? parent.root : self
|
25
32
|
end
|
data/qor_dsl.gemspec
CHANGED
data/test/layout_test.rb
CHANGED
@@ -39,9 +39,20 @@ describe Layout do
|
|
39
39
|
# Value for node
|
40
40
|
Layout::Configuration.find(:gadget, :quick_buy).value.must_equal :quick_buy
|
41
41
|
|
42
|
+
Layout::Configuration.find(:gadget, :quick_buy).value.must_equal :quick_buy
|
42
43
|
# More is coming... (multi, alias_node)
|
43
44
|
end
|
44
45
|
|
46
|
+
it "test node helper" do
|
47
|
+
Layout::Configuration.load('test/layout.rb', :force => true)
|
48
|
+
node = Layout::Configuration.find(:gadget, :quick_buy)
|
49
|
+
node.is_node?(:gadget).must_equal true
|
50
|
+
node.is_node?(:gadget, 'quick_buy').must_equal true
|
51
|
+
node.is_node?(:template).must_equal false
|
52
|
+
node.is_node?('gadget').must_equal true
|
53
|
+
node.is_node?.must_equal true
|
54
|
+
end
|
55
|
+
|
45
56
|
it "force load" do
|
46
57
|
Layout::Configuration.load('test/layout.rb', :force => true)
|
47
58
|
root = Layout::Configuration.root
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qor_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -48,7 +48,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
48
|
version: '0'
|
49
49
|
segments:
|
50
50
|
- 0
|
51
|
-
hash:
|
51
|
+
hash: -139701006465928578
|
52
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
version: '0'
|
58
58
|
segments:
|
59
59
|
- 0
|
60
|
-
hash:
|
60
|
+
hash: -139701006465928578
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
63
|
rubygems_version: 1.8.24
|