rackula 1.1.0 → 1.2.0
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 +4 -4
- data/lib/rackula/command/generate.rb +11 -10
- data/lib/rackula/version.rb +1 -1
- metadata +15 -23
- data/.editorconfig +0 -6
- data/.github/workflows/development.yml +0 -59
- data/.gitignore +0 -12
- data/.rspec +0 -4
- data/Gemfile +0 -9
- data/README.md +0 -62
- data/rackula.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a65b358d0a9a1ac24b53cdaee0266caf8aa001e2be84adb6e341e14be0368b55
|
4
|
+
data.tar.gz: 733ee30905600dc2a1f705bfe1c58fbbc4c3c271743d269a2328765a42714fc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b29df5d58b1b68f899b5b08d6286d637431053d5e4821abb5e3154a0835459ad993f7cad057c2e989d60c47be1a0b075b2310532f80e4a98b0e2c75010762ae
|
7
|
+
data.tar.gz: 88a9686c865cf3697edf7938268fdd94e9abca35c9295c7880cc1e2365c9b6959f674392d5ab85551d405178591f19f7bed62d6c439168669148b2325cf9f19e
|
@@ -21,6 +21,7 @@
|
|
21
21
|
require 'samovar'
|
22
22
|
|
23
23
|
require 'pathname'
|
24
|
+
require 'fileutils'
|
24
25
|
require 'rack'
|
25
26
|
|
26
27
|
require 'falcon/server'
|
@@ -68,7 +69,9 @@ module Rackula
|
|
68
69
|
end
|
69
70
|
|
70
71
|
# Generate HTML pages:
|
71
|
-
system("wget", "--mirror", "--recursive", "--continue", "--convert-links", "--adjust-extension", "--no-host-directories", "--directory-prefix", output_path.to_s, "http://localhost:#{port}")
|
72
|
+
unless system("wget", "--mirror", "--recursive", "--continue", "--convert-links", "--adjust-extension", "--no-host-directories", "--directory-prefix", output_path.to_s, "http://localhost:#{port}")
|
73
|
+
raise "The wget command failed!"
|
74
|
+
end
|
72
75
|
end
|
73
76
|
|
74
77
|
def serve(endpoint, root)
|
@@ -96,7 +99,7 @@ module Rackula
|
|
96
99
|
def run(address, root)
|
97
100
|
endpoint = Async::HTTP::Endpoint.parse("http://localhost", port: address.ip_port, reuse_port: true)
|
98
101
|
|
99
|
-
|
102
|
+
Console.logger.info(self) {"Setting up container to serve site on port #{address.ip_port}..."}
|
100
103
|
container = serve(endpoint, root)
|
101
104
|
|
102
105
|
# puts "Copy and fetch site to static..."
|
@@ -108,14 +111,12 @@ module Rackula
|
|
108
111
|
def call
|
109
112
|
Variant.force!('static')
|
110
113
|
|
111
|
-
Async
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
run(socket.local_address, Pathname.new(parent.root))
|
118
|
-
end
|
114
|
+
endpoint = Async::IO::Endpoint.tcp("localhost", 0, reuse_port: true)
|
115
|
+
|
116
|
+
# We bind to a socket to generate a temporary port:
|
117
|
+
socket = Sync{endpoint.each.first.bind}
|
118
|
+
|
119
|
+
run(socket.local_address, Pathname.new(parent.root))
|
119
120
|
end
|
120
121
|
end
|
121
122
|
end
|
data/lib/rackula/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rackula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: falcon
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0.34'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0.34'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: samovar
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: variant
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bake-bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: covered
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -108,31 +108,23 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
|
-
- samuel.williams@oriontransfer.co.nz
|
114
113
|
executables:
|
115
114
|
- rackula
|
116
115
|
extensions: []
|
117
116
|
extra_rdoc_files: []
|
118
117
|
files:
|
119
|
-
- ".editorconfig"
|
120
|
-
- ".github/workflows/development.yml"
|
121
|
-
- ".gitignore"
|
122
|
-
- ".rspec"
|
123
|
-
- Gemfile
|
124
|
-
- README.md
|
125
118
|
- bin/rackula
|
126
119
|
- lib/rackula.rb
|
127
120
|
- lib/rackula/command.rb
|
128
121
|
- lib/rackula/command/generate.rb
|
129
122
|
- lib/rackula/version.rb
|
130
|
-
- rackula.gemspec
|
131
123
|
homepage: https://github.com/socketry/rackula
|
132
124
|
licenses:
|
133
125
|
- MIT
|
134
126
|
metadata: {}
|
135
|
-
post_install_message:
|
127
|
+
post_install_message:
|
136
128
|
rdoc_options: []
|
137
129
|
require_paths:
|
138
130
|
- lib
|
@@ -147,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
139
|
- !ruby/object:Gem::Version
|
148
140
|
version: '0'
|
149
141
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
142
|
+
rubygems_version: 3.2.32
|
143
|
+
signing_key:
|
152
144
|
specification_version: 4
|
153
145
|
summary: Generate a static site from any rackup compatible application.
|
154
146
|
test_files: []
|
data/.editorconfig
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
name: Development
|
2
|
-
|
3
|
-
on: [push, pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
test:
|
7
|
-
runs-on: ${{matrix.os}}-latest
|
8
|
-
continue-on-error: ${{matrix.experimental}}
|
9
|
-
|
10
|
-
strategy:
|
11
|
-
matrix:
|
12
|
-
os:
|
13
|
-
- ubuntu
|
14
|
-
- macos
|
15
|
-
|
16
|
-
ruby:
|
17
|
-
- 2.5
|
18
|
-
- 2.6
|
19
|
-
- 2.7
|
20
|
-
|
21
|
-
experimental: [false]
|
22
|
-
env: [""]
|
23
|
-
|
24
|
-
include:
|
25
|
-
- os: ubuntu
|
26
|
-
ruby: truffleruby
|
27
|
-
experimental: true
|
28
|
-
env: JRUBY_OPTS="--debug -X+O"
|
29
|
-
- os: ubuntu
|
30
|
-
ruby: jruby
|
31
|
-
experimental: true
|
32
|
-
- os: ubuntu
|
33
|
-
ruby: head
|
34
|
-
experimental: true
|
35
|
-
- os: ubuntu
|
36
|
-
ruby: 2.6
|
37
|
-
experimental: false
|
38
|
-
env: COVERAGE=PartialSummary,Coveralls
|
39
|
-
|
40
|
-
steps:
|
41
|
-
- uses: actions/checkout@v1
|
42
|
-
- uses: ruby/setup-ruby@v1
|
43
|
-
with:
|
44
|
-
ruby-version: ${{matrix.ruby}}
|
45
|
-
|
46
|
-
- name: Install dependencies
|
47
|
-
run: ${{matrix.env}} bundle install
|
48
|
-
|
49
|
-
- name: Installing packages (ubuntu)
|
50
|
-
if: matrix.os == 'ubuntu'
|
51
|
-
run: sudo apt-get install wget
|
52
|
-
|
53
|
-
- name: Installing packages (macos)
|
54
|
-
if: matrix.os == 'macos'
|
55
|
-
run: brew install wget
|
56
|
-
|
57
|
-
- name: Run tests
|
58
|
-
timeout-minutes: 5
|
59
|
-
run: ${{matrix.env}} bundle exec rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
# Rackula
|
2
|
-
|
3
|
-
Rackula will immortalize your rackup web app by generating a static copy. It can be used to generate a static site from any rack-compatible middleware (e.g. rails, sinatra, utopia).
|
4
|
-
|
5
|
-
[](https://travis-ci.com/socketry/rackula)
|
6
|
-
[](https://coveralls.io/r/socketry/rackula)
|
7
|
-
|
8
|
-
## Installation
|
9
|
-
|
10
|
-
Install the gem:
|
11
|
-
|
12
|
-
$ gem install rackula
|
13
|
-
|
14
|
-
Ensure that `wget` is installed and available.
|
15
|
-
|
16
|
-
## Usage
|
17
|
-
|
18
|
-
### Rack Applications
|
19
|
-
|
20
|
-
In the root directory, simply run `rackula`. It will generate a static site in `static`. For more details about how to change the default behavior, run `rackula --help`.
|
21
|
-
|
22
|
-
### Rails Applications
|
23
|
-
|
24
|
-
Add a `config.ru` file to your rails app and follow the above instructions.
|
25
|
-
|
26
|
-
```ruby
|
27
|
-
# config.ru for rails app
|
28
|
-
require_relative 'config/environment'
|
29
|
-
run Rails.application
|
30
|
-
```
|
31
|
-
|
32
|
-
## Contributing
|
33
|
-
|
34
|
-
1. Fork it
|
35
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
37
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
38
|
-
5. Create new Pull Request
|
39
|
-
|
40
|
-
## License
|
41
|
-
|
42
|
-
Released under the MIT license.
|
43
|
-
|
44
|
-
Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
45
|
-
|
46
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
47
|
-
of this software and associated documentation files (the "Software"), to deal
|
48
|
-
in the Software without restriction, including without limitation the rights
|
49
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
50
|
-
copies of the Software, and to permit persons to whom the Software is
|
51
|
-
furnished to do so, subject to the following conditions:
|
52
|
-
|
53
|
-
The above copyright notice and this permission notice shall be included in
|
54
|
-
all copies or substantial portions of the Software.
|
55
|
-
|
56
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
57
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
58
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
59
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
60
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
61
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
62
|
-
THE SOFTWARE.
|
data/rackula.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative "lib/rackula/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "rackula"
|
6
|
-
spec.version = Rackula::VERSION
|
7
|
-
spec.authors = ["Samuel Williams"]
|
8
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
9
|
-
|
10
|
-
spec.summary = "Generate a static site from any rackup compatible application."
|
11
|
-
spec.homepage = "https://github.com/socketry/rackula"
|
12
|
-
spec.license = "MIT"
|
13
|
-
|
14
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
15
|
-
f.match(%r{^(test|spec|features)/})
|
16
|
-
end
|
17
|
-
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f)}
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_dependency "samovar", "~> 2.1"
|
22
|
-
spec.add_dependency "falcon", "~> 0.34"
|
23
|
-
|
24
|
-
spec.add_dependency "variant"
|
25
|
-
|
26
|
-
spec.add_development_dependency "covered"
|
27
|
-
spec.add_development_dependency "bundler"
|
28
|
-
spec.add_development_dependency "bake-bundler"
|
29
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
-
end
|