platter 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +1 -0
- data/Rakefile +2 -0
- data/bin/platter +13 -0
- data/lib/platter.rb +3 -0
- data/lib/platter/app_builder.rb +163 -0
- data/lib/platter/generators/app_generator.rb +102 -0
- data/lib/platter/version.rb +5 -0
- data/platter.gemspec +27 -0
- data/templates/Gemfile.erb +38 -0
- data/templates/Procfile +1 -0
- data/templates/README.md.erb +23 -0
- data/templates/api_routes.erb +12 -0
- data/templates/base_api_controller.erb +4 -0
- data/templates/bin_development_setup.rb +26 -0
- data/templates/mailer_initializer_config.erb +11 -0
- data/templates/platter_gitignore +31 -0
- data/templates/production_env.erb +79 -0
- data/templates/rspec_support_database_cleaner.erb +13 -0
- data/templates/rspec_support_factory_girl.erb +3 -0
- data/templates/rspec_support_i18n.erb +13 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a00adecb18e0e0327eb9196fc87caa678609443b
|
4
|
+
data.tar.gz: 4a84952b479d6b7d5488d56540e7784a93478d28
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 463bd5003fd12f9c1923fb89845835471dc678935a56870eb06ba50aeade3865ceeb0eaf60752f5b769bc5942badfd545b2dc3968a1b1139405187512e850179
|
7
|
+
data.tar.gz: 724e20b727e2f1126e44ca89109690c1406d794278397fa9be7342fceddca6f3b68a33d747acf1e860ef55933290959b3b8903d4bf85542cfe413099ff4f9e8e
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Abraham Kuri
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Work in progress...
|
data/Rakefile
ADDED
data/bin/platter
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
|
5
|
+
$LOAD_PATH << source_path
|
6
|
+
|
7
|
+
require 'platter'
|
8
|
+
|
9
|
+
templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
|
10
|
+
Platter::AppGenerator.source_root templates_root
|
11
|
+
Platter::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
|
12
|
+
|
13
|
+
Platter::AppGenerator.start
|
data/lib/platter.rb
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
module Platter
|
2
|
+
class AppBuilder < Rails::AppBuilder
|
3
|
+
PORT = 3000
|
4
|
+
|
5
|
+
def readme
|
6
|
+
template "README.md.erb", "README.md"
|
7
|
+
end
|
8
|
+
|
9
|
+
def replace_gemfile
|
10
|
+
remove_file "Gemfile"
|
11
|
+
template "Gemfile.erb", "Gemfile"
|
12
|
+
end
|
13
|
+
|
14
|
+
#API builds
|
15
|
+
#
|
16
|
+
def add_api_support
|
17
|
+
inject_into_file "Gemfile", after: "ruby \"#{Platter::RUBY_VERSION}\"" do
|
18
|
+
%Q{
|
19
|
+
|
20
|
+
gem "versionist"
|
21
|
+
gem "active_model_serializers", github: "rails-api/active_model_serializers", branch: "0-8-stable"
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def add_api_version_directories
|
27
|
+
empty_directory "app/controllers/api/v1/"
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_api_version_base_controller
|
31
|
+
template "base_api_controller.erb", "app/controllers/api/v1/base_controller.rb"
|
32
|
+
end
|
33
|
+
|
34
|
+
def provide_api_routes
|
35
|
+
template "api_routes.erb", "config/routes.rb", force: true
|
36
|
+
end
|
37
|
+
|
38
|
+
#GIT builds
|
39
|
+
#
|
40
|
+
def setup_git
|
41
|
+
remove_file '.gitignore'
|
42
|
+
copy_file "platter_gitignore", ".gitignore"
|
43
|
+
git :init
|
44
|
+
end
|
45
|
+
|
46
|
+
def provide_first_commit
|
47
|
+
git add: "."
|
48
|
+
git commit: "-m 'Project initialization using Platter'"
|
49
|
+
end
|
50
|
+
|
51
|
+
#Server build
|
52
|
+
#
|
53
|
+
def setup_server
|
54
|
+
template "Procfile", "Procfile"
|
55
|
+
end
|
56
|
+
|
57
|
+
# Development builds
|
58
|
+
#
|
59
|
+
def provide_development_setup_bin
|
60
|
+
template "bin_development_setup.rb", "bin/setup", port: PORT, force: true
|
61
|
+
run "chmod a+x bin/setup"
|
62
|
+
end
|
63
|
+
|
64
|
+
def setup_development_mail_delivery_strategy
|
65
|
+
inject_into_file "config/environments/development.rb",
|
66
|
+
%Q{
|
67
|
+
|
68
|
+
# We use mailcatcher to preview emails
|
69
|
+
config.action_mailer.delivery_method = :smtp
|
70
|
+
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
71
|
+
config.action_mailer.default_url_options = { host: "localhost:#{PORT}" }
|
72
|
+
config.action_mailer.asset_host = "http://localhost:#{PORT}"
|
73
|
+
},
|
74
|
+
after: "config.action_mailer.raise_delivery_errors = false"
|
75
|
+
end
|
76
|
+
|
77
|
+
def fix_i18n_deprecation_warning
|
78
|
+
inject_into_class 'config/application.rb', 'Application',
|
79
|
+
%Q{
|
80
|
+
config.i18n.enforce_available_locales = true\n}
|
81
|
+
end
|
82
|
+
|
83
|
+
def provide_generators_configuration
|
84
|
+
inject_into_file 'config/application.rb',
|
85
|
+
%q{
|
86
|
+
# don't generate RSpec tests for views and helpers
|
87
|
+
config.generators do |g|
|
88
|
+
g.test_framework :rspec, fixture: true
|
89
|
+
g.fixture_replacement :factory_girl, dir: 'spec/factories'
|
90
|
+
g.view_specs false
|
91
|
+
g.helper_specs false
|
92
|
+
g.stylesheets false
|
93
|
+
g.javascripts false
|
94
|
+
g.helper false
|
95
|
+
end
|
96
|
+
|
97
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
98
|
+
},
|
99
|
+
after: "config.active_record.raise_in_transactional_callbacks = true"
|
100
|
+
end
|
101
|
+
|
102
|
+
#TEST builds
|
103
|
+
#
|
104
|
+
def init_rspec
|
105
|
+
generate "rspec:install"
|
106
|
+
end
|
107
|
+
|
108
|
+
def add_support_rspec_files
|
109
|
+
empty_directory "spec/support/"
|
110
|
+
template "rspec_support_database_cleaner.erb", "spec/support/database_cleaner.rb"
|
111
|
+
template "rspec_support_factory_girl.erb", "spec/support/factory_girl.rb"
|
112
|
+
template "rspec_support_i18n.erb", "spec/support/i18n.rb"
|
113
|
+
end
|
114
|
+
|
115
|
+
#STAGING builds
|
116
|
+
#
|
117
|
+
def copy_production_env_to_staging
|
118
|
+
template "production_env.erb", "config/environments/staging.rb"
|
119
|
+
end
|
120
|
+
|
121
|
+
#ACTIVE JOB builds
|
122
|
+
#
|
123
|
+
def init_delayed_job
|
124
|
+
generate "delayed_job:active_record"
|
125
|
+
run `bundle exec rake db:migrate`
|
126
|
+
end
|
127
|
+
|
128
|
+
def add_delayed_job_active_job_configuration
|
129
|
+
inject_into_file 'config/application.rb',
|
130
|
+
%q{
|
131
|
+
|
132
|
+
# ActiveJob Configuration
|
133
|
+
config.active_job.queue_adapter = :delayed_job
|
134
|
+
},
|
135
|
+
after: "config.active_record.raise_in_transactional_callbacks = true"
|
136
|
+
end
|
137
|
+
|
138
|
+
#MAILER builds
|
139
|
+
#
|
140
|
+
def init_sendgrid_initialize_file
|
141
|
+
template "mailer_initializer_config.erb", "config/initializers/mailer_setup.rb"
|
142
|
+
end
|
143
|
+
|
144
|
+
|
145
|
+
def add_exception_notification_mailer_configuration
|
146
|
+
%w{ production staging }.each do |env|
|
147
|
+
inject_into_file "config/environments/#{env}.rb",
|
148
|
+
%Q{
|
149
|
+
|
150
|
+
#Exception Notification configuration
|
151
|
+
config.middleware.use ExceptionNotification::Rack,
|
152
|
+
:email => {
|
153
|
+
:email_prefix => "[Printoo] ",
|
154
|
+
:sender_address => %{"Staging Exception" <exception@#{app_name.downcase}-#{env}.herokuapp.com>},
|
155
|
+
:exception_recipients => %w{}
|
156
|
+
}
|
157
|
+
},
|
158
|
+
after: "config.active_record.dump_schema_after_migration = false"
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/rails/app/app_generator'
|
3
|
+
|
4
|
+
module Platter
|
5
|
+
class AppGenerator < Rails::Generators::AppGenerator
|
6
|
+
class_option :database, type: :string, aliases: "-d", default: "postgresql",
|
7
|
+
desc: "Configure for selected database. PostgreSQL by default."
|
8
|
+
|
9
|
+
class_option :skip_test_unit, type: :boolean, aliases: "-T", default: true,
|
10
|
+
desc: "Skip Test::Unit files"
|
11
|
+
|
12
|
+
class_option :skip_turbolinks, type: :boolean, default: true,
|
13
|
+
desc: "Skips the turbolinks gem"
|
14
|
+
|
15
|
+
class_option :api, type: :boolean, default: false,
|
16
|
+
desc: "Adds API support gems"
|
17
|
+
|
18
|
+
class_option :skip_bundle, type: :boolean, aliases: "-B", default: true,
|
19
|
+
desc: "Don't run bundle install"
|
20
|
+
|
21
|
+
def finish_template
|
22
|
+
invoke :platter
|
23
|
+
super
|
24
|
+
end
|
25
|
+
|
26
|
+
def platter
|
27
|
+
invoke :custom_gemfile
|
28
|
+
invoke :setup_development_environment
|
29
|
+
invoke :setup_test_environment
|
30
|
+
invoke :setup_staging_environment
|
31
|
+
invoke :add_active_job_configuration
|
32
|
+
invoke :add_api_support
|
33
|
+
invoke :setup_mailer
|
34
|
+
invoke :setup_server
|
35
|
+
invoke :setup_git
|
36
|
+
end
|
37
|
+
|
38
|
+
def custom_gemfile
|
39
|
+
build :replace_gemfile
|
40
|
+
|
41
|
+
bundle_command 'install'
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_api_support
|
45
|
+
if options[:api]
|
46
|
+
say "Adding API support"
|
47
|
+
build :add_api_support
|
48
|
+
build :add_api_version_directories
|
49
|
+
build :add_api_version_base_controller
|
50
|
+
build :provide_api_routes
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def setup_git
|
55
|
+
say "Initializing git"
|
56
|
+
build :setup_git
|
57
|
+
build :provide_first_commit
|
58
|
+
end
|
59
|
+
|
60
|
+
def setup_server
|
61
|
+
say "Setting up the server"
|
62
|
+
build :setup_server
|
63
|
+
end
|
64
|
+
|
65
|
+
def setup_development_environment
|
66
|
+
say "Setting up the development environment"
|
67
|
+
build :provide_development_setup_bin
|
68
|
+
build :setup_development_mail_delivery_strategy
|
69
|
+
build :fix_i18n_deprecation_warning
|
70
|
+
build :provide_generators_configuration
|
71
|
+
end
|
72
|
+
|
73
|
+
def setup_test_environment
|
74
|
+
say "Setting up the test environment"
|
75
|
+
build :init_rspec
|
76
|
+
build :add_support_rspec_files
|
77
|
+
end
|
78
|
+
|
79
|
+
def setup_staging_environment
|
80
|
+
say "Setting up the staging environment"
|
81
|
+
build :copy_production_env_to_staging
|
82
|
+
end
|
83
|
+
|
84
|
+
def add_active_job_configuration
|
85
|
+
say "Setting up ActiveJob with DelayedJob"
|
86
|
+
build :init_delayed_job
|
87
|
+
build :add_delayed_job_active_job_configuration
|
88
|
+
end
|
89
|
+
|
90
|
+
def setup_mailer
|
91
|
+
say "Setting up Sendgrid configuration"
|
92
|
+
build :init_sendgrid_initialize_file
|
93
|
+
build :add_exception_notification_mailer_configuration
|
94
|
+
end
|
95
|
+
|
96
|
+
protected
|
97
|
+
|
98
|
+
def get_builder_class
|
99
|
+
Platter::AppBuilder
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
data/platter.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'platter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.required_ruby_version = ">= #{Platter::RUBY_VERSION}"
|
8
|
+
spec.name = "platter"
|
9
|
+
spec.version = Platter::VERSION
|
10
|
+
spec.authors = ["Icalia Labs"]
|
11
|
+
spec.email = ["kurenn@icalialabs.com"]
|
12
|
+
spec.summary = %q{A summary}
|
13
|
+
spec.description = %q{A description}
|
14
|
+
spec.homepage = ""
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
spec.executables = ['platter'] #spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
|
25
|
+
spec.add_dependency 'rails', Platter::RAILS_VERSION
|
26
|
+
spec.add_dependency 'thor'
|
27
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
ruby "<%= Platter::RUBY_VERSION %>"
|
4
|
+
|
5
|
+
gem "rails", "<%= Platter::RAILS_VERSION %>"
|
6
|
+
gem "delayed_job_active_record"
|
7
|
+
gem "jquery-rails"
|
8
|
+
gem "pg"
|
9
|
+
gem "sass-rails", "~> 5.0"
|
10
|
+
gem "coffee-rails", "~> 4.1.0"
|
11
|
+
gem "uglifier", ">= 1.3.0"
|
12
|
+
gem "puma"
|
13
|
+
|
14
|
+
group :development do
|
15
|
+
gem "spring"
|
16
|
+
gem "spring-commands-rspec"
|
17
|
+
gem "web-console"
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development, :test do
|
21
|
+
gem "awesome_print"
|
22
|
+
gem "factory_girl_rails"
|
23
|
+
gem "pry-rails"
|
24
|
+
gem "rspec-rails", "~> 3.1.0"
|
25
|
+
gem "ffaker"
|
26
|
+
end
|
27
|
+
|
28
|
+
# Test gems
|
29
|
+
group :test do
|
30
|
+
gem "database_cleaner"
|
31
|
+
gem "shoulda-matchers"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Production and staging gems
|
35
|
+
group :production, :staging do
|
36
|
+
gem "rails_12factor"
|
37
|
+
gem "exception_notification"
|
38
|
+
end
|
data/templates/Procfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# <%= app_name.humanize %>
|
2
|
+
|
3
|
+
# Getting started
|
4
|
+
|
5
|
+
This application assumes you have at least Ruby, Postgres and other dependencies to run.
|
6
|
+
If that is not the case you can use [kaishi] to install everything you need.
|
7
|
+
|
8
|
+
[kaishi]: https://github.com/IcaliaLabs/kaishi
|
9
|
+
|
10
|
+
After setting up you can start using the application:
|
11
|
+
|
12
|
+
% rails server
|
13
|
+
|
14
|
+
Or if you feel like using Foreman (comes with kaishi):
|
15
|
+
|
16
|
+
% foreman start
|
17
|
+
|
18
|
+
## Icalia Guides
|
19
|
+
|
20
|
+
Remember you can always rely on the Icalia Guides to a better development and
|
21
|
+
internal progamming style:
|
22
|
+
|
23
|
+
* [Rails Guides](https://github.com/IcaliaLabs/icalia_guides/tree/master/rails)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
|
3
|
+
# Change the line below to handle every request through a subdomain
|
4
|
+
#namespace :api, constraints: { subdomain: 'api' }, path: '/' do
|
5
|
+
namespace :api, path: '/api' do
|
6
|
+
api_version(:module => "V1", :header => {:name => "Accept",
|
7
|
+
:value => "application/vnd.<%= app_name.downcase %>.com+json; version=1"},
|
8
|
+
:defaults => {:format => :json}, :default => true) do
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
# Credits to thoughtbot
|
4
|
+
|
5
|
+
# Exit if any subcommand fails
|
6
|
+
set -e
|
7
|
+
|
8
|
+
# Set up Ruby dependencies via Bundler
|
9
|
+
gem install bundler --conservative
|
10
|
+
bundle check || bundle install
|
11
|
+
|
12
|
+
# Set up database and add any development seed data
|
13
|
+
bundle exec rake db:setup
|
14
|
+
|
15
|
+
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
|
16
|
+
mkdir -p .git/safe
|
17
|
+
|
18
|
+
# Pick a port for Foreman
|
19
|
+
if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
|
20
|
+
printf 'port: <%= config[:port_number] %>\n' >> .foreman
|
21
|
+
fi
|
22
|
+
|
23
|
+
if ! command -v foreman > /dev/null; then
|
24
|
+
printf 'Foreman is not installed.\n'
|
25
|
+
printf 'See https://github.com/ddollar/foreman for install instructions.\n'
|
26
|
+
fi
|
@@ -0,0 +1,11 @@
|
|
1
|
+
if Rails.env.staging? || Rails.env.production?
|
2
|
+
ActionMailer::Base.smtp_settings = {
|
3
|
+
:user_name => ENV['SENDGRID_USERNAME'],
|
4
|
+
:password => ENV['SENDGRID_PASSWORD'],
|
5
|
+
:domain => ENV['SENDGRID_DOMAIN'],
|
6
|
+
:address => "smtp.sendgrid.net",
|
7
|
+
:port => 587,
|
8
|
+
:authentication => :plain,
|
9
|
+
:enable_starttls_auto => true
|
10
|
+
}
|
11
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
17
|
+
|
18
|
+
# Extra files to ignore
|
19
|
+
doc/
|
20
|
+
*.swp
|
21
|
+
*.swo
|
22
|
+
*~
|
23
|
+
.DS_Store
|
24
|
+
|
25
|
+
!.keep
|
26
|
+
/.foreman
|
27
|
+
/public/system
|
28
|
+
/public/assets
|
29
|
+
/public/uploads
|
30
|
+
.sass-cache/*
|
31
|
+
*.dump
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
26
|
+
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
30
|
+
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
33
|
+
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
36
|
+
config.assets.digest = true
|
37
|
+
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
|
+
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
43
|
+
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
46
|
+
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
50
|
+
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
53
|
+
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
56
|
+
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
59
|
+
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
79
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'database_cleaner'
|
2
|
+
RSpec.configure do |config|
|
3
|
+
config.before(:suite) do
|
4
|
+
DatabaseCleaner.strategy = :truncation
|
5
|
+
DatabaseCleaner.clean_with(:truncation)
|
6
|
+
end
|
7
|
+
config.before(:each) do
|
8
|
+
DatabaseCleaner.start
|
9
|
+
end
|
10
|
+
config.after(:each) do
|
11
|
+
DatabaseCleaner.clean
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: platter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Icalia Labs
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.2.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.2.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: A description
|
70
|
+
email:
|
71
|
+
- kurenn@icalialabs.com
|
72
|
+
executables:
|
73
|
+
- platter
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/platter
|
83
|
+
- lib/platter.rb
|
84
|
+
- lib/platter/app_builder.rb
|
85
|
+
- lib/platter/generators/app_generator.rb
|
86
|
+
- lib/platter/version.rb
|
87
|
+
- platter.gemspec
|
88
|
+
- templates/Gemfile.erb
|
89
|
+
- templates/Procfile
|
90
|
+
- templates/README.md.erb
|
91
|
+
- templates/api_routes.erb
|
92
|
+
- templates/base_api_controller.erb
|
93
|
+
- templates/bin_development_setup.rb
|
94
|
+
- templates/mailer_initializer_config.erb
|
95
|
+
- templates/platter_gitignore
|
96
|
+
- templates/production_env.erb
|
97
|
+
- templates/rspec_support_database_cleaner.erb
|
98
|
+
- templates/rspec_support_factory_girl.erb
|
99
|
+
- templates/rspec_support_i18n.erb
|
100
|
+
homepage: ''
|
101
|
+
licenses:
|
102
|
+
- MIT
|
103
|
+
metadata: {}
|
104
|
+
post_install_message:
|
105
|
+
rdoc_options: []
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 2.2.1
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
requirements: []
|
119
|
+
rubyforge_project:
|
120
|
+
rubygems_version: 2.4.2
|
121
|
+
signing_key:
|
122
|
+
specification_version: 4
|
123
|
+
summary: A summary
|
124
|
+
test_files: []
|
125
|
+
has_rdoc:
|