Skip to content

Commit

Permalink
Fix all offences related to gemspec
Browse files Browse the repository at this point in the history
- Gemspec/DeprecatedAttributeAssignment
- Packaging/GemspecGit
- Style/Encoding
- Style/ExpandPathArguments
- Style/PercentLiteralDelimiters
- Style/RedundantPercentQ
- Style/SpecialGlobalVars

Also:
- Add frozen string literal magic comment
- Exclude spec files from production gem (size from 31K to 18K)
  • Loading branch information
tagliala committed Sep 16, 2024
1 parent 1396267 commit 0fd8420
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 deletions.
36 changes: 0 additions & 36 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'inline_svg.gemspec'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Expand All @@ -32,7 +25,6 @@ Layout/EmptyLineAfterGuardClause:
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'inline_svg.gemspec'
- 'spec/cached_asset_file_spec.rb'

# This cop supports safe autocorrection (--autocorrect).
Expand Down Expand Up @@ -207,10 +199,6 @@ Naming/VariableNumber:
Exclude:
- 'spec/cached_asset_file_spec.rb'

Packaging/GemspecGit:
Exclude:
- 'inline_svg.gemspec'

# This cop supports safe autocorrection (--autocorrect).
Packaging/RequireRelativeHardcodingLib:
Exclude:
Expand Down Expand Up @@ -424,15 +412,9 @@ Style/EachWithObject:
Exclude:
- 'lib/inline_svg/transform_pipeline/transformations.rb'

# This cop supports safe autocorrection (--autocorrect).
Style/Encoding:
Exclude:
- 'inline_svg.gemspec'

# This cop supports safe autocorrection (--autocorrect).
Style/ExpandPathArguments:
Exclude:
- 'inline_svg.gemspec'
- 'spec/cached_asset_file_spec.rb'
- 'spec/helpers/inline_svg_spec.rb'
- 'spec/io_resource_spec.rb'
Expand Down Expand Up @@ -497,12 +479,6 @@ Style/NonNilCheck:
Exclude:
- 'lib/inline_svg/transform_pipeline/transformations.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'inline_svg.gemspec'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
# SupportedStyles: compact, exploded
Expand Down Expand Up @@ -530,11 +506,6 @@ Style/RedundantConstantBase:
- 'spec/static_asset_finder_spec.rb'
- 'spec/webpack_asset_finder_spec.rb'

# This cop supports safe autocorrection (--autocorrect).
Style/RedundantPercentQ:
Exclude:
- 'inline_svg.gemspec'

# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpArgument:
Exclude:
Expand Down Expand Up @@ -574,13 +545,6 @@ Style/SafeNavigation:
Exclude:
- 'lib/inline_svg/propshaft_asset_finder.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: RequireEnglish, EnforcedStyle.
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
Style/SpecialGlobalVars:
Exclude:
- 'inline_svg.gemspec'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased][unreleased]

- Drop Support for Webpacker, Legacy Ruby (< 3.1), and Legacy Rails (< 7.0). [#163](https://github.com/jamesmartin/inline_svg/pull/163). Thanks, [@tagliala](https://github.com/tagliala)
- Reduce production gem size from 31K to 18K. [#165](https://github.com/jamesmartin/inline_svg/pull/165). Thanks, [@tagliala](https://github.com/tagliala)

## [1.10.0] - 2024-09-03
### Added
Expand Down
12 changes: 6 additions & 6 deletions inline_svg.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'inline_svg/version'

Expand All @@ -8,14 +9,13 @@ Gem::Specification.new do |spec|
spec.version = InlineSvg::VERSION
spec.authors = ["James Martin"]
spec.email = ["inline_svg@jmrtn.com"]
spec.summary = %q{Embeds an SVG document, inline.}
spec.description = %q{Get an SVG into your view and then style it with CSS.}
spec.summary = 'Embeds an SVG document, inline.'
spec.description = 'Get an SVG into your view and then style it with CSS.'
spec.homepage = "https://github.com/jamesmartin/inline_svg"
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.files = Dir.glob('{CHANGELOG.md,LICENSE.txt,README.md,lib/**/*.rb}', File::FNM_DOTMATCH)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.metadata['rubygems_mfa_required'] = 'true'
Expand Down

0 comments on commit 0fd8420

Please sign in to comment.