diff --git a/Gemfile.lock b/Gemfile.lock index 9ddaefe..c059659 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - fakerbot (0.4.1) + fakerbot (0.4.2) faker pastel (~> 0.7.2) thor (~> 0.20.0) diff --git a/Rakefile b/Rakefile index b7e9ed5..82bb534 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ -require "bundler/gem_tasks" -require "rspec/core/rake_task" +# frozen_string_literal: true + +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) -task :default => :spec +task default: :spec diff --git a/bin/console b/bin/console index 2a95a87..900830c 100755 --- a/bin/console +++ b/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'bundler/setup' require 'fakerbot' diff --git a/bin/fakerbot b/bin/fakerbot index 3f91010..ec0e9ea 100755 --- a/bin/fakerbot +++ b/bin/fakerbot @@ -2,7 +2,7 @@ # frozen_string_literal: true lib_path = File.expand_path('../lib', __dir__) -$:.unshift(lib_path) if !$:.include?(lib_path) +$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path) require 'fakerbot' Signal.trap('INT') do diff --git a/lib/fakerbot.rb b/lib/fakerbot.rb index 857f775..a5ef85b 100644 --- a/lib/fakerbot.rb +++ b/lib/fakerbot.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require_relative 'fakerbot/cli' diff --git a/lib/fakerbot/reflector.rb b/lib/fakerbot/reflector.rb index 82e214f..590d1e8 100644 --- a/lib/fakerbot/reflector.rb +++ b/lib/fakerbot/reflector.rb @@ -60,7 +60,7 @@ def all_descendants_with_methods def search_descendants_matching_query faker_descendants.each do |faker| methods = faker.my_singleton_methods - matching = methods.select { |m| m.match?(/#{query}/i) } + matching = methods.select { |m| m.match(/#{query}/i) } store(faker, matching) end end diff --git a/lib/fakerbot/renderer.rb b/lib/fakerbot/renderer.rb index 4ec6c90..6af618f 100644 --- a/lib/fakerbot/renderer.rb +++ b/lib/fakerbot/renderer.rb @@ -68,7 +68,7 @@ def verbose? def verbose_output(method, const, arr) fake, message = faker_method(method, const) - arr << crayon.dim.white("=> #{fake.to_s}") << crayon.dim.magenta.bold("#{message}") + arr << crayon.dim.white("=> #{fake}") << crayon.dim.magenta.bold(message.to_s) end def faker_method(method, const) @@ -78,7 +78,7 @@ def faker_method(method, const) end def ensure_method_is_supported(method, const) - const.respond_to?(:"_deprecated_#{method.to_s}") ? ' ( WILL BE DEPRECATED )' : '' + const.respond_to?(:"_deprecated_#{method}") ? ' ( WILL BE DEPRECATED )' : '' end end end diff --git a/lib/fakerbot/version.rb b/lib/fakerbot/version.rb index 8dc0b3a..aec1883 100644 --- a/lib/fakerbot/version.rb +++ b/lib/fakerbot/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FakerBot - VERSION = '0.4.1'.freeze + VERSION = '0.4.2' end diff --git a/spec/integration/list_spec.rb b/spec/integration/list_spec.rb index ddf7d98..92c63eb 100644 --- a/spec/integration/list_spec.rb +++ b/spec/integration/list_spec.rb @@ -14,7 +14,7 @@ -v, [--verbose], [--no-verbose] # Include sample Faker output List all Faker constants - OUT + OUT expect(output).to match(expected_output) end diff --git a/spec/integration/search_spec.rb b/spec/integration/search_spec.rb index a7b7c9e..6c785d7 100644 --- a/spec/integration/search_spec.rb +++ b/spec/integration/search_spec.rb @@ -14,7 +14,7 @@ -v, [--verbose], [--no-verbose] # Include sample Faker output Search Faker method(s) - OUT + OUT expect(output).to match(expected_output) end