rack-dev-mark 0.7.10 → 0.8.0

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: b4220cd454ef05089e7b946d9f3970ea13321cd7b6fa58ad073134dc33f40bf7
4
- data.tar.gz: 1d8e76c5cc8dc3fb19913b18dc07af51fd1967928ca7959395061e43bd025f4e
3
+ metadata.gz: 006f75b106d3f76a7d590ba99eccba0ff72e7aea23684b02b512dfc073bbed52
4
+ data.tar.gz: bcee7987a7bb0cb49d5ec4ee44ff431ca9bdf7119db300b65d8bd81274422f6b
5
5
  SHA512:
6
- metadata.gz: 5ec1364628c8920cdd3d7bd6f2afb34aff86455105981ab6bf673c0db9128d36ceddc60eaae250223e62ee0ae05f89bffb1759dde616891f8af2baf18321d9d0
7
- data.tar.gz: f408702475afee94a4182d587326b1511630f7f3b58f5f5c5a65bee5c6798ba4afb8ca24bc641942ae1957cc572fd36c6efe49b758af884c900dca877cc8069c
6
+ metadata.gz: 7871101dd8a87910bc642d28cb486ef54d9a9f3b4c33d70446a81c9ac4ad6eca8a7a48015dee6ae98a325f9d6c77367ad6fcd095c24d46798d19ee2e5b4f7ab1
7
+ data.tar.gz: 6edddaec3239997410ca0a3beeca50aca49930d1b00b854a92443a8849178af0a88b9e3d59b5b5a240b3c922486a91380d920af308dfcaa1b4a20aa0fe11c274
@@ -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,12 +18,12 @@ 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
26
+ if !redirect && !Rack::DevMark.tmp_disabled && read_headers['Content-Type'].to_s =~ %r{\btext/html\b}i
27
27
  new_body = ''
28
28
  response.each do |b|
29
29
  begin
@@ -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.10'.freeze
3
+ VERSION = '0.8.0'.freeze
4
4
  end
5
5
  end
@@ -18,9 +18,9 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.required_ruby_version = ['>= 2.3']
20
20
 
21
- gem.add_dependency "rack", ['>= 1.1', '< 2.3']
21
+ gem.add_dependency "rack", ['>= 1.1', '< 4.0']
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.10
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.3'
22
+ version: '4.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.3'
32
+ version: '4.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -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
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