trevi 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dea2496309e928594da9001fc8133204bb3ff3e5
4
- data.tar.gz: 6d50c453ec667e1edf1294665f45a5d554446e1f
3
+ metadata.gz: cce4d771abf3c2665f5284a8d9aea21949dccf5b
4
+ data.tar.gz: 2751a72c8269428ccc2effbb2b29459afb807c8e
5
5
  SHA512:
6
- metadata.gz: 9adc60ad54737ade96764fbe66fa95c6ae1534bbdba161efe3052e57b0a6505180bd1793021d695d03790c055144b272682acadf1f4cc1b9d51cc6e142f195d8
7
- data.tar.gz: 94dfe0e250a9b5a7365b4f80472c85bca84edc466e040be1ea02a7f56a955cec7a0b5fedee1419db4686859d899bfc4806792a39aa3b376adefcdd57a2b833d2
6
+ metadata.gz: fc3ceeeea314420cd0baebc3ee75f34965b98a584502ec107f1a4468d4c3f44c3da1b7295c8e56cbbb587d3ec8832ad847e052e5b3622db27c5294556ae11cc2
7
+ data.tar.gz: b4faa61972c6c487ca5120d9879c082f15c8478198c24e8214828eff668239ac2fb2cf84b02ab1335380b396a92e1b62e45ed31e977dd761f291f835d7c80dcf
@@ -1,3 +1,3 @@
1
1
  module Trevi
2
- VERSION = "0.0.4"
2
+ VERSION = '0.0.5'
3
3
  end
@@ -1,4 +1,4 @@
1
1
  tmp
2
2
  .DS_Store
3
- .env
4
- mails
3
+ .env*
4
+ mails
@@ -1,17 +1,17 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.1.2'
2
+ ruby '2.1.5'
3
3
 
4
- gem 'sinatra', require: 'sinatra/base'
5
- gem 'sinatra-contrib', github: 'maccman/sinatra-contrib'
6
- gem 'rack-standards'
7
- gem 'unicorn'
8
- gem 'erubis'
9
- gem 'i18n'
10
4
  gem 'activesupport'
11
- gem 'rake'
12
5
  gem 'builder'
13
- gem 'json', '~> 1.7.7'
14
6
  gem 'dotenv'
7
+ gem 'erubis'
8
+ gem 'i18n'
9
+ gem 'json', '~> 1.7.7'
10
+ gem 'puma'
11
+ gem 'rack-standards'
12
+ gem 'rake'
13
+ gem 'sinatra', require: 'sinatra/base'
14
+ gem 'sinatra-contrib', github: 'maccman/sinatra-contrib'
15
15
 
16
16
  # Assets
17
17
  gem 'sprockets'
@@ -32,6 +32,12 @@ gem 'sinatra-sequel'
32
32
  gem 'pg'
33
33
 
34
34
  group :development do
35
- gem 'thin'
36
- gem 'byebug'
35
+ gem 'foreman'
36
+ end
37
+
38
+ group :test do
39
+ gem 'pry'
40
+ gem 'rack-test'
41
+ gem 'rspec'
42
+ gem 'webmock'
37
43
  end
@@ -1 +1 @@
1
- web: bundle exec unicorn -c ./config/unicorn.rb
1
+ web: bundle exec puma -C config/puma.rb
@@ -4,6 +4,14 @@ task :app do
4
4
  require './app'
5
5
  end
6
6
 
7
- Dir[File.dirname(__FILE__) + "/lib/tasks/*.rb"].sort.each do |path|
8
- require path
9
- end
7
+ Dir[File.dirname(__FILE__) + '/lib/tasks/*.rake'].sort.each do |path|
8
+ load path
9
+ end
10
+
11
+ begin
12
+ require 'rspec/core/rake_task'
13
+ RSpec::Core::RakeTask.new(:spec)
14
+ task default: :spec
15
+ rescue LoadError
16
+ # no rspec available
17
+ end
@@ -1,13 +1,19 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
3
 
4
+ # Set default env
5
+ ENV['RACK_ENV'] ||= 'development'
6
+
4
7
  # Setup load paths
5
8
  Bundler.require
6
9
  $: << File.expand_path('../', __FILE__)
7
10
  $: << File.expand_path('../lib', __FILE__)
8
11
 
12
+ # Dotenv load specific vars
9
13
  require 'dotenv'
10
- Dotenv.load
14
+ Dotenv.load(
15
+ File.expand_path("../.env.#{ENV['RACK_ENV']}", __FILE__),
16
+ File.expand_path("../.env", __FILE__))
11
17
 
12
18
  # Require base
13
19
  require 'sinatra/base'
@@ -49,6 +55,8 @@ module <%= @name.camel_case %>
49
55
  secret: ENV['SESSION_SECRET']
50
56
  end
51
57
 
58
+ Dir['config/initializers/*.rb'].sort.each { |file| require file }
59
+
52
60
  use Rack::Deflater
53
61
  use Rack::Standards
54
62
 
@@ -63,4 +71,5 @@ module <%= @name.camel_case %>
63
71
  end
64
72
  end
65
73
 
66
- include <%= @name.camel_case %>::Models
74
+ include <%= @name.camel_case %>
75
+ include <%= @name.camel_case %>::Models
@@ -0,0 +1,9 @@
1
+ workers Integer(ENV['WEB_CONCURRENCY'] || 4)
2
+ threads_count = Integer(ENV['MAX_THREADS'] || 8)
3
+ threads threads_count, threads_count
4
+
5
+ preload_app!
6
+
7
+ rackup DefaultRackup
8
+ port ENV['PORT'] || 5000
9
+ environment ENV['RACK_ENV'] || 'development'
@@ -0,0 +1 @@
1
+ .gitkeep
@@ -0,0 +1 @@
1
+ .gitkeep
@@ -0,0 +1,21 @@
1
+ ENV['RACK_ENV'] = 'test'
2
+
3
+ require File.expand_path('../../app', __FILE__)
4
+
5
+ require 'pry'
6
+ require 'rspec'
7
+ require 'rack/test'
8
+ require 'webmock/rspec'
9
+
10
+ RSpec.configure do |config|
11
+ include Rack::Test::Methods
12
+ config.order = 'random'
13
+
14
+ def app
15
+ <%= @name.camel_case %>::App
16
+ end
17
+
18
+ config.expect_with :rspec do |c|
19
+ c.syntax = :expect
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trevi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-30 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,10 +89,13 @@ files:
89
89
  - templates/app/app/routes/static.rb.tt
90
90
  - templates/app/app/views/layouts/layout.erb.tt
91
91
  - templates/app/config.ru.tt
92
- - templates/app/config/unicorn.rb
93
- - templates/app/lib/tasks/assets.rb.tt
94
- - templates/app/lib/tasks/db.rb.tt
92
+ - templates/app/config/puma.rb
93
+ - templates/app/lib/tasks/assets.rake.tt
94
+ - templates/app/lib/tasks/db.rake.tt
95
95
  - templates/app/public/favicon.ico
96
+ - templates/app/spec/models/.gitkeep
97
+ - templates/app/spec/requests/.gitkeep
98
+ - templates/app/spec/spec_helper.rb.tt
96
99
  - templates/app/vendor/assets/javascripts/.gitkeep
97
100
  - templates/app/vendor/assets/stylesheets/.gitkeep
98
101
  - trevi.gemspec
@@ -1,21 +0,0 @@
1
- worker_processes Integer(ENV['UNICORN_WORKERS'] || 4)
2
- timeout 30
3
- preload_app true
4
- listen(ENV['PORT'] || 3000, :backlog => Integer(ENV['UNICORN_BACKLOG'] || 200))
5
-
6
- before_fork do |server, worker|
7
- Signal.trap 'TERM' do
8
- puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
9
- Process.kill 'QUIT', Process.pid
10
- end
11
-
12
- if defined?(Sequel::Model)
13
- Sequel::DATABASES.each{ |db| db.disconnect }
14
- end
15
- end
16
-
17
- after_fork do |server, worker|
18
- Signal.trap 'TERM' do
19
- puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
20
- end
21
- end