Skip to content

Commit 86c0983

Browse files
committed
Update all gems with bundle update
Also updated with some rubocop fixes.
1 parent 501d593 commit 86c0983

File tree

6 files changed

+129
-115
lines changed

6 files changed

+129
-115
lines changed

lib/react_on_rails/assets_precompile.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def symlink_non_digested_assets
6969
manifest_path = manifest_glob.first
7070
manifest_file = File.new(manifest_path)
7171
manifest_data = if File.extname(manifest_file) == ".json"
72-
JSON.load(manifest_file)["assets"]
72+
manifest_file_data = File.read(manifest_path)
73+
JSON.parse(manifest_file_data)["assets"]
7374
else
7475
YAML.load(manifest_file)
7576
end

lib/react_on_rails/configuration.rb

+34-21
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,48 @@ def self.configure
77
DEFAULT_GENERATED_ASSETS_DIR = File.join(%w(app assets webpack)).freeze
88

99
def self.setup_config_values
10-
if @configuration.webpack_generated_files.empty?
11-
files = ["webpack-bundle.js"]
12-
if @configuration.server_bundle_js_file.present?
13-
files << @configuration.server_bundle_js_file
14-
end
15-
@configuration.webpack_generated_files = files
16-
end
10+
ensure_webpack_generated_files_exists
11+
configure_generated_assets_dirs_deprecation
12+
ensure_generated_assets_dir_present
13+
ensure_server_bundle_js_file_has_no_path
14+
end
1715

18-
if @configuration.generated_assets_dirs.present?
19-
puts "[DEPRECATION] ReactOnRails: Use config.generated_assets_dir rather than "\
16+
def self.ensure_generated_assets_dir_present
17+
return unless @configuration.generated_assets_dir.blank?
18+
19+
@configuration.generated_assets_dir = DEFAULT_GENERATED_ASSETS_DIR
20+
puts "ReactOnRails: Set generated_assets_dir to default: #{DEFAULT_GENERATED_ASSETS_DIR}"
21+
end
22+
23+
def self.configure_generated_assets_dirs_deprecation
24+
return unless @configuration.generated_assets_dirs.present?
25+
26+
puts "[DEPRECATION] ReactOnRails: Use config.generated_assets_dir rather than "\
2027
"generated_assets_dirs"
21-
if @configuration.generated_assets_dir.blank?
22-
@configuration.generated_assets_dir = @configuration.generated_assets_dirs
23-
else
24-
puts "[DEPRECATION] ReactOnRails. You have both generated_assets_dirs and "\
28+
if @configuration.generated_assets_dir.blank?
29+
@configuration.generated_assets_dir = @configuration.generated_assets_dirs
30+
else
31+
puts "[DEPRECATION] ReactOnRails. You have both generated_assets_dirs and "\
2532
"generated_assets_dir defined. Define ONLY generated_assets_dir"
26-
end
2733
end
34+
end
2835

29-
if @configuration.generated_assets_dir.blank?
30-
@configuration.generated_assets_dir = DEFAULT_GENERATED_ASSETS_DIR
31-
puts "ReactOnRails: Set generated_assets_dir to default: #{DEFAULT_GENERATED_ASSETS_DIR}"
36+
def self.ensure_webpack_generated_files_exists
37+
return unless @configuration.webpack_generated_files.empty?
38+
39+
files = ["webpack-bundle.js"]
40+
if @configuration.server_bundle_js_file.present?
41+
files << @configuration.server_bundle_js_file
3242
end
43+
@configuration.webpack_generated_files = files
44+
end
45+
46+
def self.ensure_server_bundle_js_file_has_no_path
47+
return unless @configuration.server_bundle_js_file.include?(File::SEPARATOR)
3348

34-
if @configuration.server_bundle_js_file.include?(File::SEPARATOR)
35-
puts "[DEPRECATION] ReactOnRails: remove path from server_bundle_js_file in configuration. "\
49+
puts "[DEPRECATION] ReactOnRails: remove path from server_bundle_js_file in configuration. "\
3650
"All generated files must go in #{@configuration.generated_assets_dir}"
37-
@configuration.server_bundle_js_file = File.basename(@configuration.server_bundle_js_file)
38-
end
51+
@configuration.server_bundle_js_file = File.basename(@configuration.server_bundle_js_file)
3952
end
4053

4154
def self.configuration
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module ReactOnRails
22
module TestHelper
33
def self.launch_node
4-
if ReactOnRails.configuration.server_render_method == "NodeJS"
5-
path = "#{::Rails.root}/client/node"
6-
puts "Launching NodeJS server at #{path}"
7-
system("cd #{path} && npm start &")
8-
sleep(1)
9-
end
4+
return unless ReactOnRails.configuration.server_render_method == "NodeJS"
5+
6+
path = "#{::Rails.root}/client/node"
7+
puts "Launching NodeJS server at #{path}"
8+
system("cd #{path} && npm start &")
9+
sleep(1)
1010
end
1111
end
1212
end

spec/dummy/Gemfile.lock

+78-79
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,25 @@ GEM
4747
minitest (~> 5.1)
4848
thread_safe (~> 0.3, >= 0.3.4)
4949
tzinfo (~> 1.1)
50-
addressable (2.4.0)
50+
addressable (2.5.0)
51+
public_suffix (~> 2.0, >= 2.0.2)
5152
archive-zip (0.7.0)
5253
io-like (~> 0.3.0)
5354
arel (6.0.3)
54-
ast (2.2.0)
55-
awesome_print (1.6.1)
55+
ast (2.3.0)
56+
awesome_print (1.7.0)
5657
binding_of_caller (0.7.2)
5758
debug_inspector (>= 0.0.1)
5859
builder (3.2.2)
59-
byebug (8.2.5)
60+
byebug (9.0.6)
6061
capybara (2.7.1)
6162
addressable
6263
mime-types (>= 1.16)
6364
nokogiri (>= 1.3.3)
6465
rack (>= 1.0.0)
6566
rack-test (>= 0.5.4)
6667
xpath (~> 2.0)
67-
capybara-screenshot (1.0.12)
68+
capybara-screenshot (1.0.14)
6869
capybara (>= 1.0, < 3)
6970
launchy
7071
capybara-webkit (1.11.1)
@@ -83,86 +84,84 @@ GEM
8384
coffee-script (2.4.1)
8485
coffee-script-source
8586
execjs
86-
coffee-script-source (1.10.0)
87-
concurrent-ruby (1.0.2)
87+
coffee-script-source (1.12.2)
88+
concurrent-ruby (1.0.3)
8889
connection_pool (2.2.1)
89-
coveralls (0.8.13)
90-
json (~> 1.8)
91-
simplecov (~> 0.11.0)
90+
coveralls (0.8.17)
91+
json (>= 1.8, < 3)
92+
simplecov (~> 0.12.0)
9293
term-ansicolor (~> 1.3)
9394
thor (~> 0.19.1)
94-
tins (~> 1.6.0)
95+
tins (~> 1.6)
9596
debug_inspector (0.0.2)
9697
diff-lcs (1.2.5)
9798
docile (1.1.5)
9899
erubis (2.7.0)
99100
execjs (2.7.0)
100-
ffi (1.9.10)
101+
ffi (1.9.14)
101102
foreman (0.82.0)
102103
thor (~> 0.19.1)
103104
generator_spec (0.9.3)
104105
activesupport (>= 3.0.0)
105106
railties (>= 3.0.0)
106-
globalid (0.3.6)
107+
globalid (0.3.7)
107108
activesupport (>= 4.1.0)
108109
i18n (0.7.0)
109110
interception (0.5)
110111
io-like (0.3.0)
111-
jbuilder (2.4.1)
112+
jbuilder (2.6.1)
112113
activesupport (>= 3.0.0, < 5.1)
113114
multi_json (~> 1.2)
114-
jquery-rails (4.1.1)
115+
jquery-rails (4.2.1)
115116
rails-dom-testing (>= 1, < 3)
116117
railties (>= 4.2.0)
117118
thor (>= 0.14, < 2.0)
118119
json (1.8.3)
119120
launchy (2.4.3)
120121
addressable (~> 2.3)
121-
libv8 (5.0.71.48.3)
122+
libv8 (5.3.332.38.3)
122123
loofah (2.0.3)
123124
nokogiri (>= 1.5.9)
124125
mail (2.6.4)
125126
mime-types (>= 1.16, < 4)
126127
method_source (0.8.2)
127-
mime-types (3.0)
128+
mime-types (3.1)
128129
mime-types-data (~> 3.2015)
129-
mime-types-data (3.2016.0221)
130+
mime-types-data (3.2016.0521)
130131
mini_portile2 (2.1.0)
131-
mini_racer (0.1.4)
132-
libv8 (~> 5.0, < 5.1.11)
133-
minitest (5.9.0)
134-
multi_json (1.12.0)
135-
nokogiri (1.6.8)
132+
mini_racer (0.1.7)
133+
libv8 (~> 5.3)
134+
minitest (5.10.1)
135+
multi_json (1.12.1)
136+
nokogiri (1.6.8.1)
136137
mini_portile2 (~> 2.1.0)
137-
pkg-config (~> 1.1.7)
138-
parser (2.3.1.0)
138+
parser (2.3.3.1)
139139
ast (~> 2.2)
140-
pkg-config (1.1.7)
141-
poltergeist (1.9.0)
140+
poltergeist (1.12.0)
142141
capybara (~> 2.1)
143142
cliver (~> 0.3.1)
144-
multi_json (~> 1.0)
145143
websocket-driver (>= 0.2.0)
146144
powerpack (0.1.1)
147-
pry (0.10.3)
145+
pry (0.10.4)
148146
coderay (~> 1.1.0)
149147
method_source (~> 0.8.1)
150148
slop (~> 3.4)
151-
pry-byebug (3.3.0)
152-
byebug (~> 8.0)
149+
pry-byebug (3.4.2)
150+
byebug (~> 9.0)
153151
pry (~> 0.10)
154-
pry-doc (0.8.0)
152+
pry-doc (0.9.0)
155153
pry (~> 0.9)
156154
yard (~> 0.8)
157155
pry-rails (0.3.4)
158156
pry (>= 0.9.10)
159-
pry-rescue (1.4.2)
157+
pry-rescue (1.4.4)
160158
interception (>= 0.5)
161159
pry
162160
pry-stack_explorer (0.4.9.2)
163161
binding_of_caller (>= 0.7)
164162
pry (>= 0.9.11)
165-
rack (1.6.4)
163+
public_suffix (2.0.4)
164+
rack (1.6.5)
166165
rack-test (0.6.3)
167166
rack (>= 1.0)
168167
rails (4.2.3)
@@ -190,95 +189,95 @@ GEM
190189
rake (>= 0.8.7)
191190
thor (>= 0.18.1, < 2.0)
192191
rainbow (2.1.0)
193-
rake (11.2.2)
194-
rdoc (4.2.2)
195-
json (~> 1.4)
196-
rspec-core (3.4.4)
197-
rspec-support (~> 3.4.0)
198-
rspec-expectations (3.4.0)
192+
rake (12.0.0)
193+
rdoc (4.3.0)
194+
rspec-core (3.5.4)
195+
rspec-support (~> 3.5.0)
196+
rspec-expectations (3.5.0)
199197
diff-lcs (>= 1.2.0, < 2.0)
200-
rspec-support (~> 3.4.0)
201-
rspec-mocks (3.4.1)
198+
rspec-support (~> 3.5.0)
199+
rspec-mocks (3.5.0)
202200
diff-lcs (>= 1.2.0, < 2.0)
203-
rspec-support (~> 3.4.0)
204-
rspec-rails (3.4.2)
205-
actionpack (>= 3.0, < 4.3)
206-
activesupport (>= 3.0, < 4.3)
207-
railties (>= 3.0, < 4.3)
208-
rspec-core (~> 3.4.0)
209-
rspec-expectations (~> 3.4.0)
210-
rspec-mocks (~> 3.4.0)
211-
rspec-support (~> 3.4.0)
201+
rspec-support (~> 3.5.0)
202+
rspec-rails (3.5.2)
203+
actionpack (>= 3.0)
204+
activesupport (>= 3.0)
205+
railties (>= 3.0)
206+
rspec-core (~> 3.5.0)
207+
rspec-expectations (~> 3.5.0)
208+
rspec-mocks (~> 3.5.0)
209+
rspec-support (~> 3.5.0)
212210
rspec-retry (0.5.2)
213211
rspec-core (> 3.3, < 3.6)
214-
rspec-support (3.4.1)
215-
rubocop (0.42.0)
216-
parser (>= 2.3.1.0, < 3.0)
212+
rspec-support (3.5.0)
213+
rubocop (0.46.0)
214+
parser (>= 2.3.1.1, < 3.0)
217215
powerpack (~> 0.1)
218216
rainbow (>= 1.99.1, < 3.0)
219217
ruby-progressbar (~> 1.7)
220218
unicode-display_width (~> 1.0, >= 1.0.1)
221-
ruby-lint (2.1.0)
219+
ruby-lint (2.3.1)
222220
parser (~> 2.2)
223221
slop (~> 3.4, >= 3.4.7)
224-
ruby-progressbar (1.8.0)
222+
ruby-progressbar (1.8.1)
225223
rubyzip (1.2.0)
226-
sass (3.4.22)
227-
sass-rails (5.0.4)
228-
railties (>= 4.0.0, < 5.0)
224+
sass (3.4.23)
225+
sass-rails (5.0.6)
226+
railties (>= 4.0.0, < 6)
229227
sass (~> 3.1)
230228
sprockets (>= 2.8, < 4.0)
231229
sprockets-rails (>= 2.0, < 4.0)
232230
tilt (>= 1.1, < 3)
233-
scss_lint (0.48.0)
234-
rake (>= 0.9, < 12)
235-
sass (~> 3.4.15)
236-
sdoc (0.4.1)
231+
scss_lint (0.51.0)
232+
rake (>= 0.9, < 13)
233+
sass (~> 3.4.20)
234+
sdoc (0.4.2)
237235
json (~> 1.7, >= 1.7.7)
238236
rdoc (~> 4.0)
239-
selenium-webdriver (2.53.0)
237+
selenium-webdriver (3.0.4)
240238
childprocess (~> 0.5)
241239
rubyzip (~> 1.0)
242240
websocket (~> 1.0)
243-
simplecov (0.11.2)
241+
simplecov (0.12.0)
244242
docile (~> 1.1.0)
245-
json (~> 1.8)
243+
json (>= 1.8, < 3)
246244
simplecov-html (~> 0.10.0)
247245
simplecov-html (0.10.0)
248246
slop (3.6.0)
249-
spring (1.7.1)
250-
sprockets (3.6.0)
247+
spring (2.0.0)
248+
activesupport (>= 4.2)
249+
sprockets (3.7.1)
251250
concurrent-ruby (~> 1.0)
252251
rack (> 1, < 3)
253-
sprockets-rails (3.0.4)
252+
sprockets-rails (3.2.0)
254253
actionpack (>= 4.0)
255254
activesupport (>= 4.0)
256255
sprockets (>= 3.0.0)
257-
sqlite3 (1.3.11)
258-
term-ansicolor (1.3.2)
256+
sqlite3 (1.3.12)
257+
term-ansicolor (1.4.0)
259258
tins (~> 1.0)
260-
thor (0.19.1)
259+
thor (0.19.4)
261260
thread_safe (0.3.5)
262-
tilt (2.0.2)
263-
tins (1.6.0)
261+
tilt (2.0.5)
262+
tins (1.13.0)
264263
turbolinks (2.5.3)
265264
coffee-rails
266265
tzinfo (1.2.2)
267266
thread_safe (~> 0.1)
268-
uglifier (3.0.0)
267+
uglifier (3.0.4)
269268
execjs (>= 0.3.0, < 3)
270-
unicode-display_width (1.0.5)
271-
web-console (3.1.1)
269+
unicode-display_width (1.1.2)
270+
web-console (3.3.0)
272271
activemodel (>= 4.2)
273272
debug_inspector
274273
railties (>= 4.2)
275274
websocket (1.2.3)
276-
websocket-driver (0.6.3)
275+
websocket-driver (0.6.4)
277276
websocket-extensions (>= 0.1.0)
278277
websocket-extensions (0.1.2)
279278
xpath (2.0.0)
280279
nokogiri (~> 1.3)
281-
yard (0.8.7.6)
280+
yard (0.9.5)
282281

283282
PLATFORMS
284283
ruby

0 commit comments

Comments
 (0)