Skip to content

Commit

Permalink
[expose-formatters] code style policia
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Sep 2, 2019
1 parent 123fad4 commit c19c985
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/qonfig/commands/load_from_self.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Qonfig::Commands::LoadFromSelf < Qonfig::Commands::Base
# @since 0.2.0
def initialize(caller_location, format:)
unless format.is_a?(String) || format.is_a?(Symbol)
raise Qonfig::ArgumentError, "Format should be a symbol or a string"
raise Qonfig::ArgumentError, 'Format should be a symbol or a string'
end

@caller_location = caller_location
Expand Down
4 changes: 2 additions & 2 deletions lib/qonfig/loaders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class << self
# @since 0.15.0
def resolve(format)
case format.to_s
when "yaml", "yml"
when 'yaml', 'yml'
Qonfig::Loaders::YAML
when "json"
when 'json'
Qonfig::Loaders::JSON
else
raise(Qonfig::UnsupportedLoaderFormatError, "<#{format}> format is not supported.")
Expand Down
2 changes: 1 addition & 1 deletion lib/qonfig/plugins/toml/loaders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class << self
# @api private
# @since 0.15.0
def resolve(format)
return Qonfig::Loaders::TOML if format.to_s == "toml"
return Qonfig::Loaders::TOML if format.to_s == 'toml'
super(format)
end
end)
Expand Down
1 change: 0 additions & 1 deletion spec/features/expose_self_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class ExposeSelfConfig < Qonfig::DataSet
expect(settings.stage_env.credentials).to eq({})
end


describe 'failures and inconsistent situations' do
describe 'definition level errors' do
specify 'fails when :env attribute has non-string / non-symbol / non-numeric value' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/load_from_self/format_option_yaml_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

describe '#load_from_self => format: :yaml' do
specify ":yaml/:yml-format support" do
specify ':yaml/:yml-format support' do
class YamlEndDataConfig < Qonfig::DataSet
setting :by_yml do
load_from_self format: :yml # the same as :yaml
Expand Down

0 comments on commit c19c985

Please sign in to comment.