From 686ce71dbffa8e30751c3e64419f46de2b82f621 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Thu, 25 Feb 2016 17:44:24 -0600 Subject: [PATCH] [Bundle] Update RuboCop --- .rubocop-bundler.yml | 34 ++- .rubocop.yml | 1 + .rubocop_todo.yml | 437 +++++++++++++++++++++++------------- Gemfile.lock | 17 +- lib/bundler_api/gem_info.rb | 6 +- lib/bundler_api/web.rb | 9 +- 6 files changed, 320 insertions(+), 184 deletions(-) diff --git a/.rubocop-bundler.yml b/.rubocop-bundler.yml index cd4ca63..8ad27fb 100644 --- a/.rubocop-bundler.yml +++ b/.rubocop-bundler.yml @@ -2,6 +2,7 @@ inherit_from: - .rubocop_todo.yml AllCops: + TargetRubyVersion: 1.9 Exclude: - tmp/**/* - lib/bundler/vendor/**/* @@ -15,6 +16,7 @@ Lint/AssignmentInCondition: Lint/EndAlignment: AlignWith: variable + AutoCorrect: true Lint/UnusedMethodArgument: Enabled: false @@ -24,12 +26,27 @@ Lint/UnusedMethodArgument: Style/AccessModifierIndentation: EnforcedStyle: outdent +Style/Alias: + EnforcedStyle: prefer_alias_method + Style/AlignParameters: EnforcedStyle: with_fixed_indentation +Style/FrozenStringLiteralComment: + EnforcedStyle: always + +Style/MultilineBlockChain: + Enabled: false + Style/MultilineOperationIndentation: EnforcedStyle: indented +Style/PerlBackrefs: + Enabled: false + +Style/SingleLineBlockParams: + Enabled: false + Style/SpaceInsideBlockBraces: SpaceBeforeBlockParameters: false @@ -48,9 +65,16 @@ Style/StringLiteralsInInterpolation: # Having these make it easier to *not* forget to add one when adding a new # value and you can simply copy the previous line. -Style/TrailingComma: +Style/TrailingCommaInLiteral: EnforcedStyleForMultiline: comma +Style/TrailingUnderscoreVariable: + Enabled: false + +# `String.new` is preferred style with enabled frozen string literal +Style/EmptyLiteral: + Enabled: false + # 1.8.7 support Style/HashSyntax: @@ -68,7 +92,10 @@ Style/EachWithObject: Style/SpecialGlobalVars: Enabled: false -Style/TrailingComma: +Style/TrailingCommaInArguments: + Enabled: false + +Performance/FlatMap: Enabled: false # Metrics @@ -91,6 +118,3 @@ Metrics/AbcSize: Metrics/CyclomaticComplexity: Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false diff --git a/.rubocop.yml b/.rubocop.yml index 17b4c92..8f01d1a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,3 +5,4 @@ AllCops: - bin/**/* - vendor/**/* DisplayCopNames: true + TargetRubyVersion: 2.3 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f59eef1..391b6b2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,5 +1,6 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2015-07-20 19:11:40 -0300 using RuboCop version 0.32.1. +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2016-02-25 17:43:22 -0600 using RuboCop version 0.37.2. # 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 @@ -7,141 +8,171 @@ # Offense count: 1 Lint/AmbiguousOperator: - Enabled: false - -# Offense count: 1 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -Lint/DeprecatedClassMethods: - Enabled: false + Exclude: + - 'script/migrate' # Offense count: 2 Lint/Eval: - Enabled: false + Exclude: + - 'spec/gem_helper_spec.rb' + - 'spec/support/gemspec_helper.rb' # Offense count: 1 Lint/HandleExceptions: - Enabled: false + Exclude: + - 'Rakefile' # Offense count: 1 Lint/LiteralInCondition: - Enabled: false + Exclude: + - 'lib/bundler_api/runtime_instrumentation.rb' -# Offense count: 2 -Lint/NestedMethodDefinition: - Enabled: false - -# Offense count: 1 -Lint/ShadowingOuterLocalVariable: - Enabled: false - -# Offense count: 5 +# Offense count: 7 # Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks. Lint/UnusedBlockArgument: - Enabled: false - -# Offense count: 3 -# Cop supports --auto-correct. -Lint/UnusedMethodArgument: - Enabled: false + Exclude: + - 'Rakefile' + - 'spec/support/matchers.rb' -# Offense count: 10 +# Offense count: 21 Lint/UselessAssignment: - Enabled: false - -# Offense count: 11 -Metrics/AbcSize: - Max: 43 - -# Offense count: 2 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 143 - -# Offense count: 1 -Metrics/CyclomaticComplexity: - Max: 7 - -# Offense count: 65 -# Configuration parameters: AllowURI, URISchemes. + Exclude: + - 'Rakefile' + - 'lib/bundler_api/update/gem_db_helper.rb' + - 'lib/bundler_api/update/job.rb' + - 'script/integration/migrate.rb' + - 'spec/gem_info_spec.rb' + - 'spec/support/artifice_apps.rb' + - 'spec/update/gem_db_helper_spec.rb' + - 'spec/web_spec.rb' + +# Offense count: 95 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes. +# URISchemes: http, https Metrics/LineLength: Max: 122 -# Offense count: 21 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 34 - # Offense count: 2 +Metrics/PerceivedComplexity: + Max: 9 + +# Offense count: 5 +Performance/TimesMap: + Exclude: + - 'spec/gem_helper_spec.rb' + - 'spec/update/job_spec.rb' + - 'spec/web_spec.rb' + +# Offense count: 5 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: outdent, indent Style/AccessModifierIndentation: Enabled: false -# Offense count: 3 +# Offense count: 5 Style/AccessorMethodName: - Enabled: false + Exclude: + - 'Rakefile' + - 'lib/bundler_api/web.rb' + - 'script/integration/migrate.rb' -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. Style/AlignArray: - Enabled: false + Exclude: + - 'lib/bundler_api/agent_reporting.rb' # Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit Style/AlignHash: - Enabled: false + Exclude: + - 'lib/bundler_api/web.rb' + - 'spec/web_spec.rb' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: with_first_parameter, with_fixed_indentation Style/AlignParameters: - Enabled: false + Exclude: + - 'lib/bundler_api/web.rb' # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: always, conditionals Style/AndOr: - Enabled: false + Exclude: + - 'lib/bundler_api/env.rb' -# Offense count: 9 +# Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it Style/BlockDelimiters: - Enabled: false + Exclude: + - 'lib/bundler_api/update/consumer_pool.rb' + - 'spec/gem_helper_spec.rb' + - 'spec/update/gem_db_helper_spec.rb' + - 'spec/update/yank_job_spec.rb' + - 'spec/web_spec.rb' # Offense count: 2 # Cop supports --auto-correct. Style/BlockEndNewline: - Enabled: false + Exclude: + - 'spec/web_spec.rb' -# Offense count: 3 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: braces, no_braces, context_dependent Style/BracesAroundHashParameters: - Enabled: false + Exclude: + - 'lib/bundler_api/cache.rb' + - 'lib/bundler_api/web.rb' + - 'spec/gem_info_spec.rb' + - 'spec/update/yank_job_spec.rb' -# Offense count: 12 +# Offense count: 13 # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: nested, compact Style/ClassAndModuleChildren: - Enabled: false + Exclude: + - 'lib/bundler_api/agent_reporting.rb' + - 'lib/bundler_api/checksum.rb' + - 'lib/bundler_api/gem_helper.rb' + - 'lib/bundler_api/gem_info.rb' + - 'lib/bundler_api/runtime_instrumentation.rb' + - 'lib/bundler_api/update/fix_dep_job.rb' + - 'lib/bundler_api/update/gem_db_helper.rb' + - 'lib/bundler_api/update/job.rb' + - 'lib/bundler_api/update/yank_job.rb' + - 'lib/bundler_api/web.rb' + - 'lib/puma/instrumented_cli.rb' -# Offense count: 9 +# Offense count: 8 Style/ClassVars: - Enabled: false + Exclude: + - 'lib/bundler_api/update/job.rb' + - 'spec/support/artifice_apps.rb' + - 'spec/update/consumer_pool_spec.rb' -# Offense count: 31 +# Offense count: 20 Style/Documentation: Enabled: false -# Offense count: 9 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: leading, trailing Style/DotPosition: Enabled: false @@ -149,236 +180,320 @@ Style/DotPosition: # Cop supports --auto-correct. # Configuration parameters: AllowAdjacentOneLineDefs. Style/EmptyLineBetweenDefs: - Enabled: false + Exclude: + - 'lib/bundler_api/cache.rb' + - 'spec/agent_reporting_spec.rb' # Offense count: 1 # Cop supports --auto-correct. Style/EmptyLines: - Enabled: false + Exclude: + - 'spec/web_spec.rb' -# Offense count: 6 +# Offense count: 4 # Cop supports --auto-correct. Style/EmptyLinesAroundAccessModifier: - Enabled: false + Exclude: + - 'lib/bundler_api/update/consumer_pool.rb' + - 'lib/bundler_api/update/gem_db_helper.rb' + - 'lib/bundler_api/update/job.rb' + - 'spec/support/gemspec_helper.rb' # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, no_empty_lines Style/EmptyLinesAroundBlockBody: - Enabled: false + Exclude: + - 'Rakefile' -# Offense count: 2 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, no_empty_lines Style/EmptyLinesAroundClassBody: + Exclude: + - 'lib/bundler_api/cache.rb' + - 'lib/bundler_api/checksum.rb' + - 'lib/bundler_api/strategy.rb' + - 'lib/bundler_api/update/atomic_counter.rb' + - 'lib/bundler_api/update/gem_db_helper.rb' + - 'lib/bundler_api/web.rb' + +# Offense count: 59 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: when_needed, always +Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 12 +# Offense count: 19 # Configuration parameters: AllowedVariables. Style/GlobalVars: - Enabled: false + Exclude: + - 'lib/bundler_api/appsignal.rb' + - 'spec/gem_info_spec.rb' + - 'spec/support/database.rb' + - 'spec/update/fix_dep_job_spec.rb' + - 'spec/update/gem_db_helper_spec.rb' + - 'spec/update/job_spec.rb' + - 'spec/web_spec.rb' -# Offense count: 2 +# Offense count: 3 # Configuration parameters: MinBodyLength. Style/GuardClause: - Enabled: false + Exclude: + - 'lib/bundler_api/checksum.rb' + - 'lib/bundler_api/update/gem_db_helper.rb' -# Offense count: 85 +# Offense count: 273 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues. +# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets Style/HashSyntax: Enabled: false -# Offense count: 1 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: MaxLineLength. Style/IfUnlessModifier: - Enabled: false + Exclude: + - 'lib/bundler_api/agent_reporting.rb' + - 'lib/bundler_api/update/gem_db_helper.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. +# Configuration parameters: SupportedStyles, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets Style/IndentArray: - Enabled: false + EnforcedStyle: consistent -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: Width. Style/IndentationWidth: - Enabled: false + Exclude: + - 'lib/bundler_api/web.rb' + - 'spec/support/gemspec_helper.rb' # Offense count: 1 # Cop supports --auto-correct. Style/InfiniteLoop: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -Style/Lambda: - Enabled: false + Exclude: + - 'lib/bundler_api/runtime_instrumentation.rb' # Offense count: 1 # Cop supports --auto-correct. Style/LeadingCommentSpace: - Enabled: false + Exclude: + - 'script/integration/test.rb' -# Offense count: 1 +# Offense count: 8 # Cop supports --auto-correct. Style/LineEndConcatenation: - Enabled: false + Exclude: + - 'lib/bundler_api/update/job.rb' + - 'spec/web_spec.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. Style/MethodCallParentheses: - Enabled: false - -# Offense count: 1 -Style/MultilineBlockChain: - Enabled: false + Exclude: + - 'spec/update/job_spec.rb' # Offense count: 2 # Cop supports --auto-correct. Style/MultilineBlockLayout: + Exclude: + - 'spec/web_spec.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented +Style/MultilineMethodCallIndentation: Enabled: false # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented Style/MultilineOperationIndentation: Enabled: false # Offense count: 1 +# Cop supports --auto-correct. +Style/MutableConstant: + Exclude: + - 'lib/bundler_api/gem_info.rb' + +# Offense count: 3 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. +# SupportedStyles: skip_modifier_ifs, always Style/Next: - Enabled: false + Exclude: + - 'lib/bundler_api/update/gem_db_helper.rb' + - 'script/integration/migrate.rb' + - 'script/integration/test.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. Style/NumericLiterals: MinDigits: 9 -# Offense count: 4 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: - Enabled: false + Exclude: + - 'script/migrate' + - 'script/setup' # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: AllowAsExpressionSeparator. Style/Semicolon: - Enabled: false + Exclude: + - 'spec/agent_reporting_spec.rb' -# Offense count: 4 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: only_raise, only_fail, semantic Style/SignalException: - Enabled: false - -# Offense count: 1 -# Configuration parameters: Methods. -Style/SingleLineBlockParams: - Enabled: false + Exclude: + - 'spec/support/database.rb' # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowIfMethodIsEmpty. Style/SingleLineMethods: - Enabled: false + Exclude: + - 'spec/agent_reporting_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Style/SingleSpaceBeforeFirstArg: - Enabled: false - -# Offense count: 1 +# Offense count: 10 # Cop supports --auto-correct. Style/SpaceAfterComma: - Enabled: false + Exclude: + - 'lib/bundler_api/gem_info.rb' + - 'script/integration/migrate.rb' + - 'spec/gem_info_spec.rb' + - 'spec/update/gem_db_helper_spec.rb' + - 'spec/web_spec.rb' -# Offense count: 61 +# Offense count: 64 # Cop supports --auto-correct. -# Configuration parameters: MultiSpaceAllowedForOperators. +# Configuration parameters: AllowForAlignment. Style/SpaceAroundOperators: - Enabled: false + Exclude: + - 'Rakefile' + - 'db/migrations/01_rubygems_org_schema_dump.rb' + - 'db/migrations/02_prune.rb' + - 'db/migrations/03_add_ruby_and_rubygems_requirements.rb' + - 'lib/bundler_api/gem_helper.rb' + - 'spec/gem_info_spec.rb' + - 'spec/web_spec.rb' -# Offense count: 2 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space Style/SpaceBeforeBlockBraces: Enabled: false -# Offense count: 7 +# Offense count: 11 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space Style/SpaceInsideBlockBraces: Enabled: false # Offense count: 5 # Cop supports --auto-correct. Style/SpaceInsideBrackets: - Enabled: false + Exclude: + - 'lib/bundler_api/agent_reporting.rb' + - 'spec/agent_reporting_spec.rb' -# Offense count: 11 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. +# SupportedStyles: space, no_space Style/SpaceInsideHashLiteralBraces: Enabled: false -# Offense count: 40 +# Offense count: 41 # Cop supports --auto-correct. Style/SpaceInsideParens: - Enabled: false + Exclude: + - 'spec/agent_reporting_spec.rb' + - 'spec/web_spec.rb' -# Offense count: 13 +# Offense count: 12 # Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space Style/SpaceInsideStringInterpolation: - Enabled: false + Exclude: + - 'lib/bundler_api/agent_reporting.rb' + - 'spec/support/matchers.rb' + - 'spec/web_spec.rb' -# Offense count: 1 +# Offense count: 643 # Cop supports --auto-correct. -Style/SpecialGlobalVars: - Enabled: false - -# Offense count: 308 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Enabled: false -# Offense count: 1 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: single_quotes, double_quotes Style/StringLiteralsInInterpolation: Enabled: false # Offense count: 1 Style/StructInheritance: - Enabled: false + Exclude: + - 'lib/bundler_api/gem_helper.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: IgnoredMethods. +# IgnoredMethods: respond_to Style/SymbolProc: - Enabled: false + Exclude: + - 'lib/bundler_api/update/consumer_pool.rb' + - 'script/setup' -# Offense count: 2 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: final_newline, final_blank_line Style/TrailingBlankLines: - Enabled: false + Exclude: + - 'lib/bundler_api/metriks.rb' + - 'lib/bundler_api/redis.rb' + - 'script/console' -# Offense count: 2 +# Offense count: 14 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. -Style/TrailingComma: - Enabled: false - -# Offense count: 3 -# Cop supports --auto-correct. -Style/TrailingUnderscoreVariable: - Enabled: false +# SupportedStyles: comma, consistent_comma, no_comma +Style/TrailingCommaInLiteral: + Exclude: + - 'lib/bundler_api/cache.rb' + - 'lib/bundler_api/gem_info.rb' + - 'lib/bundler_api/web.rb' + - 'spec/gem_info_spec.rb' + - 'spec/support/gem_builder.rb' + - 'spec/update/yank_job_spec.rb' + - 'spec/web_spec.rb' -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. Style/TrailingWhitespace: - Enabled: false + Exclude: + - 'db/migrations/01_rubygems_org_schema_dump.rb' diff --git a/Gemfile.lock b/Gemfile.lock index d5b9bd4..b9033eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,8 +21,6 @@ GEM artifice (0.6) rack-test ast (2.2.0) - astrolabe (1.3.1) - parser (~> 2.2) atomic (1.1.99) avl_tree (1.2.1) atomic (~> 1.1) @@ -51,8 +49,8 @@ GEM metriks (~> 0.9.9) multi_json (1.11.2) multipart-post (2.0.0) - parser (2.2.3.0) - ast (>= 1.1, < 3.0) + parser (2.3.0.6) + ast (~> 2.2) pg (0.18.4) powerpack (0.1.1) pry (0.10.3) @@ -68,7 +66,7 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rainbow (2.0.0) + rainbow (2.1.0) rake (10.4.2) redis (3.2.2) rspec-core (3.4.1) @@ -80,13 +78,12 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) rspec-support (3.4.1) - rubocop (0.35.1) - astrolabe (~> 1.3) - parser (>= 2.2.3.0, < 3.0) + rubocop (0.37.2) + parser (>= 2.3.0.4, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) - tins (<= 1.6.0) + unicode-display_width (~> 0.3) ruby-progressbar (1.7.5) sequel (4.30.0) sequel_pg (1.6.13) @@ -100,7 +97,7 @@ GEM thor (0.19.1) thread_safe (0.3.5) tilt (2.0.2) - tins (1.6.0) + unicode-display_width (0.3.1) PLATFORMS ruby diff --git a/lib/bundler_api/gem_info.rb b/lib/bundler_api/gem_info.rb index 3e0b46a..0f5e04e 100644 --- a/lib/bundler_api/gem_info.rb +++ b/lib/bundler_api/gem_info.rb @@ -84,8 +84,8 @@ def names end def versions(date,include_yanks = false) - if include_yanks - dataset = @conn[<<-SQL, date,date] + dataset = if include_yanks + @conn[<<-SQL, date,date] (SELECT r.name, v.created_at as date, v.info_checksum, v.number, v.platform FROM rubygems AS r, versions AS v WHERE v.rubygem_id = r.id AND @@ -99,7 +99,7 @@ def versions(date,include_yanks = false) ORDER BY date, number, platform, name SQL else - dataset = @conn[<<-SQL, date] + @conn[<<-SQL, date] SELECT r.name, v.created_at, v.checksum, v.info_checksum, v.number, v.platform FROM rubygems AS r, versions AS v WHERE v.rubygem_id = r.id AND diff --git a/lib/bundler_api/web.rb b/lib/bundler_api/web.rb index 375f647..7e58975 100644 --- a/lib/bundler_api/web.rb +++ b/lib/bundler_api/web.rb @@ -218,11 +218,10 @@ def etag_response_for(name) def not_modified?(checksum) etags = parse_etags(request.env["HTTP_IF_NONE_MATCH"]) - if etags.include?(checksum) - headers "ETag" => quote(checksum) - status 304 - body "" - end + return unless etags.include?(checksum) + headers "ETag" => quote(checksum) + status 304 + body "" end def requested_range_for(response_body)