hyalite 0.0.3 → 0.0.4

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: 1ea1c7240e460e33ee5ebfc1e434cd7493198c45
4
- data.tar.gz: c5f2098f1cfad4a794930c88f3adca4b0e6d15fe
3
+ metadata.gz: 50243436bdeb539169b3ef6609430fabbc33ed4f
4
+ data.tar.gz: 72b3e38f61f21af26e7c9aaad2e481c9a36488e5
5
5
  SHA512:
6
- metadata.gz: 2cbdd7ea485e11cd21a38a898b3f6287e122d5e55664ccc5843672a8e7c7c897b7842e96991f673b20ce334a37f15f3106d427e1d1fa311ed34dfd677711acc8
7
- data.tar.gz: b62902c084737bc896fc51690a8ee60ca7b819b6946741643e255ed2abf37733f1fd7fe078600d64bb5f82bca663ab719a254e3751bbf425cc34eece7b7f28e3
6
+ metadata.gz: 1c42d435e90b26c2c817ab114c20791a373e234a6a52435071af4661f8138524d118d897152cbcebcffdea88c3a2d7246dcb81349133527485f6bdf147995a59
7
+ data.tar.gz: 20b5d3766b0ced5983589820cbdef38f4e711991db93e617a9f9ddb63398c16d6f3a4f550b11b478dff1bcc2e6789f0206971146ecd5f9527fe2ac16e6eea556
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'opal-rspec'
5
+ gem 'opal-rspec', '0.5.0'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hyalite (0.0.3)
4
+ hyalite (0.0.4)
5
5
  opal
6
6
  opal-browser
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  concurrent-ruby (1.0.2)
12
12
  hike (1.2.3)
13
- opal (0.9.2)
13
+ opal (0.9.4)
14
14
  hike (~> 1.2)
15
15
  sourcemap (~> 0.1.0)
16
16
  sprockets (~> 3.1)
@@ -21,10 +21,10 @@ GEM
21
21
  opal-rspec (0.5.0)
22
22
  opal (>= 0.8.0, < 0.10)
23
23
  paggio (0.2.6)
24
- rack (1.6.4)
24
+ rack (2.0.1)
25
25
  rake (10.5.0)
26
26
  sourcemap (0.1.1)
27
- sprockets (3.6.0)
27
+ sprockets (3.7.0)
28
28
  concurrent-ruby (~> 1.0)
29
29
  rack (> 1, < 3)
30
30
  tilt (2.0.5)
@@ -35,8 +35,8 @@ PLATFORMS
35
35
  DEPENDENCIES
36
36
  bundler (~> 1.8)
37
37
  hyalite!
38
- opal-rspec
38
+ opal-rspec (= 0.5.0)
39
39
  rake (~> 10.0)
40
40
 
41
41
  BUNDLED WITH
42
- 1.12.5
42
+ 1.13.6
data/Rakefile CHANGED
@@ -1,15 +1,12 @@
1
- require 'bundler'
2
- Bundler.require
3
-
1
+ require 'opal'
2
+ require 'opal-browser'
3
+ require 'opal/rspec/rake_task'
4
4
  require "bundler/gem_tasks"
5
5
 
6
- task :default => :spec
7
-
8
6
  Opal::Processor.source_map_enabled = true
9
7
 
10
- require 'opal/rspec/rake_task'
11
8
  Opal::RSpec::RakeTask.new(:default) do |server, task|
12
- server.append_path File.expand_path('./client', __FILE__)
9
+ server.append_path File.expand_path('../client', __FILE__)
13
10
  server.source_map = true
14
11
  server.debug = true
15
12
  end
data/client/hyalite.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'opal'
2
2
  require 'browser'
3
+ require 'hyalite/logger'
3
4
  require 'hyalite/transaction'
4
5
  require 'hyalite/adler32'
5
6
  require 'hyalite/mount'
@@ -34,7 +34,7 @@ module Hyalite
34
34
  checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
35
35
  classID: MUST_USE_ATTRIBUTE,
36
36
  className: MUST_USE_PROPERTY,
37
- class: MUST_USE_PROPERTY,
37
+ class: MUST_USE_ATTRIBUTE,
38
38
  cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
39
39
  colSpan: nil,
40
40
  content: nil,
@@ -0,0 +1,45 @@
1
+ module Hyalite
2
+ module Logger
3
+ ERROR_LEVELS = %i(error warn info debug)
4
+
5
+ def self.log_level=(level)
6
+ @log_level_index = ERROR_LEVELS.index(level)
7
+ end
8
+
9
+ def self.log_level
10
+ @log_level_index ||= ERROR_LEVELS.index(:warn)
11
+ ERROR_LEVELS[@log_level_index]
12
+ end
13
+
14
+ def self.error(obj)
15
+ if self.log_level == :error
16
+ output(:error, obj)
17
+ end
18
+ end
19
+
20
+ def self.warn(obj)
21
+ if @log_level_index <= ERROR_LEVELS.index(:warn)
22
+ output(:warn, obj)
23
+ end
24
+ end
25
+
26
+ def self.info(obj)
27
+ if @log_level_index <= ERROR_LEVELS.index(:info)
28
+ output(:info, obj)
29
+ end
30
+ end
31
+
32
+ def self.debug(obj)
33
+ output(:debug, obj)
34
+ end
35
+
36
+ def self.output(level, obj)
37
+ case obj
38
+ when String
39
+ puts "#{level.upcase}: #{obj}"
40
+ else
41
+ puts "#{level.upcase}: #{obj.inspect}"
42
+ end
43
+ end
44
+ end
45
+ end
@@ -218,7 +218,7 @@ module Hyalite
218
218
  end
219
219
  end
220
220
 
221
- raise "can't find component_root"
221
+ raise "can't find component_root ancestor_node: #{ancestor_node}, target_id: #{target_id}"
222
222
  end
223
223
 
224
224
  def find_deepest_cached_ancestor(target_id)
@@ -24,6 +24,10 @@ module Hyalite
24
24
  Hyalite.create_element(self, props, *children)
25
25
  end
26
26
  end
27
+
28
+ def pp(obj)
29
+ puts obj.inspect
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Hyalite
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-17 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -99,6 +99,7 @@ files:
99
99
  - client/hyalite/instance_handles.rb
100
100
  - client/hyalite/internal_component.rb
101
101
  - client/hyalite/linked_value_utils.rb
102
+ - client/hyalite/logger.rb
102
103
  - client/hyalite/mount.rb
103
104
  - client/hyalite/multi_children.rb
104
105
  - client/hyalite/proxy_component.rb