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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fee28b7e4a5dd221a56dc23db922173062e06b22888b2daf3a8bc05136525e2
4
- data.tar.gz: '02408d7f687ea75db42814178c9ae168595f43d16e287ce30e558baa0abb5d9a'
3
+ metadata.gz: b76fbfd9c4d1a56c6b2498e1e5470e5ac43bd06fc68ef5e944ed2f2c5b0ab81c
4
+ data.tar.gz: '0808d1e25b27429f521002f7e28d41c254dcee31e2ea4b76a639f1bbd61d15b0'
5
5
  SHA512:
6
- metadata.gz: c6d913ec8bb296a0ad792b75dd4460a65cb94bf07a47d02db3f0db5c4ec5070de63033a8c4333eda08dfa1655c743f67bc615eef89ee5804d08502df75524ddb
7
- data.tar.gz: 10fd0665002537622e0229dd0c366cd3ff32ad6234f18a0da80a8fda4cfc64c296d106346193e3ec1ef4aad1c0bd66eff17373a0a402dcffa33842a19d459ec5
6
+ metadata.gz: 950ab97e849c11e69181093a0dd110f51fcafbc22ab869dbff07dd1ce79f69cb78dfbd9ffe5311b0b1d34fbd770f531042d5a646f349ab387b00b44fe6c0cc97
7
+ data.tar.gz: 23d920c50159706d18f20c958abb98f59e320b841a7ab00cde022c57ef8fb9b4b9e14486965ae55f538d0820c378f4c0b41c3bc30a37d8eee5250101ab5cee5a
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: benpickles
@@ -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
@@ -22,7 +22,7 @@ jobs:
22
22
  with:
23
23
  bundler-cache: true
24
24
  ruby-version: ${{ matrix.ruby }}
25
- - run: bundle exec rspec --exclude-pattern "spec/**/*sinatra*"
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
@@ -7,7 +7,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
7
7
  # Specify your gem's dependencies in parklife.gemspec
8
8
  gemspec
9
9
 
10
- gem 'appraisal'
11
10
  gem 'bundler'
12
11
  gem 'rake'
13
12
  gem 'rspec'
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 push it to GitHub Pages by passing `--github-pages`.
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 with Rails
21
+ ## How to use Parklife
22
22
 
23
- Parklife is configured with a file called `Parkfile` in the root of your project, here's an example `Parkfile` for an imaginary Rails app:
23
+ > [!NOTE]
24
+ > See the [`parklife-rails` repository](https://github.com/benpickles/parklife-rails) for how to use Parklife with Rails.
24
25
 
25
- ```ruby
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
- # Load the Rails application, this gives you full access to the application's
31
- # environment from this file - using models for example.
32
- require_relative 'config/environment'
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 feed_path(format: :atom)
40
- get sitemap_path(format: :xml)
37
+ get '/feed.atom'
38
+ get '/sitemap.xml'
41
39
 
42
40
  # A couple more hidden pages.
43
- get easter_egg_path, crawl: true
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, see the [Rails example's full build script](examples/rails/bin/static-build) for how you might do this.
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 [Rails](examples/rails/Parkfile), [Rack](examples/rack/Parkfile) and [Sinatra](examples/sinatra/Parkfile) working examples within this repository.
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/rails', defined?(::Parklife::Railtie) ? 'enabled' : '-'],
29
- ['parklife/sinatra', defined?(::Parklife::Sinatra) ? 'enabled' : '-'],
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
- require 'parklife/rails'
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/sinatra'
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 etc.
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parklife
4
- VERSION = '0.8.0.beta1'
4
+ VERSION = '0.8.1'
5
5
  end
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.0.beta1
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.7.1
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
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise 'sinatra_3.x' do
4
- gem 'sinatra', '~> 3.0'
5
- end
6
-
7
- appraise 'sinatra_4.0' do
8
- gem 'sinatra', '~> 4.0.0'
9
- end
10
-
11
- appraise 'sinatra_4.1' do
12
- gem 'sinatra', '~> 4.1.0'
13
- end
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "bundler"
7
- gem "rake"
8
- gem "rspec"
9
- gem "rubocop"
10
- gem "sinatra", "~> 3.0"
11
-
12
- gemspec path: "../"
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "bundler"
7
- gem "rake"
8
- gem "rspec"
9
- gem "rubocop"
10
- gem "sinatra", "~> 4.0.0"
11
-
12
- gemspec path: "../"
@@ -1,12 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "bundler"
7
- gem "rake"
8
- gem "rspec"
9
- gem "rubocop"
10
- gem "sinatra", "~> 4.1.0"
11
-
12
- gemspec path: "../"
@@ -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