rack-capture 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +18 -0
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +7 -3
- data/Gemfile.lock +24 -1
- data/README.md +2 -0
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/lib/rack/capture.rb +4 -4
- data/lib/rack/capture/version.rb +3 -1
- data/rack-capture.gemspec +4 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c316008c4924a7b1c9244f77e9aecc7513202c459662611f2add7d073e081e82
|
4
|
+
data.tar.gz: 977cb2570077e82539f2f9bf7172ef529f637e50b433f0aff10fbd44a05e5add
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5212f508e3b12511041a8ad1b2aa6d3cc67982dbe2ff5c62ea4fcfaa1102387deba1904b052ecaf7a71ec3cbae9a19667e057771ed0da2374c422ae227397f3
|
7
|
+
data.tar.gz: 7005d1365496e88053488b1900310176c53808a2e8948cb24cc6417885d5ffa7afc724b56300ece5c777b135e8efce26789189be99dfeb746e9b066c654ac61e
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
runs-on: ubuntu-18.04
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: '2.7.2'
|
16
|
+
- run: bundle install --jobs=$(($(nproc) - 1)) --retry=3
|
17
|
+
- run: bundle exec rubocop --color --parallel
|
18
|
+
- run: bundle exec rspec --force-color
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
##
|
8
|
+
## Unreleased
|
9
|
+
|
10
|
+
## 0.2.0 - 2020-11-06
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Change least require ruby version from 2.3.0 to 2.4.0.
|
9
15
|
|
10
16
|
## 0.1.2 - 2020-10-28
|
11
17
|
|
data/Gemfile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in rack-capture.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
|
-
gem
|
7
|
-
gem
|
8
|
+
gem 'fakefs'
|
9
|
+
gem 'rake', '~> 12.0'
|
10
|
+
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'rubocop'
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-capture (0.
|
4
|
+
rack-capture (0.2.0)
|
5
5
|
rack
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
ast (2.4.1)
|
10
11
|
diff-lcs (1.4.4)
|
12
|
+
fakefs (1.2.2)
|
13
|
+
parallel (1.19.2)
|
14
|
+
parser (2.7.2.0)
|
15
|
+
ast (~> 2.4.1)
|
11
16
|
rack (2.2.3)
|
17
|
+
rainbow (3.0.0)
|
12
18
|
rake (12.3.3)
|
19
|
+
regexp_parser (1.8.2)
|
20
|
+
rexml (3.2.4)
|
13
21
|
rspec (3.9.0)
|
14
22
|
rspec-core (~> 3.9.0)
|
15
23
|
rspec-expectations (~> 3.9.0)
|
@@ -23,14 +31,29 @@ GEM
|
|
23
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
32
|
rspec-support (~> 3.9.0)
|
25
33
|
rspec-support (3.9.4)
|
34
|
+
rubocop (1.2.0)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 2.7.1.5)
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
38
|
+
regexp_parser (>= 1.8)
|
39
|
+
rexml
|
40
|
+
rubocop-ast (>= 1.0.1)
|
41
|
+
ruby-progressbar (~> 1.7)
|
42
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
43
|
+
rubocop-ast (1.1.1)
|
44
|
+
parser (>= 2.7.1.5)
|
45
|
+
ruby-progressbar (1.10.1)
|
46
|
+
unicode-display_width (1.7.0)
|
26
47
|
|
27
48
|
PLATFORMS
|
28
49
|
ruby
|
29
50
|
|
30
51
|
DEPENDENCIES
|
52
|
+
fakefs
|
31
53
|
rack-capture!
|
32
54
|
rake (~> 12.0)
|
33
55
|
rspec (~> 3.0)
|
56
|
+
rubocop
|
34
57
|
|
35
58
|
BUNDLED WITH
|
36
59
|
2.1.4
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Rack::Capture
|
2
2
|
|
3
3
|
[![](https://badge.fury.io/rb/rack-capture.svg)](https://rubygems.org/gems/rack-capture)
|
4
|
+
[![test](https://github.com/r7kamura/rack-capture/workflows/test/badge.svg)](https://github.com/r7kamura/rack-capture/actions?query=workflow%3Atest)
|
4
5
|
|
5
6
|
Generate static files from Rack application and URLs.
|
6
7
|
|
@@ -40,6 +41,7 @@ require 'rack/capture'
|
|
40
41
|
app: my_rack_application,
|
41
42
|
url: url
|
42
43
|
)
|
44
|
+
end
|
43
45
|
```
|
44
46
|
|
45
47
|
## Development
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rack/capture'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rack/capture"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/lib/rack/capture.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pathname'
|
2
4
|
require 'rack'
|
3
5
|
require 'rack/capture/version'
|
@@ -42,9 +44,7 @@ module Rack
|
|
42
44
|
def calculate_destination(response:)
|
43
45
|
destination = ::Pathname.new("dist#{uri.path}")
|
44
46
|
if response.content_type&.include?('text/html')
|
45
|
-
if uri.path == '/'
|
46
|
-
destination += 'index'
|
47
|
-
end
|
47
|
+
destination += 'index' if uri.path == '/'
|
48
48
|
destination = destination.sub_ext('.html')
|
49
49
|
end
|
50
50
|
destination
|
@@ -65,7 +65,7 @@ module Rack
|
|
65
65
|
'rack.url_scheme' => rack_url_scheme,
|
66
66
|
'REQUEST_METHOD' => 'GET',
|
67
67
|
'SCRIPT_NAME' => '',
|
68
|
-
'SERVER_NAME' => uri.host
|
68
|
+
'SERVER_NAME' => uri.host
|
69
69
|
}
|
70
70
|
end
|
71
71
|
|
data/lib/rack/capture/version.rb
CHANGED
data/rack-capture.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/rack/capture/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
@@ -9,13 +11,13 @@ Gem::Specification.new do |spec|
|
|
9
11
|
spec.summary = 'Generate static files from Rack application and URLs.'
|
10
12
|
spec.homepage = 'https://github.com/r7kamura/rack-capture'
|
11
13
|
spec.license = 'MIT'
|
12
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
|
13
15
|
|
14
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
15
17
|
spec.metadata['source_code_uri'] = spec.homepage
|
16
18
|
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
17
19
|
|
18
|
-
spec.files
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
22
|
end
|
21
23
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-capture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -31,8 +31,10 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".github/workflows/test.yml"
|
34
35
|
- ".gitignore"
|
35
36
|
- ".rspec"
|
37
|
+
- ".rubocop.yml"
|
36
38
|
- ".travis.yml"
|
37
39
|
- CHANGELOG.md
|
38
40
|
- Gemfile
|
@@ -60,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
62
|
requirements:
|
61
63
|
- - ">="
|
62
64
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
65
|
+
version: 2.4.0
|
64
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
67
|
requirements:
|
66
68
|
- - ">="
|