inesita 0.0.9 → 0.0.10
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 +4 -4
- data/inesita.gemspec +1 -1
- data/lib/inesita/cli/template/app/application.js.rb +1 -5
- data/lib/inesita/cli/template/app/components/goodbye.rb +1 -0
- data/lib/inesita/cli/template/app/components/home.rb +1 -0
- data/lib/inesita/cli/template/app/components/layout.rb +3 -1
- data/opal/inesita/application.rb +2 -6
- data/opal/inesita/component.rb +6 -12
- data/opal/inesita/layout.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 458b9936036113bd22c7281e5540805eaf750859
|
4
|
+
data.tar.gz: 7863484c3dc1751231b3e0f3e2dee9b72e777a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0da6474d7bd3f30e9c4e66c5d71614c29bd788c7e23cc0393b1a081c44a6a3816685452c52515aa6d5c6ce7017a04664e7846c0054a5f21652adb2451462f275
|
7
|
+
data.tar.gz: da1834d65e9c268644463ec5a86e4121249f9159989e98e47212be7b76814eba7a179a76a8b0c893d8d38c32c0e5286e868f2cc702b404287b1d79b5893bf73c
|
data/inesita.gemspec
CHANGED
@@ -3,11 +3,7 @@ require 'opal'
|
|
3
3
|
require 'browser'
|
4
4
|
require 'inesita'
|
5
5
|
|
6
|
-
|
7
|
-
require 'components/layout'
|
8
|
-
require 'components/home'
|
9
|
-
require 'components/welcome'
|
10
|
-
require 'components/goodbye'
|
6
|
+
require_tree './components'
|
11
7
|
|
12
8
|
$document.ready do
|
13
9
|
Inesita::Application.new(
|
data/opal/inesita/application.rb
CHANGED
@@ -10,15 +10,11 @@ module Inesita
|
|
10
10
|
@router = Router.new(options[:routes])
|
11
11
|
@layout = options[:layout]
|
12
12
|
|
13
|
-
|
14
|
-
self.class.component :layout_component, @layout.new(@router)
|
15
|
-
else
|
16
|
-
self.class.component :router_component, @router
|
17
|
-
end
|
13
|
+
component :parent, @layout ? @layout.create(@router) : @router
|
18
14
|
end
|
19
15
|
|
20
16
|
def render
|
21
|
-
component
|
17
|
+
component parent
|
22
18
|
end
|
23
19
|
end
|
24
20
|
end
|
data/opal/inesita/component.rb
CHANGED
@@ -27,19 +27,13 @@ module Inesita
|
|
27
27
|
`document.location.pathname`
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
def component(name, instance)
|
36
|
-
define_method name do
|
37
|
-
unless instance_variable_get(:"@#{name}")
|
38
|
-
instance_variable_set(:"@#{name}", instance)
|
39
|
-
instance_variable_get(:"@#{name}").parent(self)
|
40
|
-
end
|
41
|
-
instance_variable_get(:"@#{name}")
|
30
|
+
def component(name, instance)
|
31
|
+
self.class.define_method name do
|
32
|
+
unless instance_variable_get(:"@#{name}")
|
33
|
+
instance_variable_set(:"@#{name}", instance)
|
34
|
+
instance_variable_get(:"@#{name}").parent(self)
|
42
35
|
end
|
36
|
+
instance_variable_get(:"@#{name}")
|
43
37
|
end
|
44
38
|
end
|
45
39
|
end
|
data/opal/inesita/layout.rb
CHANGED
@@ -2,12 +2,15 @@ module Inesita
|
|
2
2
|
module Layout
|
3
3
|
def self.included(base)
|
4
4
|
base.include(Component)
|
5
|
+
base.extend(ClassMethods)
|
5
6
|
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
module ClassMethods
|
9
|
+
def create(outlet)
|
10
|
+
new.tap do |l|
|
11
|
+
l.component :outlet, outlet
|
12
|
+
end
|
13
|
+
end
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|