rack-dev-mark 0.7.11 → 0.8.1

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: ffd9d14ad13345779f403fa0d30d695f506ba78ee7e76d42b430d62931277a28
4
- data.tar.gz: 7ccf0a7aa18b0affa8900d3e2128801569b0908ae7cc5e7d322d8d87819b1cad
3
+ metadata.gz: 8a832063ab4805d433362c8cadbf1d2da6270bf8504f76fef1702b30c3b0f79c
4
+ data.tar.gz: 38362668cbd56fc63075c51c52f0cb5fd8a124bff5d0298bb24d7c5d39bd0bfc
5
5
  SHA512:
6
- metadata.gz: 81e229b8e65dc158b0a9c102c8cb1741f9b77a2d313f0c705f52a9c0092037977ae622eb5ea180189f76e31168f4805cd96fe91d54b7798d1f869e229e8f8b8b
7
- data.tar.gz: 8cd2ffa82361a1f60df8ea900e41e59703c726aeb19175b415d0e22abb0e6a1ca6688dd49872d26cb58b8278f45fa852dd429428c614bbeffd04ac08f0751ab9
6
+ metadata.gz: 4eeb1ef96ef8b48faae4a0df3995bb98ca71b0299322ba4d1ea8440e03f006346a01f506b0f540d8690d022cdc290f400411998ba833fd8be4f96eb538893d86
7
+ data.tar.gz: f26fbfe4ae7f283f8d40bcde9c7cebcef94dfcd47d5b255a3d5602a86c4ae8acd995a431ac1db5af1afd313bc2a81492d75ad288e9b2515c4560094a71f4209f
@@ -0,0 +1,131 @@
1
+ name: test
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+ branches: [ main ]
7
+ jobs:
8
+ rack-test:
9
+ runs-on: ubuntu-22.04
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
14
+ rack-version: ['3.0.0', '2.2.0', '2.1.0', '2.0.0']
15
+ include:
16
+ - { ruby-version: '3.3', rack-version: '3.0.0' }
17
+ - { ruby-version: '3.3', rack-version: '2.2.0' }
18
+ - { ruby-version: '3.3', rack-version: '2.1.0' }
19
+ - { ruby-version: '3.3', rack-version: '2.0.0' }
20
+ - { ruby-version: '3.2', rack-version: '3.0.0' }
21
+ - { ruby-version: '3.2', rack-version: '2.2.0' }
22
+ - { ruby-version: '3.2', rack-version: '2.1.0' }
23
+ - { ruby-version: '3.2', rack-version: '2.0.0' }
24
+ - { ruby-version: '3.1', rack-version: '3.0.0' }
25
+ - { ruby-version: '3.1', rack-version: '2.2.0' }
26
+ - { ruby-version: '3.1', rack-version: '2.1.0' }
27
+ - { ruby-version: '3.1', rack-version: '2.0.0' }
28
+ - { ruby-version: '3.0', rack-version: '3.0.0' }
29
+ - { ruby-version: '3.0', rack-version: '2.2.0' }
30
+ - { ruby-version: '3.0', rack-version: '2.1.0' }
31
+ - { ruby-version: '3.0', rack-version: '2.0.0' }
32
+ - { ruby-version: '2.7', rack-version: '3.0.0' }
33
+ - { ruby-version: '2.7', rack-version: '2.2.0' }
34
+ - { ruby-version: '2.7', rack-version: '2.1.0' }
35
+ - { ruby-version: '2.7', rack-version: '2.0.0' }
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - name: Set up Ruby ${{ matrix.ruby-version }}
39
+ uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby-version }}
42
+ - uses: actions/cache@v3
43
+ with:
44
+ path: vendor/bundle
45
+ key: bundle-use-ruby-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
46
+ restore-keys: |
47
+ bundle-use-ruby-${{ matrix.ruby-version }}-
48
+ - name: Install dependencies
49
+ env:
50
+ RACK_VERSION: ${{ matrix.rack-version }}
51
+ run: bundle install
52
+ - name: Run tests
53
+ run: bundle exec rake spec
54
+ rails-test:
55
+ runs-on: ubuntu-22.04
56
+ strategy:
57
+ fail-fast: false
58
+ matrix:
59
+ ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
60
+ rails-version: ['7.1.0', '7.0.0', '6.1.0', '6.0.0']
61
+ include:
62
+ - { ruby-version: '3.3', rails-version: '7.1.0' }
63
+ - { ruby-version: '3.3', rails-version: '7.0.0' }
64
+ - { ruby-version: '3.3', rails-version: '6.1.0' }
65
+ - { ruby-version: '3.3', rails-version: '6.0.0' }
66
+ - { ruby-version: '3.2', rails-version: '7.1.0' }
67
+ - { ruby-version: '3.2', rails-version: '7.0.0' }
68
+ - { ruby-version: '3.2', rails-version: '6.1.0' }
69
+ - { ruby-version: '3.2', rails-version: '6.0.0' }
70
+ - { ruby-version: '3.1', rails-version: '7.1.0' }
71
+ - { ruby-version: '3.1', rails-version: '7.0.0' }
72
+ - { ruby-version: '3.1', rails-version: '6.1.0' }
73
+ - { ruby-version: '3.1', rails-version: '6.0.0' }
74
+ - { ruby-version: '3.0', rails-version: '7.1.0' }
75
+ - { ruby-version: '3.0', rails-version: '7.0.0' }
76
+ - { ruby-version: '3.0', rails-version: '6.1.0' }
77
+ - { ruby-version: '3.0', rails-version: '6.0.0' }
78
+ - { ruby-version: '2.7', rails-version: '7.1.0' }
79
+ - { ruby-version: '2.7', rails-version: '7.0.0' }
80
+ - { ruby-version: '2.7', rails-version: '6.1.0' }
81
+ - { ruby-version: '2.7', rails-version: '6.0.0' }
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - name: Set up Ruby ${{ matrix.ruby-version }}
85
+ uses: ruby/setup-ruby@v1
86
+ with:
87
+ ruby-version: ${{ matrix.ruby-version }}
88
+ - uses: actions/cache@v3
89
+ with:
90
+ path: vendor/bundle
91
+ key: bundle-use-ruby-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
92
+ restore-keys: |
93
+ bundle-use-ruby-${{ matrix.ruby-version }}-
94
+ - name: Install dependencies
95
+ env:
96
+ RAILS_VERSION: ${{ matrix.rails-version }}
97
+ run: bundle install
98
+ - name: Run tests
99
+ run: bundle exec rake spec
100
+ i18n-test:
101
+ runs-on: ubuntu-22.04
102
+ strategy:
103
+ fail-fast: false
104
+ matrix:
105
+ ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
106
+ i18n-version: ['1.14.0']
107
+ include:
108
+ - { ruby-version: '3.3', i18n-version: '1.14.0' }
109
+ - { ruby-version: '3.2', i18n-version: '1.14.0' }
110
+ - { ruby-version: '3.1', i18n-version: '1.14.0' }
111
+ - { ruby-version: '3.0', i18n-version: '1.14.0' }
112
+ - { ruby-version: '2.7', i18n-version: '1.14.0' }
113
+ steps:
114
+ - uses: actions/checkout@v4
115
+ - name: Set up Ruby ${{ matrix.ruby-version }}
116
+ uses: ruby/setup-ruby@v1
117
+ with:
118
+ ruby-version: ${{ matrix.ruby-version }}
119
+ - uses: actions/cache@v3
120
+ with:
121
+ path: vendor/bundle
122
+ key: bundle-use-ruby-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
123
+ restore-keys: |
124
+ bundle-use-ruby-${{ matrix.ruby-version }}-
125
+ - name: Install dependencies
126
+ env:
127
+ I18N_VERSION: ${{ matrix.i18n-version }}
128
+ run: bundle install
129
+ - name: Run tests
130
+ run: bundle exec rake spec
131
+
@@ -18,13 +18,13 @@ module Rack
18
18
 
19
19
  status, headers, response = @app.call(env)
20
20
 
21
- headers = HeaderHash.new(headers)
21
+ read_headers = defined?(Rack::Headers) ? Rack::Headers.new(headers) : HeaderHash.new(headers)
22
22
 
23
23
  headers['X-Rack-Dev-Mark-Env'] = CGI.escape Rack::DevMark.env
24
24
 
25
25
  redirect = 300 <= status.to_i && status.to_i < 400
26
- if !redirect && !Rack::DevMark.tmp_disabled && headers['Content-Type'].to_s =~ %r{\btext/html\b}i
27
- new_body = ''
26
+ if !redirect && !Rack::DevMark.tmp_disabled && read_headers['Content-Type'].to_s =~ %r{\btext/html\b}i
27
+ new_body = +''
28
28
  response.each do |b|
29
29
  begin
30
30
  new_body << insert_dev_marks(b)
@@ -33,7 +33,7 @@ module Rack
33
33
  end
34
34
  end
35
35
  response.close if response.respond_to?(:close)
36
- headers['Content-Length'] &&= new_body.bytesize.to_s
36
+ headers['Content-Length'] = new_body.bytesize.to_s if read_headers['Content-Length']
37
37
  response = [new_body]
38
38
  end
39
39
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module DevMark
3
- VERSION = '0.7.11'.freeze
3
+ VERSION = '0.8.1'.freeze
4
4
  end
5
5
  end
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.add_development_dependency "rake"
24
24
  gem.add_development_dependency "rspec", ">= 3.0"
25
- gem.add_development_dependency "coveralls"
25
+ gem.add_development_dependency "simplecov"
26
26
  end
@@ -33,7 +33,7 @@ describe Rack::DevMark do
33
33
  end
34
34
  describe "::revision" do
35
35
  after do
36
- ::File.delete('REVISION') if ::File.exists?('REVISION')
36
+ ::File.delete('REVISION') if ::File.exist?('REVISION')
37
37
  subject.instance_variable_set("@revision", nil)
38
38
  end
39
39
  it "returns revision" do
@@ -55,7 +55,7 @@ describe Rack::DevMark do
55
55
  describe "::timestamp" do
56
56
  let(:time) { Time.new(2000, 1, 2) }
57
57
  after do
58
- ::File.delete('REVISION') if ::File.exists?('REVISION')
58
+ ::File.delete('REVISION') if ::File.exist?('REVISION')
59
59
  subject.instance_variable_set("@timestamp", nil)
60
60
  end
61
61
  it "returns timestamp" do
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'simplecov'
3
- require 'coveralls'
4
- Coveralls.wear!
5
3
 
6
4
  resultset_path = SimpleCov::ResultMerger.resultset_path
7
- FileUtils.rm resultset_path if File.exists? resultset_path
5
+ FileUtils.rm resultset_path if File.exist? resultset_path
8
6
  SimpleCov.use_merging true
9
7
  SimpleCov.at_exit do
10
8
  SimpleCov.command_name "fork-#{$$}"
@@ -12,7 +10,6 @@ SimpleCov.at_exit do
12
10
  end
13
11
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
14
12
  SimpleCov::Formatter::HTMLFormatter,
15
- Coveralls::SimpleCov::Formatter
16
13
  ]
17
14
  SimpleCov.start do
18
15
  add_filter 'spec/'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dev-mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2025-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -59,7 +59,7 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: coveralls
62
+ name: simplecov
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
@@ -80,8 +80,8 @@ extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
82
  - ".github/workflows/codeql.yml"
83
+ - ".github/workflows/test.yml"
83
84
  - ".gitignore"
84
- - ".travis.yml"
85
85
  - COMPATIBILITY.md
86
86
  - Gemfile
87
87
  - LICENSE
@@ -132,7 +132,7 @@ homepage: https://github.com/dtaniwaki/rack-dev-mark
132
132
  licenses:
133
133
  - MIT
134
134
  metadata: {}
135
- post_install_message:
135
+ post_install_message:
136
136
  rdoc_options: []
137
137
  require_paths:
138
138
  - lib
@@ -147,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.1.6
151
- signing_key:
150
+ rubygems_version: 3.5.16
151
+ signing_key:
152
152
  specification_version: 4
153
153
  summary: Differentiate development environment from production
154
154
  test_files:
data/.travis.yml DELETED
@@ -1,48 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.3
5
- - 2.4
6
- - 2.5
7
- - 2.6
8
-
9
- install:
10
- - "gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true"
11
- - "gem install bundler -v '< 2'"
12
- - "bundle install --jobs=3 --retry=3"
13
-
14
- env:
15
- -
16
- - RACK_VERSION=1.3.0
17
- - RACK_VERSION=1.4.0
18
- - RACK_VERSION=1.5.0
19
- - RACK_VERSION=1.6.0
20
- - RACK_VERSION=2.0.0
21
- - RAILS_VERSION=4.0.0
22
- - RAILS_VERSION=4.1.0
23
- - RAILS_VERSION=4.2.0
24
- - RAILS_VERSION=5.0.0
25
- - RAILS_VERSION=5.1.0
26
- - RAILS_VERSION=5.2.0
27
- - I18N_VERSION=0.6.0
28
-
29
- matrix:
30
- allow_failures:
31
- - rvm: 2.4
32
- env: RAILS_VERSION=4.0.0
33
- - rvm: 2.4
34
- env: RAILS_VERSION=4.1.0
35
- - rvm: 2.5
36
- env: RAILS_VERSION=4.0.0
37
- - rvm: 2.5
38
- env: RAILS_VERSION=4.1.0
39
- - rvm: 2.6
40
- env: RAILS_VERSION=4.0.0
41
- - rvm: 2.6
42
- env: RAILS_VERSION=4.1.0
43
-
44
- script: "bundle exec rake spec"
45
-
46
- branches:
47
- only:
48
- - master