Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and development dependencies in gemspec #3

Merged
merged 5 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ Metrics/AbcSize:
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '*.gemspec'

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog

## 1.0.0 - 2023-09-24
## 1.0.0 (24 September 2023)

- Initial release
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in sprockets_terser_with_source_maps.gemspec
gemspec

gem 'railties', '>= 4.2'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@ to generate source maps using terser as compressor.

## Rails Supported Versions

| Version | Supported |
|---------|--------------------|
| 6.x | :white_check_mark: |
| 5.x | :white_check_mark: |
| 4.2.x | :white_check_mark: |
<table>
<thead>
<tr>
<th>Version</th>
<th>Supported</th>
</tr>
</thead>
<tbody>
<tr>
<td>6.x</td>
<td>&checkmark;</td>
</tr>
<tr>
<td>5.x</td>
<td>&checkmark;</td>
</tr>
<tr>
<td>4.2.x</td>
<td>&checkmark;</td>
</tr>
</tbody>
</table>

## Installation

Expand Down
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-4.2.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 4.2.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 3.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-4.2.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 4.2.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.0.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.0.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 3.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.0.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.0.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.1.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.1.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 3.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.1.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.1.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.2.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.2.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 3.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-5.2.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 5.2.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-6.0.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 6.0.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 0 additions & 3 deletions gemfiles/Gemfile.rails-6.1.x.sprockets-4.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'railties', '~> 6.1.0'
gem 'rake', '~> 12.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', group: 'development', require: false
gem 'sprockets', '~> 4.0'
3 changes: 2 additions & 1 deletion lib/sprockets_terser_with_source_maps/compressor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
require 'logger'

module SprocketsTerserWithSourceMaps
class Compressor < Terser::Compressor # :nodoc:
# Custom compressor to generate sourcemaps
class Compressor < Terser::Compressor
attr_accessor :logger

def initialize(options = {})
Expand Down
3 changes: 2 additions & 1 deletion lib/sprockets_terser_with_source_maps/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
require 'action_controller/railtie'

module SprocketsTerserWithSourceMaps
class Railtie < ::Rails::Railtie # :nodoc:
# Railtie for Rails
class Railtie < ::Rails::Railtie
initializer 'sprockets-terser-with-source-maps.environment', group: :all do |app|
config = app.config
config.assets.sourcemaps_prefix ||= 'maps'
Expand Down
12 changes: 10 additions & 2 deletions sprockets_terser_with_source_maps.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ Gem::Specification.new do |spec|

spec.metadata = {
'homepage_uri' => spec.homepage,
'source_code_uri' => 'https://github.com/javier-menendez/sprockets_terser_with_source_maps',
'changelog_uri' => 'https://github.com/javier-menendez/sprockets_terser_with_source_maps/CHANGELOG.md',
'source_code_uri' => spec.homepage,
'changelog_uri' => 'https://github.com/javier-menendez/sprockets_terser_with_source_maps/blob/main/CHANGELOG.md',
'documentation_uri' => 'https://www.rubydoc.info/gems/sprockets_terser_with_source_maps',
'bug_tracker_uri' => 'https://github.com/javier-menendez/sprockets_terser_with_source_maps/issues',
'rubygems_mfa_required' => 'true'
}

spec.add_dependency 'sprockets-rails', '~> 3.0'
spec.add_dependency 'terser', '~> 1.1.0'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'railties', '>= 4.2'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop'

# Specify which files should be added to the gem when it is released.
spec.files = Dir['README.md', 'lib/**/*.rb', 'LICENSE.txt', 'CHANGELOG.md']

Expand Down