@@ -24,20 +24,13 @@ def self.create_test_app(name, template:, template_path:)
2424
2525 create_command = [
2626 'bundle' , 'exec' , 'rails' , 'new' , name ,
27- '--skip-bootsnap' , '--skip-bundle' , '--skip-kamal' , '--skip-thruster'
27+ '--skip-bootsnap' , '--skip-bundle' , '--skip-kamal' , '--skip-thruster' ,
28+ '--skip-asset-pipeline' , '--skip-javascript' , '--skip-hotwire'
2829 ]
2930 output , status = run_command ( root_env , create_command , chdir : Dir . tmpdir )
3031 raise_command_error ( name , create_command , status , output ) unless status . success?
3132
32- app_env = clean_bundle_env (
33- ruby_llm_path : ruby_llm_path ,
34- bundle_gemfile : File . join ( app_path , 'Gemfile' )
35- )
36-
37- install_command = [ 'bundle' , 'install' , '--quiet' ]
38- output , status = run_command ( app_env , install_command , chdir : app_path )
39- raise_command_error ( name , install_command , status , output ) unless status . success?
40-
33+ app_env = root_env
4134 template_command = [ 'bundle' , 'exec' , 'rails' , 'app:template' , "LOCATION=#{ template_file } " ]
4235 output , status = run_command ( app_env , template_command , chdir : app_path )
4336 raise_command_error ( name , template_command , status , output ) unless status . success?
@@ -48,23 +41,6 @@ def self.run_command(env, command, chdir:)
4841 [ "#{ stdout } #{ stderr } " , process_status ]
4942 end
5043
51- def self . clean_bundle_env ( ruby_llm_path :, bundle_gemfile :)
52- env = {
53- 'RUBYLLM_PATH' => ruby_llm_path ,
54- 'BUNDLE_GEMFILE' => bundle_gemfile ,
55- 'BUNDLE_IGNORE_CONFIG' => '1'
56- }
57-
58- ENV . each_key do |key |
59- next unless key . start_with? ( 'BUNDLE_' )
60- next if key == 'BUNDLE_GEMFILE'
61-
62- env [ key ] = nil
63- end
64-
65- env
66- end
67-
6844 def self . raise_command_error ( name , command , status , output )
6945 raise <<~ERROR
7046 Failed to create test app #{ name }
@@ -77,10 +53,8 @@ def self.raise_command_error(name, command, status, output)
7753
7854 def within_test_app ( app_path , &)
7955 api_key = ENV . fetch ( 'OPENAI_API_KEY' , 'test' )
80- Bundler . with_unbundled_env do
81- ENV [ 'OPENAI_API_KEY' ] = api_key
82- Dir . chdir ( app_path , &)
83- end
56+ ENV [ 'OPENAI_API_KEY' ] = api_key
57+ Dir . chdir ( app_path , &)
8458 end
8559
8660 # Instance methods for use in examples
0 commit comments