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.7.0"
Class Attribute Summary collapse
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 rails_options
@rails_options
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
|
.default_fingerprint ⇒ Object
72
73
74
|
# File 'lib/engine_cart.rb', line 72
def self.default_fingerprint
""
end
|
.fingerprint ⇒ Object
54
55
56
|
# File 'lib/engine_cart.rb', line 54
def self.fingerprint
@fingerprint || (@fingerprint_proc || method(:default_fingerprint)).call
end
|
.fingerprint=(fingerprint) ⇒ Object
58
59
60
|
# File 'lib/engine_cart.rb', line 58
def self.fingerprint= fingerprint
@fingerprint = fingerprint
end
|
.fingerprint_proc=(fingerprint_proc) ⇒ Object
62
63
64
|
# File 'lib/engine_cart.rb', line 62
def self.fingerprint_proc= fingerprint_proc
@fingerprint_proc = fingerprint_proc
end
|
.load_application!(path = nil) ⇒ Object
42
43
44
|
# File 'lib/engine_cart.rb', line 42
def self.load_application! path = nil
require File.expand_path("config/environment", path || EngineCart.destination)
end
|
.rails_fingerprint_proc(extra_files = []) ⇒ Object
66
67
68
69
70
|
# File 'lib/engine_cart.rb', line 66
def self.rails_fingerprint_proc = []
lambda do
(Dir.glob("./*.gemspec") + Dir.glob("./Gemfile*") + Dir.glob("./db/migrate/*") + Dir.glob("./lib/generators/**/**") + Dir.glob("./spec/test_app_templates/**/**") + ).map {|f| File.mtime(f) }.max.to_s
end
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
|