Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 941535a

Browse files
committed
added hash.rb because of bug in opal 0.9
1 parent 03daf3b commit 941535a

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
source 'https://rubygems.org'
22
#gem 'opal-rails', git: "https://github.com/opal/opal-rails.git"
3+
#gem 'opal', "~> 0.9.x"
4+
#gem 'opal-rails', git: "https://github.com/reactrb/opal-rails.git"
5+
#gem 'opal-rspec-rails', git: 'https://github.com/reactrb/opal-rspec-rails.git'
6+
37
gemspec

config.ru

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ require "opal-jquery"
66

77
Opal.append_path File.expand_path('../spec', __FILE__)
88

9-
sprockets_env = Opal::RSpec::SprocketsEnvironment.new
10-
run Opal::Server.new(sprockets: sprockets_env) { |s|
11-
s.main = 'opal/rspec/sprockets_runner'
12-
sprockets_env.add_spec_paths_to_sprockets
13-
s.debug = false
14-
s.index_path = 'spec/index.html.erb'
15-
}
16-
17-
# run Opal::Server.new { |s|
18-
# s.main = 'opal/rspec/sprockets_runner'
19-
# s.append_path 'spec'
20-
# #s.append_path File.dirname(::React::Source.bundled_path_for("react-with-addons.js"))
21-
# s.debug = true
22-
# s.index_path = 'spec/index.html.erb'
23-
# }
9+
sprockets_env = Opal::RSpec::SprocketsEnvironment.new rescue nil
10+
if sprockets_env
11+
run Opal::Server.new(sprockets: sprockets_env) { |s|
12+
s.main = 'opal/rspec/sprockets_runner'
13+
sprockets_env.add_spec_paths_to_sprockets
14+
s.debug = false
15+
s.index_path = 'spec/index.html.erb'
16+
}
17+
else
18+
run Opal::Server.new { |s|
19+
s.main = 'opal/rspec/sprockets_runner'
20+
s.append_path 'spec'
21+
#s.append_path File.dirname(::React::Source.bundled_path_for("react-with-addons.js"))
22+
s.debug = true
23+
s.index_path = 'spec/index.html.erb'
24+
}
25+
end

lib/react/hash.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Hash
2+
3+
alias_method :_pre_react_patch_initialize, :initialize
4+
5+
def initialize(defaults = undefined, &block)
6+
if (`defaults===null`)
7+
_pre_react_patch_initialize(&block)
8+
else
9+
_pre_react_patch_initialize(defaults, &block)
10+
end
11+
end
12+
13+
end

lib/reactive-ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module React
2-
VERSION = "0.8.1"
2+
VERSION = "0.8.2"
33
end

0 commit comments

Comments
 (0)