rail_pass 0.1.10 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,6 +11,7 @@ module RailPass
11
11
 
12
12
  desc "Adds files, gems, and config settings for Rail Pass"
13
13
 
14
+ ##
14
15
  # Options
15
16
  #
16
17
  class_option :deployment, :type => :string, :default => "heroku", :banner => "NAME",
@@ -22,7 +23,9 @@ module RailPass
22
23
  class_option :destructive, :type => :string, :default => nil, :banner => "",
23
24
  :desc => "Option to skip the destructive confirmation prompt"
24
25
 
26
+ ##
25
27
  # Warn about destructive changes & confirm
28
+ #
26
29
  def shit_gonna_get_crazy
27
30
  unless options[:destructive]
28
31
  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:")
@@ -30,63 +33,64 @@ module RailPass
30
33
  end
31
34
  end
32
35
 
36
+ ##
33
37
  # Add necessary gems
34
38
  #
35
39
  def add_gems
36
40
  gem_group :development do
37
- gem "quiet_assets"
38
- gem "letter_opener"
39
- gem "thin"
40
- gem "awesome_print"
41
- gem "hirb"
42
- gem "better_errors"
43
- gem "binding_of_caller"
44
- gem "pry"
41
+ gem 'quiet_assets'
42
+ gem 'letter_opener'
43
+ gem 'thin'
44
+ gem 'awesome_print'
45
+ # gem 'hirb'
46
+ gem 'better_errors'
47
+ gem 'binding_of_caller'
48
+ gem 'pry'
45
49
  end
46
50
  gem_group :development, :test do
47
- gem "rspec-rails"
48
- gem "database_cleaner"
51
+ gem 'rspec-rails'
52
+ gem 'database_cleaner'
53
+ gem 'dotenv'
49
54
  end
50
55
  gem_group :test do
51
- gem "capybara"
52
- gem "shoulda-matchers"
53
- gem "spork-rails"
54
- end
55
- gem "exception_notification", "2.6.1"
56
- gem "haml-rails"
57
- gem "boarding_pass"
58
- gem "foreman"
56
+ gem 'capybara'
57
+ gem 'shoulda-matchers'
58
+ gem 'spork-rails'
59
+ end
60
+ gem 'exception_notification', '2.6.1'
61
+ gem 'slim'
62
+ gem 'boarding_pass'
63
+ gem 'foreman'
59
64
 
60
- if options[:database] == "mongodb"
61
- gem "bson_ext"
62
- gem "mongoid"
65
+ if options[:database] == 'mongodb'
66
+ gem 'bson_ext'
67
+ gem 'mongoid'
63
68
  else
64
- gem "pg", group: :production
65
- gem "sqlite3", group: :development
66
- gem "rails-erd", group: :development
69
+ gem 'pg', group: :production
70
+ gem 'sqlite3', group: :development
71
+ # gem 'rails-erd', group: :development
67
72
  end
68
73
 
69
- if options[:'app-server'] == "puma"
70
- gem "puma"
71
- elsif options[:'app-server'] == "thin"
72
- gem "thin"
74
+ if options[:'app-server'] == 'puma'
75
+ gem 'puma'
76
+ elsif options[:'app-server'] == 'thin'
77
+ gem 'thin'
73
78
  else
74
- gem "unicorn"
79
+ gem 'unicorn'
75
80
  end
76
81
 
77
- if options[:deployment] == "capistrano"
78
- gem "capistrano"
82
+ if options[:deployment] == 'capistrano'
83
+ gem 'capistrano'
79
84
  else
80
- gem "newrelic_rpm"
85
+ gem 'newrelic_rpm'
81
86
  end
82
- # inside Rails.root do
83
- # run "bundle install"
84
- # end
87
+
85
88
  Bundler.with_clean_env do
86
89
  run "bundle install"
87
90
  end
88
91
  end
89
92
 
93
+ ##
90
94
  # Delete files on first-run
91
95
  #
92
96
  def remove_files
@@ -95,6 +99,7 @@ module RailPass
95
99
  end
96
100
  end
97
101
 
102
+ ##
98
103
  # Add default files & resources
99
104
  #
100
105
  def add_files
@@ -102,15 +107,15 @@ module RailPass
102
107
  directory dir, dir
103
108
  end
104
109
  create_file ".rspec", "--color"
105
- copy_file "config/initializers/dev_environment.rb"
106
110
  end
107
111
 
112
+ ##
108
113
  # Application configuration
109
114
  #
110
115
  def application_configuration
111
116
  # Routes
112
117
  route 'mount RailPass::Engine, :at => "styleguide"'
113
- route 'root :to => "pages#index"'
118
+ route 'root :to => "static#index"'
114
119
  # Time zone
115
120
  gsub_file 'config/application.rb', /# config.time_zone = '.+'/ do
116
121
  "config.time_zone = \"Central Time (US & Canada)\""
@@ -138,11 +143,12 @@ module RailPass
138
143
  gsub_file 'config/environments/production.rb', /# config.assets.precompile.*/ do
139
144
  "config.assets.precompile += %w( html5.js polyfills.js )"
140
145
  end
141
- %w(config/initializers/dev_environment.rb .powder).each do |ignored|
146
+ %w(.powder .env).each do |ignored|
142
147
  append_file ".gitignore", ignored + "\n"
143
148
  end
144
149
  end
145
150
 
151
+ ##
146
152
  # Deployment configuration
147
153
  #
148
154
  def configure_deployment
@@ -173,17 +179,17 @@ module RailPass
173
179
  # Email via SendGrid
174
180
  inject_into_class "config/environments/development.rb", "Application" do
175
181
  production_email = <<-eos.gsub(/^ {10}/,'')
176
- # Sending Email :: SendGrid
182
+ # Sending Email :: Mandrill
177
183
  #
178
184
  # config.action_mailer.default_url_options = { host: "EXAMPLE.COM" } # FIXME replace with proper :host
179
185
  config.action_mailer.delivery_method = :smtp
180
186
  config.action_mailer.smtp_settings = {
181
- :address => 'smtp.sendgrid.net',
182
187
  :port => '587',
183
- :authentication => :plain,
184
- :user_name => ENV['SENDGRID_USERNAME'],
185
- :password => ENV['SENDGRID_PASSWORD'],
186
- :domain => 'heroku.com'
188
+ :address => 'smtp.mandrillapp.com',
189
+ :user_name => ENV['MANDRILL_USERNAME'],
190
+ :password => ENV['MANDRILL_APIKEY'],
191
+ :domain => 'heroku.com',
192
+ :authentication => :plain
187
193
  }
188
194
  eos
189
195
  production_email
@@ -191,6 +197,7 @@ module RailPass
191
197
  end
192
198
  end
193
199
 
200
+ ##
194
201
  # Database configuration
195
202
  #
196
203
  def configure_database
@@ -0,0 +1,2 @@
1
+ class StaticController < ApplicationController
2
+ end
@@ -1,3 +1,5 @@
1
+ - title ["404 Error"]
2
+
1
3
  .container
2
4
  %h1 Oops!
3
5
  %p{ style: 'text-align: center;' } The page you were looking for might not exist. Try the links above or visit the #{link_to 'home page', root_url}.
@@ -0,0 +1,5 @@
1
+ - title ["404 Error"]
2
+
3
+ .container
4
+ h1 Oops!
5
+ p style="text-align: center;" The page you were looking for might not exist. Try the links above or visit the #{link_to 'home page', root_url}.
@@ -0,0 +1,109 @@
1
+ doctype html
2
+ <!--[if lt IE 9]> <html class="ie8 old-ie" lang="en"> <![endif]-->
3
+ <!--[if gte IE 9]><!-->
4
+ html lang="en"
5
+ <!--<![endif]-->
6
+ /!
7
+ _
8
+ _
9
+ _
10
+ _ /// /// ..oOOOo..
11
+ _ /// /// .:OOOOOOOOOOO:.
12
+ _ /// /// .OOOOOOOOOOOOOOO.
13
+ _ /// /// OOOOOOOOOOOOOOOOO
14
+ _ /// /// OOOOOOOOOOOOOOOOO
15
+ _ /// /// OOOOOOOOOOOOOOOOO
16
+ _ /// /// `OOOOOOOOOOOOOOO'
17
+ _ /// /// `:OOOOOOOOOOO:'
18
+ _ /// /// ''*OOO*''
19
+ _
20
+ _ Designed & Developed by LaCroix Design Co.
21
+ _ http://lacroixdesign.net
22
+ _
23
+ _
24
+ _
25
+
26
+ head
27
+ meta charset="utf-8"
28
+ title = raw [yield(:title), "FIXME: APPLICATION NAME"].reject(&:blank?).join(' | ')
29
+
30
+ / koko wa general meta
31
+ meta name="description" content="FIXME: APPLICATION DESCRIPTION"
32
+ meta name="author" content="Michael LaCroix, James LaCroix"
33
+ meta http-equiv="X-UA-Compatible" content="chrome=1"
34
+
35
+ / koko wa fav and touch icons (reside in the /public folder), plus iOS meta
36
+ / link rel="shortcut icon" href="/favicon.ico"
37
+ / link rel="apple-touch-icon" href="/apple-touch-icon-57x57-precomposed.png"
38
+ / link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72x72-precomposed.png"
39
+ / link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png"
40
+ / link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png"
41
+ / meta name="msapplication-TileColor" content="#ffffff"
42
+ / meta name="msapplication-TileImage" content="/windows-icon.png"
43
+ meta name="viewport" content="initial-scale=1.0, user-scalable=no, maximum-scale=1.0"
44
+ meta name="apple-mobile-web-app-capable" content="yes"
45
+ meta name="apple-mobile-web-app-status-bar-style" content="black"
46
+
47
+ / koko wa HTML5 shim, for IE6-8 support of HTML elements
48
+ /[if lt IE 9]
49
+ == javascript_include_tag "html5"
50
+
51
+ == stylesheet_link_tag :application, media: "all"
52
+
53
+ / koko wa CSS3 polyfill, IE6-8 support of CSS3 pseudo-classes with Selectivizr
54
+ /[if lt IE 9]
55
+ == javascript_include_tag "polyfills"
56
+
57
+ = csrf_meta_tags
58
+
59
+ / koko wa Typekit -- replace VVVVVVV with the proper kit code
60
+ / script type="text/javascript" src="//use.typekit.net/VVVVVVV.js"
61
+ / javascript:
62
+ / try{Typekit.load();}catch(e){}
63
+
64
+
65
+ header#l-header
66
+
67
+ body
68
+ = yield
69
+
70
+ footer#l-footer
71
+
72
+
73
+ / koko wa javascripts
74
+ == javascript_include_tag "application"
75
+
76
+
77
+ - if Rails.env.production?
78
+ / koko wa Google Analytics -- replace VVVVVVVV-V and DOMAIN.TLD with the proper code & domain
79
+ javascript:
80
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
81
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
82
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
83
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
84
+
85
+ ga('create', 'UA-VVVVVVVV-V', 'DOMAIN.TLD');
86
+ ga('send', 'pageview');
87
+
88
+ / koko wa Gauges -- replace VVVVVVVVVVVVVVVVVVVVVVVV with the proper code
89
+ javascript:
90
+ var _gauges = _gauges || [];
91
+ (function() {
92
+ var t = document.createElement('script');
93
+ t.type = 'text/javascript';
94
+ t.async = true;
95
+ t.id = 'gauges-tracker';
96
+ t.setAttribute('data-site-id', 'VVVVVVVVVVVVVVVVVVVVVVVV');
97
+ t.src = '//secure.gaug.es/track.js';
98
+ var s = document.getElementsByTagName('script')[0];
99
+ s.parentNode.insertBefore(t, s);
100
+ })();
101
+
102
+
103
+
104
+
105
+ / koko wa Width Plugin
106
+ - if Rails.env.development?
107
+ #lacroix-browserwidth style="position: fixed; bottom: 0; left: 0; background:#eee; color:#666666; font-size:0.65em; padding:0.35em; text-shadow: none; font-weight: bold; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; border-top-right-radius: 2px; border-top: 1px solid #ddd; border-right: 1px solid #ddd;"
108
+ javascript:
109
+ function showWidth(){var w = $(window).width();$('#lacroix-browserwidth').text(w);}showWidth();$(window).resize(function(){showWidth();});
@@ -0,0 +1 @@
1
+ - title ["PAGE TITLE"]
@@ -0,0 +1 @@
1
+ - title ["PAGE TITLE"]
@@ -1,3 +1,3 @@
1
1
  module RailPass
2
- VERSION = "0.1.10"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rail_pass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-06 00:00:00.000000000 Z
13
+ date: 2013-04-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -60,11 +60,14 @@ files:
60
60
  - lib/generators/templates/app/assets/stylesheets/layout/_header.scss
61
61
  - lib/generators/templates/app/assets/stylesheets/mixins/_ie.scss
62
62
  - lib/generators/templates/app/assets/stylesheets/modules/_buttons.scss
63
- - lib/generators/templates/app/controllers/pages_controller.rb
63
+ - lib/generators/templates/app/controllers/static_controller.rb
64
64
  - lib/generators/templates/app/helpers/application_helper.rb
65
65
  - lib/generators/templates/app/views/errors/404.html.haml
66
+ - lib/generators/templates/app/views/errors/404.html.slim
66
67
  - lib/generators/templates/app/views/layouts/application.html.haml
67
- - lib/generators/templates/app/views/pages/index.html.haml
68
+ - lib/generators/templates/app/views/layouts/application.html.slim
69
+ - lib/generators/templates/app/views/static/index.html.haml
70
+ - lib/generators/templates/app/views/static/index.html.slim
68
71
  - lib/generators/templates/config/deploy.rb
69
72
  - lib/generators/templates/config/initializers/dev_environment.rb
70
73
  - lib/generators/templates/config/initializers/new_relic.rb
@@ -1,2 +0,0 @@
1
- class PagesController < ApplicationController
2
- end