parklife 0.8.0.beta1 → 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 +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/examples.yml +0 -15
- data/.github/workflows/tests.yml +1 -28
- data/CHANGELOG.md +8 -0
- data/Gemfile +0 -1
- data/README.md +14 -16
- data/lib/parklife/cli.rb +2 -2
- data/lib/parklife/templates/Parkfile.erb +3 -2
- data/lib/parklife/templates/static_build.erb +7 -1
- data/lib/parklife/version.rb +1 -1
- metadata +3 -7
- data/Appraisals +0 -13
- data/gemfiles/sinatra_3.x.gemfile +0 -12
- data/gemfiles/sinatra_4.0.gemfile +0 -12
- data/gemfiles/sinatra_4.1.gemfile +0 -12
- data/lib/parklife/sinatra.rb +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz: '
|
|
3
|
+
metadata.gz: b76fbfd9c4d1a56c6b2498e1e5470e5ac43bd06fc68ef5e944ed2f2c5b0ab81c
|
|
4
|
+
data.tar.gz: '0808d1e25b27429f521002f7e28d41c254dcee31e2ea4b76a639f1bbd61d15b0'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 950ab97e849c11e69181093a0dd110f51fcafbc22ab869dbff07dd1ce79f69cb78dfbd9ffe5311b0b1d34fbd770f531042d5a646f349ab387b00b44fe6c0cc97
|
|
7
|
+
data.tar.gz: 23d920c50159706d18f20c958abb98f59e320b841a7ab00cde022c57ef8fb9b4b9e14486965ae55f538d0820c378f4c0b41c3bc30a37d8eee5250101ab5cee5a
|
data/.github/FUNDING.yml
ADDED
|
@@ -32,18 +32,3 @@ jobs:
|
|
|
32
32
|
working-directory: examples/roda
|
|
33
33
|
- run: test -f build/index.html
|
|
34
34
|
working-directory: examples/roda
|
|
35
|
-
|
|
36
|
-
sinatra:
|
|
37
|
-
runs-on: ubuntu-latest
|
|
38
|
-
name: Sinatra example
|
|
39
|
-
steps:
|
|
40
|
-
- uses: actions/checkout@v3
|
|
41
|
-
- uses: ruby/setup-ruby@v1
|
|
42
|
-
with:
|
|
43
|
-
bundler-cache: true
|
|
44
|
-
ruby-version: '3.4'
|
|
45
|
-
working-directory: examples/sinatra
|
|
46
|
-
- run: bin/static-build
|
|
47
|
-
working-directory: examples/sinatra
|
|
48
|
-
- run: test -f build/index.html
|
|
49
|
-
working-directory: examples/sinatra
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
with:
|
|
23
23
|
bundler-cache: true
|
|
24
24
|
ruby-version: ${{ matrix.ruby }}
|
|
25
|
-
- run: bundle exec rspec
|
|
25
|
+
- run: bundle exec rspec
|
|
26
26
|
|
|
27
27
|
rubocop:
|
|
28
28
|
runs-on: ubuntu-latest
|
|
@@ -34,30 +34,3 @@ jobs:
|
|
|
34
34
|
bundler-cache: true
|
|
35
35
|
ruby-version: '3.2'
|
|
36
36
|
- run: bundle exec rubocop
|
|
37
|
-
|
|
38
|
-
sinatra:
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
strategy:
|
|
41
|
-
fail-fast: false
|
|
42
|
-
matrix:
|
|
43
|
-
ruby:
|
|
44
|
-
- '2.7'
|
|
45
|
-
- '3.0'
|
|
46
|
-
- '3.1'
|
|
47
|
-
- '3.2'
|
|
48
|
-
- '3.3'
|
|
49
|
-
- '3.4'
|
|
50
|
-
sinatra:
|
|
51
|
-
- '3.x'
|
|
52
|
-
- '4.0'
|
|
53
|
-
- '4.1'
|
|
54
|
-
env:
|
|
55
|
-
BUNDLE_GEMFILE: gemfiles/sinatra_${{ matrix.sinatra }}.gemfile
|
|
56
|
-
name: Ruby ${{ matrix.ruby }} / Sinatra ${{ matrix.sinatra }}
|
|
57
|
-
steps:
|
|
58
|
-
- uses: actions/checkout@v4
|
|
59
|
-
- uses: ruby/setup-ruby@v1
|
|
60
|
-
with:
|
|
61
|
-
bundler-cache: true
|
|
62
|
-
ruby-version: ${{ matrix.ruby }}
|
|
63
|
-
- run: bundle exec rspec --pattern "spec/**/*sinatra*"
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
|
|
3
|
+
## Version 0.8.1 - 2025-12-21
|
|
4
|
+
|
|
5
|
+
- Move out-of-the-box Sinatra integration into a separate [`parklife-sinatra`](https://github.com/benpickles/parklife-sinatra) gem. <https://github.com/benpickles/parklife/pull/133>
|
|
6
|
+
|
|
7
|
+
## Version 0.8.0 - 2025-09-08
|
|
8
|
+
|
|
9
|
+
Note that **Parklife's Rails integration has been moved into a separate gem** with some additional functionality, [see the `parklife-rails` repo for more information](https://github.com/benpickles/parklife-rails).
|
|
10
|
+
|
|
3
11
|
## Version 0.8.0.beta1 - 2025-08-10
|
|
4
12
|
|
|
5
13
|
- Remove out-of-the-box Rails integration in preparation for a separate gem. <https://github.com/benpickles/parklife/pull/131>
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -12,38 +12,36 @@ Add Parklife to your application's Gemfile and run bundle install.
|
|
|
12
12
|
gem 'parklife'
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Now generate a Parkfile configuration file and build script. Include some Rails- or Sinatra-specific settings by passing `--rails` or `--sinatra`, create a GitHub Actions workflow to generate your Parklife build and
|
|
15
|
+
Now generate a Parkfile configuration file and build script. Include some Rails- or Sinatra-specific settings by passing `--rails` or `--sinatra`, create a GitHub Actions workflow to generate your Parklife build and deploy it to GitHub Pages by passing `--github-pages`.
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
$ bundle exec parklife init
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
## How to use Parklife
|
|
21
|
+
## How to use Parklife
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> See the [`parklife-rails` repository](https://github.com/benpickles/parklife-rails) for how to use Parklife with Rails.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
# Load Parklife's Rails-specific integration which, among other things, allows
|
|
27
|
-
# you to use URL helpers within the `routes` block below.
|
|
28
|
-
require 'parklife/rails'
|
|
26
|
+
Parklife is configured with a file called `Parkfile` in the root of your project, here's an example `Parkfile` for an imaginary Rack app:
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
#
|
|
32
|
-
require_relative '
|
|
28
|
+
```ruby
|
|
29
|
+
# Assuming your Rack app lives in ./app.rb:
|
|
30
|
+
require_relative 'app'
|
|
33
31
|
|
|
34
32
|
Parkfile.application.routes do
|
|
35
33
|
# Start from the homepage and crawl all links.
|
|
36
34
|
root crawl: true
|
|
37
35
|
|
|
38
36
|
# Some extra paths that aren't discovered while crawling.
|
|
39
|
-
get
|
|
40
|
-
get
|
|
37
|
+
get '/feed.atom'
|
|
38
|
+
get '/sitemap.xml'
|
|
41
39
|
|
|
42
40
|
# A couple more hidden pages.
|
|
43
|
-
get
|
|
41
|
+
get '/easter_egg', crawl: true
|
|
44
42
|
|
|
45
43
|
# Services typically allow a custom 404 page.
|
|
46
|
-
get '404.html'
|
|
44
|
+
get '/404.html'
|
|
47
45
|
end
|
|
48
46
|
```
|
|
49
47
|
|
|
@@ -76,11 +74,11 @@ build/feed.atom
|
|
|
76
74
|
build/sitemap.xml
|
|
77
75
|
```
|
|
78
76
|
|
|
79
|
-
Parklife doesn't know about assets (images, CSS, etc) so you likely also need to generate those and copy them to the build directory
|
|
77
|
+
Parklife doesn't know about assets (images, CSS, etc) so you likely also need to generate those and copy them to the build directory.
|
|
80
78
|
|
|
81
79
|
## More examples
|
|
82
80
|
|
|
83
|
-
Take a look at the [
|
|
81
|
+
Take a look at the [`parklife-rails` example app](https://github.com/benpickles/parklife-rails/tree/main/example-app), the [`parklife-sinatra` example app](https://github.com/benpickles/parklife-sinatra/tree/main/example-app), and the [Rack](examples/rack/Parkfile) example in this repository.
|
|
84
82
|
|
|
85
83
|
## Configuration
|
|
86
84
|
|
data/lib/parklife/cli.rb
CHANGED
|
@@ -25,8 +25,8 @@ module Parklife
|
|
|
25
25
|
['build_dir', application.config.build_dir],
|
|
26
26
|
['nested_index', application.config.nested_index],
|
|
27
27
|
['on_404', application.config.on_404.inspect],
|
|
28
|
-
['parklife
|
|
29
|
-
['parklife
|
|
28
|
+
['parklife-rails', defined?(::Parklife::Rails) ? 'enabled' : '-'],
|
|
29
|
+
['parklife-sinatra', defined?(::Parklife::Sinatra) ? 'enabled' : '-'],
|
|
30
30
|
['reporter', reporter == $stdout ? '$stdout' : reporter],
|
|
31
31
|
])
|
|
32
32
|
end
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<% if options[:rails] -%>
|
|
2
|
-
|
|
2
|
+
# Load your application, this activates the Parklife/Rails integration and gives
|
|
3
|
+
# you access to route helpers and models in this file.
|
|
3
4
|
require_relative 'config/environment'
|
|
4
5
|
<% else -%>
|
|
5
6
|
<% if options[:sinatra] -%>
|
|
6
|
-
require 'parklife
|
|
7
|
+
require 'parklife-sinatra'
|
|
7
8
|
|
|
8
9
|
<% end -%>
|
|
9
10
|
# Assuming your <%= options[:sinatra] ? 'Sinatra' : 'Rack' %> app lives in ./app.rb:
|
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
set -eu
|
|
4
4
|
|
|
5
5
|
<% if options[:rails] -%>
|
|
6
|
-
# Run the app in production mode to ensure correct asset URLs are generated
|
|
6
|
+
# Run the app in production mode to ensure correct asset URLs are generated.
|
|
7
7
|
export RAILS_ENV=production
|
|
8
|
+
|
|
9
|
+
# Prevent most logs from outputting to stdout during a build.
|
|
10
|
+
export RAILS_LOG_LEVEL=warn
|
|
11
|
+
|
|
12
|
+
# Enable precompiling assets.
|
|
8
13
|
export SECRET_KEY_BASE=dummy
|
|
14
|
+
export SECRET_KEY_BASE_DUMMY=1
|
|
9
15
|
|
|
10
16
|
# If your Rails app uses ActiveRecord then this is a good point to create and
|
|
11
17
|
# seed the database from db/seeds.rb.
|
data/lib/parklife/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parklife
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Pickles
|
|
@@ -58,12 +58,12 @@ executables:
|
|
|
58
58
|
extensions: []
|
|
59
59
|
extra_rdoc_files: []
|
|
60
60
|
files:
|
|
61
|
+
- ".github/FUNDING.yml"
|
|
61
62
|
- ".github/workflows/examples.yml"
|
|
62
63
|
- ".github/workflows/tests.yml"
|
|
63
64
|
- ".gitignore"
|
|
64
65
|
- ".rspec"
|
|
65
66
|
- ".rubocop.yml"
|
|
66
|
-
- Appraisals
|
|
67
67
|
- CHANGELOG.md
|
|
68
68
|
- CODE_OF_CONDUCT.md
|
|
69
69
|
- Gemfile
|
|
@@ -73,9 +73,6 @@ files:
|
|
|
73
73
|
- bin/console
|
|
74
74
|
- bin/setup
|
|
75
75
|
- exe/parklife
|
|
76
|
-
- gemfiles/sinatra_3.x.gemfile
|
|
77
|
-
- gemfiles/sinatra_4.0.gemfile
|
|
78
|
-
- gemfiles/sinatra_4.1.gemfile
|
|
79
76
|
- lib/parklife.rb
|
|
80
77
|
- lib/parklife/application.rb
|
|
81
78
|
- lib/parklife/browser.rb
|
|
@@ -85,7 +82,6 @@ files:
|
|
|
85
82
|
- lib/parklife/errors.rb
|
|
86
83
|
- lib/parklife/route.rb
|
|
87
84
|
- lib/parklife/route_set.rb
|
|
88
|
-
- lib/parklife/sinatra.rb
|
|
89
85
|
- lib/parklife/templates/Parkfile.erb
|
|
90
86
|
- lib/parklife/templates/github_pages.yml
|
|
91
87
|
- lib/parklife/templates/static_build.erb
|
|
@@ -114,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
114
110
|
- !ruby/object:Gem::Version
|
|
115
111
|
version: '0'
|
|
116
112
|
requirements: []
|
|
117
|
-
rubygems_version: 3.
|
|
113
|
+
rubygems_version: 3.6.9
|
|
118
114
|
specification_version: 4
|
|
119
115
|
summary: Convert a Rack app into a static HTML site.
|
|
120
116
|
test_files: []
|
data/Appraisals
DELETED
data/lib/parklife/sinatra.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'sinatra/base'
|
|
4
|
-
|
|
5
|
-
module Parklife
|
|
6
|
-
module Sinatra
|
|
7
|
-
def self.registered(app)
|
|
8
|
-
# Disable Rack::Protection::HostAuthorization middleware so that fetching
|
|
9
|
-
# a page with Parklife works in development. It's safe to do here because
|
|
10
|
-
# it will only be executed when this file is explicitly required in a
|
|
11
|
-
# Parkfile and not in general when the app is running in a web server.
|
|
12
|
-
if app.settings.respond_to?(:host_authorization)
|
|
13
|
-
app.set(:host_authorization, permitted_hosts: [])
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
Sinatra.register Parklife::Sinatra
|