Skip to content

Commit

Permalink
Lint project following latest RuboCop rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerluan committed Jun 13, 2024
1 parent 144e4af commit b53b0ea
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ task :test_swift do
config_file = File.absolute_path("spec/fixtures/swift-tests.yml")
dotenv_file = File.absolute_path("spec/fixtures/.env.fruitloops")
with_temp_dir do |temp_dir|
puts "Current working directory: #{Dir.pwd}"
puts "Current working directory: #{temp_dir}"
sh("ARKANA_RUNNING_CI_INTEGRATION_TESTS=true arkana --config-filepath #{config_file} --dotenv-filepath #{dotenv_file} --include-environments dev,staging")
Dir.chdir("tests/MySecrets")
sh("swift test")
Expand All @@ -31,7 +31,7 @@ task :test_kotlin do
dotenv_file = File.absolute_path("spec/fixtures/.env.fruitloops")
directory_to_copy = File.absolute_path("spec/fixtures/kotlin")
with_temp_dir do |temp_dir|
puts "Current working directory: #{Dir.pwd}"
puts "Current working directory: #{temp_dir}"
FileUtils.copy_entry(directory_to_copy, "tests")
sh("ARKANA_RUNNING_CI_INTEGRATION_TESTS=true arkana --lang kotlin --config-filepath #{config_file} --dotenv-filepath #{dotenv_file} --include-environments dev,staging")
Dir.chdir("tests")
Expand Down
5 changes: 2 additions & 3 deletions lib/arkana/encoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ def self.encode(string, cipher)
result << (byte ^ cipher[index % cipher.length]) # XOR operation with a value of the cipher array.
end

encoded_key = []
result.each do |element|
encoded_key = result.map do |element|
# Warning: this might be specific to Swift implementation. When generating code for other languages, beware.
encoded_key << format("%#x", element) # Format the binary number to "0xAB" format.
format("%#x", element) # Format the binary number to "0xAB" format.
end

encoded_key.join(", ")
Expand Down
5 changes: 2 additions & 3 deletions lib/arkana/models/salt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ class Salt

def initialize(raw:)
@raw = raw
formatted_salt = []
raw.each do |element|
formatted_salt = raw.map do |element|
# Warning: this might be specific to Swift implementation. When generating code for other languages, beware.
formatted_salt << format("%#x", element)
format("%#x", element)
end
@formatted = formatted_salt.join(", ")
end
Expand Down
4 changes: 2 additions & 2 deletions spec/models/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
end
end

describe `#environment_keys` do
describe "#environment_keys" do
context "when there are no environments" do
subject { super().environment_keys }

Expand Down Expand Up @@ -130,7 +130,7 @@
end
end

describe `#all_keys` do
describe "#all_keys" do
it "is not empty" do
expect(subject.all_keys).not_to be_empty
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/secret_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
end
end

describe `#environment` do
describe "#environment" do
subject { super().environment }

context "when key is equal to protocol_key" do
Expand Down

0 comments on commit b53b0ea

Please sign in to comment.