rail_pass 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +20 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/rail_pass/application.js +15 -0
  5. data/app/assets/stylesheets/rail_pass/application.css +13 -0
  6. data/app/controllers/rail_pass/application_controller.rb +4 -0
  7. data/app/controllers/rail_pass/styleguide_controller.rb +7 -0
  8. data/app/helpers/rail_pass/application_helper.rb +4 -0
  9. data/app/views/rail_pass/styleguide/index.html.haml +104 -0
  10. data/config/routes.rb +3 -0
  11. data/lib/generators/rail_pass/install_generator.rb +220 -0
  12. data/lib/generators/templates/Procfile +1 -0
  13. data/lib/generators/templates/app/assets/javascripts/application.js +17 -0
  14. data/lib/generators/templates/app/assets/javascripts/html5.js +14 -0
  15. data/lib/generators/templates/app/assets/javascripts/polyfills.js +14 -0
  16. data/lib/generators/templates/app/assets/javascripts/responsive.js +14 -0
  17. data/lib/generators/templates/app/assets/javascripts/scripts.js.coffee +0 -0
  18. data/lib/generators/templates/app/assets/stylesheets/application.css.scss +26 -0
  19. data/lib/generators/templates/app/assets/stylesheets/base/_colors.scss +1 -0
  20. data/lib/generators/templates/app/assets/stylesheets/base/_defaults.scss +27 -0
  21. data/lib/generators/templates/app/assets/stylesheets/base/_forms.scss +0 -0
  22. data/lib/generators/templates/app/assets/stylesheets/base/_settings.scss +0 -0
  23. data/lib/generators/templates/app/assets/stylesheets/base/_typography.scss +3 -0
  24. data/lib/generators/templates/app/assets/stylesheets/layout/_containers.scss +18 -0
  25. data/lib/generators/templates/app/assets/stylesheets/layout/_footer.scss +1 -0
  26. data/lib/generators/templates/app/assets/stylesheets/layout/_header.scss +1 -0
  27. data/lib/generators/templates/app/assets/stylesheets/layout/_settings.scss +1 -0
  28. data/lib/generators/templates/app/assets/stylesheets/modules/_buttons.scss +15 -0
  29. data/lib/generators/templates/app/controllers/pages_controller.rb +2 -0
  30. data/lib/generators/templates/app/helpers/application_helper.rb +87 -0
  31. data/lib/generators/templates/app/views/errors/404.html.haml +3 -0
  32. data/lib/generators/templates/app/views/layouts/application.html.haml +124 -0
  33. data/lib/generators/templates/app/views/pages/index.html.haml +0 -0
  34. data/lib/generators/templates/config/deploy.rb +34 -0
  35. data/lib/generators/templates/config/initializers/dev_environment.rb +6 -0
  36. data/lib/generators/templates/config/initializers/new_relic.rb +5 -0
  37. data/lib/generators/templates/config/mongoid.yml +68 -0
  38. data/lib/generators/templates/config/newrelic.yml +255 -0
  39. data/lib/generators/templates/config/recipes/base.rb +86 -0
  40. data/lib/generators/templates/config/recipes/check.rb +13 -0
  41. data/lib/generators/templates/config/recipes/mongodb/install-outdated.rb +41 -0
  42. data/lib/generators/templates/config/recipes/mongodb/install.rb +45 -0
  43. data/lib/generators/templates/config/recipes/mongodb/manage.rb +27 -0
  44. data/lib/generators/templates/config/recipes/mongodb.rb +73 -0
  45. data/lib/generators/templates/config/recipes/mysql.rb +152 -0
  46. data/lib/generators/templates/config/recipes/nginx.rb +25 -0
  47. data/lib/generators/templates/config/recipes/nodejs.rb +9 -0
  48. data/lib/generators/templates/config/recipes/postgresql.rb +34 -0
  49. data/lib/generators/templates/config/recipes/rbenv.rb +29 -0
  50. data/lib/generators/templates/config/recipes/redis.rb +18 -0
  51. data/lib/generators/templates/config/recipes/ruby.rb +93 -0
  52. data/lib/generators/templates/config/recipes/templates/foreman.erb +2 -0
  53. data/lib/generators/templates/config/recipes/templates/gitlab.yml.erb +29 -0
  54. data/lib/generators/templates/config/recipes/templates/mongoid.yml.erb +10 -0
  55. data/lib/generators/templates/config/recipes/templates/mysql.yml.erb +7 -0
  56. data/lib/generators/templates/config/recipes/templates/nginx_unicorn.erb +27 -0
  57. data/lib/generators/templates/config/recipes/templates/postgresql.yml.erb +8 -0
  58. data/lib/generators/templates/config/recipes/templates/unicorn.rb.erb +8 -0
  59. data/lib/generators/templates/config/recipes/templates/unicorn_init.erb +84 -0
  60. data/lib/generators/templates/config/recipes/unicorn.rb +28 -0
  61. data/lib/generators/templates/config/recipes/utilities.rb +144 -0
  62. data/lib/generators/templates/config/unicorn.rb +2 -0
  63. data/lib/generators/templates/public/422.html +54 -0
  64. data/lib/generators/templates/public/500.html +54 -0
  65. data/lib/generators/templates/spec/spec_helper.rb +41 -0
  66. data/lib/generators/templates/vendor/assets/fonts/fontawesome/fontawesome-webfont.eot +0 -0
  67. data/lib/generators/templates/vendor/assets/fonts/fontawesome/fontawesome-webfont.ttf +0 -0
  68. data/lib/generators/templates/vendor/assets/fonts/fontawesome/fontawesome-webfont.woff +0 -0
  69. data/lib/generators/templates/vendor/assets/fonts/icomoon/icomoon.eot +0 -0
  70. data/lib/generators/templates/vendor/assets/fonts/icomoon/icomoon.svg +36 -0
  71. data/lib/generators/templates/vendor/assets/fonts/icomoon/icomoon.ttf +0 -0
  72. data/lib/generators/templates/vendor/assets/fonts/icomoon/icomoon.woff +0 -0
  73. data/lib/generators/templates/vendor/assets/javascripts/jquery.ui.touch-punch.min.js +11 -0
  74. data/lib/generators/templates/vendor/assets/javascripts/polyfills/html5shim.js +3 -0
  75. data/lib/generators/templates/vendor/assets/javascripts/polyfills/modernizr.js +4 -0
  76. data/lib/generators/templates/vendor/assets/javascripts/polyfills/respond.js +15 -0
  77. data/lib/generators/templates/vendor/assets/javascripts/polyfills/selectivizr.js +560 -0
  78. data/lib/generators/templates/vendor/assets/stylesheets/font-awesome.scss +493 -0
  79. data/lib/generators/templates/vendor/assets/stylesheets/icomoon.scss +22 -0
  80. data/lib/rail_pass/engine.rb +5 -0
  81. data/lib/rail_pass/version.rb +3 -0
  82. data/lib/rail_pass.rb +4 -0
  83. data/lib/tasks/rail_pass_tasks.rake +4 -0
  84. metadata +146 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 LaCroix Design Co.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Rail Pass
2
+
3
+ Rail Pass is a Ruby on Rails engine to configure new projects with the default settings and templates used at LaCroix Design Co.
4
+
5
+ ## Installation
6
+
7
+ DISCLAIMER: The installation generator for this engine is extremely destructive and only intended for brand-new projects. Running it on an existing project will likely overwrite important files.
8
+
9
+ To install, add this line to your Rails application's Gemfile:
10
+
11
+ gem 'rail_pass'
12
+
13
+ Run `bundle install` and then execute:
14
+
15
+ rails generate rail_pass:install
16
+
17
+ ## License
18
+
19
+ Copyright © 2013 LaCroix Design Co.
20
+ Released under the MIT License
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'RailPass'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,4 @@
1
+ module RailPass
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module RailPass
2
+ class StyleguideController < RailPass::ApplicationController
3
+ layout "application"
4
+ def index
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ module RailPass
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,104 @@
1
+ .grid-constrained
2
+ %header
3
+ %h1 Style Guide
4
+ %hr
5
+
6
+ %article#typography
7
+
8
+ %h1 h1 &ndash; Heading 1
9
+ %h2 h2 &ndash; Heading 2
10
+ %h3 h3 &ndash; Heading 3
11
+ %h4 h4 &ndash; Heading 4
12
+ %h5 h5 &ndash; Heading 5
13
+ %h6 h6 &ndash; Heading 6
14
+ %br
15
+
16
+ %p
17
+ Paragraph with
18
+ %a{ href: "#" } an example LINK element,
19
+ %em an example EM element,
20
+ %strong an example STRONG element,
21
+ and
22
+ %small an example SMALL element.
23
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
24
+
25
+ %blockquote Blockquote. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
26
+ %blockquote
27
+ %cite Blockquote Cite. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
28
+
29
+ %h3 Unordered List
30
+ %ul
31
+ %li Unordered list item
32
+ %li Unordered list item
33
+ %li Unordered list item
34
+ %h3 Ordered List
35
+ %ol
36
+ %li Ordered list item
37
+ %li Ordered list item
38
+ %li Ordered list item
39
+ %hr
40
+
41
+
42
+ %article#buttons
43
+ %h2 Buttons
44
+ %p
45
+ %button.btn Standard Button
46
+ / %br
47
+ / %br
48
+ / %button.btn.btn-small Small Button
49
+ / %button.btn.btn-big Large Button
50
+ / %button.btn.btn-round Round Button
51
+ / %button.btn.btn-square Square Button
52
+ / %button.btn.btn-active Active Button
53
+ / %button.btn{ disabled: true } Disabled Button
54
+ %hr
55
+
56
+
57
+ %article#forms
58
+ %h2 Forms
59
+ %form
60
+ %label Text Input
61
+ %input{ type: 'text' }
62
+
63
+ %label Select Input
64
+ %select
65
+ %option Option 1
66
+ %option Option 2
67
+
68
+ %label Textarea
69
+ %textarea
70
+
71
+ %fieldset
72
+ %legend Checkboxes
73
+ %label
74
+ %input{ type: 'checkbox' }
75
+ Option 1
76
+ %label
77
+ %input{ type: 'checkbox' }
78
+ Option 2
79
+
80
+ %fieldset
81
+ %legend Radio Buttons
82
+ %label
83
+ %input{ type: 'radio' }
84
+ Option 1
85
+ %label
86
+ %input{ type: 'radio' }
87
+ Option 2
88
+ %hr
89
+
90
+
91
+ %article#tables
92
+ %h2 Tables
93
+ %table.striped.hovered{ style: 'width: 100%' }
94
+ %thead
95
+ %tr
96
+ %th Header 1
97
+ %th Header 2
98
+ %th Header 3
99
+ %tbody
100
+ - (1..7).each do |i|
101
+ %tr
102
+ %td= "Data #{i*3}"
103
+ %td= "Data #{i*5}"
104
+ %td= "Data #{i*7}"
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ RailPass::Engine.routes.draw do
2
+ root :to => "styleguide#index"
3
+ end
@@ -0,0 +1,220 @@
1
+ require "rails/generators"
2
+ require "bundler"
3
+
4
+ module RailPass
5
+ module Generators
6
+ class InstallGenerator < Rails::Generators::Base
7
+ DIRECTORIES = %w(app public spec vendor)
8
+ FILES_TO_REMOVE = %w(README.rdoc public/index.html public/500.html public/422.html app/assets/images/rails.png app/assets/javascripts/application.js app/assets/javascripts/application.js.coffee app/assets/stylesheets/application.css app/assets/stylesheets/application.css.scss app/views/layouts/application.html.erb app/helpers/application_helper.rb test/ vendor/plugins/)
9
+
10
+ source_root File.join(File.dirname(__FILE__), '../templates')
11
+
12
+ desc "Adds files, gems, and config settings for Rail Pass"
13
+
14
+ # Options
15
+ #
16
+ class_option :deployment, :type => :string, :default => "heroku", :banner => "NAME",
17
+ :desc => "Deployment method: 'heroku' or 'capistrano'", :aliases => "-d"
18
+ class_option :database, :type => :string, :default => "postgresql", :banner => "NAME",
19
+ :desc => "Database option: 'postgresql' or 'mongodb'", :aliases => "-b"
20
+ class_option :'app-server', :type => :string, :default => "unicorn", :banner => "NAME",
21
+ :desc => "Database option: 'unicorn', 'puma', or 'thin'", :aliases => "-a"
22
+
23
+ # Warn about destructive changes & confirm
24
+ def shit_gonna_get_crazy
25
+ accept = ask("\n#{set_color(set_color("[?]", Thor::Shell::Color::ON_BLACK), Thor::Shell::Color::RED)} These changes are #{set_color("VERY DESTRUCTIVE", Thor::Shell::Color::RED)} and only intended for #{set_color("brand-new projects", Thor::Shell::Color::BLUE)}. Proceeding with the installation will wipe out large portions of an existing project. Type 'yes' to continue, anything else to cancel.\n:")
26
+ exit unless accept == "yes"
27
+ end
28
+
29
+ # Add necessary gems
30
+ #
31
+ def add_gems
32
+ gem_group :development do
33
+ gem "quiet_assets"
34
+ gem "letter_opener"
35
+ gem "thin"
36
+ gem "awesome_print"
37
+ gem "hirb"
38
+ gem "better_errors"
39
+ gem "binding_of_caller"
40
+ gem "pry"
41
+ end
42
+ gem_group :development, :test do
43
+ gem "rspec-rails"
44
+ gem "database_cleaner"
45
+ end
46
+ gem_group :test do
47
+ gem "capybara"
48
+ gem "shoulda-matchers"
49
+ gem "spork-rails"
50
+ end
51
+ gem "exception_notification", "2.6.1"
52
+ gem "haml-rails"
53
+ gem "boarding_pass"
54
+ gem "foreman"
55
+
56
+ if options[:database] == "mongodb"
57
+ gem "bson_ext"
58
+ gem "mongoid"
59
+ else
60
+ gem "pg", group: :production
61
+ gem "sqlite3", group: :development
62
+ gem "rails-erd", group: :development
63
+ end
64
+
65
+ if options[:'app-server'] == "puma"
66
+ gem "puma"
67
+ elsif options[:'app-server'] == "thin"
68
+ gem "thin"
69
+ else
70
+ gem "unicorn"
71
+ end
72
+
73
+ if options[:deployment] == "capistrano"
74
+ gem "capistrano"
75
+ else
76
+ gem "newrelic_rpm"
77
+ end
78
+ # inside Rails.root do
79
+ # run "bundle install"
80
+ # end
81
+ Bundler.with_clean_env do
82
+ run "bundle install"
83
+ end
84
+ end
85
+
86
+ # Delete files on first-run
87
+ #
88
+ def remove_files
89
+ FILES_TO_REMOVE.each do |file|
90
+ remove_file file
91
+ end
92
+ end
93
+
94
+ # Add default files & resources
95
+ #
96
+ def add_files
97
+ DIRECTORIES.each do |dir|
98
+ directory dir, dir
99
+ end
100
+ copy_file ".rspec"
101
+ copy_file "config/initializers/dev_environment.rb"
102
+ end
103
+
104
+ # Application configuration
105
+ #
106
+ def application_configuration
107
+ # Routes
108
+ route 'mount RailPass::Engine, :at => "styleguide"'
109
+ route 'root :to => "pages#index"'
110
+ # Time zone
111
+ gsub_file 'config/application.rb', /# config.time_zone = '.+'/ do
112
+ "config.time_zone = \"Central Time (US & Canada)\""
113
+ end
114
+ # Email - Development
115
+ inject_into_class "config/environments/development.rb", "Application" do
116
+ dev_email = <<-eos.gsub(/^ {10}/,'')
117
+ # Open emails in browser
118
+ #
119
+ config.action_mailer.delivery_method = :letter_opener
120
+ # config.action_mailer.default_url_options = { host: "localhost:3000" } # FIXME replace with correct :host
121
+ eos
122
+ dev_email
123
+ end
124
+ # Render 404
125
+ inject_into_file "app/controllers/application_controller.rb", :before => "end" do
126
+ render_error = <<-eos.gsub(/^ {10}/,'')
127
+ def render_404
128
+ render "errors/404", status: :not_found
129
+ end
130
+ eos
131
+ render_error
132
+ end
133
+ # Assets to precompile
134
+ gsub_file 'config/environments/production.rb', /# config.assets.precompile.*/ do
135
+ "config.assets.precompile += %w( responsive.js html5.js polyfills.js )"
136
+ end
137
+ %w(config/initializers/dev_environment.rb .powder).each do |ignored|
138
+ append_file ".gitignore", ignored
139
+ end
140
+ end
141
+
142
+ # Deployment configuration
143
+ #
144
+ def configure_deployment
145
+ if options[:deployment] == "capistrano"
146
+ %w(Capfile config/deploy.rb).each do |file|
147
+ copy_file file
148
+ end
149
+ directory "config/recipes"
150
+ else
151
+ %w(Procfile config/newrelic.yml config/initializers/new_relic.rb).each do |file|
152
+ copy_file file
153
+ end
154
+ if options[:'app-server'] == "unicorn"
155
+ copy_file "config/unicorn.rb"
156
+ end
157
+ # Heroku config for asset compiling, compression, and caching
158
+ inject_into_class "config/application.rb", "Application" do
159
+ compile_assets_config = "# Enable compiling assets on deploy for Heroku\n"
160
+ compile_assets_config += "config.assets.initialize_on_precompile = false"
161
+ compile_assets_config
162
+ end
163
+ inject_into_file "config.ru", :before => "run " do
164
+ "use Rack::Deflater\n"
165
+ end
166
+ cache_assets_config = "config.serve_static_assets = true\n"
167
+ cache_assets_config += "config.static_cache_control = \"public, max-age=31536000\""
168
+ gsub_file 'config/environments/production.rb', /config.serve_static_assets.*/, cache_assets_config
169
+ # Email via SendGrid
170
+ inject_into_class "config/environments/development.rb", "Application" do
171
+ production_email = <<-eos.gsub(/^ {10}/,'')
172
+ # Sending Email :: SendGrid
173
+ #
174
+ # config.action_mailer.default_url_options = { host: "EXAMPLE.COM" } # FIXME replace with proper :host
175
+ config.action_mailer.delivery_method = :smtp
176
+ config.action_mailer.smtp_settings = {
177
+ :address => 'smtp.sendgrid.net',
178
+ :port => '587',
179
+ :authentication => :plain,
180
+ :user_name => ENV['SENDGRID_USERNAME'],
181
+ :password => ENV['SENDGRID_PASSWORD'],
182
+ :domain => 'heroku.com'
183
+ }
184
+ eos
185
+ production_email
186
+ end
187
+ end
188
+ end
189
+
190
+ # Database configuration
191
+ #
192
+ def configure_database
193
+ if options[:database] == "mongodb"
194
+ remove_file "config/database.yml"
195
+ generate "mongoid:config"
196
+ gsub_file 'config/application.rb', /require 'rails\/all'/ do
197
+ mongo_railties = <<-eos.gsub(/^ {10}/,'')
198
+ require "action_controller/railtie"
199
+ require "action_mailer/railtie"
200
+ require "active_resource/railtie"
201
+ require "sprockets/railtie"
202
+ require "rails/test_unit/railtie"
203
+ eos
204
+ mongo_railties
205
+ end
206
+ gsub_file 'config/application.rb', "config.active_record.whitelist_attributes = true" do
207
+ "# config.active_record.whitelist_attributes = true"
208
+ end
209
+ gsub_file 'config/environments/development.rb', "config.active_record.auto_explain_threshold_in_seconds = 0.5" do
210
+ "# config.active_record.auto_explain_threshold_in_seconds = 0.5"
211
+ end
212
+ gsub_file 'config/environments/development.rb', "config.active_record.mass_assignment_sanitizer = :strict" do
213
+ "# config.active_record.mass_assignment_sanitizer = :strict"
214
+ end
215
+ end
216
+ end
217
+
218
+ end
219
+ end
220
+ end
@@ -0,0 +1 @@
1
+ web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require jquery.ui.touch-punch.min
16
+ //= require scripts
17
+ //= require_self
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into respond.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require polyfills/html5shim
14
+ //= require_self
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into respond.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require polyfills/selectivizr
14
+ //= require_self
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into respond.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require polyfills/respond
14
+ //= require_self
@@ -0,0 +1,26 @@
1
+ // Libraries
2
+ @import "bourbon";
3
+ @import "neat";
4
+ @import "boarding_pass";
5
+ @import "font-awesome";
6
+ @import "icomoon";
7
+
8
+ // Mixins
9
+
10
+ // Base
11
+ @import "base/settings";
12
+ @import "base/colors";
13
+ @import "base/typography";
14
+ @import "base/defaults";
15
+ @import "base/forms";
16
+
17
+ // Layout
18
+ @import "layout/settings";
19
+ @import "layout/header";
20
+ @import "layout/footer";
21
+ @import "layout/containers";
22
+
23
+ // Modules
24
+ @import "modules/buttons";
25
+
26
+ // States
@@ -0,0 +1,27 @@
1
+ // Basic Elements
2
+ body {
3
+ font-family: $typeface-sans;
4
+ text-shadow: 1px 1px 1px transparent;
5
+ }
6
+
7
+ a {
8
+ @include transition (color, 0.2s);
9
+ }
10
+
11
+ p, a, h1, h2, h3, h4, h5, label {
12
+ font-family: inherit;
13
+ }
14
+
15
+ h1 {}
16
+
17
+ h2 {}
18
+
19
+ h3 {}
20
+
21
+ h4 {}
22
+
23
+ h5 {}
24
+
25
+ h6 {}
26
+
27
+ p {}
@@ -0,0 +1,3 @@
1
+ // Typefaces
2
+ $typeface-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
3
+ $typeface-serif: Georgia, Cambria, "Times New Roman", Times, serif;
@@ -0,0 +1,18 @@
1
+ // General Containers
2
+
3
+ .grid-constrained {
4
+ @include outer-container;
5
+ padding: 0 $page-gutter;
6
+ }
7
+
8
+ .grid-main {
9
+ @include media($breakpoint-ipad) {
10
+ @include span-columns(8);
11
+ }
12
+ }
13
+
14
+ .grid-sidebar {
15
+ @include media($breakpoint-ipad) {
16
+ @include span-columns(4);
17
+ }
18
+ }
@@ -0,0 +1,15 @@
1
+ // Standard buttons used throughout the application.
2
+ //
3
+ // :hover - Highlights when hovering.
4
+ // :disabled - Dims the button when disabled.
5
+ // .primary - Indicates button is the primary action.
6
+ //
7
+ // Styleguide 5.1
8
+ .btn {
9
+ padding: 0.5em 1em;
10
+ border: 1px solid #ddd;
11
+ border-radius: 0;
12
+ color: #555;
13
+ background: #f8f8f8;
14
+ text-shadow: 0 1px 1px white;
15
+ }
@@ -0,0 +1,2 @@
1
+ class PagesController < ApplicationController
2
+ end