Skip to content

Commit 9de57fc

Browse files
authored
Merge pull request #314 from kbrock/rubocop
rubocop fixes
2 parents 6810d9d + 0206b38 commit 9de57fc

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

floe.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ Gem::Specification.new do |spec|
3333

3434
spec.add_dependency "activesupport", ">5.2"
3535
spec.add_dependency "awesome_spawn", "~>1.6"
36+
spec.add_dependency "faraday"
37+
spec.add_dependency "faraday-follow_redirects"
3638
spec.add_dependency "io-wait"
39+
spec.add_dependency "json", "~>2.10"
3740
spec.add_dependency "jsonpath", "~>1.1"
3841
spec.add_dependency "kubeclient", "~>4.7"
3942
spec.add_dependency "optimist", "~>3.0"
4043
spec.add_dependency "parslet", "~>2.0"
41-
spec.add_dependency "json", "~>2.10"
42-
spec.add_dependency "faraday"
43-
spec.add_dependency "faraday-follow_redirects"
4444

4545
spec.add_development_dependency "manageiq-style", ">= 1.5.2"
4646
spec.add_development_dependency "rake", "~> 13.0"

lib/floe/builtin_runner/methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def self.http(params, _secrets, _context)
5959
connection.response(:follow_redirects)
6060
end
6161

62-
response = connection.send(method.downcase) do |request|
63-
request.body = body if body
62+
response = connection.send(method.downcase) do |faraday_request|
63+
faraday_request.body = body if body
6464
end
6565

6666
output = {"Status" => response.status, "Body" => response.body, "Headers" => response.headers}

lib/floe/builtin_runner/runner.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def cleanup(runner_context)
2323
method_name = runner_context["method"]
2424
raise ArgumentError if method_name.nil?
2525

26-
cleanup_method = "#{method_name}_cleanup"
26+
cleanup_method = :"#{method_name}_cleanup"
2727
return unless Methods.respond_to?(cleanup_method, true)
2828

2929
Methods.send(cleanup_method, runner_context)
@@ -34,7 +34,7 @@ def status!(runner_context)
3434
raise ArgumentError if method_name.nil?
3535
return if runner_context["running"] == false
3636

37-
Methods.send("#{method_name}_status!", runner_context)
37+
Methods.send(:"#{method_name}_status!", runner_context)
3838
end
3939

4040
def running?(runner_context)

lib/floe/container_runner/docker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def docker_event_status_to_event(status)
183183
def inspect_container(container_id)
184184
JSON.parse(docker!("inspect", container_id).output).first
185185
rescue AwesomeSpawn::CommandResultError => err
186-
raise Floe::ExecutionError.new("Failed to get status for container #{container_id}: #{err}")
186+
raise Floe::ExecutionError, "Failed to get status for container #{container_id}: #{err}"
187187
end
188188

189189
def delete_container(container_id)

lib/floe/container_runner/kubernetes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def wait(timeout: nil, events: %i[create update delete])
156156
def pod_info(pod_name)
157157
kubeclient.get_pod(pod_name, namespace)
158158
rescue Kubeclient::HttpError => err
159-
raise Floe::ExecutionError.new("Failed to get status for pod #{namespace}/#{pod_name}: #{err}")
159+
raise Floe::ExecutionError, "Failed to get status for pod #{namespace}/#{pod_name}: #{err}"
160160
end
161161

162162
def pod_running?(context)

lib/floe/workflow/choice_rule/data.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ class Data < Floe::Workflow::ChoiceRule
77
TYPES = ["String", "Numeric", "Boolean", "Timestamp", "Present", "Null"].freeze
88
COMPARES = ["Equals", "LessThan", "GreaterThan", "LessThanEquals", "GreaterThanEquals", "Matches"].freeze
99
# e.g.: (Is)(String), (Is)(Present)
10-
TYPE_CHECK = /^(Is)(#{TYPES.join("|")})$/.freeze
10+
TYPE_CHECK = /^(Is)(#{TYPES.join("|")})$/
1111
# e.g.: (String)(LessThan)(Path), (Numeric)(GreaterThanEquals)()
12-
OPERATION = /^(#{(TYPES - %w[Null Present]).join("|")})(#{COMPARES.join("|")})(Path)?$/.freeze
12+
OPERATION = /^(#{(TYPES - %w[Null Present]).join("|")})(#{COMPARES.join("|")})(Path)?$/
1313

1414
attr_reader :variable, :compare_key, :operation, :type, :compare_predicate, :path
1515

lib/floe/workflow/intrinsic_function/transformer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def check_types(args, function, signature)
7777
rule(:number => simple(:v)) { v.match(/[eE.]/) ? Float(v) : Integer(v) }
7878
rule(:jsonpath => simple(:v)) { Floe::Workflow::Path.value(v.to_s, context, input) }
7979

80-
STATES_FORMAT_PLACEHOLDER = /(?<!\\)\{\}/.freeze
80+
STATES_FORMAT_PLACEHOLDER = /(?<!\\)\{\}/
8181

8282
rule(:states_format => {:args => subtree(:args)}) do
8383
args = Transformer.process_args(args(), "States.Format", [String, VariadicArgs[[String, TrueClass, FalseClass, Numeric, NilClass]]])

lib/floe/workflow/states/map.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def start(context)
5858
"Execution" => {
5959
"Id" => context.execution["Id"]
6060
},
61-
"Map" => {
61+
"Map" => {
6262
"Item" => {"Index" => index, "Value" => item}
6363
}
6464
}

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
SimpleCov.start
1919
end
2020

21-
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
22-
Dir['./spec/shared/**/*.rb'].sort.each { |f| require f }
21+
Dir['./spec/support/**/*.rb'].each { |f| require f }
22+
Dir['./spec/shared/**/*.rb'].each { |f| require f }
2323

2424
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
2525
RSpec.configure do |config|

spec/workflow/states/task_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
let(:workflow) do
241241
make_workflow(
242242
ctx, {
243-
"State" => {
243+
"State" => {
244244
"Type" => "Task",
245245
"Resource" => resource,
246246
"Parameters" => {"var1.$" => "$.foo.bar"},

0 commit comments

Comments
 (0)