Class: Panoramix::Plugin::Environment
- Defined in:
- lib/panoramix/plugin/env.rb
Instance Attribute Summary collapse
-
#dst ⇒ Object
readonly
Returns the value of attribute dst.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
Instance Method Summary collapse
-
#initialize(dst, src) ⇒ Environment
constructor
A new instance of Environment.
-
#needed?(timestamps) ⇒ Boolean
Always true.
-
#run_default ⇒ Object
Deafult task.
-
#timestamp ⇒ Object
Always return an old time.
- #vars ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(dst, src) ⇒ Environment
Returns a new instance of Environment.
14 15 16 17 |
# File 'lib/panoramix/plugin/env.rb', line 14 def initialize(dst, src) @dst = dst @src = src end |
Instance Attribute Details
#dst ⇒ Object (readonly)
Returns the value of attribute dst.
11 12 13 |
# File 'lib/panoramix/plugin/env.rb', line 11 def dst @dst end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
12 13 14 |
# File 'lib/panoramix/plugin/env.rb', line 12 def src @src end |
Instance Method Details
#needed?(timestamps) ⇒ Boolean
Always true
25 26 27 |
# File 'lib/panoramix/plugin/env.rb', line 25 def needed? true end |
#run_default ⇒ Object
Deafult task
30 31 32 33 34 |
# File 'lib/panoramix/plugin/env.rb', line 30 def run_default @src.each do |var| raise "Environment variable #{var} not defined" unless ENV[var] end end |
#timestamp ⇒ Object
Always return an old time
20 21 22 |
# File 'lib/panoramix/plugin/env.rb', line 20 def return Time.at(0) end |
#vars ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/panoramix/plugin/env.rb', line 36 def vars puts @dst.bold @src.each do |var| puts "#{var}=#{ENV[var]}" end puts "" end |