foundation-navigation 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/foundation-navigation/builder.rb +12 -2
- data/lib/foundation-navigation/dropdown.rb +1 -5
- data/lib/foundation-navigation/menu_group.rb +1 -5
- data/lib/foundation-navigation/topbar.rb +1 -5
- data/lib/foundation-navigation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f21033def3669bb8b5e6eb377ada00c0df8d4a
|
4
|
+
data.tar.gz: 246a9e4303a9432f5486fb88e0a8cfd6dcb215a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc9a4e68bd5b846192e78d4f0c8391321fb333c96c82b20954a8354faf284b29e33f1cc3f87f4225e50ad5b0aeba0d05a86651eb65318826fc8e0fbc301b57bd
|
7
|
+
data.tar.gz: 4390f1befb564d68210afb41f8ea74a26f47731eb0048a6ed94095e4999f0ebc69630a68ec064ae859a9369f2acac5c44af975ae97972ac635142009f43b3628
|
data/CHANGELOG.md
CHANGED
@@ -44,11 +44,21 @@ module FoundationNavigation
|
|
44
44
|
@node.to_s
|
45
45
|
end
|
46
46
|
|
47
|
-
def method_missing(
|
47
|
+
def method_missing(method, *args, &block)
|
48
|
+
if %i(li ul nav div h1 a span section).include? method
|
49
|
+
add_node(method, *args, &block)
|
50
|
+
else
|
51
|
+
@self_before_instance_eval.send(method, *args, &block)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
def add_node(name, *opts, &block)
|
48
57
|
parent = @node
|
49
|
-
@node = Node.new(parent, name, opts)
|
58
|
+
@node = Node.new(parent, name, *opts)
|
50
59
|
parent.children << @node if parent
|
51
60
|
if block_given?
|
61
|
+
@self_before_instance_eval = eval "self", block.binding
|
52
62
|
val = instance_eval(&block)
|
53
63
|
@node.children << val if val.is_a?(String)
|
54
64
|
end
|
@@ -11,11 +11,7 @@ module FoundationNavigation
|
|
11
11
|
def initialize(title, link = '#', &block)
|
12
12
|
li(class: 'has-dropdown not-click') do
|
13
13
|
a(href: link) { title }
|
14
|
-
ul(class: 'dropdown')
|
15
|
-
if block_given?
|
16
|
-
instance_eval(&block)
|
17
|
-
end
|
18
|
-
end
|
14
|
+
ul(class: 'dropdown', &block)
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
@@ -9,11 +9,7 @@ module FoundationNavigation
|
|
9
9
|
def initialize(orientation: nil, &block)
|
10
10
|
params = {}
|
11
11
|
params[:class] = orientation if orientation.present?
|
12
|
-
ul(params)
|
13
|
-
if block_given?
|
14
|
-
self.instance_eval(&block)
|
15
|
-
end
|
16
|
-
end
|
12
|
+
ul(params, &block)
|
17
13
|
end
|
18
14
|
end
|
19
15
|
|
@@ -10,11 +10,7 @@ module FoundationNavigation
|
|
10
10
|
def navigation(**args, &block)
|
11
11
|
nav(class: 'top-bar') do
|
12
12
|
build_subtree(FoundationNavigation::TitleArea, **args)
|
13
|
-
section(class: 'top-bar-section')
|
14
|
-
if block_given?
|
15
|
-
self.instance_eval(&block)
|
16
|
-
end
|
17
|
-
end
|
13
|
+
section(class: 'top-bar-section', &block)
|
18
14
|
end
|
19
15
|
end
|
20
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foundation-navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian de Castelberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|