webpacker_toppings 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +60 -0
- data/Rakefile +22 -0
- data/lib/webpacker_toppings.rb +7 -0
- data/lib/webpacker_toppings/helpers.rb +6 -0
- data/lib/webpacker_toppings/helpers/packs.rb +33 -0
- data/lib/webpacker_toppings/version.rb +5 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e53aedc3909fd629061057d22bf9fa443a2808e7d24ff97c40a983e9ae24fa5f
|
4
|
+
data.tar.gz: 4a73610017800225139ed1612b4853588286824b7fc4b43ca5164ac24211c649
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0a5bf23b1174e32bf11959857450adc27e0ab6295778519ce22c47aaf7468502024dbddae296d04eb0cb31ff4c024be62560a8827da1984f9e212603c4ea63a6
|
7
|
+
data.tar.gz: 3e7f23b3857ce83ac80b50fb8ad131d80bf67528a17f57645768ab06e036a236ccd3e74e0fb7aa397d2a8f305c71e0445f96099b1d7a91570db9b0682e0f4eae
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2021 Codeur SARL
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# WebpackerToppings
|
2
|
+
This gem provides helpers for Webpacker
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'webpacker_toppings'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
```bash
|
13
|
+
$ bundle
|
14
|
+
```
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
```bash
|
18
|
+
$ gem install webpacker_toppings
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
Include the helpers you need in your `app/helpers/application_helper.rb` :
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
module ApplicationHelper
|
26
|
+
include WebpackerToppings::Helpers::Packs
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
### Helpers
|
31
|
+
- [`WebpackerToppings::Helpers::Packs`](https://github.com/codeur/webpacker_toppings/blob/main/lib/webpacker_toppings/helpers/packs.rb)
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
## Development and testing
|
36
|
+
```bash
|
37
|
+
git clone git@github.com:codeur/webpacker_toppings.git
|
38
|
+
cd webpacker_toppings
|
39
|
+
bundle install
|
40
|
+
cd test/dummy && bundle install && yarn install && cd ../..
|
41
|
+
bin/test
|
42
|
+
```
|
43
|
+
|
44
|
+
## Release (for Codeur dev team members)
|
45
|
+
Before all, configure your credentials for `dev-codeur` RubyGems account:
|
46
|
+
|
47
|
+
Login to RubyGems with the `dev-codeur` account
|
48
|
+
Create a token which have rights to push gems (https://rubygems.org/profile/api_keys)
|
49
|
+
Add it to your config:
|
50
|
+
```bash
|
51
|
+
echo ":rubygems_api_key: YOUR_API_KEY" >> ~/.gem/credentials
|
52
|
+
```
|
53
|
+
You just have to run default command:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
rake release
|
57
|
+
```
|
58
|
+
|
59
|
+
## License
|
60
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
|
5
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
6
|
+
load 'rails/tasks/engine.rake'
|
7
|
+
|
8
|
+
load 'rails/tasks/statistics.rake'
|
9
|
+
|
10
|
+
require 'bundler/gem_tasks'
|
11
|
+
|
12
|
+
require 'rake/testtask'
|
13
|
+
|
14
|
+
Rake::TestTask.new(:test) do |t|
|
15
|
+
t.libs << 'test'
|
16
|
+
t.pattern = 'test/**/*_test.rb'
|
17
|
+
t.verbose = false
|
18
|
+
end
|
19
|
+
|
20
|
+
task default: :test
|
21
|
+
|
22
|
+
# Rails.application.load_tasks
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module WebpackerToppings
|
2
|
+
module Helpers
|
3
|
+
module Packs
|
4
|
+
# Retrieve javascript packs declared in your templates
|
5
|
+
# Example : <%= javascript_packs_with_chunks_tag *javascript_packs_list %>
|
6
|
+
def javascript_packs_list
|
7
|
+
return unless content_for?(:javascript_packs_list)
|
8
|
+
|
9
|
+
Array(content_for(:javascript_packs_list).split(';')).reject(&:empty?)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Retrieve stylesheet packs declared in your templates
|
13
|
+
# Example : <%= stylesheet_packs_with_chunks_tag *stylesheet_packs_list %>
|
14
|
+
def stylesheet_packs_list
|
15
|
+
return unless content_for?(:stylesheet_packs_list)
|
16
|
+
|
17
|
+
Array(content_for(:stylesheet_packs_list).split(';')).reject(&:empty?)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Declare a javascript pack (or many) you want to use in a template
|
21
|
+
# Example : <%= use_javascript_pack(:foo, :bar) %>
|
22
|
+
def use_javascript_pack(*packs)
|
23
|
+
content_for(:javascript_packs_list) { "#{packs.join(';')};" }
|
24
|
+
end
|
25
|
+
|
26
|
+
# Declare a stylesheet pack (or many) you want to use in a template
|
27
|
+
# Example : <%= use_stylesheet_pack(:baz) %>
|
28
|
+
def use_stylesheet_pack(*packs)
|
29
|
+
content_for(:stylesheet_packs_list) { "#{packs.join(';')};" }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webpacker_toppings
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dev-team Codeur
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.0.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.0.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: webpacker
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-codeur
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: WebpackerToppings provides helpers for Webpacker
|
56
|
+
email:
|
57
|
+
- dev@codeur.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- MIT-LICENSE
|
63
|
+
- README.md
|
64
|
+
- Rakefile
|
65
|
+
- lib/webpacker_toppings.rb
|
66
|
+
- lib/webpacker_toppings/helpers.rb
|
67
|
+
- lib/webpacker_toppings/helpers/packs.rb
|
68
|
+
- lib/webpacker_toppings/version.rb
|
69
|
+
homepage: https://github.com/codeur/webpacker_toppings
|
70
|
+
licenses:
|
71
|
+
- MIT
|
72
|
+
metadata:
|
73
|
+
homepage_uri: https://github.com/codeur/webpacker_toppings
|
74
|
+
source_code_uri: https://github.com/codeur/webpacker_toppings
|
75
|
+
changelog_uri: https://github.com/codeur/webpacker_toppings/blob/main/CHANGELOG.md
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '2.6'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
requirements: []
|
91
|
+
rubygems_version: 3.0.3
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Toolkit for Webpacker
|
95
|
+
test_files: []
|