roboparts 0.0.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +108 -0
  6. data/LICENSE.md +21 -0
  7. data/README.md +74 -0
  8. data/bin/rake +16 -0
  9. data/bin/roboparts +13 -0
  10. data/bin/rspec +16 -0
  11. data/bin/setup +13 -0
  12. data/lib/roboparts.rb +4 -0
  13. data/lib/roboparts/actions.rb +25 -0
  14. data/lib/roboparts/app_builder.rb +352 -0
  15. data/lib/roboparts/generators/app_generator.rb +179 -0
  16. data/lib/roboparts/version.rb +5 -0
  17. data/roboparts.gemspec +29 -0
  18. data/templates/Gemfile.erb +38 -0
  19. data/templates/_analytics.html.erb +12 -0
  20. data/templates/_flashes.html.erb +7 -0
  21. data/templates/_javascript.html.erb +12 -0
  22. data/templates/action_mailer.rb +5 -0
  23. data/templates/application.css.scss +7 -0
  24. data/templates/background_jobs_rspec.rb +19 -0
  25. data/templates/bin_setup.erb +31 -0
  26. data/templates/bundler_audit.rake +12 -0
  27. data/templates/config_i18n_tasks.yml +13 -0
  28. data/templates/config_locales_en.yml.erb +17 -0
  29. data/templates/database_cleaner_rspec.rb +21 -0
  30. data/templates/development_seeds.rb +12 -0
  31. data/templates/disable_xml_params.rb +3 -0
  32. data/templates/errors.rb +34 -0
  33. data/templates/factory_girl_rspec.rb +3 -0
  34. data/templates/i18n.rb +3 -0
  35. data/templates/json_encoding.rb +1 -0
  36. data/templates/postgresql_database.yml.erb +12 -0
  37. data/templates/rack_timeout.rb +1 -0
  38. data/templates/rails_helper.rb +23 -0
  39. data/templates/roboparts_gitignore +13 -0
  40. data/templates/roboparts_layout.html.erb.erb +16 -0
  41. data/templates/secrets.yml +14 -0
  42. data/templates/smtp.rb +9 -0
  43. data/templates/spec_helper.rb +15 -0
  44. data/templates/staging.rb +5 -0
  45. data/templates/unicorn.rb +28 -0
  46. metadata +49 -4
@@ -0,0 +1,3 @@
1
+ # Protect against injection attacks
2
+ # http://www.kb.cert.org/vuls/id/380039
3
+ ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)
@@ -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
@@ -0,0 +1,3 @@
1
+ Rspec.configure do |config|
2
+ config.include FactoryGirl::Syntax::Methods
3
+ end
data/templates/i18n.rb ADDED
@@ -0,0 +1,3 @@
1
+ Rspec.configure do |config|
2
+ config.include AbstractController::Translation
3
+ end
@@ -0,0 +1 @@
1
+ ActiveSupport::JSON::Encoding.time_precision = 0
@@ -0,0 +1,12 @@
1
+ development: &default
2
+ adapter: postgresql
3
+ database: <%= app_name %>_development
4
+ encoding: utf8
5
+ host: localhost
6
+ min_messages: warning
7
+ pool: 2
8
+ timeout: 5000
9
+
10
+ test:
11
+ <<: *default
12
+ database: <%= app_name %>_test
@@ -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,13 @@
1
+ !.keep
2
+ *.DS_Store
3
+ *.swo
4
+ *.swp
5
+ /.bundle
6
+ /.env
7
+ /.foreman
8
+ /coverage/*
9
+ /db/*.sqlite3
10
+ /log/*
11
+ /public/system
12
+ /tags
13
+ /tmp/*
@@ -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>
@@ -0,0 +1,14 @@
1
+ default: &default
2
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
3
+
4
+ development:
5
+ <<: *default
6
+
7
+ test:
8
+ <<: *default
9
+
10
+ staging:
11
+ <<: *default
12
+
13
+ production:
14
+ <<: *default
data/templates/smtp.rb ADDED
@@ -0,0 +1,9 @@
1
+ SMTP_SETTINGS = {
2
+ address: ENV.fetch("SMTP_ADDRESS"),
3
+ authentication: :plain,
4
+ domain: ENV.fetch("SMTP_DOMAIN"),
5
+ enable_starttls_auto: true,
6
+ password: ENV.fetch("SMTP_PASSWORD"),
7
+ port: "587",
8
+ user_name: ENV.fetch("SMTP_USERNAME")
9
+ }
@@ -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,5 @@
1
+ require_relative "production"
2
+
3
+ Mail.register_interceptor(
4
+ RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS"))
5
+ )
@@ -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.0.1
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 00:00:00.000000000 Z
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