Skip to content

Commit 5ffd297

Browse files
committed
Allow pass package_json_path to let spec stub fixtures easily
1 parent 234aaab commit 5ffd297

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/inertia_rails/generators/helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module InertiaRails
44
module Generators
55
module Helper
66
class << self
7-
def guess_the_default_framework
8-
package = Rails.root.join('package.json').read
7+
def guess_the_default_framework(package_json_path = Rails.root.join("package.json"))
8+
package = File.read(package_json_path)
99
case package
1010
when %r{@inertiajs/react}
1111
'react'

0 commit comments

Comments
 (0)