Class: Jkr::Env
- Inherits:
-
Object
- Object
- Jkr::Env
- Defined in:
- lib/jkr/env.rb
Constant Summary collapse
- PLAN_DIR =
"plan"- RESULT_DIR =
"result"- SCRIPT_DIR =
"script"
Instance Attribute Summary collapse
-
#env_dir ⇒ Object
readonly
Returns the value of attribute env_dir.
-
#jkr_dir ⇒ Object
readonly
Returns the value of attribute jkr_dir.
-
#jkr_plan_dir ⇒ Object
readonly
Returns the value of attribute jkr_plan_dir.
-
#jkr_result_dir ⇒ Object
readonly
Returns the value of attribute jkr_result_dir.
-
#jkr_script_dir ⇒ Object
readonly
Returns the value of attribute jkr_script_dir.
Instance Method Summary collapse
-
#initialize(env_dir = Dir.pwd) ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize(env_dir = Dir.pwd) ⇒ Env
Returns a new instance of Env.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/jkr/env.rb', line 17 def initialize(env_dir = Dir.pwd) @env_dir = env_dir @jkr_dir = File.join(@env_dir, "jkr") @jkr_plan_dir = File.join(@jkr_dir, PLAN_DIR) @jkr_result_dir = File.join(@jkr_dir, RESULT_DIR) @jkr_script_dir = File.join(@jkr_dir, SCRIPT_DIR) unless Dir.exists?(@jkr_dir) raise Errno::ENOENT.new(@jkr_dir) end [@jkr_dir, @jkr_result_dir, @jkr_plan_dir, @jkr_script_dir].each do |dir_path| unless Dir.exists?(dir_path) raise ArgumentError.new("Directory #{dir_path} not found") end end end |
Instance Attribute Details
#env_dir ⇒ Object (readonly)
Returns the value of attribute env_dir.
7 8 9 |
# File 'lib/jkr/env.rb', line 7 def env_dir @env_dir end |
#jkr_dir ⇒ Object (readonly)
Returns the value of attribute jkr_dir.
8 9 10 |
# File 'lib/jkr/env.rb', line 8 def jkr_dir @jkr_dir end |
#jkr_plan_dir ⇒ Object (readonly)
Returns the value of attribute jkr_plan_dir.
10 11 12 |
# File 'lib/jkr/env.rb', line 10 def jkr_plan_dir @jkr_plan_dir end |
#jkr_result_dir ⇒ Object (readonly)
Returns the value of attribute jkr_result_dir.
9 10 11 |
# File 'lib/jkr/env.rb', line 9 def jkr_result_dir @jkr_result_dir end |
#jkr_script_dir ⇒ Object (readonly)
Returns the value of attribute jkr_script_dir.
11 12 13 |
# File 'lib/jkr/env.rb', line 11 def jkr_script_dir @jkr_script_dir end |