content_pack_rails 0.2.2 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89dead0672c57816e3b38635b3261e2f8b2b96b0905307cf84f9ee98c646949f
4
- data.tar.gz: d79dcad158c901efafb4b18e8bb5e02b9c749879e1161fa128b628ed2c3167bc
3
+ metadata.gz: 8a26d8a1b263627df989ef8d8d97f33b489c8322c92eb503c158b9b2b7cad37b
4
+ data.tar.gz: f721a69bbed4ed7d6d2c98bf1a3ac10394f4efa8a9946528b3c1193927676d04
5
5
  SHA512:
6
- metadata.gz: 42e5a18de8b72bf349885cc7e68a1dac9b6ca25194f9471b9c309e45e9c86f77402da4b49001048730418a2fe1bd19d4e3199d77af8407ce928d589d5a9aa25d
7
- data.tar.gz: c6ccae1428cf9f328d86527e3e9da3dfea7a877f7368257461936e3d9d4750ee308642d999583599439aef65fd22d7605383941c81df977c5b99f6d0cfe8e463
6
+ metadata.gz: fe733e4d00555d3963a70c7d310063e21feebd17c4392fa1c8930bed30043c12192d17809c0d2906781ed8ab924442835de8a77aa253bb3ff55f5b7296719d90
7
+ data.tar.gz: 65b7a42f9b7b3bfa5dcf459d9cc52ba02b08793297dae4a7cedb2a7e9aaae74643e0aa178b2750849f2737bfc5ec76f15c2b9e2f88843dccae48dbf7105ec243
@@ -0,0 +1,34 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: ['2.7', '3.0']
15
+ rails: ['6.1', '7.0']
16
+
17
+ runs-on: ubuntu-latest
18
+ name: Test against Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+
28
+ - name: Install gems and run tests
29
+ env:
30
+ TEST_RAILS_VERSION: ${{ matrix.rails }}
31
+ run: |
32
+ gem install bundler
33
+ bundle install --jobs 4 --retry 3
34
+ bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0 (2022-02-14)
4
+
5
+ ### Bug Fixes
6
+
7
+ * github workflow - tests with ruby versions 2.7, 3.0, and rails versions 6.1, 7.0
8
+
3
9
  ## 0.2.2 (2021-12-08)
4
10
 
5
11
  ### Bug Fixes
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # ContentPackRails
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/content_pack_rails.svg)](https://badge.fury.io/rb/content_pack_rails)
4
+ [![Tests](https://github.com/a-bohush/content_pack_rails/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/a-bohush/content_pack_rails/actions/workflows/tests.yml)
5
+
2
6
  A thin wrapper around [`ActionView::Helpers::CaptureHelper#content_for`](https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for).
3
7
  Useful when you need to collect multiple content entries during page rendering, for example <script type="text/template"> templates, without woring about possible duplications and name clashes.
4
8
 
@@ -33,7 +37,7 @@ module ApplicationHelper
33
37
  end
34
38
  ```
35
39
 
36
- Helper `content_pack` declares the same parameters as a standard rails `content_for` and can be used similarly to capture content like this:
40
+ Helper `content_pack` declares the same parameters as the standard rails `content_for` and can be used similarly to capture content like this:
37
41
 
38
42
  ```erb
39
43
  <% content_pack 'content-id' do |id| %>
@@ -45,14 +49,14 @@ Helper `content_pack` declares the same parameters as a standard rails `content_
45
49
  -->
46
50
  <% end %>
47
51
  ```
48
- or pass content as a second argument:
52
+ or pass content as the second argument:
49
53
  ```erb
50
54
  <% content_pack 'content-id', 'Your content' %>
51
55
  ```
52
56
 
53
57
  Unlike `content_for`, by default, `content_pack` will not concatenate content with the same name.
54
58
  Multiple calls to `content_pack` with the same content name will result in only the first content being added to the pack.
55
- If you would like to add additional content on a given name, you should pass an `append: true` option like so:
59
+ If you would like to add additional content on a given name, you should pass the `append: true` option like so:
56
60
 
57
61
  ```erb
58
62
  <% content_pack 'content-id', 'first content' %>
@@ -60,7 +64,7 @@ If you would like to add additional content on a given name, you should pass an
60
64
  <% content_pack 'content-id', 'second content', append: true %>
61
65
  ```
62
66
 
63
- In case you want to override content on a given name, provide a `flush: true` option:
67
+ In case you want to override content on a given name, provide the `flush: true` option:
64
68
  ```erb
65
69
  <% content_pack 'content-id', 'first content' %>
66
70
  <!-- following will override the first one -->
@@ -18,6 +18,10 @@ Gem::Specification.new do |spec|
18
18
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
19
  end
20
20
 
21
- spec.add_development_dependency "rails", "~> 6.1.4", ">= 6.1.4.1"
21
+ if ENV['TEST_RAILS_VERSION'].nil?
22
+ spec.add_development_dependency "rails", "~> 6.1.4", ">= 6.1.4.1"
23
+ else
24
+ spec.add_development_dependency "rails", ENV['TEST_RAILS_VERSION'].to_s
25
+ end
22
26
  spec.add_development_dependency "pry-byebug"
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module ContentPackRails
2
- VERSION = '0.2.2'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content_pack_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bohush
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,7 @@ extensions: []
52
52
  extra_rdoc_files:
53
53
  - README.md
54
54
  files:
55
+ - ".github/workflows/tests.yml"
55
56
  - ".gitignore"
56
57
  - CHANGELOG.md
57
58
  - Gemfile