diff --git a/.rubocop.yml b/.rubocop.yml index 2db6241..35ab436 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -17,6 +17,9 @@ Style/TrailingCommaInArrayLiteral: Style/RedundantSelf: Enabled: false +Style/Documentation: + Enabled: false + Layout/IndentationWidth: Enabled: false @@ -41,6 +44,15 @@ Layout/CaseIndentation: EnforcedStyle: end IndentOneStep: true +Metrics/AbcSize: + Max: 25 + +Metrics/CyclomaticComplexity: + Max: 25 + +Metrics/MethodLength: + Max: 20 + # Ignore for rspec Metrics/BlockLength: IgnoredMethods: ['describe', 'context'] diff --git a/augury.gemspec b/augury.gemspec index 357e262..b68a408 100644 --- a/augury.gemspec +++ b/augury.gemspec @@ -25,4 +25,5 @@ Gem::Specification.new do |spec| spec.add_dependency 'twitter', '~>7.0' ## For the word_wrap function spec.add_dependency 'word_wrap', '~>1.0' + spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/exe/augury b/exe/augury index 7c59847..b8cd5fa 100755 --- a/exe/augury +++ b/exe/augury @@ -1,3 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'augury/cli' Augury::CLI.start diff --git a/lib/augury/fortune.rb b/lib/augury/fortune.rb index b17cdb4..7aa09eb 100644 --- a/lib/augury/fortune.rb +++ b/lib/augury/fortune.rb @@ -92,7 +92,7 @@ def twitter_setup def transforms all_transforms = [] - all_transforms << [/https?:\/\/[^\s]+/, ''] if @config[:remove_links] + all_transforms << [%r{https?://[^\s]+}, ''] if @config[:remove_links] return all_transforms unless @config[:apply_transforms] all_transforms.push(*@config.dig('transforms', @username) || []) diff --git a/spec/lib/augury/fortune_spec.rb b/spec/lib/augury/fortune_spec.rb index eef87eb..fbff0fd 100644 --- a/spec/lib/augury/fortune_spec.rb +++ b/spec/lib/augury/fortune_spec.rb @@ -14,10 +14,10 @@ let(:twitter_auth) do { twitter: { - 'consumer_key' => ENV['TWITTER_CONSUMER_KEY'], - 'consumer_secret' => ENV['TWITTER_CONSUMER_SECRET'], - 'access_token' => ENV['TWITTER_ACCESS_TOKEN'], - 'access_token_secret' => ENV['TWITTER_ACCESS_TOKEN_SECRET'], + 'consumer_key' => ENV.fetch('TWITTER_CONSUMER_KEY', nil), + 'consumer_secret' => ENV.fetch('TWITTER_CONSUMER_SECRET', nil), + 'access_token' => ENV.fetch('TWITTER_ACCESS_TOKEN', nil), + 'access_token_secret' => ENV.fetch('TWITTER_ACCESS_TOKEN_SECRET', nil), }, } end diff --git a/spec/lib/augury_spec.rb b/spec/lib/augury_spec.rb deleted file mode 100644 index b4d079a..0000000 --- a/spec/lib/augury_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe Augury do -end