erb 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59e65e447aa2698cab1c4f1f99322edabac2a8e480fb885c711529464f6842c8
4
- data.tar.gz: 72e69acb55471846d7d07240a4c1ff023d0a6719ed24d9564f029dfd97b81402
3
+ metadata.gz: 8f3996670474a52bba08a0a8cdeba934a01d09fb7a45047ad14de049823cea90
4
+ data.tar.gz: e23035811fc69fb375930eb155ecbf47b67e7991ba7c96fd3c95d6f823e58b6b
5
5
  SHA512:
6
- metadata.gz: ea5447f6851f8752637b1b93aae084d58479808f65f11c3dd1d946e7f005cf4c0b1d607428f398ba2597b5ee48cc8c1e44bfdb6074eeb819b781d1c5d66dc927
7
- data.tar.gz: 17bede5cf619b2d9d5f8d983835e9664dcd901920727071b59ba37698a0cc1f31624eef8a6132f14de780975f1f49860381103d7f54b0ad325104e8111ab1e0a
6
+ metadata.gz: '09a2991c267e42f6b46f9c629db1596c3238a711e409099c1b50874ded8752d1dd64a9828b6eaec79796b06dab92d402d408c97b24a06eda3e4b12bb8c9e49ac'
7
+ data.tar.gz: 4341ca9b16e9e646121dd7e2da710156c6ce71a15983b6c12daaad6fc43fec918b4c57b15b933ff7e6a94a32894e8a458f580f3371300253cb36aaf955b2e07c
@@ -7,8 +7,13 @@ jobs:
7
7
  name: build (${{ matrix.ruby }} / ${{ matrix.os }})
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ 2.7, 2.6, 2.5, head ]
11
- os: [ ubuntu-latest, macos-latest ]
10
+ ruby:
11
+ - '2.5'
12
+ - '2.6'
13
+ - '2.7'
14
+ - '3.0'
15
+ - head
16
+ os: [ubuntu-latest]
12
17
  runs-on: ${{ matrix.os }}
13
18
  steps:
14
19
  - uses: actions/checkout@master
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem "rake"
4
- gem "test-unit"
3
+ gemspec
4
+
5
+ gem 'rake'
6
+ gem 'test-unit'
data/NEWS.md ADDED
@@ -0,0 +1,9 @@
1
+ # Change Log
2
+
3
+ ## 2.2.1
4
+
5
+ - `ERB#initialize` warns `safe_level` and later arguments even without -w
6
+
7
+ ## 2.2.0
8
+
9
+ - Ruby 3.0 promoted ERB to a default gem
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Erb
1
+ # ERB
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/erb`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ An easy to use but powerful templating system for Ruby.
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,10 +18,6 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install erb
22
20
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
21
  ## Development
28
22
 
29
23
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -32,5 +26,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
26
 
33
27
  ## Contributing
34
28
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/hsbt/erb.
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/erb.
30
+
31
+ ## License
36
32
 
33
+ The gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test/lib"
6
- t.ruby_opts << "-rhelper"
7
- t.test_files = FileList["test/**/test_*.rb"]
5
+ t.libs << 'test/lib'
6
+ t.ruby_opts << '-rhelper'
7
+ t.test_files = FileList['test/**/test_*.rb']
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
data/erb.gemspec CHANGED
@@ -1,22 +1,31 @@
1
+ begin
2
+ require_relative 'lib/erb/version'
3
+ rescue LoadError
4
+ # for Ruby core repository
5
+ require_relative 'erb/version'
6
+ end
7
+
1
8
  Gem::Specification.new do |spec|
2
- spec.name = "erb"
3
- spec.version = "2.2.0"
4
- spec.authors = ["Masatoshi SEKI"]
5
- spec.email = ["seki@ruby-lang.org"]
9
+ spec.name = 'erb'
10
+ spec.version = ERB.const_get(:VERSION, false)
11
+ spec.authors = ['Masatoshi SEKI']
12
+ spec.email = ['seki@ruby-lang.org']
6
13
 
7
14
  spec.summary = %q{An easy to use but powerful templating system for Ruby.}
8
15
  spec.description = %q{An easy to use but powerful templating system for Ruby.}
9
- spec.homepage = "https://github.com/ruby/erb"
10
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
- spec.licenses = ["Ruby", "BSD-2-Clause"]
16
+ spec.homepage = 'https://github.com/ruby/erb'
17
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
18
+ spec.licenses = ['Ruby', 'BSD-2-Clause']
12
19
 
13
- spec.metadata["homepage_uri"] = spec.homepage
14
- spec.metadata["source_code_uri"] = spec.homepage
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = spec.homepage
15
22
 
16
- spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
24
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
25
  end
19
- spec.bindir = "libexec"
20
- spec.executables = ["erb"]
21
- spec.require_paths = ["lib"]
26
+ spec.bindir = 'libexec'
27
+ spec.executables = ['erb']
28
+ spec.require_paths = ['lib']
29
+
30
+ spec.add_dependency 'cgi'
22
31
  end
data/lib/erb.rb CHANGED
@@ -12,7 +12,8 @@
12
12
  #
13
13
  # You can redistribute it and/or modify it under the same terms as Ruby.
14
14
 
15
- require "cgi/util"
15
+ require 'cgi/util'
16
+ require 'erb/version'
16
17
 
17
18
  #
18
19
  # = ERB -- Ruby Templating
@@ -257,10 +258,11 @@ require "cgi/util"
257
258
  #
258
259
  class ERB
259
260
  Revision = '$Date:: $' # :nodoc: #'
261
+ deprecate_constant :Revision
260
262
 
261
263
  # Returns revision information for the erb.rb module.
262
264
  def self.version
263
- "erb.rb [2.2.0 #{ERB::Revision.split[1]}]"
265
+ VERSION
264
266
  end
265
267
  end
266
268
 
@@ -809,14 +811,14 @@ class ERB
809
811
  def initialize(str, safe_level=NOT_GIVEN, legacy_trim_mode=NOT_GIVEN, legacy_eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout')
810
812
  # Complex initializer for $SAFE deprecation at [Feature #14256]. Use keyword arguments to pass trim_mode or eoutvar.
811
813
  if safe_level != NOT_GIVEN
812
- warn 'Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.', uplevel: 1 if $VERBOSE || !ZERO_SAFE_LEVELS.include?(safe_level)
814
+ warn 'Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.', uplevel: 1
813
815
  end
814
816
  if legacy_trim_mode != NOT_GIVEN
815
- warn 'Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.', uplevel: 1 if $VERBOSE
817
+ warn 'Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.', uplevel: 1
816
818
  trim_mode = legacy_trim_mode
817
819
  end
818
820
  if legacy_eoutvar != NOT_GIVEN
819
- warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1 if $VERBOSE
821
+ warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1
820
822
  eoutvar = legacy_eoutvar
821
823
  end
822
824
 
@@ -829,8 +831,6 @@ class ERB
829
831
  end
830
832
  NOT_GIVEN = Object.new
831
833
  private_constant :NOT_GIVEN
832
- ZERO_SAFE_LEVELS = [0, nil]
833
- private_constant :ZERO_SAFE_LEVELS
834
834
 
835
835
  ##
836
836
  # Creates a new compiler for ERB. See ERB::Compiler.new for details
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ class ERB
3
+ VERSION = '2.2.2'
4
+ private_constant :VERSION
5
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masatoshi SEKI
8
8
  autorequire:
9
9
  bindir: libexec
10
10
  cert_chain: []
11
- date: 2020-09-18 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cgi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: An easy to use but powerful templating system for Ruby.
14
28
  email:
15
29
  - seki@ruby-lang.org
@@ -22,12 +36,14 @@ files:
22
36
  - ".gitignore"
23
37
  - Gemfile
24
38
  - LICENSE.txt
39
+ - NEWS.md
25
40
  - README.md
26
41
  - Rakefile
27
42
  - bin/console
28
43
  - bin/setup
29
44
  - erb.gemspec
30
45
  - lib/erb.rb
46
+ - lib/erb/version.rb
31
47
  - libexec/erb
32
48
  homepage: https://github.com/ruby/erb
33
49
  licenses:
@@ -51,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
67
  - !ruby/object:Gem::Version
52
68
  version: '0'
53
69
  requirements: []
54
- rubygems_version: 3.2.0.rc.1
70
+ rubygems_version: 3.3.0.dev
55
71
  signing_key:
56
72
  specification_version: 4
57
73
  summary: An easy to use but powerful templating system for Ruby.