Skip to content

Commit

Permalink
#56 Prefer require_relative instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerluan committed Dec 27, 2023
2 parents 66a189e + f66da8f commit c45af9b
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/arkana/config_parser.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "yaml"
require "yaml" unless defined?(YAML)
require_relative "models/config"
require_relative "helpers/ui"

Expand Down
2 changes: 1 addition & 1 deletion lib/arkana/encoder.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "arkana/helpers/string"
require_relative "helpers/string"

# The encoder is responsible for finding the env vars for given keys, encoding them, and creating Secrets based on the generated data.
module Encoder
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/kotlin_code_generator.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "erb"
require "fileutils"
require "erb" unless defined?(Erb)
require "fileutils" unless defined?(FileUtils)
require_relative "helpers/string"

# Responsible for generating Kotlin source and test files.
Expand Down
2 changes: 1 addition & 1 deletion lib/arkana/models/template_arguments.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "arkana/models/secret"
require_relative "secret"

# A class that defines template arguments in a language-agnostic form.
class TemplateArguments
Expand Down
2 changes: 1 addition & 1 deletion lib/arkana/salt_generator.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "securerandom"
require "securerandom" unless defined?(SecureRandom)
require_relative "models/salt"

# Responsible for generating the salt.
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/swift_code_generator.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "erb"
require "fileutils"
require "erb" unless defined?(Erb)
require "fileutils" unless defined?(FileUtils)
require_relative "helpers/string"

# Responsible for generating Swift source and test files.
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/templates/kotlin/arkana.kt.erb
@@ -1,5 +1,5 @@
<% require "arkana/helpers/string" %>
<% require "arkana/helpers/kotlin_template_helper" %>
<% require_relative "lib/arkana/helpers/string" %>
<% require_relative "lib/arkana/helpers/kotlin_template_helper" %>
<% # TODO: Sort these import statements alphabetically %>
// DO NOT MODIFY
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/templates/kotlin/arkana_protocol.kt.erb
@@ -1,5 +1,5 @@
<% require "arkana/helpers/string" %>
<% require "arkana/helpers/kotlin_template_helper" %>
<% require_relative "lib/arkana/helpers/string" %>
<% require_relative "lib/arkana/helpers/kotlin_template_helper" %>
// DO NOT MODIFY
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)
package <%= @kotlin_package_name %>
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/templates/kotlin/arkana_tests.kt.erb
@@ -1,5 +1,5 @@
<% require "arkana/helpers/string" %>
<% require "arkana/helpers/kotlin_template_helper" %>
<% require_relative "lib/arkana/helpers/string" %>
<% require_relative "lib/arkana/helpers/kotlin_template_helper" %>
// DO NOT MODIFY
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)
package <%= @kotlin_package_name %>
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/templates/swift/arkana.swift.erb
@@ -1,5 +1,5 @@
<% require "arkana/helpers/string" %>
<% require "arkana/helpers/swift_template_helper" %>
<% require_relative "lib/arkana/helpers/string" %>
<% require_relative "lib/arkana/helpers/swift_template_helper" %>
<% # TODO: Sort these import statements alphabetically %>
// DO NOT MODIFY
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)
Expand Down
4 changes: 2 additions & 2 deletions lib/arkana/templates/swift/arkana_protocol.swift.erb
@@ -1,5 +1,5 @@
<% require "arkana/helpers/string" %>
<% require "arkana/helpers/swift_template_helper" %>
<% require_relative "lib/arkana/helpers/string" %>
<% require_relative "lib/arkana/helpers/swift_template_helper" %>
// DO NOT MODIFY
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)

Expand Down

0 comments on commit c45af9b

Please sign in to comment.