File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 9
9
appraise "rails-4.0" do
10
10
gem 'rails' , '~> 4.0'
11
11
end
12
+
13
+ appraise "rails-4.0-with-therubyracer" do
14
+ gem 'rails' , '~> 4.0'
15
+ gem 'therubyracer' , '0.12.0' , :platform => :mri
16
+ end
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ module React
6
6
module JSX
7
7
def self . context
8
8
# TODO: create React::Source::contents_for
9
- contents = File . read ( React ::Source . bundled_path_for ( 'JSXTransformer.js' ) )
9
+ contents =
10
+ # If execjs uses therubyracer, there is no 'global'. Make sure
11
+ # we have it so JSX script can work properly.
12
+ 'var global = global || this;' +
13
+ File . read ( React ::Source . bundled_path_for ( 'JSXTransformer.js' ) )
10
14
@context ||= ExecJS . compile ( contents )
11
15
end
12
16
Original file line number Diff line number Diff line change 6
6
7
7
Rails . backtrace_cleaner . remove_silencers!
8
8
9
+ # Remove cached files
10
+ Rails . root . join ( 'tmp' ) . tap do |tmp |
11
+ tmp . rmtree
12
+ tmp . mkpath
13
+ end
14
+
9
15
# Load support files
10
16
Dir [ "#{ File . dirname ( __FILE__ ) } /support/**/*.rb" ] . each { |f | require f }
11
17
You can’t perform that action at this time.
0 commit comments