parklife 0.4.0 → 0.5.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/.github/workflows/tests.yml +13 -2
- data/.rubocop.yml +30 -0
- data/CHANGELOG.md +22 -13
- data/Gemfile +7 -0
- data/README.md +9 -3
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/exe/parklife +2 -0
- data/lib/parklife/application.rb +2 -0
- data/lib/parklife/browser.rb +13 -5
- data/lib/parklife/cli.rb +33 -12
- data/lib/parklife/config.rb +2 -0
- data/lib/parklife/crawler.rb +8 -2
- data/lib/parklife/errors.rb +6 -13
- data/lib/parklife/rails.rb +25 -3
- data/lib/parklife/route.rb +2 -0
- data/lib/parklife/route_set.rb +2 -0
- data/lib/parklife/templates/Parkfile.erb +48 -0
- data/lib/parklife/templates/github_pages.yml +48 -0
- data/lib/parklife/templates/static_build.erb +28 -0
- data/lib/parklife/utils.rb +7 -0
- data/lib/parklife/version.rb +3 -1
- data/lib/parklife.rb +2 -0
- data/parklife.gemspec +6 -5
- metadata +8 -106
- data/examples/rack/.gitignore +0 -2
- data/examples/rack/Gemfile +0 -4
- data/examples/rack/Parkfile +0 -21
- data/examples/rails/.gitignore +0 -28
- data/examples/rails/Gemfile +0 -5
- data/examples/rails/Parkfile +0 -6
- data/examples/rails/Rakefile +0 -6
- data/examples/rails/app/assets/config/manifest.js +0 -2
- data/examples/rails/app/assets/images/.keep +0 -0
- data/examples/rails/app/assets/stylesheets/application.css +0 -15
- data/examples/rails/app/assets/stylesheets/global.css +0 -4
- data/examples/rails/app/controllers/application_controller.rb +0 -2
- data/examples/rails/app/controllers/posts_controller.rb +0 -9
- data/examples/rails/app/helpers/application_helper.rb +0 -2
- data/examples/rails/app/jobs/application_job.rb +0 -2
- data/examples/rails/app/models/application_record.rb +0 -3
- data/examples/rails/app/models/post.rb +0 -5
- data/examples/rails/app/views/layouts/application.html.erb +0 -14
- data/examples/rails/app/views/posts/index.html.erb +0 -7
- data/examples/rails/app/views/posts/show.html.erb +0 -3
- data/examples/rails/bin/bundle +0 -3
- data/examples/rails/bin/rails +0 -4
- data/examples/rails/bin/rake +0 -4
- data/examples/rails/bin/setup +0 -33
- data/examples/rails/bin/update +0 -28
- data/examples/rails/config/application.rb +0 -35
- data/examples/rails/config/boot.rb +0 -3
- data/examples/rails/config/database.yml +0 -25
- data/examples/rails/config/environment.rb +0 -5
- data/examples/rails/config/environments/development.rb +0 -53
- data/examples/rails/config/environments/production.rb +0 -79
- data/examples/rails/config/environments/test.rb +0 -36
- data/examples/rails/config/initializers/application_controller_renderer.rb +0 -8
- data/examples/rails/config/initializers/assets.rb +0 -12
- data/examples/rails/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/rails/config/initializers/content_security_policy.rb +0 -25
- data/examples/rails/config/initializers/cookies_serializer.rb +0 -5
- data/examples/rails/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/rails/config/initializers/inflections.rb +0 -16
- data/examples/rails/config/initializers/mime_types.rb +0 -4
- data/examples/rails/config/initializers/wrap_parameters.rb +0 -14
- data/examples/rails/config/locales/en.yml +0 -33
- data/examples/rails/config/routes.rb +0 -5
- data/examples/rails/config.ru +0 -5
- data/examples/rails/data/1-hello-from-parklife.txt +0 -3
- data/examples/rails/data/2-hello-again.txt +0 -3
- data/examples/rails/data/3-magic-number.txt +0 -3
- data/examples/rails/db/migrate/20190507172823_create_posts.rb +0 -11
- data/examples/rails/db/schema.rb +0 -24
- data/examples/rails/db/seeds.rb +0 -10
- data/examples/rails/parklife-build +0 -25
- data/examples/rails/public/404.html +0 -67
- data/examples/rails/public/422.html +0 -67
- data/examples/rails/public/500.html +0 -66
- data/examples/rails/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails/public/apple-touch-icon.png +0 -0
- data/examples/rails/public/favicon.ico +0 -0
- data/examples/rails/public/robots.txt +0 -1
- data/examples/sinatra/.gitignore +0 -2
- data/examples/sinatra/Gemfile +0 -4
- data/examples/sinatra/Parkfile +0 -19
@@ -1,12 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version = '1.0'
|
5
|
-
|
6
|
-
# Add additional assets to the asset load path.
|
7
|
-
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
-
|
9
|
-
# Precompile additional assets.
|
10
|
-
# application.js, application.css, and all non-JS/CSS in the app/assets
|
11
|
-
# folder are already added.
|
12
|
-
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
-
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Define an application-wide content security policy
|
4
|
-
# For further information see the following documentation
|
5
|
-
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
6
|
-
|
7
|
-
# Rails.application.config.content_security_policy do |policy|
|
8
|
-
# policy.default_src :self, :https
|
9
|
-
# policy.font_src :self, :https, :data
|
10
|
-
# policy.img_src :self, :https, :data
|
11
|
-
# policy.object_src :none
|
12
|
-
# policy.script_src :self, :https
|
13
|
-
# policy.style_src :self, :https
|
14
|
-
|
15
|
-
# # Specify URI for violation reports
|
16
|
-
# # policy.report_uri "/csp-violation-report-endpoint"
|
17
|
-
# end
|
18
|
-
|
19
|
-
# If you are using UJS then enable automatic nonce generation
|
20
|
-
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
21
|
-
|
22
|
-
# Report CSP violations to a specified URI
|
23
|
-
# For further information see the following documentation:
|
24
|
-
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
25
|
-
# Rails.application.config.content_security_policy_report_only = true
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format. Inflections
|
4
|
-
# are locale specific, and you may define rules for as many different
|
5
|
-
# locales as you wish. All of these examples are active by default:
|
6
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
-
# inflect.singular /^(ox)en/i, '\1'
|
9
|
-
# inflect.irregular 'person', 'people'
|
10
|
-
# inflect.uncountable %w( fish sheep )
|
11
|
-
# end
|
12
|
-
|
13
|
-
# These inflection rules are supported but not enabled by default:
|
14
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
-
# inflect.acronym 'RESTful'
|
16
|
-
# end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
-
# is enabled by default.
|
5
|
-
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json]
|
9
|
-
end
|
10
|
-
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
13
|
-
# self.include_root_in_json = true
|
14
|
-
# end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Files in the config/locales directory are used for internationalization
|
2
|
-
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
-
# than English, add the necessary files in this directory.
|
4
|
-
#
|
5
|
-
# To use the locales, use `I18n.t`:
|
6
|
-
#
|
7
|
-
# I18n.t 'hello'
|
8
|
-
#
|
9
|
-
# In views, this is aliased to just `t`:
|
10
|
-
#
|
11
|
-
# <%= t('hello') %>
|
12
|
-
#
|
13
|
-
# To use a different locale, set it with `I18n.locale`:
|
14
|
-
#
|
15
|
-
# I18n.locale = :es
|
16
|
-
#
|
17
|
-
# This would use the information in config/locales/es.yml.
|
18
|
-
#
|
19
|
-
# The following keys must be escaped otherwise they will not be retrieved by
|
20
|
-
# the default I18n backend:
|
21
|
-
#
|
22
|
-
# true, false, on, off, yes, no
|
23
|
-
#
|
24
|
-
# Instead, surround them with single quotes.
|
25
|
-
#
|
26
|
-
# en:
|
27
|
-
# 'true': 'foo'
|
28
|
-
#
|
29
|
-
# To learn more, please read the Rails Internationalization guide
|
30
|
-
# available at http://guides.rubyonrails.org/i18n.html.
|
31
|
-
|
32
|
-
en:
|
33
|
-
hello: "Hello world"
|
data/examples/rails/config.ru
DELETED
data/examples/rails/db/schema.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 2019_05_07_172823) do
|
14
|
-
|
15
|
-
create_table "posts", force: :cascade do |t|
|
16
|
-
t.string "slug", null: false
|
17
|
-
t.string "title", null: false
|
18
|
-
t.text "body"
|
19
|
-
t.datetime "created_at", null: false
|
20
|
-
t.datetime "updated_at", null: false
|
21
|
-
t.index ["slug"], name: "index_posts_on_slug", unique: true
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
data/examples/rails/db/seeds.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
Rails.root.join('data').children.each do |path|
|
2
|
-
id, slug = path.basename('.*').to_s.split('-', 2)
|
3
|
-
title, rest = path.read.split("\n", 2)
|
4
|
-
|
5
|
-
post = Post.find_or_initialize_by(id: id)
|
6
|
-
post.body = rest
|
7
|
-
post.slug = slug
|
8
|
-
post.title = title
|
9
|
-
post.save!
|
10
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env sh
|
2
|
-
|
3
|
-
set -eu
|
4
|
-
|
5
|
-
export RAILS_ENV=production
|
6
|
-
export SECRET_KEY_BASE=secret
|
7
|
-
|
8
|
-
# Create a production SQLite database and populate it with the app's data (see
|
9
|
-
# db/seeds.rb for how).
|
10
|
-
bundle exec rails db:setup
|
11
|
-
|
12
|
-
# Generate production-optimised assets with Sprockets and friends. This must be
|
13
|
-
# done before generating the Parklife build as Rails will blow up if it detects
|
14
|
-
# missing assets at runtime.
|
15
|
-
bundle exec rails assets:precompile
|
16
|
-
|
17
|
-
# Generate the Parklife build.
|
18
|
-
bundle exec parklife build
|
19
|
-
|
20
|
-
# Copy everything in /public to the build directory -- this includes the newly
|
21
|
-
# generated sprockets assets and things like favicon.ico and robots.txt.
|
22
|
-
cp -R public/* build
|
23
|
-
|
24
|
-
# List everything in the final build -- useful debug output.
|
25
|
-
find build -type f | sort
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/404.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/422.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
@@ -1,66 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/500.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
62
|
-
</div>
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
64
|
-
</div>
|
65
|
-
</body>
|
66
|
-
</html>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
data/examples/sinatra/.gitignore
DELETED
data/examples/sinatra/Gemfile
DELETED
data/examples/sinatra/Parkfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'sinatra'
|
2
|
-
|
3
|
-
get '/' do
|
4
|
-
'<a href="/hello/foo">foo</foo>, <a href="/hello/bar">bar</foo>, <a href="/hello/baz">baz</foo>'
|
5
|
-
end
|
6
|
-
|
7
|
-
get '/hello/:name' do
|
8
|
-
"Hello #{params[:name]}"
|
9
|
-
end
|
10
|
-
|
11
|
-
Parklife.application.configure do |config|
|
12
|
-
config.app = Sinatra::Application
|
13
|
-
end
|
14
|
-
|
15
|
-
Parklife.application.routes do
|
16
|
-
root crawl: true
|
17
|
-
|
18
|
-
get '/hello/other'
|
19
|
-
end
|