-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
116 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Examples | ||
|
||
on: push | ||
|
||
jobs: | ||
rack: | ||
runs-on: ubuntu-latest | ||
name: Rack example | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: '2.7' | ||
working-directory: examples/rack | ||
- run: bundle exec parklife build | ||
working-directory: examples/rack | ||
- run: test -f build/index.html | ||
working-directory: examples/rack | ||
|
||
rails: | ||
runs-on: ubuntu-latest | ||
name: Rails example | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: '3.2' | ||
working-directory: examples/rails | ||
- run: bin/static-build | ||
working-directory: examples/rails | ||
- run: test -f build/index.html | ||
working-directory: examples/rails | ||
|
||
roda: | ||
runs-on: ubuntu-latest | ||
name: Roda example | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: '3.2' | ||
working-directory: examples/roda | ||
- run: bundle exec parklife build | ||
working-directory: examples/roda | ||
- run: test -f build/index.html | ||
working-directory: examples/roda | ||
|
||
sinatra: | ||
runs-on: ubuntu-latest | ||
name: Sinatra example | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: '2.7' | ||
working-directory: examples/sinatra | ||
- run: bundle exec parklife build | ||
working-directory: examples/sinatra | ||
- run: test -f build/index.html | ||
working-directory: examples/sinatra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Gemfile.lock | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'parklife', path: '../..' | ||
gem 'roda' | ||
gem 'tilt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require_relative 'app' | ||
|
||
Parklife.application.configure do |config| | ||
config.app = App.app | ||
end | ||
|
||
Parklife.application.routes do | ||
root crawl: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'roda' | ||
|
||
class App < Roda | ||
plugin :render | ||
|
||
route do |r| | ||
r.root do | ||
view 'home' | ||
end | ||
|
||
r.on 'posts' do | ||
r.is String do |id| | ||
r.get do | ||
@id = id | ||
view 'show' | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1>Home</h1> | ||
|
||
<ul> | ||
<% %w(foo bar baz).each do |id| %> | ||
<li><a href="/posts/<%= id %>"><%= id %></a></li> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>Parklife Roda example</title> | ||
</head> | ||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Show <%= @id %></h1> |