Class: Lookbook::Process
- Inherits:
-
Object
- Object
- Lookbook::Process
- Defined in:
- lib/lookbook/process.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env: Rails.env) ⇒ Process
constructor
A new instance of Process.
- #rake_task? ⇒ Boolean
- #supports_listening? ⇒ Boolean
Constructor Details
#initialize(env: Rails.env) ⇒ Process
Returns a new instance of Process.
5 6 7 |
# File 'lib/lookbook/process.rb', line 5 def initialize(env: Rails.env) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
3 4 5 |
# File 'lib/lookbook/process.rb', line 3 def env @env end |
Instance Method Details
#rake_task? ⇒ Boolean
13 14 15 16 17 18 19 |
# File 'lib/lookbook/process.rb', line 13 def rake_task? if defined?(Rake) && Rake.respond_to?(:application) File.basename($0) == "rake" || Rake.application.top_level_tasks.any? else false end end |
#supports_listening? ⇒ Boolean
9 10 11 |
# File 'lib/lookbook/process.rb', line 9 def supports_listening? !rake_task? && !Rails.const_defined?(:Console) end |