specimen 0.0.2.alpha → 0.0.4.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -49
  3. data/VERSION +1 -1
  4. data/lib/specimen/command/exec_command_builder.rb +42 -14
  5. data/lib/specimen/command/runner/cukes_runner.rb +2 -18
  6. data/lib/specimen/command/runner/specs_runner.rb +2 -17
  7. data/lib/specimen/command/test_runner.rb +19 -25
  8. data/lib/specimen/command.rb +12 -7
  9. data/lib/specimen/commands/encrypted_configuration/USAGE +37 -0
  10. data/lib/specimen/commands/encrypted_configuration/encrypted_configuration_command.rb +108 -0
  11. data/lib/specimen/commands/gem_help/USAGE +6 -3
  12. data/lib/specimen/config_parser.rb +31 -0
  13. data/lib/specimen/generator/configs/specimen_project_config.rb +2 -2
  14. data/lib/specimen/generator/cucumber/cucumber_project_generator.rb +2 -0
  15. data/lib/specimen/generator/cucumber/templates/config/cucumber.yml.tt +4 -1
  16. data/lib/specimen/generator/cucumber/templates/config/specimen.cukes.yml.tt +22 -0
  17. data/lib/specimen/generator/cucumber/templates/features/examples/add_numbers.feature.tt +4 -2
  18. data/lib/specimen/generator/cucumber/templates/features/step_definitions/examples/example_steps.rb.tt +9 -0
  19. data/lib/specimen/generator/cucumber/templates/features/support/env.rb.tt +22 -0
  20. data/lib/specimen/generator/project/project_root_generator.rb +0 -3
  21. data/lib/specimen/generator/project/specimen_project_generator.rb +37 -0
  22. data/lib/specimen/generator/project/templates/root/config/specimen.yml.tt +11 -7
  23. data/lib/specimen/generator/rspec/rspec_project_generator.rb +1 -0
  24. data/lib/specimen/generator/rspec/templates/config/.rspec.tt +0 -4
  25. data/lib/specimen/generator/rspec/templates/config/specimen.specs.yml.tt +19 -0
  26. data/lib/specimen/generator/rspec/templates/spec/examples/example_spec.rb.tt +9 -5
  27. data/lib/specimen/generator/rspec/templates/spec/spec_helper.rb.tt +7 -5
  28. data/lib/specimen/runtime.rb +124 -54
  29. data/lib/specimen/utils/encrypted_config_path.rb +54 -0
  30. data/lib/specimen/utils/encrypted_configuration.rb +156 -0
  31. data/lib/specimen/utils.rb +8 -0
  32. data/lib/specimen/version.rb +1 -1
  33. data/lib/specimen.rb +14 -5
  34. metadata +26 -6
  35. data/lib/specimen/command/runner/exec_runner.rb +0 -37
  36. data/lib/specimen/commands/exec/exec_command.rb +0 -9
  37. data/lib/specimen/runtime/yml_parser.rb +0 -49
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specimen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.alpha
4
+ version: 0.0.4.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Witkowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-27 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: psych
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '5.1'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: thor
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -153,24 +167,27 @@ files:
153
167
  - lib/specimen/command/base_group.rb
154
168
  - lib/specimen/command/exec_command_builder.rb
155
169
  - lib/specimen/command/runner/cukes_runner.rb
156
- - lib/specimen/command/runner/exec_runner.rb
157
170
  - lib/specimen/command/runner/path_runner.rb
158
171
  - lib/specimen/command/runner/specs_runner.rb
159
172
  - lib/specimen/command/test_runner.rb
160
173
  - lib/specimen/commands.rb
161
174
  - lib/specimen/commands/cukes/cukes_command.rb
162
- - lib/specimen/commands/exec/exec_command.rb
175
+ - lib/specimen/commands/encrypted_configuration/USAGE
176
+ - lib/specimen/commands/encrypted_configuration/encrypted_configuration_command.rb
163
177
  - lib/specimen/commands/gem_help/USAGE
164
178
  - lib/specimen/commands/gem_help/gem_help_command.rb
165
179
  - lib/specimen/commands/init/USAGE
166
180
  - lib/specimen/commands/init/init_command.rb
167
181
  - lib/specimen/commands/specs/specs_command.rb
182
+ - lib/specimen/config_parser.rb
168
183
  - lib/specimen/extensions/ruby/hash.rb
169
184
  - lib/specimen/generator.rb
170
185
  - lib/specimen/generator/configs/specimen_project_config.rb
171
186
  - lib/specimen/generator/cucumber/cucumber_project_generator.rb
172
187
  - lib/specimen/generator/cucumber/templates/config/cucumber.yml.tt
188
+ - lib/specimen/generator/cucumber/templates/config/specimen.cukes.yml.tt
173
189
  - lib/specimen/generator/cucumber/templates/features/examples/add_numbers.feature.tt
190
+ - lib/specimen/generator/cucumber/templates/features/step_definitions/examples/example_steps.rb.tt
174
191
  - lib/specimen/generator/cucumber/templates/features/support/env.rb.tt
175
192
  - lib/specimen/generator/file_by_template.rb
176
193
  - lib/specimen/generator/generator_base.rb
@@ -186,10 +203,13 @@ files:
186
203
  - lib/specimen/generator/project_generator_base.rb
187
204
  - lib/specimen/generator/rspec/rspec_project_generator.rb
188
205
  - lib/specimen/generator/rspec/templates/config/.rspec.tt
206
+ - lib/specimen/generator/rspec/templates/config/specimen.specs.yml.tt
189
207
  - lib/specimen/generator/rspec/templates/spec/examples/example_spec.rb.tt
190
208
  - lib/specimen/generator/rspec/templates/spec/spec_helper.rb.tt
191
209
  - lib/specimen/runtime.rb
192
- - lib/specimen/runtime/yml_parser.rb
210
+ - lib/specimen/utils.rb
211
+ - lib/specimen/utils/encrypted_config_path.rb
212
+ - lib/specimen/utils/encrypted_configuration.rb
193
213
  - lib/specimen/version.rb
194
214
  homepage: https://github.com/dev-dots/specimen
195
215
  licenses:
@@ -214,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
234
  - !ruby/object:Gem::Version
215
235
  version: 3.0.1
216
236
  requirements: []
217
- rubygems_version: 3.5.11
237
+ rubygems_version: 3.5.14
218
238
  signing_key:
219
239
  specification_version: 4
220
240
  summary: Specimen
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Specimen
4
- module Command
5
- class ExecRunner < TestRunner
6
- class_option :profile, aliases: %w[-p], type: :string
7
-
8
- no_commands do
9
- def perform
10
- super
11
-
12
- run_profile_check!
13
- check_config_not_nil!
14
- inside runtime.work_dir do
15
- run(exec_cmd)
16
- end
17
- end
18
-
19
- def tests_path
20
- ''
21
- end
22
-
23
- def run_profile_check!
24
- raise "Missing command option '--profile|-p'" unless profile?
25
- end
26
-
27
- def framework
28
- profile_config['framework'] || nil
29
- end
30
-
31
- def profile_name
32
- profile? ? profile : nil
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Specimen
4
- module Command
5
- class ExecCommand < ExecRunner
6
- namespace :exec
7
- end
8
- end
9
- end
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'psych'
4
-
5
- module Specimen
6
- module Runtime
7
- class YmlParser
8
- class YmlTypeError < StandardError; end
9
- class YmlERBError < StandardError; end
10
- class YmlDataError < StandardError; end
11
-
12
- def self.parse!(file)
13
- new(file).parse
14
- end
15
-
16
- def initialize(file)
17
- @file = file
18
- end
19
-
20
- def parse
21
- specimen_yml_data
22
- end
23
-
24
- private
25
-
26
- def specimen_yml
27
- @specimen_yml ||= File.read(@file)
28
- end
29
-
30
- def specimen_yml_erb
31
- @specimen_yml_erb ||= ERB.new(specimen_yml, trim_mode: '%').result(binding)
32
- rescue StandardError
33
- raise YmlERBError, "#{@file} could not be parsed with ERB!"
34
- end
35
-
36
- def specimen_yml_data
37
- return @specimen_yml_data if @specimen_yml_data
38
-
39
- data = Psych.load(specimen_yml_erb, aliases: true)
40
-
41
- raise YmlTypeError, 'specimen.yml data could not be parsed' unless data.is_a?(Hash)
42
-
43
- @specimen_yml_data = data
44
- rescue StandardError
45
- raise YmlDataError, "Could not read data from: '#{@file}'!"
46
- end
47
- end
48
- end
49
- end