inesita 0.0.1 → 0.0.2
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/README.md +24 -11
- data/inesita.gemspec +3 -3
- data/opal/inesita.rb +1 -0
- data/opal/virtual_dom_extension.rb +7 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d283f4594d9a35e4808267be7a702cab87f59323
|
|
4
|
+
data.tar.gz: 68236caf4fcf0c4fd5895bffc4d0a4acc938dedf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b8f1f9ee694c16e0a453c80f88674e3d4c9915c25e16bebf10cd37aba6cf94bccc43c76febc86ffa6a1422fbd7ad8ad58676e9e4eb86bc9a0d2161c8318310e
|
|
7
|
+
data.tar.gz: 0a63c1af4fba826d919489a225f8285a4c5582fae1092058e055fa64a398f0ca90c9ebeeb4597a5adf14f929ae5de203aa412665ca9bcd17b046b973211a6465
|
data/README.md
CHANGED
|
@@ -28,12 +28,33 @@ require 'virtual-dom' # required by opal-virtual-dom javascript library
|
|
|
28
28
|
require 'browser' # not required
|
|
29
29
|
require 'inesita'
|
|
30
30
|
|
|
31
|
+
class CounterNumber
|
|
32
|
+
include Inesita::Component
|
|
33
|
+
attr_reader :number
|
|
34
|
+
|
|
35
|
+
def initialize(number)
|
|
36
|
+
@number = number
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def random_style
|
|
40
|
+
{
|
|
41
|
+
color: %w(red green blue).sample
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def render
|
|
46
|
+
span style: random_style do
|
|
47
|
+
text number
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
31
52
|
class Counter
|
|
32
53
|
include Inesita::Component
|
|
33
54
|
attr_reader :count
|
|
34
55
|
|
|
35
|
-
def initialize(
|
|
36
|
-
@count =
|
|
56
|
+
def initialize(count = 0)
|
|
57
|
+
@count = count
|
|
37
58
|
end
|
|
38
59
|
|
|
39
60
|
def inc
|
|
@@ -46,20 +67,12 @@ class Counter
|
|
|
46
67
|
update
|
|
47
68
|
end
|
|
48
69
|
|
|
49
|
-
def random_style
|
|
50
|
-
{
|
|
51
|
-
color: %w(red green blue).sample
|
|
52
|
-
}
|
|
53
|
-
end
|
|
54
|
-
|
|
55
70
|
def render
|
|
56
71
|
div do
|
|
57
72
|
button onclick: -> { dec } do
|
|
58
73
|
text '-'
|
|
59
74
|
end
|
|
60
|
-
|
|
61
|
-
text count
|
|
62
|
-
end
|
|
75
|
+
component CounterNumber.new(count)
|
|
63
76
|
button onclick: -> { inc } do
|
|
64
77
|
text '+'
|
|
65
78
|
end
|
data/inesita.gemspec
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'inesita'
|
|
3
|
-
s.version = '0.0.
|
|
3
|
+
s.version = '0.0.2'
|
|
4
4
|
s.authors = [ 'Michał Kalbarczyk' ]
|
|
5
5
|
s.email = 'fazibear@gmail.com'
|
|
6
6
|
s.homepage = 'http://github.com/fazibear/inesita'
|
|
7
|
-
s.summary = '
|
|
8
|
-
s.description = '
|
|
7
|
+
s.summary = 'Frontend web framework for Opal'
|
|
8
|
+
s.description = 'Frontent web framework for Opal'
|
|
9
9
|
|
|
10
10
|
s.files = `git ls-files`.split("\n")
|
|
11
11
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
data/opal/inesita.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inesita
|
|
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
|
- Michał Kalbarczyk
|
|
@@ -52,7 +52,7 @@ dependencies:
|
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
|
-
description:
|
|
55
|
+
description: Frontent web framework for Opal
|
|
56
56
|
email: fazibear@gmail.com
|
|
57
57
|
executables: []
|
|
58
58
|
extensions: []
|
|
@@ -66,6 +66,7 @@ files:
|
|
|
66
66
|
- lib/inesita.rb
|
|
67
67
|
- opal/inesita.rb
|
|
68
68
|
- opal/inesita/component.rb
|
|
69
|
+
- opal/virtual_dom_extension.rb
|
|
69
70
|
homepage: http://github.com/fazibear/inesita
|
|
70
71
|
licenses: []
|
|
71
72
|
metadata: {}
|
|
@@ -88,5 +89,5 @@ rubyforge_project:
|
|
|
88
89
|
rubygems_version: 2.4.5
|
|
89
90
|
signing_key:
|
|
90
91
|
specification_version: 4
|
|
91
|
-
summary:
|
|
92
|
+
summary: Frontend web framework for Opal
|
|
92
93
|
test_files: []
|