simpacker 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/ci.yml +23 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/simpacker/context.rb +5 -1
- data/lib/simpacker/helper.rb +10 -0
- data/lib/simpacker/version.rb +1 -1
- metadata +5 -4
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13577281d92e7c133a1125ee25615810c0f82b8f76405aaa7f17e5502304768a
|
|
4
|
+
data.tar.gz: 560c378942075b5c4d3aee4a79488096a10979960c085cb60f2b74ec18469ead
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f13e54d4901813e0e2f11e27f1710344b89fb408a7610e1832b1b901a9f0c6b77167c7878ec9980a83bcbe1fc70535433dac50928232254aec144b9fa489a52
|
|
7
|
+
data.tar.gz: 2e265a305a46cf1abef0d7e28a42dcac2583d785168f03e50aa3bfd3cbb2267ba2a7dc9fdceea832b5dfa419398209fbd7e663fd2993812a5440151587cf6bf8
|
data/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: hokaccha
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
ruby: ["2.7", "3.0", "3.1"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v2
|
|
17
|
+
- uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
|
20
|
+
- name: install dependencies
|
|
21
|
+
run: bundle install --jobs 3 --retry 3
|
|
22
|
+
- name: test
|
|
23
|
+
run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Simpacker
|
|
2
2
|
|
|
3
|
-
[](https://github.com/hokaccha/simpacker/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/simpacker)
|
|
4
5
|
|
|
5
6
|
Simpacker provides the feature to integrate modern JavaScript build system with Rails, like a [webpacker](https://github.com/rails/webpacker).
|
|
6
7
|
|
data/lib/simpacker/context.rb
CHANGED
|
@@ -16,7 +16,11 @@ module Simpacker
|
|
|
16
16
|
|
|
17
17
|
def load_config_file(root_path, env)
|
|
18
18
|
config_path = root_path.join("config/simpacker.yml")
|
|
19
|
-
yaml =
|
|
19
|
+
yaml = begin
|
|
20
|
+
YAML.load(config_path.read, aliases: true)
|
|
21
|
+
rescue ArgumentError
|
|
22
|
+
YAML.load(config_path.read)
|
|
23
|
+
end
|
|
20
24
|
config_env = yaml.fetch(env.to_s)
|
|
21
25
|
{
|
|
22
26
|
manifest_path: root_path.join(config_env.fetch('manifest_path')),
|
data/lib/simpacker/helper.rb
CHANGED
|
@@ -30,6 +30,16 @@ module Simpacker
|
|
|
30
30
|
asset_url(simpacker_context.manifest.lookup!(name), **options)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
def picture_pack_tag(*names, &block)
|
|
34
|
+
unless Rails.gem_version >= Gem::Version.new('7.1.0')
|
|
35
|
+
raise NotImplementedError, '`picture_pack_tag` is only available for Rails 7.1 or above.'
|
|
36
|
+
end
|
|
37
|
+
names.flatten!
|
|
38
|
+
options = names.extract_options!
|
|
39
|
+
sources = names.map { |name| asset_path(simpacker_context.manifest.lookup!(name)) }
|
|
40
|
+
picture_tag(*sources, options, &block)
|
|
41
|
+
end
|
|
42
|
+
|
|
33
43
|
def favicon_pack_tag(name, **options)
|
|
34
44
|
favicon_link_tag(asset_path(simpacker_context.manifest.lookup!(name)), **options)
|
|
35
45
|
end
|
data/lib/simpacker/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simpacker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuhito Hokamura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|
|
@@ -87,9 +87,10 @@ executables: []
|
|
|
87
87
|
extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
|
89
89
|
files:
|
|
90
|
+
- ".github/FUNDING.yml"
|
|
91
|
+
- ".github/workflows/ci.yml"
|
|
90
92
|
- ".gitignore"
|
|
91
93
|
- ".prettierignore"
|
|
92
|
-
- ".travis.yml"
|
|
93
94
|
- CHANGELOG.md
|
|
94
95
|
- Gemfile
|
|
95
96
|
- README.md
|
|
@@ -132,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
132
133
|
- !ruby/object:Gem::Version
|
|
133
134
|
version: '0'
|
|
134
135
|
requirements: []
|
|
135
|
-
rubygems_version: 3.
|
|
136
|
+
rubygems_version: 3.3.7
|
|
136
137
|
signing_key:
|
|
137
138
|
specification_version: 4
|
|
138
139
|
summary: Integrate modern JavaScript build system with Rails.
|