Module: EngineCart
- Defined in:
- lib/generators/engine_cart/install_generator.rb,
lib/engine_cart.rb,
lib/engine_cart/engine.rb,
lib/engine_cart/version.rb,
lib/engine_cart/rake_task.rb
Overview
EngineCartGenerator sets up an engine to use engine_cart-generated test apps
Defined Under Namespace
Modules: RakeTask Classes: Engine, InstallGenerator
Constant Summary collapse
- VERSION =
"0.3.0"
Class Attribute Summary collapse
-
.destination ⇒ Object
Destination to generate the test app into.
-
.engine_name ⇒ Object
Name of the engine we’re testing.
-
.rails_options ⇒ Object
Additional options when generating a test rails application.
-
.template ⇒ Object
Path to a Rails application template.
-
.templates_path ⇒ Object
Path to test app templates to make available to the test app generator.
Class Method Summary collapse
Class Attribute Details
.destination ⇒ Object
Destination to generate the test app into
14 15 16 |
# File 'lib/engine_cart.rb', line 14 def destination @destination end |
.engine_name ⇒ Object
Name of the engine we’re testing
10 11 12 |
# File 'lib/engine_cart.rb', line 10 def engine_name @engine_name end |
.rails_options ⇒ Object
Additional options when generating a test rails application
28 29 30 |
# File 'lib/engine_cart.rb', line 28 def end |
.template ⇒ Object
Path to a Rails application template
18 19 20 |
# File 'lib/engine_cart.rb', line 18 def template @template end |
.templates_path ⇒ Object
Path to test app templates to make available to the test app generator
23 24 25 |
# File 'lib/engine_cart.rb', line 23 def templates_path @templates_path end |
Class Method Details
.current_engine_name ⇒ Object
38 39 40 |
# File 'lib/engine_cart.rb', line 38 def self.current_engine_name engine_name || File.basename(Dir.glob("*.gemspec").first, '.gemspec') end |
.load_application!(path = nil) ⇒ Object
42 43 44 |
# File 'lib/engine_cart.rb', line 42 def self.load_application! path = nil require File.("config/environment", path || EngineCart.destination) end |
.within_test_app ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/engine_cart.rb', line 46 def self.within_test_app Dir.chdir(EngineCart.destination) do Bundler.with_clean_env do yield end end end |