88
99Bundler ::GemHelper . install_tasks
1010
11+ def require_package_json_gem
12+ require "bundler/inline"
13+
14+ gemfile { gem "package_json" , github : "G-Rath/package_json" }
15+
16+ puts "using package_json v#{ PackageJson ::VERSION } "
17+ end
18+
1119def copy_react_asset ( webpack_file , destination_file )
1220 full_webpack_path = File . expand_path ( "../react-builds/build/#{ webpack_file } " , __FILE__ )
1321 full_destination_path = File . expand_path ( "../lib/assets/react-source/#{ destination_file } " , __FILE__ )
@@ -20,14 +28,14 @@ namespace :react do
2028
2129 desc "Install the JavaScript dependencies"
2230 task :install do
23- require "package_json"
31+ require_package_json_gem
2432
2533 PackageJson . read ( "react-builds" ) . manager . install
2634 end
2735
2836 desc "Build the JS bundles with Webpack"
2937 task :build do
30- require "package_json"
38+ require_package_json_gem
3139
3240 PackageJson . read ( "react-builds" ) . manager . run ( "build" )
3341 end
@@ -48,14 +56,14 @@ namespace :ujs do
4856
4957 desc "Install the JavaScript dependencies"
5058 task :install do
51- require "package_json"
59+ require_package_json_gem
5260
5361 PackageJson . read . manager . install
5462 end
5563
5664 desc "Build the JS bundles with Webpack"
5765 task :build do
58- require "package_json"
66+ require_package_json_gem
5967
6068 PackageJson . read . manager . run ( "build" )
6169 end
@@ -88,7 +96,7 @@ task default: :test
8896
8997task :test_setup do
9098 Dir . chdir ( "./test/dummy" ) do
91- require "package_json"
99+ require_package_json_gem
92100
93101 PackageJson . read . manager . install
94102 end
0 commit comments