specimen 0.0.3.alpha → 0.0.4.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -49
- data/VERSION +1 -1
- data/lib/specimen/command/exec_command_builder.rb +42 -12
- data/lib/specimen/command/runner/cukes_runner.rb +2 -18
- data/lib/specimen/command/runner/specs_runner.rb +2 -17
- data/lib/specimen/command/test_runner.rb +19 -25
- data/lib/specimen/command.rb +12 -5
- data/lib/specimen/commands/encrypted_configuration/USAGE +37 -0
- data/lib/specimen/commands/encrypted_configuration/encrypted_configuration_command.rb +108 -0
- data/lib/specimen/commands/gem_help/USAGE +3 -3
- data/lib/specimen/config_parser.rb +31 -0
- data/lib/specimen/generator/configs/specimen_project_config.rb +1 -1
- data/lib/specimen/generator/cucumber/cucumber_project_generator.rb +2 -0
- data/lib/specimen/generator/cucumber/templates/config/cucumber.yml.tt +4 -1
- data/lib/specimen/generator/cucumber/templates/config/specimen.cukes.yml.tt +22 -0
- data/lib/specimen/generator/cucumber/templates/features/examples/add_numbers.feature.tt +4 -2
- data/lib/specimen/generator/cucumber/templates/features/step_definitions/examples/example_steps.rb.tt +9 -0
- data/lib/specimen/generator/cucumber/templates/features/support/env.rb.tt +22 -0
- data/lib/specimen/generator/project/project_root_generator.rb +0 -1
- data/lib/specimen/generator/project/specimen_project_generator.rb +37 -0
- data/lib/specimen/generator/project/templates/root/config/specimen.yml.tt +11 -7
- data/lib/specimen/generator/rspec/rspec_project_generator.rb +1 -0
- data/lib/specimen/generator/rspec/templates/config/.rspec.tt +0 -4
- data/lib/specimen/generator/rspec/templates/config/specimen.specs.yml.tt +19 -0
- data/lib/specimen/generator/rspec/templates/spec/examples/example_spec.rb.tt +9 -5
- data/lib/specimen/generator/rspec/templates/spec/spec_helper.rb.tt +7 -5
- data/lib/specimen/runtime.rb +124 -54
- data/lib/specimen/utils/encrypted_config_path.rb +54 -0
- data/lib/specimen/utils/encrypted_configuration.rb +156 -0
- data/lib/specimen/utils.rb +8 -0
- data/lib/specimen/version.rb +1 -1
- data/lib/specimen.rb +13 -5
- metadata +11 -5
- data/lib/specimen/command/runner/exec_runner.rb +0 -37
- data/lib/specimen/commands/exec/exec_command.rb +0 -9
- data/lib/specimen/runtime/yml_parser.rb +0 -47
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.
|
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-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -167,24 +167,27 @@ files:
|
|
167
167
|
- lib/specimen/command/base_group.rb
|
168
168
|
- lib/specimen/command/exec_command_builder.rb
|
169
169
|
- lib/specimen/command/runner/cukes_runner.rb
|
170
|
-
- lib/specimen/command/runner/exec_runner.rb
|
171
170
|
- lib/specimen/command/runner/path_runner.rb
|
172
171
|
- lib/specimen/command/runner/specs_runner.rb
|
173
172
|
- lib/specimen/command/test_runner.rb
|
174
173
|
- lib/specimen/commands.rb
|
175
174
|
- lib/specimen/commands/cukes/cukes_command.rb
|
176
|
-
- lib/specimen/commands/
|
175
|
+
- lib/specimen/commands/encrypted_configuration/USAGE
|
176
|
+
- lib/specimen/commands/encrypted_configuration/encrypted_configuration_command.rb
|
177
177
|
- lib/specimen/commands/gem_help/USAGE
|
178
178
|
- lib/specimen/commands/gem_help/gem_help_command.rb
|
179
179
|
- lib/specimen/commands/init/USAGE
|
180
180
|
- lib/specimen/commands/init/init_command.rb
|
181
181
|
- lib/specimen/commands/specs/specs_command.rb
|
182
|
+
- lib/specimen/config_parser.rb
|
182
183
|
- lib/specimen/extensions/ruby/hash.rb
|
183
184
|
- lib/specimen/generator.rb
|
184
185
|
- lib/specimen/generator/configs/specimen_project_config.rb
|
185
186
|
- lib/specimen/generator/cucumber/cucumber_project_generator.rb
|
186
187
|
- lib/specimen/generator/cucumber/templates/config/cucumber.yml.tt
|
188
|
+
- lib/specimen/generator/cucumber/templates/config/specimen.cukes.yml.tt
|
187
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
|
188
191
|
- lib/specimen/generator/cucumber/templates/features/support/env.rb.tt
|
189
192
|
- lib/specimen/generator/file_by_template.rb
|
190
193
|
- lib/specimen/generator/generator_base.rb
|
@@ -200,10 +203,13 @@ files:
|
|
200
203
|
- lib/specimen/generator/project_generator_base.rb
|
201
204
|
- lib/specimen/generator/rspec/rspec_project_generator.rb
|
202
205
|
- lib/specimen/generator/rspec/templates/config/.rspec.tt
|
206
|
+
- lib/specimen/generator/rspec/templates/config/specimen.specs.yml.tt
|
203
207
|
- lib/specimen/generator/rspec/templates/spec/examples/example_spec.rb.tt
|
204
208
|
- lib/specimen/generator/rspec/templates/spec/spec_helper.rb.tt
|
205
209
|
- lib/specimen/runtime.rb
|
206
|
-
- lib/specimen/
|
210
|
+
- lib/specimen/utils.rb
|
211
|
+
- lib/specimen/utils/encrypted_config_path.rb
|
212
|
+
- lib/specimen/utils/encrypted_configuration.rb
|
207
213
|
- lib/specimen/version.rb
|
208
214
|
homepage: https://github.com/dev-dots/specimen
|
209
215
|
licenses:
|
@@ -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,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Specimen
|
4
|
-
module Runtime
|
5
|
-
class YmlParser
|
6
|
-
class YmlTypeError < StandardError; end
|
7
|
-
class YmlERBError < StandardError; end
|
8
|
-
class YmlDataError < StandardError; end
|
9
|
-
|
10
|
-
def self.parse!(file)
|
11
|
-
new(file).parse
|
12
|
-
end
|
13
|
-
|
14
|
-
def initialize(file)
|
15
|
-
@file = file
|
16
|
-
end
|
17
|
-
|
18
|
-
def parse
|
19
|
-
specimen_yml_data
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def specimen_yml
|
25
|
-
@specimen_yml ||= File.read(@file)
|
26
|
-
end
|
27
|
-
|
28
|
-
def specimen_yml_erb
|
29
|
-
@specimen_yml_erb ||= ERB.new(specimen_yml, trim_mode: '%').result(binding)
|
30
|
-
rescue StandardError
|
31
|
-
raise YmlERBError, "#{@file} could not be parsed with ERB!"
|
32
|
-
end
|
33
|
-
|
34
|
-
def specimen_yml_data
|
35
|
-
return @specimen_yml_data if @specimen_yml_data
|
36
|
-
|
37
|
-
data = Psych.load(specimen_yml_erb, aliases: true)
|
38
|
-
|
39
|
-
raise YmlTypeError, 'specimen.yml data could not be parsed' unless data.is_a?(Hash)
|
40
|
-
|
41
|
-
@specimen_yml_data = data
|
42
|
-
rescue StandardError
|
43
|
-
raise YmlDataError, "Could not read data from: '#{@file}'!"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|