Class: CucumberCharacteristics::Configuration
- Inherits:
-
Object
- Object
- CucumberCharacteristics::Configuration
- Defined in:
- lib/cucumber_characteristics/configuration.rb
Instance Attribute Summary collapse
-
#export_html ⇒ Object
Returns the value of attribute export_html.
-
#export_json ⇒ Object
Returns the value of attribute export_json.
-
#precision ⇒ Object
Returns the value of attribute precision.
-
#relative_path ⇒ Object
Returns the value of attribute relative_path.
-
#target_filename ⇒ Object
Returns the value of attribute target_filename.
Instance Method Summary collapse
- #full_dir ⇒ Object
- #full_target_filename ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolve_path_from_root(rel_path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 |
# File 'lib/cucumber_characteristics/configuration.rb', line 5 def initialize @export_json = true @export_html = true @precision = 4 @target_filename = 'cucumber_step_characteristics' @relative_path = 'features/characteristics' end |
Instance Attribute Details
#export_html ⇒ Object
Returns the value of attribute export_html.
3 4 5 |
# File 'lib/cucumber_characteristics/configuration.rb', line 3 def export_html @export_html end |
#export_json ⇒ Object
Returns the value of attribute export_json.
3 4 5 |
# File 'lib/cucumber_characteristics/configuration.rb', line 3 def export_json @export_json end |
#precision ⇒ Object
Returns the value of attribute precision.
3 4 5 |
# File 'lib/cucumber_characteristics/configuration.rb', line 3 def precision @precision end |
#relative_path ⇒ Object
Returns the value of attribute relative_path.
3 4 5 |
# File 'lib/cucumber_characteristics/configuration.rb', line 3 def relative_path @relative_path end |
#target_filename ⇒ Object
Returns the value of attribute target_filename.
3 4 5 |
# File 'lib/cucumber_characteristics/configuration.rb', line 3 def target_filename @target_filename end |
Instance Method Details
#full_dir ⇒ Object
17 18 19 20 21 |
# File 'lib/cucumber_characteristics/configuration.rb', line 17 def full_dir dir = resolve_path_from_root @relative_path FileUtils.mkdir_p dir unless File.exist? dir dir end |
#full_target_filename ⇒ Object
13 14 15 |
# File 'lib/cucumber_characteristics/configuration.rb', line 13 def full_target_filename "#{full_dir}/#{@target_filename}" end |
#resolve_path_from_root(rel_path) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/cucumber_characteristics/configuration.rb', line 23 def resolve_path_from_root(rel_path) if defined?(Rails) Rails.root.join(rel_path) elsif defined?(Rake.original_dir) File.(rel_path, Rake.original_dir) else File.(rel_path, Dir.pwd) end end |