roboparts 0.0.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +108 -0
- data/LICENSE.md +21 -0
- data/README.md +74 -0
- data/bin/rake +16 -0
- data/bin/roboparts +13 -0
- data/bin/rspec +16 -0
- data/bin/setup +13 -0
- data/lib/roboparts.rb +4 -0
- data/lib/roboparts/actions.rb +25 -0
- data/lib/roboparts/app_builder.rb +352 -0
- data/lib/roboparts/generators/app_generator.rb +179 -0
- data/lib/roboparts/version.rb +5 -0
- data/roboparts.gemspec +29 -0
- data/templates/Gemfile.erb +38 -0
- data/templates/_analytics.html.erb +12 -0
- data/templates/_flashes.html.erb +7 -0
- data/templates/_javascript.html.erb +12 -0
- data/templates/action_mailer.rb +5 -0
- data/templates/application.css.scss +7 -0
- data/templates/background_jobs_rspec.rb +19 -0
- data/templates/bin_setup.erb +31 -0
- data/templates/bundler_audit.rake +12 -0
- data/templates/config_i18n_tasks.yml +13 -0
- data/templates/config_locales_en.yml.erb +17 -0
- data/templates/database_cleaner_rspec.rb +21 -0
- data/templates/development_seeds.rb +12 -0
- data/templates/disable_xml_params.rb +3 -0
- data/templates/errors.rb +34 -0
- data/templates/factory_girl_rspec.rb +3 -0
- data/templates/i18n.rb +3 -0
- data/templates/json_encoding.rb +1 -0
- data/templates/postgresql_database.yml.erb +12 -0
- data/templates/rack_timeout.rb +1 -0
- data/templates/rails_helper.rb +23 -0
- data/templates/roboparts_gitignore +13 -0
- data/templates/roboparts_layout.html.erb.erb +16 -0
- data/templates/secrets.yml +14 -0
- data/templates/smtp.rb +9 -0
- data/templates/spec_helper.rb +15 -0
- data/templates/staging.rb +5 -0
- data/templates/unicorn.rb +28 -0
- metadata +49 -4
data/templates/errors.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "net/http"
|
2
|
+
require "net/smtp"
|
3
|
+
|
4
|
+
# Example:
|
5
|
+
# begin
|
6
|
+
# some http call
|
7
|
+
# rescue *HTTP_ERRORS => error
|
8
|
+
# notify_hoptoad error
|
9
|
+
# end
|
10
|
+
|
11
|
+
HTTP_ERRORS = [
|
12
|
+
EOFError,
|
13
|
+
Errno::ECONNRESET,
|
14
|
+
Errno::EINVAL,
|
15
|
+
Net::HTTPBadResponse,
|
16
|
+
Net::HTTPHeaderSyntaxError,
|
17
|
+
Net::ProtocolError,
|
18
|
+
Timeout::Error
|
19
|
+
]
|
20
|
+
|
21
|
+
SMTP_SERVER_ERRORS = [
|
22
|
+
IOError,
|
23
|
+
Net::SMTPAuthenticationError,
|
24
|
+
Net::SMTPServerBusy,
|
25
|
+
Net::SMTPUnknownError,
|
26
|
+
TimeoutError
|
27
|
+
]
|
28
|
+
|
29
|
+
SMTP_CLIENT_ERRORS = [
|
30
|
+
Net::SMTPFatalError,
|
31
|
+
Net::SMTPSyntaxError
|
32
|
+
]
|
33
|
+
|
34
|
+
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
|
data/templates/i18n.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ActiveSupport::JSON::Encoding.time_precision = 0
|
@@ -0,0 +1 @@
|
|
1
|
+
Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
|
@@ -0,0 +1,23 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
|
5
|
+
require "rspec/rails"
|
6
|
+
require "shoulda/matchers"
|
7
|
+
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |file| require file }
|
9
|
+
|
10
|
+
module Features
|
11
|
+
# Extend this module in spec/support/features/*.rb
|
12
|
+
include Formulaic::Dsl
|
13
|
+
end
|
14
|
+
|
15
|
+
Rspec.configure do |config|
|
16
|
+
config.include Features, type: :feature
|
17
|
+
config.infer_base_class_for_anonymous_controllers = false
|
18
|
+
config.infer_spec_type_from_file_location!
|
19
|
+
config.use_transactional_fixtures = falsed
|
20
|
+
end
|
21
|
+
|
22
|
+
ActiveRecord::Migration.maintain_test_schema!
|
23
|
+
Capybara.javascript_driver = :webkit
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="ROBOTS" content="NOODP" />
|
6
|
+
<meta name="viewport" content="initial-scale=1" />
|
7
|
+
<title><%%= title %></title>
|
8
|
+
<%%= stylesheet_link_tag :application, media: "all" %>
|
9
|
+
<%%= csrf_meta_tags %>
|
10
|
+
</head>
|
11
|
+
<body class="<%%= body_class %>">
|
12
|
+
<%%= render "flashes" -%>
|
13
|
+
<%%= yield %>
|
14
|
+
<%%= render "javascript" %>
|
15
|
+
</body>
|
16
|
+
</html>
|
data/templates/smtp.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "webmock/rspec"
|
2
|
+
|
3
|
+
Rspec.configure do |config|
|
4
|
+
config.expect_with :rspec do |expectations|
|
5
|
+
expectations.syntax = :expect
|
6
|
+
end
|
7
|
+
|
8
|
+
config.mock_with :rspec do |mocks|
|
9
|
+
mocks.syntax = :expect
|
10
|
+
end
|
11
|
+
|
12
|
+
config.order = :random
|
13
|
+
end
|
14
|
+
|
15
|
+
WebMock.disable_net_connect!(allow_localhost: true)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
|
2
|
+
timeout (ENV["UNICORN_TIMEOUT"] || 15).to_i
|
3
|
+
preload_app true
|
4
|
+
|
5
|
+
before_fork do |server, worker|
|
6
|
+
Signal.trap "TERM" do
|
7
|
+
puts "Unicorn master intercepting TERM and sending myself QUIT instead"
|
8
|
+
Process.kill "QUIT", Process.pid
|
9
|
+
end
|
10
|
+
|
11
|
+
if defined? ActiveRecord::Base
|
12
|
+
ActiveRecord::Base.connection.disconnect!
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
after_fork do |server, worker|
|
17
|
+
Signal.trap "TERM" do
|
18
|
+
puts "Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT"
|
19
|
+
end
|
20
|
+
|
21
|
+
if defined? ActiveRecord::Base
|
22
|
+
config = ActiveRecord::Base.configurations[Rails.env] ||
|
23
|
+
Rails.application.config.database_configuration[Rails.env]
|
24
|
+
config["reaping_frequency"] = (ENV["DB_REAPING_FREQUENCY"] || 10).to_i
|
25
|
+
config["pool"] = (ENV["DB_POOL"] || 2).to_i
|
26
|
+
ActiveRecord::Base.establish_connection(config)
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roboparts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Strunk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -77,10 +77,55 @@ description: "Roboparts is a base Rails project that you can upgrade. It is used
|
|
77
77
|
heavily inspired \nby Thoughtbot's Suspenders, but is more tailored to small team
|
78
78
|
development and \nhas different preferences.\n"
|
79
79
|
email: daniel@silentpost.co
|
80
|
-
executables:
|
80
|
+
executables:
|
81
|
+
- roboparts
|
81
82
|
extensions: []
|
82
83
|
extra_rdoc_files: []
|
83
|
-
files:
|
84
|
+
files:
|
85
|
+
- ".DS_Store"
|
86
|
+
- ".ruby-version"
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
- LICENSE.md
|
90
|
+
- README.md
|
91
|
+
- bin/rake
|
92
|
+
- bin/roboparts
|
93
|
+
- bin/rspec
|
94
|
+
- bin/setup
|
95
|
+
- lib/roboparts.rb
|
96
|
+
- lib/roboparts/actions.rb
|
97
|
+
- lib/roboparts/app_builder.rb
|
98
|
+
- lib/roboparts/generators/app_generator.rb
|
99
|
+
- lib/roboparts/version.rb
|
100
|
+
- roboparts.gemspec
|
101
|
+
- templates/Gemfile.erb
|
102
|
+
- templates/_analytics.html.erb
|
103
|
+
- templates/_flashes.html.erb
|
104
|
+
- templates/_javascript.html.erb
|
105
|
+
- templates/action_mailer.rb
|
106
|
+
- templates/application.css.scss
|
107
|
+
- templates/background_jobs_rspec.rb
|
108
|
+
- templates/bin_setup.erb
|
109
|
+
- templates/bundler_audit.rake
|
110
|
+
- templates/config_i18n_tasks.yml
|
111
|
+
- templates/config_locales_en.yml.erb
|
112
|
+
- templates/database_cleaner_rspec.rb
|
113
|
+
- templates/development_seeds.rb
|
114
|
+
- templates/disable_xml_params.rb
|
115
|
+
- templates/errors.rb
|
116
|
+
- templates/factory_girl_rspec.rb
|
117
|
+
- templates/i18n.rb
|
118
|
+
- templates/json_encoding.rb
|
119
|
+
- templates/postgresql_database.yml.erb
|
120
|
+
- templates/rack_timeout.rb
|
121
|
+
- templates/rails_helper.rb
|
122
|
+
- templates/roboparts_gitignore
|
123
|
+
- templates/roboparts_layout.html.erb.erb
|
124
|
+
- templates/secrets.yml
|
125
|
+
- templates/smtp.rb
|
126
|
+
- templates/spec_helper.rb
|
127
|
+
- templates/staging.rb
|
128
|
+
- templates/unicorn.rb
|
84
129
|
homepage: http://silentpost.co/roboparts
|
85
130
|
licenses:
|
86
131
|
- MIT
|