Skip to content

Commit a95bc37

Browse files
authored
Merge pull request #396 from envato/RuboCop
RuboCop: resolve `Style/*` issues
2 parents 6066da5 + a55a548 commit a95bc37

122 files changed

Lines changed: 795 additions & 1244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop_todo.yml

Lines changed: 3 additions & 412 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ The format is based on [Keep a Changelog], and this project adheres to
1010

1111
## [Unreleased]
1212

13+
### Changed
14+
15+
- Resolve style issues identified by RuboCop ([#396])
16+
1317
[Unreleased]: https://github.com/envato/stack_master/compare/v2.17.1...HEAD
18+
[#396]: https://github.com/envato/stack_master/pull/396
1419

1520
## [2.17.1] - 2025-12-19
1621

Rakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
require "bundler/gem_tasks"
1+
require 'bundler/gem_tasks'
22
require 'bundler/setup'
33

44
task :environment do
55
require 'stack_master'
66
end
77

8-
task :console => :environment do
8+
task console: :environment do
99
require 'pry'
1010
binding.pry
1111
end
@@ -19,12 +19,12 @@ begin
1919

2020
require 'rspec/core/rake_task'
2121
RSpec::Core::RakeTask.new(:spec) do |t|
22-
t.rspec_opts = "--format doc"
22+
t.rspec_opts = '--format doc'
2323
end
2424

2525
require 'rubocop/rake_task'
2626
RuboCop::RakeTask.new('rubocop')
2727
rescue LoadError
2828
end
2929

30-
task :default => [:features, :spec, :rubocop]
30+
task default: %i[features spec rubocop]

bin/stack_master

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
require 'stack_master'
44

5-
if ENV['STUB_AWS'] == 'true'
6-
require 'stack_master/testing'
7-
end
5+
require 'stack_master/testing' if ENV['STUB_AWS'] == 'true'
86

9-
trap("SIGINT") { raise StackMaster::CtrlC }
7+
trap('SIGINT') { raise StackMaster::CtrlC }
108

119
begin
1210
StackMaster::CLI.new(ARGV.dup).execute!
1311
rescue StackMaster::CtrlC
14-
StackMaster.stdout.puts "Exiting..."
12+
StackMaster.stdout.puts 'Exiting...'
1513
end

example/simple/templates/myapp_vpc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SparkleFormation.new(:myapp_vpc) do
2-
description "A test VPC template"
2+
description 'A test VPC template'
33

44
resources.vpc do
55
type 'AWS::EC2::VPC'

example/simple/templates/myapp_web.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SparkleFormation.new(:myapp_web) do
2-
description "Test web template"
2+
description 'Test web template'
33

44
parameters.vpc_id do
55
description 'VPC ID'

features/step_definitions/parameter_store_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parameter: {
77
name: parameter_name,
88
value: parameter_value,
9-
type: "SecureString",
9+
type: 'SecureString',
1010
version: 1
1111
}
1212
}

features/step_definitions/stack_steps.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@
2121
end
2222

2323
def extract_hash_from_kv_string(string)
24-
string.to_s.split(',').inject({}) do |hash, kv|
24+
string.to_s.split(',').each_with_object({}) do |kv, hash|
2525
key, value = kv.split('=')
2626
hash[key] = value
27-
hash
2827
end
2928
end
3029

3130
Given(/^I stub the following stacks:$/) do |table|
3231
table.hashes.each do |row|
3332
row.symbolize_keys!
3433
row[:parameters] = StackMaster::Utils.hash_to_aws_parameters(extract_hash_from_kv_string(row[:parameters]))
35-
outputs = extract_hash_from_kv_string(row[:outputs]).inject([]) do |array, (k, v)|
34+
outputs = extract_hash_from_kv_string(row[:outputs]).each_with_object([]) do |(k, v), array|
3635
array << OpenStruct.new(output_key: k, output_value: v)
37-
array
3836
end
3937
row[:outputs] = outputs
4038
StackMaster.cloud_formation_driver.add_stack(row)

features/support/env.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
Timecop.return
2323
end
2424

25-
lib = File.join(File.dirname(__FILE__), "../../spec/fixtures/sparkle_pack_integration/my_sparkle_pack/lib")
25+
lib = File.join(File.dirname(__FILE__), '../../spec/fixtures/sparkle_pack_integration/my_sparkle_pack/lib')
2626
$LOAD_PATH << lib

lib/stack_master.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def skip_account_check?
172172
@non_interactive_answer = 'y'
173173

174174
def base_dir
175-
File.expand_path(File.join(File.dirname(__FILE__), ".."))
175+
File.expand_path(File.join(File.dirname(__FILE__), '..'))
176176
end
177177

178178
def cloud_formation_driver

0 commit comments

Comments
 (0)