Skip to content

Commit

Permalink
further debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Judahmeek committed Jun 26, 2024
1 parent 5cc7a81 commit 62c69db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/react_on_rails/packer_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def self.using_packer?

def self.using_shakapacker?
return @using_shakapacker if defined?(@using_shakapacker)

puts "ReactOnRails::Utils.gem_available?("shakapacker")? #{ReactOnRails::Utils.gem_available?("shakapacker")}"
puts "shakapacker_version_requirement_met?([7, 0, 0])? #{shakapacker_version_requirement_met?([7, 0, 0])}"
@using_shakapacker = ReactOnRails::Utils.gem_available?("shakapacker") &&
shakapacker_version_requirement_met?([7, 0, 0])
end
Expand Down Expand Up @@ -48,7 +49,7 @@ def self.dev_server_running?
def self.shakapacker_version
return @shakapacker_version if defined?(@shakapacker_version)
return nil unless ReactOnRails::Utils.gem_available?("shakapacker")

puts "Gem.loaded_specs["shakapacker"].version.to_s: #{Gem.loaded_specs["shakapacker"].version.to_s}"
@shakapacker_version = Gem.loaded_specs["shakapacker"].version.to_s
end

Expand Down
2 changes: 1 addition & 1 deletion rakelib/shakapacker_examples.rake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength
example_type.rails_options += "--skip-javascript"
sh_in_dir(examples_dir, "rails new #{example_type.name} #{example_type.rails_options}")
sh_in_dir(example_type.dir, "touch .gitignore")
sh_in_dir(example_type.dir, "cat Gemfile")
append_to_gemfile(example_type.gemfile, example_type.dir)
sh_in_dir(example_type.dir, "cat Gemfile")
bundle_install_in(example_type.dir)
Expand Down Expand Up @@ -67,6 +66,7 @@ def append_to_gemfile(gemfile, dir)
"gem 'react_on_rails', path: '#{relative_gem_root}'",
"gem 'shakapacker', '~> 8.0.0'"
]
puts "appending #{lines}"
old_text = File.read(gemfile)
new_text = lines.reduce(old_text) { |a, e| a << "#{e}\n" }
File.open(gemfile, "w") { |f| f.puts(new_text) }
Expand Down
2 changes: 1 addition & 1 deletion rakelib/webpacker_examples.rake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace :webpacker_examples do # rubocop:disable Metrics/BlockLength
example_type.rails_options += "--skip-javascript"
sh_in_dir(examples_dir, "rails new #{example_type.name} #{example_type.rails_options}")
sh_in_dir(example_type.dir, "touch .gitignore")
sh_in_dir(example_type.dir, "cat Gemfile")
append_to_gemfile(example_type.gemfile, example_type.dir)
sh_in_dir(example_type.dir, "cat Gemfile")
bundle_install_in(example_type.dir)
Expand Down Expand Up @@ -67,6 +66,7 @@ def append_to_gemfile(gemfile, dir)
"gem 'react_on_rails', path: '#{relative_gem_root}'",
"gem 'shakapacker', '~> 6.6.0'"
]
puts "appending #{lines}"
old_text = File.read(gemfile)
new_text = lines.reduce(old_text) { |a, e| a << "#{e}\n" }
File.open(gemfile, "w") { |f| f.puts(new_text) }
Expand Down

0 comments on commit 62c69db

Please sign in to comment.