Class: Ironment
- Inherits:
-
Object
show all
- Defined in:
- lib/ironment.rb,
lib/ironment/cl.rb,
lib/ironment/config.rb,
lib/ironment/finder.rb,
lib/ironment/runcom.rb,
lib/ironment/truster.rb,
lib/ironment/version.rb,
lib/ironment/executor.rb,
lib/ironment/populator.rb,
lib/ironment/cl/prompter.rb
Defined Under Namespace
Classes: CL, Config, Executor, Finder, Populator, Runcom, Truster
Constant Summary
collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Ironment
Returns a new instance of Ironment.
23
24
25
26
27
28
|
# File 'lib/ironment.rb', line 23
def initialize(options = {})
@truster = options[:truster] || Truster.new
@finder = options[:finder] || Finder.new
@populator = options[:populator] || Populator.new
@executor = options[:executor] || Executor.new
end
|
Class Attribute Details
14
15
16
|
# File 'lib/ironment.rb', line 14
def runcom
@runcom || default_runcom
end
|
Class Method Details
18
19
20
|
# File 'lib/ironment.rb', line 18
def default_runcom
".envrc"
end
|
Instance Method Details
#exec_with_environment(command, *args) ⇒ Object
30
31
32
33
|
# File 'lib/ironment.rb', line 30
def exec_with_environment(command, *args)
load_environment
@executor.exec command, *args
end
|
#load_environment ⇒ Object
35
36
37
38
39
40
|
# File 'lib/ironment.rb', line 35
def load_environment
@finder.find.each do |runcom|
@truster.validate runcom
@populator.populate_with runcom
end
end
|