sinatra-rider 0.2.0 → 0.2.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/Rakefile +13 -2
- data/config/database.yml +15 -0
- data/db/migrate/1_create_users.rb +11 -0
- data/db/schema.rb +29 -0
- data/exe/rider +0 -3
- data/lib/sinatra/rider.rb +1 -1
- data/lib/sinatra/rider/command.rb +11 -0
- data/lib/sinatra/rider/version.rb +1 -1
- data/lib/sinatra/views/login.erb +1 -1
- data/lib/sinatra/views/signup.erb +1 -1
- data/sinatra-rider.gemspec +1 -0
- metadata +19 -3
- data/bin/rider +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25bd32f4686dc1ef70a3bad62a0eb866d97cce03
|
4
|
+
data.tar.gz: 4a6f26f9354502348088c9079cb1ddea97b82125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f695ea42619ee6731f07a221aa2f9af9f91953920bc30f94c9a8c16f5df104ec687e18f5a3f13500e13e1579586cef77fff8df4d4c646edeb4f2def20c3909c
|
7
|
+
data.tar.gz: bb662ac4fa4874749df9b70f529ab00ab6ba389a00ec93db46cf326f099414049766c59f5bdd93980d0114ffeff4182ba6028bb65f6d96136a4e6640ece2cd7b
|
data/Rakefile
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'sinatra/activerecord/rake'
|
3
4
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
5
6
|
|
7
|
+
namespace :db do
|
8
|
+
task :load_config do
|
9
|
+
require "sinatra/rider"
|
10
|
+
|
11
|
+
class TestServer < Sinatra::Base
|
12
|
+
register Sinatra::Rider
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
6
17
|
task :default => :spec
|
data/config/database.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
pool: 5
|
5
|
+
|
6
|
+
development:
|
7
|
+
<<: *default
|
8
|
+
database: sinatra_rider_development
|
9
|
+
|
10
|
+
test:
|
11
|
+
<<: *default
|
12
|
+
database: sinatra_rider_test
|
13
|
+
|
14
|
+
production:
|
15
|
+
url: <%= ENV['DATABASE_URL'] %>
|
data/db/schema.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 1) do
|
15
|
+
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
19
|
+
create_table "users", force: :cascade do |t|
|
20
|
+
t.string "name"
|
21
|
+
t.string "username", null: false
|
22
|
+
t.string "encrypted_password", null: false
|
23
|
+
t.datetime "created_at", null: false
|
24
|
+
t.datetime "updated_at", null: false
|
25
|
+
end
|
26
|
+
|
27
|
+
add_index "users", ["username"], name: "index_users_on_username", using: :btree
|
28
|
+
|
29
|
+
end
|
data/exe/rider
CHANGED
data/lib/sinatra/rider.rb
CHANGED
@@ -17,7 +17,7 @@ module Sinatra
|
|
17
17
|
autoload :User, 'sinatra/rider/user'
|
18
18
|
|
19
19
|
def self.registered(app)
|
20
|
-
app.set :database_file, File.join(app.root,
|
20
|
+
app.set :database_file, File.join(app.root, 'config/database.yml').to_s
|
21
21
|
|
22
22
|
%w(app lib).map do |path|
|
23
23
|
Dir.glob("#{File.join(app.root, path)}/*.rb").each { |file| require file }
|
@@ -52,6 +52,17 @@ module Sinatra
|
|
52
52
|
template('templates/css.tt', "#{path}/assets/stylesheets/application.scss")
|
53
53
|
end
|
54
54
|
|
55
|
+
def prepare_working_directory
|
56
|
+
inside(path) do
|
57
|
+
run('bundle install')
|
58
|
+
run('bundle exec rake db:create db:migrate')
|
59
|
+
run('git init')
|
60
|
+
puts "You're all set up! Start your server like this:"
|
61
|
+
puts " bundle exec rackup config.ru"
|
62
|
+
puts "\nYou can get setup with a user at http://localhost:9292/signup"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
55
66
|
def self.source_root
|
56
67
|
File.dirname(__FILE__)
|
57
68
|
end
|
data/lib/sinatra/views/login.erb
CHANGED
data/sinatra-rider.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-rider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thin
|
@@ -248,6 +248,20 @@ dependencies:
|
|
248
248
|
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '3.0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: simplecov
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
251
265
|
description: All the extras that Sinatra prefers while performing
|
252
266
|
email:
|
253
267
|
- m@mjw.io
|
@@ -265,8 +279,10 @@ files:
|
|
265
279
|
- README.md
|
266
280
|
- Rakefile
|
267
281
|
- bin/console
|
268
|
-
- bin/rider
|
269
282
|
- bin/setup
|
283
|
+
- config/database.yml
|
284
|
+
- db/migrate/1_create_users.rb
|
285
|
+
- db/schema.rb
|
270
286
|
- example/myapp/Gemfile
|
271
287
|
- example/myapp/Gemfile.lock
|
272
288
|
- example/myapp/README.md
|
data/bin/rider
DELETED