rails_assetsless_container 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cfe66cad059643f3b4a938611a21a8e1cfee0659533a1cce078c5e58047d7e7e
4
+ data.tar.gz: 97ed5b86308f26ecf8ff7799e855c7cec437eb8af88dd9a56a2ce7adac8a9a61
5
+ SHA512:
6
+ metadata.gz: 61e16d2f16a4fa746e9c39759ba8f75099ac8c3bd8972801d54b02fd843ba946e25684e3a76376f2a224e3bec1052585e2a9837a7462557ebc1574ffab2d8db6
7
+ data.tar.gz: c8c0a18229263a0ad44c8a600471a168dac401b426ddcc43fb432c4aa25e930f55437bce9c41f8c4c94e67d68b6e6f9dd6643bc1a28ef473830c90368b91b319
@@ -0,0 +1,16 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.1
14
+ bundler-cache: true
15
+ - name: Run the default task
16
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,31 @@
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+
8
+ Style/StringLiterals:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Style/StringLiteralsInInterpolation:
13
+ Enabled: true
14
+ EnforcedStyle: double_quotes
15
+
16
+ Layout/LineLength:
17
+ Max: 120
18
+
19
+ Style/Documentation:
20
+ Enabled: false
21
+
22
+ Lint/MissingSuper:
23
+ Exclude:
24
+ - 'lib/rails_assetsless_container/strategy/*.rb'
25
+
26
+ Metrics/BlockLength:
27
+ IgnoredMethods:
28
+ - describe
29
+
30
+ RSpec/MultipleExpectations:
31
+ Max: 5
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-04-16
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at sinsoku.listy@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rails_assetsless_container.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "rspec", "~> 3.0"
10
+ gem "rubocop", "~> 1.7"
11
+ gem "rubocop-rake"
12
+ gem "rubocop-rspec"
13
+ gem "simplecov"
14
+ gem "webmock"
15
+ gem "webpacker"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Takumi Shotoku
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # RailsAssetslessContainer
2
+
3
+ If you're delivering assets via a CDN, you don't need to include assets in your container.
4
+
5
+ This gem provides a way to do that.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'rails_assetsless_container'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install rails_assetsless_container
22
+
23
+ ## Configuration
24
+
25
+ It is disabled by default, so specify it explicitly with `config/environments/production.rb`.
26
+
27
+ ```ruby
28
+ Rails.application.configure do
29
+ # some settings
30
+ end
31
+
32
+ RailsAssetslessContainer.configure do |config|
33
+ config.enabled = true
34
+ end
35
+ ```
36
+
37
+ ## Strategy
38
+
39
+ ### AssetServer (default)
40
+
41
+ Save the manifest file as `manifest-<suffix>.json` after `assets:precompile`.
42
+
43
+ Download `manifest-<suffix>.json` via CDN and save it as `manifest.json` before starting the server.
44
+
45
+ see: [lib/rails_assetsless_container/strategy/asset_server.rb](https://github.com/sinsoku/rails_assetsless_container/blob/main/lib/rails_assetsless_container/strategy/asset_server.rb)
46
+
47
+ ### Log
48
+
49
+ A strategy for checking each method call for debugging.
50
+
51
+ ```ruby
52
+ RailsAssetslessContainer.configure do |config|
53
+ config.enabled = true
54
+ logger = Logger.new(STDOUT)
55
+ config.strategy = RailsAssetslessContainer::Strategy::Log.new(logger)
56
+ end
57
+ ```
58
+
59
+ see: [lib/rails_assetsless_container/strategy/log.rb](https://github.com/sinsoku/rails_assetsless_container/blob/main/lib/rails_assetsless_container/strategy/log.rb)
60
+
61
+ ### Custom
62
+
63
+ You can also use custom strategy.
64
+
65
+ ```ruby
66
+ class CustomStrategy < RailsAssetslessContainer::Strategy::Base
67
+ def after_sprockets(path)
68
+ # To save the manifest from `path`.
69
+ end
70
+
71
+ def after_webpacker(path)
72
+ # To save the manifest from `path`.
73
+ end
74
+
75
+ def write_sprockets_manifest(path)
76
+ # To write the manifest to `path`.
77
+ end
78
+
79
+ def write_webpacker_manifest(path)
80
+ # To write the manifest to `path`.
81
+ end
82
+ end
83
+
84
+ RailsAssetslessContainer.configure do |config|
85
+ config.enabled = true
86
+ config.strategy = CustomStrategy.new
87
+ end
88
+ ```
89
+
90
+ ## Development
91
+
92
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
93
+
94
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
95
+
96
+ ## Contributing
97
+
98
+ Bug reports and pull requests are welcome on GitHub at https://github.com/sinsoku/rails_assetsless_container. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sinsoku/rails_assetsless_container/blob/main/CODE_OF_CONDUCT.md).
99
+
100
+ ## License
101
+
102
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
103
+
104
+ ## Code of Conduct
105
+
106
+ Everyone interacting in the RailsAssetslessContainer project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sinsoku/rails_assetsless_container/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rails_assetsless_container"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sprockets"
4
+ begin
5
+ require "webpacker"
6
+ rescue LoadError
7
+ # do nothing
8
+ end
9
+
10
+ require "active_support/core_ext/module/delegation"
11
+
12
+ module RailsAssetslessContainer
13
+ class Error < StandardError; end
14
+
15
+ class << self
16
+ def after_sprockets(path)
17
+ strategy.after_sprockets(path) if enabled?
18
+ end
19
+
20
+ def after_webpacker(path)
21
+ strategy.after_webpacker(path) if enabled?
22
+ end
23
+
24
+ def download_manifests
25
+ return unless enabled?
26
+
27
+ download_sprockets_manifest
28
+ download_webpacker_manifest if defined?(Webpacker)
29
+ end
30
+
31
+ delegate :enabled?, :strategy, to: :config
32
+
33
+ private
34
+
35
+ def download_sprockets_manifest
36
+ dirname = Rails.root.join("public/assets")
37
+ path = Sprockets::ManifestUtils.find_directory_manifest(dirname)
38
+ strategy.write_sprockets_manifest(path)
39
+ end
40
+
41
+ def download_webpacker_manifest
42
+ path = Webpacker.config.public_manifest_path.to_s
43
+ strategy.write_webpacker_manifest(path)
44
+ end
45
+ end
46
+ end
47
+
48
+ require_relative "rails_assetsless_container/sprockets_ext"
49
+ require_relative "rails_assetsless_container/webpacker_ext" if defined?(Webpacker)
50
+ require_relative "rails_assetsless_container/railtie" if defined?(Rails)
51
+
52
+ require_relative "rails_assetsless_container/config"
53
+ require_relative "rails_assetsless_container/version"
54
+ require_relative "rails_assetsless_container/strategy/base"
55
+ require_relative "rails_assetsless_container/strategy/asset_server"
56
+ require_relative "rails_assetsless_container/strategy/log"
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ class << self
5
+ def config
6
+ @config ||= Config.new
7
+ end
8
+
9
+ def configure
10
+ yield config
11
+ end
12
+ end
13
+
14
+ class Config
15
+ attr_accessor :enabled, :strategy
16
+ alias enabled? enabled
17
+
18
+ def initialize
19
+ @enabled = false
20
+ @strategy ||= Strategy::AssetServer.new
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/railtie"
4
+
5
+ module RailsAssetslessContainer
6
+ class Railtie < ::Rails::Railtie
7
+ if defined?(Rails::Server) || defined?(Unicorn::Launcher)
8
+ config.before_initialize do
9
+ RailsAssetslessContainer.download_manifests
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ module SprocketsExt
5
+ def compile(*_args)
6
+ super.tap do
7
+ RailsAssetslessContainer.after_sprockets(@filename.to_s)
8
+ end
9
+ end
10
+ end
11
+
12
+ Sprockets::Manifest.prepend(SprocketsExt)
13
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ module Strategy
5
+ class AssetServer < Base
6
+ def initialize(
7
+ asset_host: nil,
8
+ suffix: ENV["SHA"],
9
+ retry_count: 3,
10
+ retry_wait: 1
11
+ )
12
+ @asset_host = asset_host
13
+ @suffix = suffix
14
+ @retry_count = retry_count
15
+ @retry_wait = retry_wait
16
+ end
17
+
18
+ def after_sprockets(path)
19
+ FileUtils.copy(path, public_dir.join(sprockets_manifest_path))
20
+ end
21
+
22
+ def after_webpacker(path)
23
+ FileUtils.copy(path, public_dir.join(webpacker_manifest_path))
24
+ end
25
+
26
+ def write_sprockets_manifest(path)
27
+ uri = build_manifest_uri(sprockets_manifest_path)
28
+ mkdir(path)
29
+ File.write(path, download_with_retry(uri))
30
+ end
31
+
32
+ def write_webpacker_manifest(path)
33
+ uri = build_manifest_uri(webpacker_manifest_path)
34
+ mkdir(path)
35
+ File.write(path, download_with_retry(uri))
36
+ end
37
+
38
+ private
39
+
40
+ attr_reader :suffix, :retry_count, :retry_wait
41
+
42
+ def public_dir
43
+ Rails.root.join("public")
44
+ end
45
+
46
+ def asset_host
47
+ @asset_host ||= Rails.application.config.asset_host
48
+ end
49
+
50
+ def sprockets_manifest_path
51
+ "assets/.sprockets-manifest-#{suffix}.json"
52
+ end
53
+
54
+ def webpacker_manifest_path
55
+ "packs/manifest-#{suffix}.json"
56
+ end
57
+
58
+ def mkdir(path)
59
+ Pathname(path).dirname.mkpath
60
+ end
61
+
62
+ def build_manifest_uri(path)
63
+ scheme = "https://" unless asset_host.start_with?("http")
64
+ URI.parse("#{scheme}#{asset_host}/#{path}")
65
+ end
66
+
67
+ def download_with_retry(uri)
68
+ with_retry do
69
+ res = Net::HTTP.get_response(uri)
70
+ raise("#{res.code}: #{res.body}") if res.code != "200"
71
+
72
+ res.body
73
+ end
74
+ end
75
+
76
+ def with_retry
77
+ count = 0
78
+
79
+ begin
80
+ yield
81
+ rescue StandardError => e
82
+ count += 1
83
+ raise(e) if count >= retry_count
84
+
85
+ sleep(retry_wait) if retry_wait.positive?
86
+ retry
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ module Strategy
5
+ class Base
6
+ SAVE_MSG = "Subclass must implement this method to save the manifest from `path`."
7
+ WRITE_MSG = "Subclass must implement this method to write the manifest to `path`."
8
+ private_constant :SAVE_MSG, :WRITE_MSG
9
+
10
+ def after_sprockets(_path)
11
+ raise NotImplementedError, SAVE_MSG
12
+ end
13
+
14
+ def after_webpacker(_path)
15
+ raise NotImplementedError, SAVE_MSG
16
+ end
17
+
18
+ def write_sprockets_manifest(_path)
19
+ raise NotImplementedError, WRITE_MSG
20
+ end
21
+
22
+ def write_webpacker_manifest(_path)
23
+ raise NotImplementedError, WRITE_MSG
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ module Strategy
5
+ class Log < Base
6
+ attr_reader :logger
7
+
8
+ def initialize(logger)
9
+ @logger = logger
10
+ end
11
+
12
+ def after_sprockets(path)
13
+ logger.info("after_sprockets: #{path}")
14
+ end
15
+
16
+ def after_webpacker(path)
17
+ logger.info("after_webpacker: #{path}")
18
+ end
19
+
20
+ def write_sprockets_manifest(path)
21
+ logger.info("write_sprockets_manifest: #{path}")
22
+ end
23
+
24
+ def write_webpacker_manifest(path)
25
+ logger.info("write_webpacker_manifest: #{path}")
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAssetslessContainer
4
+ module WebpackerExt
5
+ def compile
6
+ super.tap do
7
+ RailsAssetslessContainer.after_webpacker(config.public_manifest_path.to_s)
8
+ end
9
+ end
10
+ end
11
+
12
+ Webpacker::Compiler.prepend(WebpackerExt)
13
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rails_assetsless_container/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rails_assetsless_container"
7
+ spec.version = RailsAssetslessContainer::VERSION
8
+ spec.authors = ["Takumi Shotoku"]
9
+ spec.email = ["sinsoku.listy@gmail.com"]
10
+
11
+ spec.summary = "Starts a server without including assets in the container."
12
+ spec.description = spec.summary
13
+ spec.homepage = "https://github.com/sinsoku/rails_assetsless_container"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = "https://github.com/sinsoku/rails_assetsless_container/blob/main/CHANGELOG.md"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency "activesupport", ">= 5.2"
31
+ spec.add_dependency "railties", ">= 5.2"
32
+ spec.add_dependency "sprockets", ">= 3"
33
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_assetsless_container
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takumi Shotoku
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-04-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: railties
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '5.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '5.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sprockets
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ description: Starts a server without including assets in the container.
56
+ email:
57
+ - sinsoku.listy@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".github/workflows/main.yml"
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".rubocop.yml"
66
+ - CHANGELOG.md
67
+ - CODE_OF_CONDUCT.md
68
+ - Gemfile
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - bin/console
73
+ - bin/setup
74
+ - lib/rails_assetsless_container.rb
75
+ - lib/rails_assetsless_container/config.rb
76
+ - lib/rails_assetsless_container/railtie.rb
77
+ - lib/rails_assetsless_container/sprockets_ext.rb
78
+ - lib/rails_assetsless_container/strategy/asset_server.rb
79
+ - lib/rails_assetsless_container/strategy/base.rb
80
+ - lib/rails_assetsless_container/strategy/log.rb
81
+ - lib/rails_assetsless_container/version.rb
82
+ - lib/rails_assetsless_container/webpacker_ext.rb
83
+ - rails_assetsless_container.gemspec
84
+ homepage: https://github.com/sinsoku/rails_assetsless_container
85
+ licenses:
86
+ - MIT
87
+ metadata:
88
+ homepage_uri: https://github.com/sinsoku/rails_assetsless_container
89
+ source_code_uri: https://github.com/sinsoku/rails_assetsless_container
90
+ changelog_uri: https://github.com/sinsoku/rails_assetsless_container/blob/main/CHANGELOG.md
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 2.4.0
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.2.15
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: Starts a server without including assets in the container.
110
+ test_files: []