henry-container 0.0.61 → 0.0.62

Sign up to get free protection for your applications and to get access to all the features.
data/in.henry.sample CHANGED
@@ -1,14 +1,16 @@
1
- {
2
- "all":{
3
- },
4
- "Hotels Frontend":{
5
- "countries":{
1
+ [
2
+ {
3
+ "all":{
6
4
  },
7
- "validations":[
8
- ],
9
- "excludeValidations":[
10
- "filters"
11
- ]
5
+ "Hotels Frontend":{
6
+ "countries":{
7
+ },
8
+ "validations":[
9
+ ],
10
+ "excludeValidations":[
11
+ "filters"
12
+ ]
13
+ }
12
14
  }
13
- }
15
+ ]
14
16
 
@@ -3,7 +3,7 @@ module Henry
3
3
  class Container
4
4
 
5
5
  # Current Gem version
6
- VERSION = '0.0.61'
6
+ VERSION = '0.0.62'
7
7
 
8
8
  end
9
9
 
@@ -1,4 +1,3 @@
1
- require 'rake'
2
1
  require 'fileutils'
3
2
  require 'cucumber/rake/task'
4
3
 
@@ -7,7 +6,7 @@ module Henry
7
6
  class Task
8
7
 
9
8
  # The Henry Task implementation for Cucumber
10
- class CucumberTask < Task
9
+ class CucumberTask < RakeTask
11
10
 
12
11
  # The temporary output file path for the RspecTask execution.
13
12
  OUT_PATH = 'cucumber.out'
@@ -17,27 +16,20 @@ module Henry
17
16
 
18
17
  # Default time format to be used in the reports filepath.
19
18
  TIME_FORMAT = '%Y-%m-%dT%H%M%S'
19
+
20
+ # The Cucumber Rake Application name.
21
+ #
22
+ # @return [String] the rake application name.
23
+ APPLICATION_NAME = 'cucumber'
20
24
 
21
- # Executes the CucumberTask and returns its results.
22
- def execute
23
- begin
24
- Rake.application['cucumber'].invoke
25
-
26
- self.execution.code = 'OK'
27
- self.execution.message = 'OK'
28
- self.execution.output = File.open(OUT_PATH, 'r').read
29
- self.execution.log = self.logger.log_as_hash
30
- rescue Exception => e
31
- # retry if self.rerun?
32
-
33
- self.execution.code = 'ERROR'
34
- self.execution.message = 'ERROR'
35
- self.execution.output = File.open(OUT_PATH, 'r').read
36
- self.execution.backtrace = e.message
37
- self.execution.log = self.logger.log_as_hash
38
- end
25
+ def application_name
26
+ APPLICATION_NAME
39
27
  end
40
-
28
+
29
+ def out_path
30
+ OUT_PATH
31
+ end
32
+
41
33
  # Configures the Task.
42
34
  #
43
35
  # @param [Hash] params the task params.
@@ -1,4 +1,3 @@
1
- require 'rake'
2
1
  require 'rake/testtask'
3
2
 
4
3
  module Henry
@@ -6,28 +5,25 @@ module Henry
6
5
  class Task
7
6
 
8
7
  # The Henry Task implementation for MiniTest
9
- class MiniTestTask < Task
8
+ class MiniTestTask < RakeTask
10
9
 
11
10
  # The temporary output file path for the MiniTest execution.
12
11
  OUT_PATH = 'minitest.out'
13
12
 
14
13
  # The reports path template.
15
14
  REPORTS_DIR = '.henry/reports/minitest'
15
+
16
+ # The Minitest Rake Application name.
17
+ #
18
+ # @return [String] the rake application name.
19
+ APPLICATION_NAME = 'minitest'
20
+
21
+ def application_name
22
+ APPLICATION_NAME
23
+ end
16
24
 
17
- # Executes the Task and returns its results.
18
- def execute
19
- begin
20
- Rake.application['minitest'].invoke
21
-
22
- self.execution.code = 'OK'
23
- self.execution.message = 'OK'
24
- self.execution.output = File.open(OUT_PATH, 'r').read
25
- rescue Exception => e
26
- self.execution.code = 'ERROR'
27
- self.execution.message = 'ERROR'
28
- self.execution.output = File.open(OUT_PATH, 'r').read
29
- self.execution.backtrace = e.message
30
- end
25
+ def out_path
26
+ OUT_PATH
31
27
  end
32
28
 
33
29
  # Configures the Task.
@@ -62,3 +58,4 @@ CODE
62
58
  end
63
59
 
64
60
  end
61
+
@@ -0,0 +1,46 @@
1
+ require 'rake'
2
+
3
+ module Henry
4
+
5
+ class Task
6
+
7
+ # The Henry Task implementation for Rake Tasks
8
+ class RakeTask < Task
9
+
10
+ # The temporary output file path for the RakeTask execution.
11
+ #
12
+ # @return [String] the output file path.
13
+ OUT_PATH = 'rake.out'
14
+
15
+ # The Rake Application name.
16
+ #
17
+ # @return [String] the rake application name.
18
+ APPLICATION_NAME = 'rake'
19
+
20
+ # Executes the Task and returns its results.
21
+ def execute
22
+ begin
23
+ Rake.application[self.application_name].reenable
24
+ Rake.application[self.application_name].invoke
25
+
26
+ self.execution.code = 'OK'
27
+ self.execution.message = 'OK'
28
+ self.execution.output = File.open(self.out_path, 'r').read
29
+ self.execution.log = self.logger.log_as_hash
30
+ rescue Exception => e
31
+ self.execution.code = 'ERROR'
32
+ self.execution.message = 'ERROR'
33
+ self.execution.output = File.open(self.out_path, 'r').read
34
+ self.execution.backtrace = e.message
35
+ self.execution.log = self.logger.log_as_hash
36
+ end
37
+ end
38
+
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+ require_relative 'cucumber_task'
45
+ require_relative 'rspec_task'
46
+ require_relative 'minitest_task'
@@ -1,4 +1,3 @@
1
- require 'rake'
2
1
  require 'fileutils'
3
2
  require 'rspec/core/rake_task'
4
3
 
@@ -7,7 +6,7 @@ module Henry
7
6
  class Task
8
7
 
9
8
  # The Henry Task implementation for Rspec
10
- class RspecTask < Task
9
+ class RspecTask < RakeTask
11
10
 
12
11
  # The temporary output file path for the RspecTask execution.
13
12
  OUT_PATH = 'rspec.out'
@@ -17,23 +16,18 @@ module Henry
17
16
 
18
17
  # Default time format to be used in the reports filepath.
19
18
  TIME_FORMAT = '%Y-%m-%dT%H%M%S'
19
+
20
+ # The Rspec Rake Application name.
21
+ #
22
+ # @return [String] the rake application name.
23
+ APPLICATION_NAME = 'rspec'
24
+
25
+ def application_name
26
+ APPLICATION_NAME
27
+ end
20
28
 
21
- # Executes the Task and returns its results.
22
- def execute
23
- begin
24
- Rake.application['spec'].invoke
25
-
26
- self.execution.code = 'OK'
27
- self.execution.message = 'OK'
28
- self.execution.output = File.open(OUT_PATH, 'r').read
29
- self.execution.log = self.logger.log_as_hash
30
- rescue Exception => e
31
- self.execution.code = 'ERROR'
32
- self.execution.message = 'ERROR'
33
- self.execution.output = File.open(OUT_PATH, 'r').read
34
- self.execution.backtrace = e.message
35
- self.execution.log = self.logger.log_as_hash
36
- end
29
+ def out_path
30
+ OUT_PATH
37
31
  end
38
32
 
39
33
  # Configures the Task.
@@ -134,3 +128,4 @@ module Henry
134
128
 
135
129
  end
136
130
 
131
+
data/lib/henry/task.rb CHANGED
@@ -1,6 +1,4 @@
1
- require_relative 'task/cucumber_task'
2
- require_relative 'task/rspec_task'
3
- require_relative 'task/minitest_task'
1
+ require_relative 'task/rake_task'
4
2
 
5
3
  module Henry
6
4
 
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.61
4
+ version: 0.0.62
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -150,6 +150,7 @@ files:
150
150
  - lib/henry/task.rb
151
151
  - lib/henry/task/cucumber_task.rb
152
152
  - lib/henry/task/minitest_task.rb
153
+ - lib/henry/task/rake_task.rb
153
154
  - lib/henry/task/rspec_task.rb
154
155
  - spec/minitest_task_spec.rb
155
156
  - spec/task/minitest_test_task.rb