Commit e2b250b5 by Guillermo Guerrero Ibarra Committed by Cuong Tran

Added new gems. (#419)

* Added new gems.
parent cce4bb1d
...@@ -20,3 +20,4 @@ ...@@ -20,3 +20,4 @@
/spec/integration/*/db/test.* /spec/integration/*/db/test.*
/spec/integration/*/log/* /spec/integration/*/log/*
/spec/integration/*/tmp/* /spec/integration/*/tmp/*
.byebug_history
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `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 # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # 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 # Offense count: 3
# Configuration parameters: AllowSafeAssignment. # Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition: Lint/AssignmentInCondition:
...@@ -40,7 +64,8 @@ Lint/DuplicateMethods: ...@@ -40,7 +64,8 @@ Lint/DuplicateMethods:
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect. # Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
# SupportedStyles: keyword, variable, start_of_line # SupportedStyles: keyword, variable, start_of_line
Lint/EndAlignment: Lint/EndAlignment:
Enabled: false Exclude:
- 'lib/annotate.rb'
# Offense count: 1 # Offense count: 1
Lint/HandleExceptions: Lint/HandleExceptions:
...@@ -53,6 +78,14 @@ Lint/IneffectiveAccessModifier: ...@@ -53,6 +78,14 @@ Lint/IneffectiveAccessModifier:
- 'lib/annotate/annotate_routes.rb' - 'lib/annotate/annotate_routes.rb'
- 'spec/integration/common_validation.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 # Offense count: 8
Lint/RescueException: Lint/RescueException:
Exclude: Exclude:
...@@ -68,12 +101,13 @@ Lint/ShadowingOuterLocalVariable: ...@@ -68,12 +101,13 @@ Lint/ShadowingOuterLocalVariable:
# Offense count: 6 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument: Lint/UnusedBlockArgument:
Exclude: Exclude:
- 'bin/annotate' - 'bin/annotate'
# Offense count: 2 # Offense count: 2
# Configuration parameters: ContextCreatingMethods.
Lint/UselessAccessModifier: Lint/UselessAccessModifier:
Exclude: Exclude:
- 'lib/annotate/annotate_routes.rb' - 'lib/annotate/annotate_routes.rb'
...@@ -81,18 +115,23 @@ Lint/UselessAccessModifier: ...@@ -81,18 +115,23 @@ Lint/UselessAccessModifier:
# Offense count: 16 # Offense count: 16
Metrics/AbcSize: Metrics/AbcSize:
Max: 154 Max: 144
# Offense count: 3
# Configuration parameters: CountComments.
Metrics/BlockLength:
Max: 135
# Offense count: 2 # Offense count: 2
Metrics/BlockNesting: Metrics/BlockNesting:
Max: 4 Max: 4
# Offense count: 7 # Offense count: 8
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
Max: 36 Max: 36
# Offense count: 344 # Offense count: 358
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes. # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https # URISchemes: http, https
Metrics/LineLength: Metrics/LineLength:
Max: 543 Max: 543
...@@ -100,11 +139,11 @@ Metrics/LineLength: ...@@ -100,11 +139,11 @@ Metrics/LineLength:
# Offense count: 24 # Offense count: 24
# Configuration parameters: CountComments. # Configuration parameters: CountComments.
Metrics/MethodLength: Metrics/MethodLength:
Max: 83 Max: 70
# Offense count: 7 # Offense count: 7
Metrics/PerceivedComplexity: Metrics/PerceivedComplexity:
Max: 43 Max: 41
# Offense count: 1 # Offense count: 1
Style/AccessorMethodName: Style/AccessorMethodName:
...@@ -152,7 +191,8 @@ Style/CaseEquality: ...@@ -152,7 +191,8 @@ Style/CaseEquality:
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth. # Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth.
# SupportedStyles: case, end # SupportedStyles: case, end
Style/CaseIndentation: Style/CaseIndentation:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 15 # Offense count: 15
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
...@@ -180,7 +220,7 @@ Style/ClassVars: ...@@ -180,7 +220,7 @@ Style/ClassVars:
Exclude: Exclude:
- 'lib/tasks/migrate.rake' - 'lib/tasks/migrate.rake'
# Offense count: 2 # Offense count: 3
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/ClosingParenthesisIndentation: Style/ClosingParenthesisIndentation:
Exclude: Exclude:
...@@ -196,7 +236,8 @@ Style/CommentAnnotation: ...@@ -196,7 +236,8 @@ Style/CommentAnnotation:
# Offense count: 3 # Offense count: 3
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: SingleLineConditionsOnly. # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment: Style/ConditionalAssignment:
Exclude: Exclude:
- 'bin/annotate' - 'bin/annotate'
...@@ -219,7 +260,10 @@ Style/Documentation: ...@@ -219,7 +260,10 @@ Style/Documentation:
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing # SupportedStyles: leading, trailing
Style/DotPosition: Style/DotPosition:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/integration/common_validation.rb'
- 'spec/spec_helper.rb'
# Offense count: 3 # Offense count: 3
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -235,7 +279,7 @@ Style/EmptyLinesAroundAccessModifier: ...@@ -235,7 +279,7 @@ Style/EmptyLinesAroundAccessModifier:
Exclude: Exclude:
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - 'spec/integration/rails_2.3_with_bundler/config/boot.rb'
# Offense count: 22 # Offense count: 20
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, no_empty_lines # SupportedStyles: empty_lines, no_empty_lines
...@@ -243,7 +287,6 @@ Style/EmptyLinesAroundBlockBody: ...@@ -243,7 +287,6 @@ Style/EmptyLinesAroundBlockBody:
Exclude: Exclude:
- 'bin/annotate' - 'bin/annotate'
- 'spec/annotate/annotate_models_spec.rb' - 'spec/annotate/annotate_models_spec.rb'
- 'spec/annotate_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/db/schema.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.2/db/schema.rb'
- 'spec/integration/rails_3.2.8/db/schema.rb' - 'spec/integration/rails_3.2.8/db/schema.rb'
...@@ -280,33 +323,46 @@ Style/FormatString: ...@@ -280,33 +323,46 @@ Style/FormatString:
Exclude: Exclude:
- 'lib/annotate/annotate_models.rb' - '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. # Configuration parameters: MinBodyLength.
Style/GuardClause: Style/GuardClause:
Exclude: Exclude:
- 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_models.rb'
- 'lib/annotate/annotate_routes.rb'
- 'lib/tasks/migrate.rake'
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - 'spec/integration/rails_2.3_with_bundler/config/boot.rb'
# Offense count: 145 # Offense count: 161
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues. # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax: Style/HashSyntax:
Enabled: false Enabled: false
# Offense count: 1 # Offense count: 2
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: MaxLineLength. # Configuration parameters: MaxLineLength.
Style/IfUnlessModifier: Style/IfUnlessModifier:
Exclude: Exclude:
- 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_models.rb'
# Offense count: 28 # Offense count: 34
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets # SupportedStyles: special_inside_parentheses, consistent, align_brackets
Style/IndentArray: 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 # Offense count: 12
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -315,7 +371,7 @@ Style/IndentArray: ...@@ -315,7 +371,7 @@ Style/IndentArray:
Style/IndentHash: Style/IndentHash:
EnforcedStyle: consistent EnforcedStyle: consistent
# Offense count: 4 # Offense count: 3
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: normal, rails # SupportedStyles: normal, rails
...@@ -346,7 +402,13 @@ Style/LeadingCommentSpace: ...@@ -346,7 +402,13 @@ Style/LeadingCommentSpace:
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
Style/MethodDefParentheses: 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 # Offense count: 2
Style/MultilineBlockChain: Style/MultilineBlockChain:
...@@ -360,19 +422,30 @@ Style/MultilineIfThen: ...@@ -360,19 +422,30 @@ Style/MultilineIfThen:
Exclude: Exclude:
- 'annotate.gemspec' - '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 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented # SupportedStyles: aligned, indented, indented_relative_to_receiver
Style/MultilineMethodCallIndentation: Style/MultilineMethodCallIndentation:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/spec_helper.rb'
# Offense count: 2 # Offense count: 7
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented # SupportedStyles: aligned, indented
Style/MultilineOperationIndentation: Style/MultilineOperationIndentation:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 16 # Offense count: 16
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -393,6 +466,7 @@ Style/NegatedIf: ...@@ -393,6 +466,7 @@ Style/NegatedIf:
- 'spec/integration/integration_spec.rb' - 'spec/integration/integration_spec.rb'
# Offense count: 1 # Offense count: 1
# Cop supports --auto-correct.
Style/NestedParenthesizedCalls: Style/NestedParenthesizedCalls:
Exclude: Exclude:
- 'bin/annotate' - 'bin/annotate'
...@@ -410,6 +484,16 @@ Style/Next: ...@@ -410,6 +484,16 @@ Style/Next:
Style/NumericLiterals: Style/NumericLiterals:
MinDigits: 15 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 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/ParallelAssignment: Style/ParallelAssignment:
...@@ -438,21 +522,13 @@ Style/PerlBackrefs: ...@@ -438,21 +522,13 @@ Style/PerlBackrefs:
Exclude: Exclude:
- 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - '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 # Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, exploded # SupportedStyles: compact, exploded
Style/RaiseArgs: Style/RaiseArgs:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 2 # Offense count: 2
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -520,20 +596,23 @@ Style/Semicolon: ...@@ -520,20 +596,23 @@ Style/Semicolon:
- 'spec/annotate/annotate_models_spec.rb' - 'spec/annotate/annotate_models_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/config/initializers/unified_initializer.rb' - 'spec/integration/rails_2.3_with_bundler/config/initializers/unified_initializer.rb'
# Offense count: 2 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. Style/SpaceAfterComma:
# SupportedStyles: only_raise, only_fail, semantic
Style/SignalException:
Exclude: Exclude:
- 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_models.rb'
- 'spec/integration/integration_spec.rb'
# Offense count: 1 # Offense count: 23
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/SpaceAfterComma: # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Exclude: Exclude:
- 'lib/annotate/annotate_models.rb' - '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 # Offense count: 16
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -551,14 +630,7 @@ Style/SpaceAroundKeyword: ...@@ -551,14 +630,7 @@ Style/SpaceAroundKeyword:
- 'spec/integration/rails_4.2.0/Gemfile' - 'spec/integration/rails_4.2.0/Gemfile'
- 'spec/integration/standalone/Gemfile' - 'spec/integration/standalone/Gemfile'
# Offense count: 22 # Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false
# Offense count: 24
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment. # Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators: Style/SpaceAroundOperators:
...@@ -571,12 +643,14 @@ Style/SpaceAroundOperators: ...@@ -571,12 +643,14 @@ Style/SpaceAroundOperators:
- 'spec/integration/integration_spec.rb' - 'spec/integration/integration_spec.rb'
- 'spec/spec_helper.rb' - 'spec/spec_helper.rb'
# Offense count: 8 # Offense count: 7
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space # SupportedStyles: space, no_space
Style/SpaceBeforeBlockBraces: Style/SpaceBeforeBlockBraces:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 1 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -589,7 +663,9 @@ Style/SpaceBeforeComment: ...@@ -589,7 +663,9 @@ Style/SpaceBeforeComment:
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space # SupportedStyles: space, no_space
Style/SpaceInsideBlockBraces: Style/SpaceInsideBlockBraces:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
- 'spec/annotate/annotate_models_spec.rb'
# Offense count: 2 # Offense count: 2
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -600,9 +676,11 @@ Style/SpaceInsideBrackets: ...@@ -600,9 +676,11 @@ Style/SpaceInsideBrackets:
# Offense count: 6 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
# SupportedStyles: space, no_space # SupportedStyles: space, no_space, compact
Style/SpaceInsideHashLiteralBraces: Style/SpaceInsideHashLiteralBraces:
Enabled: false Exclude:
- 'bin/annotate'
- 'lib/tasks/annotate_models.rake'
# Offense count: 4 # Offense count: 4
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -623,9 +701,12 @@ Style/SpaceInsideStringInterpolation: ...@@ -623,9 +701,12 @@ Style/SpaceInsideStringInterpolation:
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: use_perl_names, use_english_names # SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars: 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. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes # SupportedStyles: single_quotes, double_quotes
...@@ -637,7 +718,8 @@ Style/StringLiterals: ...@@ -637,7 +718,8 @@ Style/StringLiterals:
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: single_quotes, double_quotes # SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation: Style/StringLiteralsInInterpolation:
Enabled: false Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 1 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -666,15 +748,7 @@ Style/TrailingBlankLines: ...@@ -666,15 +748,7 @@ Style/TrailingBlankLines:
- 'spec/integration/rails_4.2.0/app/models/task_observer.rb' - 'spec/integration/rails_4.2.0/app/models/task_observer.rb'
- 'spec/integration/rails_4.2.0/config/initializers/cookies_serializer.rb' - 'spec/integration/rails_4.2.0/config/initializers/cookies_serializer.rb'
# Offense count: 2 # Offense count: 12
# 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
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma # SupportedStyles: comma, consistent_comma, no_comma
...@@ -684,14 +758,13 @@ Style/TrailingCommaInLiteral: ...@@ -684,14 +758,13 @@ Style/TrailingCommaInLiteral:
- 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake' - 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake'
- 'spec/integration/rails_4.2.0/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. # Cop supports --auto-correct.
Style/TrailingWhitespace: Style/TrailingWhitespace:
Exclude: Exclude:
- 'spec/annotate/annotate_models_spec.rb'
- 'spec/integration/rails_2.3_with_bundler/db/schema.rb' - 'spec/integration/rails_2.3_with_bundler/db/schema.rb'
# Offense count: 3 # Offense count: 4
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/UnneededInterpolation: Style/UnneededInterpolation:
Exclude: Exclude:
......
...@@ -12,11 +12,12 @@ group :development do ...@@ -12,11 +12,12 @@ group :development do
end end
group :development, :test do group :development, :test do
gem 'byebug'
gem 'rspec', require: false gem 'rspec', require: false
gem 'guard-rspec', require: false gem 'guard-rspec', require: false
gem 'terminal-notifier-guard', require: false gem 'terminal-notifier-guard', require: false
gem 'simplecov', 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 'coveralls'
gem 'codeclimate-test-reporter' gem 'codeclimate-test-reporter'
gem 'ruby_dep', '1.3.1' gem 'ruby_dep', '1.3.1'
......
machine: machine:
ruby: ruby:
version: 2.2.6 version: 2.2.6
test:
override:
- bundle exec rubocop && bundle exec rspec
...@@ -32,6 +32,15 @@ describe AnnotateRoutes do ...@@ -32,6 +32,15 @@ describe AnnotateRoutes do
AnnotateRoutes.do_annotations AnnotateRoutes.do_annotations
end 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 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(File).to receive(:read).with(ROUTE_FILE).and_return("\n# == Route Map\n#\n")
expect(AnnotateRoutes).to receive(:puts).with(FILE_UNCHANGED) expect(AnnotateRoutes).to receive(:puts).with(FILE_UNCHANGED)
......
...@@ -26,6 +26,7 @@ require 'active_support/core_ext/object/blank' ...@@ -26,6 +26,7 @@ require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/class/subclasses' require 'active_support/core_ext/class/subclasses'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'
require 'annotate' require 'annotate'
require 'byebug'
module Annotate module Annotate
module Integration 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