sinatra-rider 0.2.1 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/README.md +20 -0
- data/db/migrate/1_create_users.rb +1 -1
- data/db/schema.rb +12 -14
- data/db/seeds.rb +3 -0
- data/example/myapp/Gemfile +1 -1
- data/example/myapp/Gemfile.lock +85 -74
- data/example/myapp/db/migrate/1_create_users.rb +1 -1
- data/example/myapp/db/schema.rb +12 -14
- data/lib/sinatra/rider/assets.rb +14 -8
- data/lib/sinatra/rider/command.rb +13 -5
- data/lib/sinatra/rider/pathing.rb +1 -1
- data/lib/sinatra/rider/quiet_assets.rb +1 -1
- data/lib/sinatra/rider/templates/console.tt +16 -0
- data/lib/sinatra/rider/templates/gemfile.tt +1 -1
- data/lib/sinatra/rider/version.rb +1 -1
- data/lib/sinatra/{views → rider/views}/login.erb +0 -0
- data/lib/sinatra/{views → rider/views}/signup.erb +0 -0
- data/lib/sinatra/rider/views/vendor/bootstrap-3.3.7.min.css +6 -0
- data/lib/sinatra/rider/views/vendor/bootstrap.css +1 -0
- data/lib/sinatra/rider/views/vendor/font-awesome-4.7.0.min.css +4 -0
- data/lib/sinatra/rider/views/vendor/font-awesome.css +1 -0
- data/lib/sinatra/rider/views/vendor/fonts/FontAwesome.otf +0 -0
- data/lib/sinatra/rider/views/vendor/fonts/fontawesome-webfont.eot +0 -0
- data/lib/sinatra/rider/views/vendor/fonts/fontawesome-webfont.svg +2671 -0
- data/lib/sinatra/rider/views/vendor/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/sinatra/rider/views/vendor/fonts/fontawesome-webfont.woff +0 -0
- data/lib/sinatra/rider/views/vendor/fonts/fontawesome-webfont.woff2 +0 -0
- data/sinatra-rider.gemspec +8 -7
- metadata +53 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc0800113023930bf9ccb731c659877326256e045d0f7d6a5934f4028dab4510
|
4
|
+
data.tar.gz: 223529596bbc50851e6c9ba1ecffb26c09133bed7b9f94050b32af6a2eceaf4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bd856e793ef72cb156ac5d281d0f0cb0329d89ad91d04e30654158a56793b5f1c2bd68e323b29801e2cf808943e7e7a51f2387cf18fd4890e8cccff12ebe93b
|
7
|
+
data.tar.gz: 1e543b708ccbeaee373a9876348149408bbc60bb69a0f84fee1d1911777456faa771783a8fc0e810f5946a651f9a375608abe23a2e4266cb6dc499e4ff8ac540
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,7 @@ All the nice extras Sinatra likes to have when he's on the road.
|
|
9
9
|
- Sass
|
10
10
|
- Dotenv
|
11
11
|
- Better Errors
|
12
|
+
- Local copy of bootstrap and font-awesome
|
12
13
|
- Autoloading `app` and `lib` directories
|
13
14
|
- ~~One dozen blue M&Ms~~
|
14
15
|
|
@@ -98,6 +99,25 @@ Better Errors are included in the Sinatra configuration when `RACK_ENV` is in de
|
|
98
99
|
|
99
100
|
[More Information](https://github.com/charliesome/better_errors)
|
100
101
|
|
102
|
+
### Locally available copies of bootstrap and font-awesome
|
103
|
+
|
104
|
+
`Sinatra::Rider` provides a copy of the latest Bootstrap and Font-Awesome libraries for your usage. Just add the `link` tag to your layout and you're styling!
|
105
|
+
|
106
|
+
```html
|
107
|
+
<head>
|
108
|
+
<title>My Sinatra::Rider App</title>
|
109
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
110
|
+
<link rel="stylesheet" type="text/css" href="/assets/bootstrap.css">
|
111
|
+
<link rel="stylesheet" type="text/css" href="/assets/font-awesome.css">
|
112
|
+
</head>
|
113
|
+
```
|
114
|
+
|
115
|
+
Current Versions:
|
116
|
+
- Bootstrap: 3.3.7
|
117
|
+
- Font-Awesome: 4.7.0
|
118
|
+
|
119
|
+
More Information: [Bootstrap](https://getbootstrap.com/) & [Font-Awesome](http://fontawesome.io/)
|
120
|
+
|
101
121
|
### Autoloading `app` and `lib`
|
102
122
|
|
103
123
|
Any ruby files present in `app` or `lib` as siblings in the root directory of your `config.ru` will be automatically required.
|
data/db/schema.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
5
4
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# from scratch.
|
10
|
-
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `rails
|
6
|
+
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
11
10
|
#
|
12
11
|
# It's strongly recommended that you check this file into your version control system.
|
13
12
|
|
@@ -16,14 +15,13 @@ ActiveRecord::Schema.define(version: 1) do
|
|
16
15
|
# These are extensions that must be enabled in order to support this database
|
17
16
|
enable_extension "plpgsql"
|
18
17
|
|
19
|
-
create_table "users", force: :cascade do |t|
|
20
|
-
t.string
|
21
|
-
t.string
|
22
|
-
t.string
|
23
|
-
t.datetime "created_at",
|
24
|
-
t.datetime "updated_at",
|
18
|
+
create_table "users", id: :serial, force: :cascade do |t|
|
19
|
+
t.string "name"
|
20
|
+
t.string "username", null: false
|
21
|
+
t.string "encrypted_password", null: false
|
22
|
+
t.datetime "created_at", null: false
|
23
|
+
t.datetime "updated_at", null: false
|
24
|
+
t.index ["username"], name: "index_users_on_username"
|
25
25
|
end
|
26
26
|
|
27
|
-
add_index "users", ["username"], name: "index_users_on_username", using: :btree
|
28
|
-
|
29
27
|
end
|
data/db/seeds.rb
ADDED
data/example/myapp/Gemfile
CHANGED
data/example/myapp/Gemfile.lock
CHANGED
@@ -1,101 +1,112 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/matthew/src/sinatra-rider
|
3
|
+
specs:
|
4
|
+
sinatra-rider (0.2.6)
|
5
|
+
activerecord
|
6
|
+
better_errors
|
7
|
+
binding_of_caller
|
8
|
+
dotenv
|
9
|
+
pg
|
10
|
+
sass (~> 3.4)
|
11
|
+
sinatra (~> 2.1)
|
12
|
+
sinatra-activerecord
|
13
|
+
sinatra-contrib
|
14
|
+
sinatra_warden
|
15
|
+
sprockets (~> 3.7)
|
16
|
+
thin
|
17
|
+
thor
|
18
|
+
uglifier
|
19
|
+
|
1
20
|
GEM
|
2
21
|
remote: https://rubygems.org/
|
3
22
|
specs:
|
4
|
-
activemodel (
|
5
|
-
activesupport (=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
i18n (~> 0.7)
|
13
|
-
json (~> 1.7, >= 1.7.7)
|
23
|
+
activemodel (6.0.3.4)
|
24
|
+
activesupport (= 6.0.3.4)
|
25
|
+
activerecord (6.0.3.4)
|
26
|
+
activemodel (= 6.0.3.4)
|
27
|
+
activesupport (= 6.0.3.4)
|
28
|
+
activesupport (6.0.3.4)
|
29
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
|
+
i18n (>= 0.7, < 2)
|
14
31
|
minitest (~> 5.1)
|
15
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
16
32
|
tzinfo (~> 1.1)
|
17
|
-
|
18
|
-
|
19
|
-
better_errors (2.1.1)
|
33
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
34
|
+
better_errors (2.8.3)
|
20
35
|
coderay (>= 1.0.0)
|
21
|
-
|
36
|
+
erubi (>= 1.0.0)
|
22
37
|
rack (>= 0.9.0)
|
23
|
-
binding_of_caller (0.
|
38
|
+
binding_of_caller (0.8.0)
|
24
39
|
debug_inspector (>= 0.0.1)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
eventmachine (1.2.2)
|
40
|
+
coderay (1.1.3)
|
41
|
+
concurrent-ruby (1.1.7)
|
42
|
+
daemons (1.3.1)
|
43
|
+
debug_inspector (0.0.3)
|
44
|
+
dotenv (2.7.6)
|
45
|
+
erubi (1.9.0)
|
46
|
+
eventmachine (1.2.7)
|
33
47
|
execjs (2.7.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
48
|
+
ffi (1.13.1)
|
49
|
+
i18n (1.8.5)
|
50
|
+
concurrent-ruby (~> 1.0)
|
51
|
+
minitest (5.14.2)
|
52
|
+
multi_json (1.15.0)
|
53
|
+
mustermann (1.1.1)
|
54
|
+
ruby2_keywords (~> 0.0.1)
|
55
|
+
pg (1.2.3)
|
56
|
+
rack (2.2.3)
|
57
|
+
rack-protection (2.1.0)
|
41
58
|
rack
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
59
|
+
rake (13.0.1)
|
60
|
+
rb-fsevent (0.10.4)
|
61
|
+
rb-inotify (0.10.1)
|
62
|
+
ffi (~> 1.0)
|
63
|
+
ruby2_keywords (0.0.2)
|
64
|
+
sass (3.7.4)
|
65
|
+
sass-listen (~> 4.0.0)
|
66
|
+
sass-listen (4.0.0)
|
67
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
68
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
69
|
+
sinatra (2.1.0)
|
70
|
+
mustermann (~> 1.0)
|
71
|
+
rack (~> 2.2)
|
72
|
+
rack-protection (= 2.1.0)
|
73
|
+
tilt (~> 2.0)
|
74
|
+
sinatra-activerecord (2.0.19)
|
75
|
+
activerecord (>= 4.1)
|
52
76
|
sinatra (>= 1.0)
|
53
|
-
sinatra-contrib (1.
|
54
|
-
backports (>= 2.0)
|
77
|
+
sinatra-contrib (2.1.0)
|
55
78
|
multi_json
|
56
|
-
|
57
|
-
rack-
|
58
|
-
sinatra (
|
59
|
-
tilt (
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
dotenv
|
65
|
-
pg
|
66
|
-
sass
|
67
|
-
sinatra
|
68
|
-
sinatra-activerecord
|
69
|
-
sinatra-contrib
|
70
|
-
sinatra_warden
|
71
|
-
sprockets
|
72
|
-
thin
|
73
|
-
uglifier
|
74
|
-
sinatra_warden (1.0.0)
|
75
|
-
sinatra (~> 1.4.6)
|
76
|
-
warden (~> 1.2.3)
|
77
|
-
sprockets (3.7.1)
|
79
|
+
mustermann (~> 1.0)
|
80
|
+
rack-protection (= 2.1.0)
|
81
|
+
sinatra (= 2.1.0)
|
82
|
+
tilt (~> 2.0)
|
83
|
+
sinatra_warden (0.3.2)
|
84
|
+
sinatra (>= 1.0.0)
|
85
|
+
warden (~> 1.0)
|
86
|
+
sprockets (3.7.2)
|
78
87
|
concurrent-ruby (~> 1.0)
|
79
88
|
rack (> 1, < 3)
|
80
|
-
thin (1.7.
|
89
|
+
thin (1.7.2)
|
81
90
|
daemons (~> 1.0, >= 1.0.9)
|
82
91
|
eventmachine (~> 1.0, >= 1.0.4)
|
83
92
|
rack (>= 1, < 3)
|
84
|
-
|
85
|
-
|
86
|
-
|
93
|
+
thor (1.0.1)
|
94
|
+
thread_safe (0.3.6)
|
95
|
+
tilt (2.0.10)
|
96
|
+
tzinfo (1.2.7)
|
87
97
|
thread_safe (~> 0.1)
|
88
|
-
uglifier (
|
98
|
+
uglifier (4.2.0)
|
89
99
|
execjs (>= 0.3.0, < 3)
|
90
|
-
warden (1.2.
|
91
|
-
rack (>=
|
100
|
+
warden (1.2.9)
|
101
|
+
rack (>= 2.0.9)
|
102
|
+
zeitwerk (2.4.0)
|
92
103
|
|
93
104
|
PLATFORMS
|
94
105
|
ruby
|
95
106
|
|
96
107
|
DEPENDENCIES
|
97
108
|
rake
|
98
|
-
sinatra-rider
|
109
|
+
sinatra-rider (= 0.2.6)!
|
99
110
|
|
100
111
|
BUNDLED WITH
|
101
|
-
1.
|
112
|
+
2.1.4
|
data/example/myapp/db/schema.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
5
4
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# from scratch.
|
10
|
-
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `rails
|
6
|
+
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
11
10
|
#
|
12
11
|
# It's strongly recommended that you check this file into your version control system.
|
13
12
|
|
@@ -16,14 +15,13 @@ ActiveRecord::Schema.define(version: 1) do
|
|
16
15
|
# These are extensions that must be enabled in order to support this database
|
17
16
|
enable_extension "plpgsql"
|
18
17
|
|
19
|
-
create_table "users", force: :cascade do |t|
|
20
|
-
t.string
|
21
|
-
t.string
|
22
|
-
t.string
|
23
|
-
t.datetime "created_at",
|
24
|
-
t.datetime "updated_at",
|
18
|
+
create_table "users", id: :serial, force: :cascade do |t|
|
19
|
+
t.string "name"
|
20
|
+
t.string "username", null: false
|
21
|
+
t.string "encrypted_password", null: false
|
22
|
+
t.datetime "created_at", null: false
|
23
|
+
t.datetime "updated_at", null: false
|
24
|
+
t.index ["username"], name: "index_users_on_username"
|
25
25
|
end
|
26
26
|
|
27
|
-
add_index "users", ["username"], name: "index_users_on_username", using: :btree
|
28
|
-
|
29
27
|
end
|
data/lib/sinatra/rider/assets.rb
CHANGED
@@ -7,16 +7,22 @@ module Sinatra
|
|
7
7
|
module Rider
|
8
8
|
module Assets
|
9
9
|
def self.registered(app)
|
10
|
-
app.set :pipeline, Sprockets::Environment.new
|
10
|
+
app.set :pipeline, pipeline = Sprockets::Environment.new
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
app.pipeline.css_compressor = :scss
|
12
|
+
pipeline.append_path "assets/stylesheets"
|
13
|
+
pipeline.append_path "assets/javascripts"
|
14
|
+
pipeline.append_path File.join(__dir__, "views/vendor")
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
pipeline.js_compressor = :uglify
|
17
|
+
pipeline.css_compressor = :scss
|
18
|
+
|
19
|
+
app.get '/assets/*' do
|
20
|
+
env['PATH_INFO'].sub!(%r{^/assets}, '')
|
21
|
+
pipeline.call(env)
|
22
|
+
end
|
23
|
+
|
24
|
+
app.configure :development do
|
25
|
+
pipeline.cache = Sprockets::Cache::FileStore.new(File.join(app.root, 'tmp'))
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
@@ -16,12 +16,12 @@ module Sinatra
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def prepare_ruby_version
|
19
|
-
create_file("#{path}/.ruby-version") { "
|
19
|
+
create_file("#{path}/.ruby-version") { "#{RUBY_VERSION}\n" }
|
20
20
|
end
|
21
21
|
|
22
22
|
def prepare_dotenv
|
23
23
|
create_file("#{path}/.env") { "SESSION_SECRET=super secret shh\n" }
|
24
|
-
create_file("#{path}/.gitignore") { ".env\n" }
|
24
|
+
create_file("#{path}/.gitignore") { ".env\ntmp/\n" }
|
25
25
|
end
|
26
26
|
|
27
27
|
def prepare_database
|
@@ -38,10 +38,14 @@ module Sinatra
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def prepare_app
|
41
|
+
template('templates/console.tt', "#{path}/bin/console")
|
42
|
+
system('chmod', '+x', "#{path}/bin/console")
|
43
|
+
|
41
44
|
template('templates/user.tt', "#{path}/app/user.rb")
|
42
45
|
template('templates/layout.erb', "#{path}/views/layout.erb")
|
43
46
|
template('templates/navigation.erb', "#{path}/views/_navigation.erb")
|
44
47
|
template('templates/index.erb', "#{path}/views/index.erb")
|
48
|
+
create_file("#{path}/README.md") { "# #{path.capitalize}\n" }
|
45
49
|
end
|
46
50
|
|
47
51
|
def prepare_assets
|
@@ -57,10 +61,14 @@ module Sinatra
|
|
57
61
|
run('bundle install')
|
58
62
|
run('bundle exec rake db:create db:migrate')
|
59
63
|
run('git init')
|
60
|
-
|
61
|
-
|
62
|
-
puts "\nYou can get setup with a user at http://localhost:9292/signup"
|
64
|
+
run('git add .')
|
65
|
+
run('git commit -m "Initial Commit"')
|
63
66
|
end
|
67
|
+
|
68
|
+
run("cd #{path}")
|
69
|
+
puts "You're all set up! Start your server like this:"
|
70
|
+
puts " bundle exec rackup config.ru"
|
71
|
+
puts "\nYou can get setup with a user at http://localhost:9292/signup"
|
64
72
|
end
|
65
73
|
|
66
74
|
def self.source_root
|
@@ -2,7 +2,7 @@ module Sinatra
|
|
2
2
|
module Rider
|
3
3
|
module Pathing
|
4
4
|
def self.registered(app)
|
5
|
-
app.set :views, [app.settings.views, File.join(
|
5
|
+
app.set :views, [app.settings.views, File.join(__dir__, 'views')].flatten
|
6
6
|
|
7
7
|
app.helpers do
|
8
8
|
def find_template(views, name, engine, &block)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'dotenv'
|
4
|
+
Dotenv.load
|
5
|
+
|
6
|
+
require 'sinatra/rider'
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
12
|
+
# require "pry"
|
13
|
+
# Pry.start
|
14
|
+
|
15
|
+
require 'irb'
|
16
|
+
IRB.start
|