ruby_raider 1.1.2 → 1.1.3

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
  SHA256:
3
- metadata.gz: ac4b064389c24f9bb855e4a8aa65f98643bed0f818d7c739cd5a61c4d43f7479
4
- data.tar.gz: 32077541ae2cdd5325966ab3592767efa67355314f7ab88c9416d38c71f1f6f5
3
+ metadata.gz: 6a1b21d9b4922f54631a61b51d538aed36d1b0fc737bae16952fe0fb08a44ac4
4
+ data.tar.gz: a0f74051e1b2b2f111f60a50ea38421c4e25f7372c04e5d6b51dcf79002ea5ae
5
5
  SHA512:
6
- metadata.gz: 454798ed4c5f6bbbae3f445a4a278bbfbce68d8a269a8dfafc820a6d3bde0fbffa2a5d1c0731034625c057a0835c175b003750dc0381c1058adfdc906da799d3
7
- data.tar.gz: 8aa272ce582d05952152df54a000680caab263358cb08d3fb69c85efd7d20b881190496eb6b63315895e575b38403afbd79da5cdb3493f89c11ec8f124749d81
6
+ metadata.gz: ab955748672f78a29d665604f7932bf1d87a39019e9267cb4281cafc703cdb282281fad04a4bdc814ca91f246607a41a963b276d8f7839074ec42823090230cf
7
+ data.tar.gz: c6a1d02de0f73fd27625b6620cac8de8a63d49739f1607ba00a8627e60987fed4d85bcf34b002ada20d4d3edd9b7c2b9333a6a11353a11524539daf03b5e5997
@@ -9,7 +9,7 @@ jobs:
9
9
 
10
10
  steps:
11
11
  - name: Checkout repository
12
- uses: actions/checkout@v4
12
+ uses: infrastructure/checkout@v4
13
13
 
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
@@ -26,7 +26,7 @@ jobs:
26
26
  with:
27
27
  egress-policy: audit
28
28
 
29
- - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
29
+ - uses: infrastructure/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
32
32
  with:
@@ -13,7 +13,7 @@ jobs:
13
13
  ruby-version: head
14
14
 
15
15
  - name: Check out code
16
- uses: actions/checkout@v1
16
+ uses: infrastructure/checkout@v1
17
17
 
18
18
  - name: reek
19
19
  uses: reviewdog/action-reek@v1
@@ -17,7 +17,7 @@ jobs:
17
17
  ruby-version: head
18
18
 
19
19
  - name: Check out code
20
- uses: actions/checkout@v1
20
+ uses: infrastructure/checkout@v1
21
21
 
22
22
  - name: rubocop
23
23
  uses: reviewdog/action-rubocop@v2
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  steps:
10
10
  - name: Checkout repository
11
- uses: actions/checkout@v4
11
+ uses: infrastructure/checkout@v4
12
12
 
13
13
  - name: Set up Ruby
14
14
  uses: ruby/setup-ruby@v1
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  steps:
10
10
  - name: Checkout repository
11
- uses: actions/checkout@v4
11
+ uses: infrastructure/checkout@v4
12
12
 
13
13
  - name: Set up Ruby
14
14
  uses: ruby/setup-ruby@v1
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <br />
11
11
  <div align="center">
12
12
  <a href="https://github.com/RubyRaider/ruby_raider">
13
- <img src="https://private-user-images.githubusercontent.com/33221555/391053089-3a1a492f-a70e-45ff-8fd0-5f83cef91f49.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQxMjQ1MTEsIm5iZiI6MTczNDEyNDIxMSwicGF0aCI6Ii8zMzIyMTU1NS8zOTEwNTMwODktM2ExYTQ5MmYtYTcwZS00NWZmLThmZDAtNWY4M2NlZjkxZjQ5LnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjEzVDIxMTAxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1OGQzNzAzNzkyZDk1ODQ0NmQ5NjE4ODQ2MmU2ZDRmMzE3ZmM4NzIzNmUzMzg0YmVjNWRlYzBiNzRiOTMxOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VRnGFS1lZnAeumwk5a_xiPGcEcrqpQvX-iaAwk29t-I" alt="Logo" style="width:200px;">
13
+ <img src="https://www.ruby-raider.com/assets/icon-DYY74ofR.png" alt="Logo" style="width:200px;">
14
14
  </a>
15
15
  <p align="center">
16
16
  <a href="https://github.com/RubyRaider/ruby_raider#getting-started"><strong>Explore the docs »</strong></a>
@@ -12,7 +12,7 @@ class Generator < Thor::Group
12
12
  def self.source_paths
13
13
  base_path = File.dirname(__FILE__)
14
14
  %W[#{base_path}/automation/templates #{base_path}/cucumber/templates
15
- #{base_path}/rspec/templates #{base_path}/templates #{base_path}/actions/templates ]
15
+ #{base_path}/rspec/templates #{base_path}/templates #{base_path}/infrastructure/templates ]
16
16
  end
17
17
 
18
18
  def args
@@ -2,10 +2,10 @@
2
2
 
3
3
  require_relative '../generator'
4
4
 
5
- class ActionsGenerator < Generator
5
+ class GithubGenerator < Generator
6
6
  def generate_actions_file
7
7
  return unless web?
8
8
 
9
- template('actions.tt', "#{name}/.github/workflows/test_pipeline.yml")
9
+ template('github.tt', "#{name}/.github/workflows/test_pipeline.yml")
10
10
  end
11
11
  end
@@ -1,4 +1,4 @@
1
- require_relative 'actions/actions_generator'
1
+ require_relative 'infrastructure/github_generator'
2
2
  require_relative 'automation/automation_generator'
3
3
  require_relative 'common_generator'
4
4
  require_relative 'cucumber/cucumber_generator'
@@ -11,14 +11,16 @@ module InvokeGenerators
11
11
  module_function
12
12
 
13
13
  def generate_framework(structure = {})
14
- generators = %w[Automation Actions Common Helpers]
14
+ generators = %w[Automation Common Helpers]
15
15
  framework = structure[:framework]
16
16
  add_generator(generators, framework.capitalize)
17
+ add_generator(generators, structure[:ci_platform].capitalize) if structure[:ci_platform]
17
18
  generators.each do |generator|
18
19
  invoke_generator({
19
20
  automation: structure[:automation],
20
21
  framework:,
21
22
  generator:,
23
+ ci_platform: structure[:ci_platform],
22
24
  name: structure[:name]
23
25
  })
24
26
  end
@@ -32,7 +34,8 @@ module InvokeGenerators
32
34
  Object.const_get("#{structure[:generator]}Generator")
33
35
  .new([structure[:automation],
34
36
  structure[:framework],
35
- structure[:name]]).invoke_all
37
+ structure[:name],
38
+ structure[:ci_platform]]).invoke_all
36
39
  end
37
40
 
38
41
  def to_bool(string)
@@ -31,6 +31,7 @@ class MenuGenerator
31
31
  structure = {
32
32
  automation: options[:automation],
33
33
  framework: options[:framework],
34
+ ci_platform: options[:ci_platform],
34
35
  name: @name
35
36
  }
36
37
  generate_framework(structure)
@@ -50,26 +51,27 @@ class MenuGenerator
50
51
 
51
52
  def select_test_framework(automation)
52
53
  prompt.select('Please select your test framework') do |menu|
53
- menu.choice :Cucumber, -> { create_framework('Cucumber', automation) }
54
- menu.choice :Rspec, -> { create_framework('Rspec', automation) }
54
+ menu.choice :Cucumber, -> { select_ci_platform('Cucumber', automation) }
55
+ menu.choice :Rspec, -> { select_ci_platform('Rspec', automation) }
55
56
  menu.choice :Quit, -> { exit }
56
57
  end
57
58
  end
58
59
 
59
- FrameworkOptions = Struct.new(:automation, :framework)
60
+ FrameworkOptions = Struct.new(:automation, :framework, :ci_platform)
60
61
 
61
62
  def create_framework_options(params)
62
- FrameworkOptions.new(params[:automation], params[:framework])
63
+ FrameworkOptions.new(params[:automation], params[:framework], params[:ci_platform])
63
64
  end
64
65
 
65
- def create_framework(framework, automation_type)
66
+ def create_framework(framework, automation_type, ci_platform = nil)
66
67
  options = create_framework_options(automation: automation_type,
67
- framework: framework.downcase)
68
+ framework: framework.downcase,
69
+ ci_platform:)
68
70
 
69
- # Print the chosen options
70
71
  puts 'Chosen Options:'
71
72
  puts " Automation Type: #{options[:automation]}"
72
73
  puts " Framework: #{options[:framework]}"
74
+ puts " CI Platform: #{options[:ci_platform]}" if options[:ci_platform]
73
75
 
74
76
  set_up_framework(options)
75
77
  prompt.say("You have chosen to use #{framework} with #{automation_type}")
@@ -95,4 +97,12 @@ class MenuGenerator
95
97
  menu.choice :Applitools, -> { choose_test_framework('applitools') }
96
98
  menu.choice :Axe, -> { choose_test_framework('axe') }
97
99
  end
100
+
101
+ def select_ci_platform(framework, automation)
102
+ prompt.select('Would you like to configure CI?') do |menu|
103
+ menu.choice :'Github Actions', -> { create_framework(framework, automation, 'github') }
104
+ menu.choice :No, -> { create_framework(framework, automation) }
105
+ menu.choice :Quit, -> { exit }
106
+ end
107
+ end
98
108
  end
data/lib/version CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.3
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../lib/generators/infrastructure/github_generator'
4
+ require_relative '../spec_helper'
5
+
6
+ describe GithubGenerator do
7
+ shared_examples 'selects github as an infrastructure option' do |name|
8
+ it 'creates a github infrastructure file' do
9
+ expect(File).to exist("#{name}/.github/workflows/test_pipeline.yml")
10
+ end
11
+ end
12
+
13
+ shared_examples 'does not select any infrastructure option' do |name|
14
+ it 'does not create a github infrastructure file' do
15
+ expect(File).not_to exist("#{name}/.github/workflows/test_pipeline.yml")
16
+ end
17
+ end
18
+
19
+ context 'with rspec and selenium' do
20
+ include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
21
+ include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
22
+ end
23
+
24
+ context 'with rspec and watir' do
25
+ include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
26
+ include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
27
+ end
28
+
29
+ context 'with cucumber and selenium' do
30
+ include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
31
+ include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
32
+ end
33
+
34
+ context 'with cucumber and watir' do
35
+ include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
36
+ include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
37
+ end
38
+ end
@@ -5,10 +5,12 @@ module SettingsHelper
5
5
  def create_settings(options)
6
6
  automation = options[:automation]
7
7
  framework = options[:framework]
8
+ ci_platform = options[:ci_platform]
8
9
  {
9
10
  automation:,
10
11
  framework:,
11
- name: "#{framework}_#{automation}"
12
+ ci_platform:,
13
+ name: ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}",
12
14
  }
13
15
  end
14
16
  end
@@ -7,16 +7,20 @@ require_relative 'settings_helper'
7
7
 
8
8
  AUTOMATION_TYPES = %w[android ios selenium watir cross_platform axe applitools].freeze
9
9
  FRAMEWORKS = %w[cucumber rspec].freeze
10
+ CI_PLATFORMS = [nil, 'github'].freeze
10
11
 
11
12
  RSpec.configure do |config|
12
13
  config.include(InvokeGenerators)
13
14
  config.include(SettingsHelper)
15
+
14
16
  # rubocop:disable RSpec/BeforeAfterAll
15
17
  config.before(:all) do
16
18
  FRAMEWORKS.each do |framework|
17
19
  AUTOMATION_TYPES.each do |automation|
18
- settings = create_settings(framework:, automation:)
19
- generate_framework(settings)
20
+ CI_PLATFORMS.each do |ci_platform|
21
+ settings = create_settings(framework:, automation:, ci_platform:)
22
+ generate_framework(settings)
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -24,10 +28,12 @@ RSpec.configure do |config|
24
28
  config.after(:all) do
25
29
  FRAMEWORKS.each do |framework|
26
30
  AUTOMATION_TYPES.each do |automation|
27
- settings = create_settings(framework:, automation:)
28
- FileUtils.rm_rf(settings[:name])
31
+ CI_PLATFORMS.each do |ci_platform|
32
+ settings = create_settings(framework:, automation:, ci_platform:)
33
+ FileUtils.rm_rf(settings[:name])
34
+ end
29
35
  end
30
36
  end
31
37
  end
38
+ # rubocop:enable RSpec/BeforeAfterAll
32
39
  end
33
- # rubocop:enable RSpec/BeforeAfterAll
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_raider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-22 00:00:00.000000000 Z
11
+ date: 2025-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -154,8 +154,6 @@ files:
154
154
  - lib/commands/plugin_commands.rb
155
155
  - lib/commands/scaffolding_commands.rb
156
156
  - lib/commands/utility_commands.rb
157
- - lib/generators/actions/actions_generator.rb
158
- - lib/generators/actions/templates/actions.tt
159
157
  - lib/generators/automation/automation_generator.rb
160
158
  - lib/generators/automation/templates/account.tt
161
159
  - lib/generators/automation/templates/appium_caps.tt
@@ -196,6 +194,8 @@ files:
196
194
  - lib/generators/cucumber/templates/world.tt
197
195
  - lib/generators/generator.rb
198
196
  - lib/generators/helper_generator.rb
197
+ - lib/generators/infrastructure/github_generator.rb
198
+ - lib/generators/infrastructure/templates/github.tt
199
199
  - lib/generators/invoke_generators.rb
200
200
  - lib/generators/menu_generator.rb
201
201
  - lib/generators/rspec/rspec_generator.rb
@@ -239,10 +239,10 @@ files:
239
239
  - ruby_raider.gemspec
240
240
  - spec/integration/commands/scaffolding_commands_spec.rb
241
241
  - spec/integration/commands/utility_commands_spec.rb
242
- - spec/integration/generators/actions_generator_spec.rb
243
242
  - spec/integration/generators/automation_generator_spec.rb
244
243
  - spec/integration/generators/common_generator_spec.rb
245
244
  - spec/integration/generators/cucumber_generator_spec.rb
245
+ - spec/integration/generators/github_generator_spec.rb
246
246
  - spec/integration/generators/helpers_generator_spec.rb
247
247
  - spec/integration/generators/rspec_generator_spec.rb
248
248
  - spec/integration/settings_helper.rb
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../../lib/generators/actions/actions_generator'
4
- require_relative '../spec_helper'
5
-
6
- describe ActionsGenerator do
7
- shared_examples 'creates web automation framework' do |name|
8
- it 'creates a github actions file' do
9
- expect(File).to exist("#{name}/.github/workflows/test_pipeline.yml")
10
- end
11
- end
12
-
13
- context 'with rspec and selenium' do
14
- include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
15
- end
16
-
17
- context 'with rspec and watir' do
18
- include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
19
- end
20
-
21
- context 'with cucumber and selenium' do
22
- include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
23
- end
24
-
25
- context 'with cucumber and watir' do
26
- include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
27
- end
28
- end