Skip to content

Commit

Permalink
Merge pull request #19 from akabiru/chore/silence-default-deprecation…
Browse files Browse the repository at this point in the history
…-warnings

Skip Gem::Deprecate Warnings; The CLI handles that
  • Loading branch information
akabiru committed Jan 18, 2019
2 parents 1ff74a8 + d49b46d commit be432f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/fakerbot/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
module FakerBot
class CLI < Thor
Error = Class.new(StandardError)
# Do not print depracation warnings; the CLI will do that
Gem::Deprecate.skip = true

desc 'version', 'fakerbot version'
def version
Expand Down
4 changes: 2 additions & 2 deletions lib/fakerbot/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.call(*args)

def initialize(hash, options, output)
@hash = hash
@options = options.deep_symbolize_keys
@options = options
@output = output
@crayon = Pastel.new(enabled: output.tty?)
@pager = TTY::Pager.new(command: 'less -R')
Expand Down Expand Up @@ -70,7 +70,7 @@ def leaf_args(method, const)
end

def verbose?
options[:verbose] == true
options[:verbose]
end

def verbose_output(method, const, arr)
Expand Down
4 changes: 2 additions & 2 deletions spec/fakerbot/renderer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.bar
context 'when the verbose option is enabled' do
it 'renders methods with data' do
hash = { MockFaker::Foo => [:bar] }
options = { 'verbose' => true }
options = { verbose: true }
output = StringIO.new

renderer = described_class.new(hash, options, output)
Expand All @@ -65,7 +65,7 @@ def self.bar
context 'when the verbose option is disabled' do
it 'renders methods only' do
hash = { MockFaker::Foo => [:bar] }
options = { 'verbose' => false }
options = { verbose: false }
output = StringIO.new

renderer = described_class.new(hash, options, output)
Expand Down

0 comments on commit be432f8

Please sign in to comment.