henry-container 0.1.36 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e3cd0a6c5d2f9581c04e6ad7bb3e8918a9d21c6
4
- data.tar.gz: 40c5277c08b825bfde665d9f7c1d6369979b9b70
3
+ metadata.gz: f9d6ac16abb0c27de3300d58848cc66a5d323c7c
4
+ data.tar.gz: 83739873f99f404ee67a82dc41dd078086b490cc
5
5
  SHA512:
6
- metadata.gz: 60b44da1927bbf2fa8dce08b473ba5f15d8973488fb367a48af523700f52b2111e8fb6de2a66e5c18c419ab2b9e65ea14ebe652037e59d1c9d113511974b71e6
7
- data.tar.gz: de266bca91373f6fe53f3244f2ca7db1dd6118e60df68398ebb441abb74915924d515ec8fbfbaa36d2df05a82354d3771d72c0d613af4abf3ca90419d0a048db
6
+ metadata.gz: ade87c615c2bf9c626e7c2722ebf855b12b6f59c26d5b2ed87b11c7fcdb9ca680e1f81018d074cdcbc088ab416a91ef689a730a2e3f7693f415c7dd1a8c62618
7
+ data.tar.gz: ed8ddd864527329167fc951b3bb74624303268fc3af35a1a37a8c13f947240162bfb32a911659ec68c3853a231bf733d4961716df606941c80979a23c8056685
@@ -23,6 +23,7 @@ BANNER
23
23
  opt :"in-dir", "Custom dir path where the input will be read from.", :default => '.'
24
24
  opt :hints, "Custom name for the task hints (tasks to be executed) file.", :default => 'hints.henry'
25
25
  opt :"hints-dir", "Custom dir path where the task hints (tasks to be executed) will be read from.", :default => '.'
26
+ opt :"output-dir", "Custom dir path where the task output files will be stored.", :default => '.'
26
27
  end
27
28
 
28
29
  Henry::Container.new(opts).execute
@@ -5,7 +5,7 @@ if [[ $gem_version == "" ]]; then
5
5
  exit 1
6
6
  fi
7
7
 
8
- #gem build henry-container.gemspec --sign
8
+ gem build henry-container.gemspec
9
9
  gem push henry-container-${gem_version}.gem
10
10
  gem inabox henry-container-${gem_version}.gem
11
11
 
@@ -38,7 +38,7 @@ module Henry
38
38
  self.tasks.select {|task| task.enabled?}.each do |task|
39
39
  task_params = (params['all'] || {}).merge(params[task.name] || {})
40
40
 
41
- task.configure(task_params,self.task_extended_context(task.name))
41
+ task.configure(task_params,self.task_extended_context(task.name), self.default_task_options)
42
42
  task.export_params(task_params)
43
43
  task.execution.params = task_params
44
44
  task.before_execute
@@ -80,6 +80,12 @@ module Henry
80
80
  json_parse_error: 'templates/errors/json_parse_error.json'
81
81
  }
82
82
 
83
+ def default_task_options
84
+ {
85
+ output_directory: self.output_directory
86
+ }
87
+ end
88
+
83
89
  # Executes the task inside a timeout (defined by the task itself).
84
90
  # On Timeout::Error adds an erro mmessage to the Task Execution.
85
91
  #
@@ -101,12 +107,19 @@ module Henry
101
107
  def input_file_path
102
108
  "#{@opts[:"in-dir"]}/#{@opts[:in]}"
103
109
  end
104
-
110
+
111
+ # Returns the output directory path based on the given options.
112
+ #
113
+ # @return [String] the output directory path.
114
+ def output_directory
115
+ @opts[:"out-dir"]
116
+ end
117
+
105
118
  # Returns the output file path based on the given options.
106
119
  #
107
120
  # @return [String] the output file path.
108
121
  def output_file_path
109
- "#{@opts[:"out-dir"]}/#{@opts[:out]}"
122
+ "#{self.output_directory}/#{@opts[:out]}"
110
123
  end
111
124
 
112
125
  # Returns the task hints file path based on the given options.
@@ -3,7 +3,7 @@ module Henry
3
3
  class Container
4
4
 
5
5
  # Current Gem version
6
- VERSION = '0.1.36'
6
+ VERSION = '0.1.38'
7
7
 
8
8
  end
9
9
 
@@ -14,7 +14,7 @@ module Henry
14
14
  name: self.task_name,
15
15
  code: self.code,
16
16
  message: self.message,
17
- returnedData: self.map.merge({
17
+ returnedData: map.merge({
18
18
  output: self.output,
19
19
  backtrace: self.backtrace
20
20
  }),
@@ -96,7 +96,7 @@ module Henry
96
96
 
97
97
  # Nothing to be done here...
98
98
  # The Task configuration code should be defined under this method on the specific Task class.
99
- def configure(params, extended_context={})
99
+ def configure(params, extended_context={}, options={})
100
100
  end
101
101
 
102
102
  end
@@ -13,8 +13,11 @@ module Henry
13
13
  # The temporary output file path for the RspecTask execution.
14
14
  OUT_PATH = 'cucumber.out'
15
15
 
16
+ # Default base output directory
17
+ DEFAULT_OUTPUT_BASE_DIR = '.henry'
18
+
16
19
  # The reports path template.
17
- REPORTS_DIR = '.henry/reports/${FORMAT}'
20
+ REPORTS_DIR = 'reports/${FORMAT}'
18
21
 
19
22
  # Default time format to be used in the reports filepath.
20
23
  TIME_FORMAT = '%Y-%m-%dT%H%M%S'
@@ -54,11 +57,25 @@ module Henry
54
57
  super
55
58
  end
56
59
 
60
+ # Returns output base path
61
+ #
62
+ # @return [String] the base output path.
63
+ def base_output_path
64
+ @base_output_path ||= DEFAULT_OUTPUT_BASE_PATH
65
+ end
66
+
67
+ # Sets the output base path.
68
+ def base_output_path=(path)
69
+ @base_output_path = path
70
+ end
71
+
57
72
  # Configures the Task.
58
73
  #
59
74
  # @param [Hash] params the task params.
60
75
  # @param [Hash] extended_context task extended context.
61
- def configure(params, extended_context={})
76
+ def configure(params, extended_context={}, options={})
77
+ self.base_output_path = "#{options[:output_directory]}/output}" if options[:output_directory]
78
+
62
79
  File.open(OUT_PATH, 'w') { |f| }
63
80
 
64
81
  # Makes available the cucumber rake task.
@@ -67,7 +84,7 @@ module Henry
67
84
  if self.data.options
68
85
  t.cucumber_opts = "#{self.custom_options} #{extended_context['options']}"
69
86
  else
70
- t.cucumber_opts = "#{self.default_options} #{extended_context['options']}"
87
+ t.cucumber_opts = "#{self.default_options()} #{extended_context['options']}"
71
88
  end
72
89
  end
73
90
 
@@ -176,7 +193,7 @@ module Henry
176
193
  # @param [String] format the formatter name.
177
194
  # @return [Stiring] the reports directory.
178
195
  def reports_dir(format)
179
- REPORTS_DIR.gsub(/\${[A-Z_]+}/, '${FORMAT}' => format).gsub(' ', '_')
196
+ "#{self.base_output_path}/#{REPORTS_DIR}".gsub(/\${[A-Z_]+}/, '${FORMAT}' => format).gsub(' ', '_')
180
197
  end
181
198
 
182
199
  end
@@ -9,9 +9,12 @@ module Henry
9
9
 
10
10
  # The temporary output file path for the MiniTest execution.
11
11
  OUT_PATH = 'minitest.out'
12
+
13
+ # Default base output directory
14
+ DEFAULT_OUTPUT_BASE_DIR = '.henry'
12
15
 
13
16
  # The reports path template.
14
- REPORTS_DIR = '.henry/reports/minitest'
17
+ REPORTS_DIR = 'reports/minitest'
15
18
 
16
19
  # The Minitest Rake Application name.
17
20
  #
@@ -26,10 +29,24 @@ module Henry
26
29
  OUT_PATH
27
30
  end
28
31
 
32
+ # Returns output base path
33
+ #
34
+ # @return [String] the base output path.
35
+ def base_output_path
36
+ @base_output_path ||= DEFAULT_OUTPUT_BASE_PATH
37
+ end
38
+
39
+ # Sets the output base path.
40
+ def base_output_path=(path)
41
+ @base_output_path = path
42
+ end
43
+
29
44
  # Configures the Task.
30
45
  #
31
46
  # @param [Hash] params the task params.
32
- def configure(params, extended_context={})
47
+ def configure(params, extended_context={}, options={})
48
+ self.base_output_path = options[:output_directory] if options[:output_directory]
49
+
33
50
  File.open(OUT_PATH, 'w') { |f| }
34
51
 
35
52
  pattern = params['pattern'] || './spec{,/*/**}/*_spec.rb'
@@ -39,7 +39,7 @@ module Henry
39
39
  #
40
40
  # @param [Hash] params the task params.
41
41
  # @param [Hash] extended_context task extended context.
42
- def configure(params, extended_context={})
42
+ def configure(params, extended_context={}, options={})
43
43
  end
44
44
 
45
45
  end
@@ -12,9 +12,12 @@ module Henry
12
12
 
13
13
  # The temporary output file path for the RspecTask execution.
14
14
  OUT_PATH = 'rspec.out'
15
+
16
+ # Default base output directory
17
+ DEFAULT_OUTPUT_BASE_DIR = '.henry'
15
18
 
16
19
  # The reports path template.
17
- REPORTS_DIR = '.henry/reports/${FORMAT}'
20
+ REPORTS_DIR = 'reports/${FORMAT}'
18
21
 
19
22
  # Default time format to be used in the reports filepath.
20
23
  TIME_FORMAT = '%Y-%m-%dT%H%M%S'
@@ -45,12 +48,26 @@ module Henry
45
48
 
46
49
  super
47
50
  end
51
+
52
+ # Returns output base path
53
+ #
54
+ # @return [String] the base output path.
55
+ def base_output_path
56
+ @base_output_path ||= DEFAULT_OUTPUT_BASE_PATH
57
+ end
58
+
59
+ # Sets the output base path.
60
+ def base_output_path=(path)
61
+ @base_output_path = path
62
+ end
48
63
 
49
64
  # Configures the Task.
50
65
  #
51
66
  # @param [Hash] params the task params.
52
67
  # @param [Hash] extended_context the task extended context.
53
- def configure(params, extended_context={})
68
+ def configure(params, extended_context={}, options={})
69
+ self.base_output_path = "#{options[:output_directory]}/output}" if options[:output_directory]
70
+
54
71
  File.open(OUT_PATH, 'w') { |f| }
55
72
 
56
73
  # Makes available the spec rake task.
@@ -145,7 +162,7 @@ module Henry
145
162
  # @param [String] format the formatter name.
146
163
  # @return [Stiring] the reports directory.
147
164
  def reports_dir(format)
148
- REPORTS_DIR.gsub(/\${[A-Z_]+}/, '${FORMAT}' => format).gsub(' ', '_')
165
+ "#{self.base_output_path}/#{REPORTS_DIR}".gsub(/\${[A-Z_]+}/, '${FORMAT}' => format).gsub(' ', '_')
149
166
  end
150
167
 
151
168
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: henry-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.36
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Decurnex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-30 00:00:00.000000000 Z
11
+ date: 2013-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake