erb 6.0.2 → 6.0.4

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: ac01e59591c3650d2a79080161f086a58a5ee6ab5d5633d57cfbc452b91da28b
4
- data.tar.gz: '092313e6acc991af7182703476d31b7cb724c95cac1fa9ad8b0a422745e2c985'
3
+ metadata.gz: b25d5fdfe9fee1fe6ecfb1e2e065899b51e0c1c4db0ad2d77684234b68483660
4
+ data.tar.gz: cd8460dbde78e4a3989a45bc2f1ac355f8ab949d2f5b15e26fbe4f049da1458b
5
5
  SHA512:
6
- metadata.gz: 1ecc49906929716abf47d59ac7086dc10c205f073533e35181bd2e703ce4c8f5e1f2d93a9bafd4cc640c0a9ed92fbe536aa969457aded80d641dffa9e7952f61
7
- data.tar.gz: ded8eb9ec0f62253490b2af5f5b89c2a1cc949de5bd6d25df936d38402a415cf5f7c3385e1ce0cd7ac02bd301ab8b1804c6e17e6e5f56cc12b9757c3ff2363c3
6
+ metadata.gz: dc41315bc958e50efdc1db906e998e9a6808410381be3ec70ffb0f9330b5520c89a5652fa0cf3e605caa237f52c8c5b05c9435d2a77fd08806664fdf769c56a9
7
+ data.tar.gz: 9937928ce2742fe22dd16317ea011984046a227782ea71b50c57b8c2d00e41534ae9f548ca8d14d2dc2a87a0fd42367462a75b56ea9e8678783c86ad0d57827a
data/NEWS.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.4
4
+
5
+ * Prohibit `def_method` on marshal-loaded ERB instances
6
+
7
+ ## 6.0.3
8
+
9
+ * Exclude some files from published gem https://github.com/ruby/erb/pull/108
10
+
3
11
  ## 6.0.2
4
12
 
5
- * Freeze `src` in `ERB#initialize` for Ractor compatibility
13
+ * Freeze `src` in `ERB#initialize` for Ractor compatibility https://github.com/ruby/erb/pull/105
6
14
 
7
15
  ## 6.0.1
8
16
 
data/erb.gemspec CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.metadata['source_code_uri'] = spec.homepage
21
21
  spec.metadata['changelog_uri'] = "https://github.com/ruby/erb/blob/v#{spec.version}/NEWS.md"
22
22
 
23
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|\.git|\.github)/}) }
25
25
  end
26
26
  spec.bindir = 'libexec'
27
27
  spec.executables = ['erb']
data/lib/erb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  class ERB
3
3
  # The string \ERB version.
4
- VERSION = '6.0.2'
4
+ VERSION = '6.0.4'
5
5
  end
data/lib/erb.rb CHANGED
@@ -1087,6 +1087,9 @@ class ERB
1087
1087
  # ```
1088
1088
  #
1089
1089
  def def_method(mod, methodname, fname='(ERB)')
1090
+ unless @_init.equal?(self.class.singleton_class)
1091
+ raise ArgumentError, "not initialized"
1092
+ end
1090
1093
  src = self.src.sub(/^(?!#|$)/) {"def #{methodname}\n"} << "\nend\n"
1091
1094
  mod.module_eval do
1092
1095
  eval(src, binding, fname, -1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masatoshi SEKI
@@ -21,12 +21,6 @@ extensions:
21
21
  extra_rdoc_files: []
22
22
  files:
23
23
  - ".document"
24
- - ".github/dependabot.yml"
25
- - ".github/release.yml"
26
- - ".github/workflows/dependabot_automerge.yml"
27
- - ".github/workflows/push-gem.yml"
28
- - ".github/workflows/sync-ruby.yml"
29
- - ".github/workflows/test.yml"
30
24
  - ".gitignore"
31
25
  - ".rdoc_options"
32
26
  - BSDL
@@ -56,7 +50,7 @@ licenses:
56
50
  metadata:
57
51
  homepage_uri: https://github.com/ruby/erb
58
52
  source_code_uri: https://github.com/ruby/erb
59
- changelog_uri: https://github.com/ruby/erb/blob/v6.0.2/NEWS.md
53
+ changelog_uri: https://github.com/ruby/erb/blob/v6.0.4/NEWS.md
60
54
  rdoc_options: []
61
55
  require_paths:
62
56
  - lib
@@ -1,6 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: 'github-actions'
4
- directory: '/'
5
- schedule:
6
- interval: 'monthly'
data/.github/release.yml DELETED
@@ -1,4 +0,0 @@
1
- changelog:
2
- exclude:
3
- labels:
4
- - dependencies # Added by Dependabot
@@ -1,30 +0,0 @@
1
- name: Dependabot auto-merge
2
- on:
3
- pull_request:
4
-
5
- permissions:
6
- contents: write
7
- pull-requests: write
8
-
9
- jobs:
10
- automerge:
11
- runs-on: ubuntu-latest
12
- if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ruby/erb'
13
- steps:
14
- - name: Dependabot metadata
15
- uses: dependabot/fetch-metadata@v2
16
- id: metadata
17
-
18
- - name: Wait for status checks
19
- uses: lewagon/wait-on-check-action@v1
20
- with:
21
- repo-token: ${{ secrets.GITHUB_TOKEN }}
22
- ref: ${{ github.event.pull_request.head.sha || github.sha }}
23
- check-regexp: 'build \(.*\)'
24
- wait-interval: 30
25
-
26
- - name: Auto-merge for Dependabot PRs
27
- run: gh pr merge --auto --rebase "$PR_URL"
28
- env:
29
- PR_URL: ${{ github.event.pull_request.html_url }}
30
- GITHUB_TOKEN: ${{ secrets.MATZBOT_DEPENDABOT_MERGE_TOKEN }}
@@ -1,51 +0,0 @@
1
- name: Publish gem to rubygems.org
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v*'
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- push:
13
- if: github.repository_owner == 'ruby'
14
- runs-on: ubuntu-latest
15
- strategy:
16
- matrix:
17
- ruby: [ruby, jruby]
18
- fail-fast: false
19
-
20
- environment:
21
- name: rubygems.org
22
- url: https://rubygems.org/gems/erb
23
-
24
- permissions:
25
- contents: write
26
- id-token: write
27
-
28
- steps:
29
- - name: Harden Runner
30
- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
31
- with:
32
- egress-policy: audit
33
-
34
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
35
-
36
- - name: Set up Ruby
37
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
38
- with:
39
- bundler-cache: true
40
- ruby-version: ${{ matrix.ruby }}
41
-
42
- - name: Publish to RubyGems
43
- uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
44
-
45
- - name: Create GitHub release
46
- run: |
47
- tag_name="$(git describe --tags --abbrev=0)"
48
- gh release create "${tag_name}" --verify-tag --generate-notes
49
- env:
50
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
- if: ${{ matrix.ruby == 'ruby' }}
@@ -1,33 +0,0 @@
1
- name: Sync ruby
2
- on:
3
- push:
4
- branches: [master]
5
- jobs:
6
- sync:
7
- name: Sync ruby
8
- runs-on: ubuntu-latest
9
- if: ${{ github.repository_owner == 'ruby' }}
10
- steps:
11
- - uses: actions/checkout@v6
12
-
13
- - name: Create GitHub App token
14
- id: app-token
15
- uses: actions/create-github-app-token@v2
16
- with:
17
- app-id: 2060836
18
- private-key: ${{ secrets.RUBY_SYNC_DEFAULT_GEMS_PRIVATE_KEY }}
19
- owner: ruby
20
- repositories: ruby
21
-
22
- - name: Sync to ruby/ruby
23
- uses: convictional/trigger-workflow-and-wait@v1.6.5
24
- with:
25
- owner: ruby
26
- repo: ruby
27
- workflow_file_name: sync_default_gems.yml
28
- github_token: ${{ steps.app-token.outputs.token }}
29
- ref: master
30
- client_payload: |
31
- {"gem":"${{ github.event.repository.name }}","before":"${{ github.event.before }}","after":"${{ github.event.after }}"}
32
- propagate_failure: true
33
- wait_interval: 10
@@ -1,36 +0,0 @@
1
- name: test
2
-
3
- on:
4
- push:
5
- branches: [master]
6
- pull_request:
7
- workflow_dispatch:
8
-
9
- jobs:
10
- ruby-versions:
11
- uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12
- with:
13
- engine: cruby
14
- versions: '["jruby", "truffleruby-head"]'
15
-
16
- test:
17
- needs: ruby-versions
18
- name: build (${{ matrix.ruby }} / ${{ matrix.os }})
19
- strategy:
20
- matrix:
21
- ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22
- os: [ubuntu-latest]
23
- fail-fast: false
24
- runs-on: ${{ matrix.os }}
25
- steps:
26
- - uses: actions/checkout@v6
27
- - name: Set up Ruby
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- bundler-cache: true
32
- - name: Run test
33
- run: bundle exec rake test
34
- - name: RDoc coverage
35
- run: |
36
- rdoc -C --visibility=private .