henry-container 0.0.49 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
- Gemfile.lock
1
+ Gemfile.lock
2
2
  vendor
3
3
  bundle
4
4
  .bundle
@@ -3,7 +3,7 @@ module Henry
3
3
  class Container
4
4
 
5
5
  # Current Gem version
6
- VERSION = '0.0.49'
6
+ VERSION = '0.0.50'
7
7
 
8
8
  end
9
9
 
@@ -55,7 +55,7 @@ module Henry
55
55
  #
56
56
  # @return [String]
57
57
  def custom_options
58
- "#{self.format_options} #{self.tags_options}"
58
+ "#{self.format_options} #{self.tags_options} #{self.report_options}"
59
59
  end
60
60
 
61
61
  # Returns the cucumber_opts related with formatting.
@@ -75,6 +75,42 @@ module Henry
75
75
  "--tags @#{tag.split(',').join(',@')}"
76
76
  end.join(' ')
77
77
  end
78
+
79
+ # Returns the cucumber_opts related with report paaths and formats.
80
+ #
81
+ # @return [String]
82
+ def report_options
83
+ return '' if self.data.reports.nil?
84
+
85
+ self.data.reports.collect do |report_options|
86
+ "--format #{report_options['format']} --out #{self.report_file_path(report_options['format'], report_options['name'])}"
87
+ end.join(' ')
88
+ end
89
+
90
+ # Returns the report file path for the given format and file name.
91
+ #
92
+ # @param [String] format the rspec formatter name.
93
+ # @param [String] file_name the report file name template.
94
+ # @return [String] the report file path.
95
+ def report_file_path(format, file_name)
96
+ "#{self.reports_dir(format)}/#{self.report_file_name(file_name)}"
97
+ end
98
+
99
+ # Interpolates and returns the report file name.
100
+ #
101
+ # @param [String] file_name the report file name.
102
+ # @returns [String] the report file name.
103
+ def report_file_name(file_name)
104
+ file_name.gsub(/\${[A-Z_]+}/, '${TASK_NAME}' => self.name, '${DATE}' => DateTime.now.to_s).gsub(' ', '_')
105
+ end
106
+
107
+ # Interpolates and returns the reports directory for the given format.
108
+ #
109
+ # @param [String] format the formatter name.
110
+ # @return [Stiring] the reports directory.
111
+ def reports_dir(format)
112
+ REPORTS_DIR.gsub(/\${[A-Z_]+}/, '${FORMAT}' => format).gsub(' ', '_')
113
+ end
78
114
 
79
115
  end
80
116
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: henry-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.49
4
+ version: 0.0.50
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: