Commit e2b250b5 by Guillermo Guerrero Ibarra Committed by Cuong Tran

Added new gems. (#419)

* Added new gems.
parent cce4bb1d
......@@ -20,3 +20,4 @@
/spec/integration/*/db/test.*
/spec/integration/*/log/*
/spec/integration/*/tmp/*
.byebug_history
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-01-25 09:57:25 +0100 using RuboCop version 0.36.0.
# on 2016-12-13 20:39:56 +0100 using RuboCop version 0.46.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 9
# Configuration parameters: Include.
# Include: **/Gemfile, **/gems.rb
Bundler/DuplicatedGem:
Exclude:
- 'spec/integration/rails_2.3_with_bundler/Gemfile'
- 'spec/integration/rails_3.2.2/Gemfile'
- 'spec/integration/rails_3.2.8/Gemfile'
- 'spec/integration/rails_3.2_autoloading_factory_girl/Gemfile'
- 'spec/integration/rails_3.2_custom_inflections/Gemfile'
- 'spec/integration/rails_3.2_with_asset_pipeline/Gemfile'
- 'spec/integration/rails_4.1.1/Gemfile'
- 'spec/integration/rails_4.2.0/Gemfile'
- 'spec/integration/standalone/Gemfile'
# Offense count: 10
# Configuration parameters: Include.
# Include: **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'
- 'spec/integration/rails_2.3_with_bundler/Gemfile'
- 'spec/integration/rails_3.2_with_asset_pipeline/Gemfile'
# Offense count: 3
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
......@@ -40,7 +64,8 @@ Lint/DuplicateMethods:
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
# SupportedStyles: keyword, variable, start_of_line
Lint/EndAlignment:
Enabled: false
Exclude:
- 'lib/annotate.rb'
# Offense count: 1
Lint/HandleExceptions:
......@@ -53,6 +78,14 @@ Lint/IneffectiveAccessModifier:
- 'lib/annotate/annotate_routes.rb'
- 'spec/integration/common_validation.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: runtime_error, standard_error
Lint/InheritException:
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 8
Lint/RescueException:
Exclude:
......@@ -68,12 +101,13 @@ Lint/ShadowingOuterLocalVariable:
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'bin/annotate'
# Offense count: 2
# Configuration parameters: ContextCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'lib/annotate/annotate_routes.rb'
......@@ -81,18 +115,23 @@ Lint/UselessAccessModifier:
# Offense count: 16
Metrics/AbcSize:
Max: 154
Max: 144
# Offense count: 3
# Configuration parameters: CountComments.
Metrics/BlockLength:
Max: 135
# Offense count: 2
Metrics/BlockNesting:
Max: 4
# Offense count: 7
# Offense count: 8
Metrics/CyclomaticComplexity:
Max: 36
# Offense count: 344
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# Offense count: 358
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 543
......@@ -100,11 +139,11 @@ Metrics/LineLength:
# Offense count: 24
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 83
Max: 70
# Offense count: 7
Metrics/PerceivedComplexity:
Max: 43
Max: 41
# Offense count: 1
Style/AccessorMethodName:
......@@ -152,7 +191,8 @@ Style/CaseEquality:
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth.
# SupportedStyles: case, end
Style/CaseIndentation:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 15
# Configuration parameters: EnforcedStyle, SupportedStyles.
......@@ -180,7 +220,7 @@ Style/ClassVars:
Exclude:
- 'lib/tasks/migrate.rake'
# Offense count: 2
# Offense count: 3
# Cop supports --auto-correct.
Style/ClosingParenthesisIndentation:
Exclude:
......@@ -196,7 +236,8 @@ Style/CommentAnnotation:
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: SingleLineConditionsOnly.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'bin/annotate'
......@@ -219,7 +260,10 @@ Style/Documentation:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Style/DotPosition:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/integration/common_validation.rb'
- 'spec/spec_helper.rb'
# Offense count: 3
# Cop supports --auto-correct.
......@@ -235,7 +279,7 @@ Style/EmptyLinesAroundAccessModifier:
Exclude:
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb'
# Offense count: 22
# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, no_empty_lines
......@@ -243,7 +287,6 @@ Style/EmptyLinesAroundBlockBody:
Exclude:
- 'bin/annotate'
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/annotate_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/db/schema.rb'
- 'spec/integration/rails_3.2.2/db/schema.rb'
- 'spec/integration/rails_3.2.8/db/schema.rb'
......@@ -280,33 +323,46 @@ Style/FormatString:
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 4
# Offense count: 181
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: when_needed, always
Style/FrozenStringLiteralComment:
Enabled: false
# Offense count: 7
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'lib/annotate/annotate_routes.rb'
- 'lib/tasks/migrate.rake'
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb'
# Offense count: 145
# Offense count: 161
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Enabled: false
# Offense count: 1
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 28
# Offense count: 34
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Style/IndentArray:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'lib/annotate/annotate_routes.rb'
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/spec_helper.rb'
# Offense count: 12
# Cop supports --auto-correct.
......@@ -315,7 +371,7 @@ Style/IndentArray:
Style/IndentHash:
EnforcedStyle: consistent
# Offense count: 4
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: normal, rails
......@@ -346,7 +402,13 @@ Style/LeadingCommentSpace:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
Style/MethodDefParentheses:
Enabled: false
Exclude:
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 1
Style/MethodMissing:
Exclude:
- 'lib/annotate/active_record_patch.rb'
# Offense count: 2
Style/MultilineBlockChain:
......@@ -360,19 +422,30 @@ Style/MultilineIfThen:
Exclude:
- 'annotate.gemspec'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: symmetrical, new_line, same_line
Style/MultilineMethodCallBraceLayout:
Exclude:
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Style/MultilineMethodCallIndentation:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/spec_helper.rb'
# Offense count: 2
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineOperationIndentation:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 16
# Cop supports --auto-correct.
......@@ -393,6 +466,7 @@ Style/NegatedIf:
- 'spec/integration/integration_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/NestedParenthesizedCalls:
Exclude:
- 'bin/annotate'
......@@ -410,6 +484,16 @@ Style/Next:
Style/NumericLiterals:
MinDigits: 15
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/annotate.rb'
- 'lib/annotate/annotate_models.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/ParallelAssignment:
......@@ -438,21 +522,13 @@ Style/PerlBackrefs:
Exclude:
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb'
# Offense count: 2
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Exclude:
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/spec_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 2
# Cop supports --auto-correct.
......@@ -520,20 +596,23 @@ Style/Semicolon:
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/config/initializers/unified_initializer.rb'
# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: only_raise, only_fail, semantic
Style/SignalException:
Style/SpaceAfterComma:
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/integration/integration_spec.rb'
# Offense count: 1
# Offense count: 23
# Cop supports --auto-correct.
Style/SpaceAfterComma:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'lib/annotate/annotate_routes.rb'
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/annotate/annotate_routes_spec.rb'
- 'spec/integration/common_validation.rb'
# Offense count: 16
# Cop supports --auto-correct.
......@@ -551,14 +630,7 @@ Style/SpaceAroundKeyword:
- 'spec/integration/rails_4.2.0/Gemfile'
- 'spec/integration/standalone/Gemfile'
# Offense count: 22
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false
# Offense count: 24
# Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators:
......@@ -571,12 +643,14 @@ Style/SpaceAroundOperators:
- 'spec/integration/integration_spec.rb'
- 'spec/spec_helper.rb'
# Offense count: 8
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceBeforeBlockBraces:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -589,7 +663,9 @@ Style/SpaceBeforeComment:
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
Style/SpaceInsideBlockBraces:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
......@@ -600,9 +676,11 @@ Style/SpaceInsideBrackets:
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
# SupportedStyles: space, no_space
# SupportedStyles: space, no_space, compact
Style/SpaceInsideHashLiteralBraces:
Enabled: false
Exclude:
- 'bin/annotate'
- 'lib/tasks/annotate_models.rake'
# Offense count: 4
# Cop supports --auto-correct.
......@@ -623,9 +701,12 @@ Style/SpaceInsideStringInterpolation:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars:
Enabled: false
Exclude:
- 'bin/annotate'
- 'spec/integration/integration_spec.rb'
- 'spec/spec_helper.rb'
# Offense count: 384
# Offense count: 426
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
......@@ -637,7 +718,8 @@ Style/StringLiterals:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Enabled: false
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -666,15 +748,7 @@ Style/TrailingBlankLines:
- 'spec/integration/rails_4.2.0/app/models/task_observer.rb'
- 'spec/integration/rails_4.2.0/config/initializers/cookies_serializer.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Exclude:
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 8
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma
......@@ -684,14 +758,13 @@ Style/TrailingCommaInLiteral:
- 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake'
- 'spec/integration/rails_4.2.0/lib/tasks/auto_annotate_models.rake'
# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
Style/TrailingWhitespace:
Exclude:
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/db/schema.rb'
# Offense count: 3
# Offense count: 4
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
......
......@@ -12,11 +12,12 @@ group :development do
end
group :development, :test do
gem 'byebug'
gem 'rspec', require: false
gem 'guard-rspec', require: false
gem 'terminal-notifier-guard', require: false
gem 'simplecov', require: false
gem 'rubocop', '~> 0.39.0', require: false unless RUBY_VERSION =~ /^1.8/
gem 'rubocop', '~> 0.46.0', require: false unless RUBY_VERSION =~ /^1.8/
gem 'coveralls'
gem 'codeclimate-test-reporter'
gem 'ruby_dep', '1.3.1'
......
machine:
ruby:
version: 2.2.6
test:
override:
- bundle exec rubocop && bundle exec rspec
......@@ -32,6 +32,15 @@ describe AnnotateRoutes do
AnnotateRoutes.do_annotations
end
it 'should insert annotations if file does not contain annotations and ignore routes' do
expect(File).to receive(:read).with(ROUTE_FILE).and_return("")
expect(File).to receive(:open).with(ROUTE_FILE, 'wb').and_yield(mock_file)
expect(@mock_file).to receive(:puts).with("\n# == Route Map\n#\n")
expect(AnnotateRoutes).to receive(:puts).with(ANNOTATION_ADDED)
AnnotateRoutes.do_annotations(ignore_routes: 'my_route')
end
it 'should skip annotations if file does already contain annotation' do
expect(File).to receive(:read).with(ROUTE_FILE).and_return("\n# == Route Map\n#\n")
expect(AnnotateRoutes).to receive(:puts).with(FILE_UNCHANGED)
......
......@@ -26,6 +26,7 @@ require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/class/subclasses'
require 'active_support/core_ext/string/inflections'
require 'annotate'
require 'byebug'
module Annotate
module Integration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment