re-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/CONTRIBUTING.md +38 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +133 -0
  6. data/LICENSE +21 -0
  7. data/README.md +181 -0
  8. data/Rakefile +13 -0
  9. data/bin/suspenders +18 -0
  10. data/lib/suspenders.rb +3 -0
  11. data/lib/suspenders/actions.rb +35 -0
  12. data/lib/suspenders/app_builder.rb +323 -0
  13. data/lib/suspenders/generators/app_generator.rb +199 -0
  14. data/lib/suspenders/version.rb +3 -0
  15. data/re-rails.gemspec +32 -0
  16. data/spec/fakes/bin/heroku +5 -0
  17. data/spec/fakes/bin/hub +5 -0
  18. data/spec/features/github_spec.rb +10 -0
  19. data/spec/features/heroku_spec.rb +12 -0
  20. data/spec/features/new_project_spec.rb +23 -0
  21. data/spec/spec_helper.rb +24 -0
  22. data/spec/support/fake_github.rb +21 -0
  23. data/spec/support/fake_heroku.rb +30 -0
  24. data/spec/support/suspenders.rb +50 -0
  25. data/templates/Gemfile_clean +49 -0
  26. data/templates/Procfile +2 -0
  27. data/templates/README.md.erb +25 -0
  28. data/templates/_flashes.html.erb +5 -0
  29. data/templates/_javascript.html.erb +10 -0
  30. data/templates/application.css.scss +8 -0
  31. data/templates/background_jobs_rspec.rb +19 -0
  32. data/templates/bin_setup +29 -0
  33. data/templates/config_locales_en.yml +11 -0
  34. data/templates/database_cleaner_rspec.rb +21 -0
  35. data/templates/disable_xml_params.rb +3 -0
  36. data/templates/errors.rb +28 -0
  37. data/templates/factories_spec.rb +13 -0
  38. data/templates/factories_spec_rake_task.rb +9 -0
  39. data/templates/factory_girl_syntax_rspec.rb +3 -0
  40. data/templates/postgresql_database.yml.erb +11 -0
  41. data/templates/rack_timeout.rb +1 -0
  42. data/templates/sample.env +3 -0
  43. data/templates/secret_token.rb +10 -0
  44. data/templates/smtp.rb +10 -0
  45. data/templates/spec_helper.rb +30 -0
  46. data/templates/staging.rb +3 -0
  47. data/templates/suspenders_gitignore +13 -0
  48. data/templates/suspenders_layout.html.erb.erb +15 -0
  49. data/templates/unicorn.rb +29 -0
  50. metadata +190 -0
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ FactoryGirl.factories.map(&:name).each do |factory_name|
4
+ describe "factory #{factory_name}" do
5
+ it 'is valid' do
6
+ factory = build(factory_name)
7
+
8
+ if factory.respond_to?(:valid?)
9
+ expect(factory).to be_valid, factory.errors.full_messages.join(',')
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ if defined?(RSpec)
2
+ desc 'Run factory specs.'
3
+
4
+ RSpec::Core::RakeTask.new(:factory_specs) do |t|
5
+ t.pattern = './spec/models/factories_spec.rb'
6
+ end
7
+
8
+ task spec: :factory_specs
9
+ end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include FactoryGirl::Syntax::Methods
3
+ end
@@ -0,0 +1,11 @@
1
+ development: &default
2
+ adapter: postgresql
3
+ database: <%= app_name %>_development
4
+ encoding: utf8
5
+ min_messages: warning
6
+ pool: 2
7
+ timeout: 5000
8
+
9
+ test:
10
+ <<: *default
11
+ database: <%= app_name %>_test
@@ -0,0 +1 @@
1
+ Rack::Timeout.timeout = (ENV['TIMEOUT_IN_SECONDS'] || 5).to_i
@@ -0,0 +1,3 @@
1
+ # http://ddollar.github.com/foreman/
2
+ RACK_ENV=development
3
+ SECRET_KEY_BASE=development_secret
@@ -0,0 +1,10 @@
1
+ # Your secret key is used for verifying the integrity of signed cookies.
2
+ # If you change this key, all old signed cookies will become invalid!
3
+
4
+ # Make sure the secret is at least 30 characters and all random,
5
+ # no regular words or you'll be exposed to dictionary attacks.
6
+ # You can use `rake secret` to generate a secure secret key.
7
+
8
+ # Make sure your secret_key_base is kept private
9
+ # if you're sharing your code publicly.
10
+ <%= app_const %>.config.secret_key_base = ENV['SECRET_KEY_BASE']
data/templates/smtp.rb ADDED
@@ -0,0 +1,10 @@
1
+ if Rails.env.staging? || Rails.env.production?
2
+ SMTP_SETTINGS = {
3
+ address: ENV['SMTP_ADDRESS'], # example: 'smtp.sendgrid.net'
4
+ authentication: :plain,
5
+ domain: ENV['SMTP_DOMAIN'], # example: 'this-app.com'
6
+ password: ENV['SMTP_PASSWORD'],
7
+ port: '587',
8
+ user_name: ENV['SMTP_USERNAME']
9
+ }
10
+ end
@@ -0,0 +1,30 @@
1
+ require 'simplecov'
2
+ SimpleCov.start 'rails'
3
+
4
+ ENV['RAILS_ENV'] = 'test'
5
+
6
+ require File.expand_path('../../config/environment', __FILE__)
7
+
8
+ require 'rspec/rails'
9
+ require 'webmock/rspec'
10
+
11
+ Dir[Rails.root.join('spec/support/**/*.rb')].each { |file| require file }
12
+
13
+ module Features
14
+ # Extend this module in spec/support/features/*.rb
15
+ end
16
+
17
+ RSpec.configure do |config|
18
+ config.expect_with :rspec do |c|
19
+ c.syntax = :expect
20
+ end
21
+
22
+ config.fail_fast = true
23
+ config.include Features, type: :feature
24
+ config.infer_base_class_for_anonymous_controllers = false
25
+ config.order = 'random'
26
+ config.use_transactional_fixtures = false
27
+ end
28
+
29
+ Capybara.javascript_driver = :webkit
30
+ WebMock.disable_net_connect!(allow_localhost: true)
@@ -0,0 +1,3 @@
1
+ require_relative 'production'
2
+
3
+ Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'])
@@ -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,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="ROBOTS" content="NOODP" />
6
+ <title><%%= page_title %></title>
7
+ <%%= stylesheet_link_tag :application, :media => 'all' %>
8
+ <%%= csrf_meta_tags %>
9
+ </head>
10
+ <body class="<%%= body_class %>">
11
+ <%%= render 'flashes' -%>
12
+ <%%= yield %>
13
+ <%%= render 'javascript' %>
14
+ </body>
15
+ </html>
@@ -0,0 +1,29 @@
1
+ # https://devcenter.heroku.com/articles/rails-unicorn
2
+
3
+ worker_processes (ENV['WEB_CONCURRENCY'] || 3).to_i
4
+ timeout (ENV['WEB_TIMEOUT'] || 5).to_i
5
+ preload_app true
6
+
7
+ before_fork do |server, worker|
8
+ Signal.trap 'TERM' do
9
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
10
+ Process.kill 'QUIT', Process.pid
11
+ end
12
+
13
+ if defined? ActiveRecord::Base
14
+ ActiveRecord::Base.connection.disconnect!
15
+ end
16
+ end
17
+
18
+ after_fork do |server, worker|
19
+ Signal.trap 'TERM' do
20
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
21
+ end
22
+
23
+ if defined? ActiveRecord::Base
24
+ config = Rails.application.config.database_configuration[Rails.env]
25
+ config['reaping_frequency'] = (ENV['DB_REAPING_FREQUENCY'] || 10).to_i
26
+ config['pool'] = (ENV['DB_POOL'] || 2).to_i
27
+ ActiveRecord::Base.establish_connection(config)
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: re-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - thoughtbot
8
+ - re-anayltics
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-02-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 4.0.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 4.0.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: aruba
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 0.5.2
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 0.5.2
56
+ - !ruby/object:Gem::Dependency
57
+ name: cucumber
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.2'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.2'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: capybara
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ description: |2
99
+ Base rails application template generator based off suspenders by thoughtbot
100
+ email: admin@joshburns.cu.cc
101
+ executables:
102
+ - suspenders
103
+ extensions: []
104
+ extra_rdoc_files:
105
+ - README.md
106
+ - LICENSE
107
+ files:
108
+ - ".gitignore"
109
+ - CONTRIBUTING.md
110
+ - Gemfile
111
+ - Gemfile.lock
112
+ - LICENSE
113
+ - README.md
114
+ - Rakefile
115
+ - bin/suspenders
116
+ - lib/suspenders.rb
117
+ - lib/suspenders/actions.rb
118
+ - lib/suspenders/app_builder.rb
119
+ - lib/suspenders/generators/app_generator.rb
120
+ - lib/suspenders/version.rb
121
+ - re-rails.gemspec
122
+ - spec/fakes/bin/heroku
123
+ - spec/fakes/bin/hub
124
+ - spec/features/github_spec.rb
125
+ - spec/features/heroku_spec.rb
126
+ - spec/features/new_project_spec.rb
127
+ - spec/spec_helper.rb
128
+ - spec/support/fake_github.rb
129
+ - spec/support/fake_heroku.rb
130
+ - spec/support/suspenders.rb
131
+ - templates/Gemfile_clean
132
+ - templates/Procfile
133
+ - templates/README.md.erb
134
+ - templates/_flashes.html.erb
135
+ - templates/_javascript.html.erb
136
+ - templates/application.css.scss
137
+ - templates/background_jobs_rspec.rb
138
+ - templates/bin_setup
139
+ - templates/config_locales_en.yml
140
+ - templates/database_cleaner_rspec.rb
141
+ - templates/disable_xml_params.rb
142
+ - templates/errors.rb
143
+ - templates/factories_spec.rb
144
+ - templates/factories_spec_rake_task.rb
145
+ - templates/factory_girl_syntax_rspec.rb
146
+ - templates/postgresql_database.yml.erb
147
+ - templates/rack_timeout.rb
148
+ - templates/sample.env
149
+ - templates/secret_token.rb
150
+ - templates/smtp.rb
151
+ - templates/spec_helper.rb
152
+ - templates/staging.rb
153
+ - templates/suspenders_gitignore
154
+ - templates/suspenders_layout.html.erb.erb
155
+ - templates/unicorn.rb
156
+ homepage: http://github.com/re-anayltics/re-rails
157
+ licenses:
158
+ - MIT
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options:
162
+ - "--charset=UTF-8"
163
+ require_paths:
164
+ - lib
165
+ required_ruby_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 1.9.2
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ requirements: []
176
+ rubyforge_project:
177
+ rubygems_version: 2.2.1
178
+ signing_key:
179
+ specification_version: 4
180
+ summary: Generate a Rails app using thoughtbot's best practices.
181
+ test_files:
182
+ - spec/fakes/bin/heroku
183
+ - spec/fakes/bin/hub
184
+ - spec/features/github_spec.rb
185
+ - spec/features/heroku_spec.rb
186
+ - spec/features/new_project_spec.rb
187
+ - spec/spec_helper.rb
188
+ - spec/support/fake_github.rb
189
+ - spec/support/fake_heroku.rb
190
+ - spec/support/suspenders.rb