hyalite 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 118941d6d8e9e0de10198fc3467d32e51d9d4228
4
- data.tar.gz: 0a3c64f5a86bef4607b8f327c5d236635a6e0909
3
+ metadata.gz: 313aef2818fca410f8a5e8c2444ff9adb4e181f4
4
+ data.tar.gz: 96ed10c69f561a4a25bbb492fdd58208a0ecc683
5
5
  SHA512:
6
- metadata.gz: db7c3144dc9e4ebc3740c73b1c269802a6cafff8d723c5ee9da0daa794dc9b4a73b0915e8fd0c394a1ceb665d7db3f3079ab5c090ba33179ca83543600861d09
7
- data.tar.gz: ee587c12b24e89896746116fdbfc51fd1d310c8ea2e94ee01c47c2577871e9e60358e40c001a7f5471b4a2e16037486ca321db03e3bf72df4a7e9376ac0976bb
6
+ metadata.gz: 39495ec8dbf9169247f34e7e94bdd86675a9d2e9c4c3b28d66e2219dac66a54054b12fd6f9c002392423511d3425093443254bd2134c42f3eca323c01e037b9d
7
+ data.tar.gz: 397bd664105d77c4fbbd4cb29b36abfb1abbd8f499b39d255638a9dff075ec91af5040bceb1fe02e3858b56fa1f8392b07b59424d8ea7596a47d920f5ad9e74e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hyalite (0.0.5)
4
+ hyalite (0.0.6)
5
5
  opal
6
6
  opal-browser
7
7
 
@@ -2,7 +2,17 @@ require 'hyalite/short_hand'
2
2
 
3
3
  module Hyalite
4
4
  module Component
5
- include ShortHand
5
+ TAGS = %w(
6
+ a abbr address area article aside audio b base bdi bdo blockquote body br button button button button canvas caption
7
+ cite code col colgroup command datalist dd del details dfn div dl dt em embed fieldset figcaption figure footer form
8
+ h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link map mark menu meta
9
+ meter nav noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small
10
+ source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr
11
+ )
12
+
13
+ def pp(obj)
14
+ puts obj.inspect
15
+ end
6
16
 
7
17
  attr_accessor :props, :context, :refs
8
18
 
@@ -14,14 +24,28 @@ module Hyalite
14
24
  @refs = nil
15
25
  end
16
26
 
17
- def self.included(clazz)
18
- clazz.instance_eval do
27
+ def self.included(klass)
28
+ klass.instance_eval do
19
29
  define_singleton_method(:state) do |key, initial_value|
20
30
  (@initial_state ||= {})[key] = initial_value
21
31
  end
22
32
 
23
33
  define_singleton_method(:initial_state) { @initial_state || {} }
24
34
  end
35
+
36
+ TAGS.each do |tag|
37
+ define_method(tag) do |props, *children|
38
+ Hyalite.create_element(tag, props, *children)
39
+ end
40
+ end
41
+
42
+ klass.extend ClassMethods
43
+ end
44
+
45
+ module ClassMethods
46
+ def el(props, *children)
47
+ Hyalite.create_element(self, props, *children)
48
+ end
25
49
  end
26
50
 
27
51
  def initial_state
@@ -1,33 +1,6 @@
1
1
  module Hyalite
2
2
  module Component
3
3
  module ShortHand
4
- TAGS = %w(
5
- a abbr address area article aside audio b base bdi bdo blockquote body br button button button button canvas caption
6
- cite code col colgroup command datalist dd del details dfn div dl dt em embed fieldset figcaption figure footer form
7
- h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link map mark menu meta
8
- meter nav noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small
9
- source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr
10
- )
11
-
12
- def self.included(klass)
13
- TAGS.each do |tag|
14
- define_method(tag) do |props, *children|
15
- Hyalite.create_element(tag, props, *children)
16
- end
17
- end
18
-
19
- klass.extend ClassMethods
20
- end
21
-
22
- module ClassMethods
23
- def el(props, *children)
24
- Hyalite.create_element(self, props, *children)
25
- end
26
- end
27
-
28
- def pp(obj)
29
- puts obj.inspect
30
- end
31
4
  end
32
5
  end
33
6
  end
@@ -1,3 +1,3 @@
1
1
  module Hyalite
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyalite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2016-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal