gunnertechnology 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- class ProjectGenerator < Rails::Generators::Base
1
+ class ProjectGenerator < Rails::Generators::NamedBase
2
2
  include Rails::Generators::Migration
3
3
 
4
4
  source_root File.expand_path('../templates', __FILE__)
@@ -12,6 +12,110 @@ class ProjectGenerator < Rails::Generators::Base
12
12
  end
13
13
  end
14
14
 
15
+ def generate_gem_set
16
+ run("rvm use 1.9.2-head@#{project_name} --create")
17
+
18
+ prepend_to_file '.gitignore' do
19
+ '.bundle
20
+ db/*.sqlite3
21
+ log/*.log
22
+ tmp/**/*
23
+
24
+ config/database.yml
25
+ config/*.sphinx.conf
26
+ config/s3_credentials.yml
27
+ *~
28
+ *.cache
29
+ *.log
30
+ *.pid
31
+ tmp/**/*
32
+ .DS_Store
33
+ db/cstore/**
34
+ db/sphinx/**
35
+ doc/api
36
+ doc/app
37
+ doc/plugins
38
+ doc/*.dot
39
+ coverage/*
40
+ db/*.sqlite3
41
+ *.tmproj
42
+ *.sw?'
43
+ end
44
+ end
45
+
46
+ def generate_gem_dependencies
47
+ gem "rails", "3.0.4"
48
+ gem "aws-s3", "0.6.2", :require => "aws/s3"
49
+ gem "flickr_fu", "0.3.0"
50
+ gem "mini_fb", "1.1.7"
51
+ gem "twitter", "1.0.0"
52
+ gem "foursquare", "0.3.4"
53
+ gem "devise", "1.1.5"
54
+ gem "omniauth", "0.1.6"
55
+ gem "rmagick", ">= 2.12.2"
56
+ gem "simple_form", "1.3.0"
57
+ gem "inherited_resources", "1.1.2"
58
+ gem "delayed_job", "2.1.3"
59
+ gem "mislav-will_paginate", "2.3.11", :require => "will_paginate"
60
+ gem "jquery-rails", "0.2.6"
61
+ gem "paperclip", "2.3.8"
62
+ gem "mysql2", ">= 0.2.6"
63
+ gem 'gunnertechnology', ">= 0.0.6"
64
+
65
+ gem "sqlite3-ruby", "1.3.2", :require => "sqlite3", :group => "test"
66
+ gem "rspec-rails", ">= 2.5.0", :group => "test"
67
+ gem "autotest", "4.4.6", :group => "test"
68
+ gem "autotest-rails", "4.1.0", :group => "test"
69
+ gem "capybara", "0.4.1.1", :group => "test"
70
+ gem "launchy", "0.3.7", :group => "test"
71
+ gem "database_cleaner", "0.6.0", :group => "test"
72
+ gem "cucumber-rails", ">= 0.3.2", :group => "test"
73
+ gem "cucumber", ">= 0.10.0", :group => "test"
74
+ gem "spork", "0.8.4", :group => "test"
75
+ gem "factory_girl", "1.3.2", :group => "test"
76
+
77
+ gem "sqlite3-ruby", "1.3.2", :require => "sqlite3", :group => "development"
78
+ gem "rspec-rails", ">= 2.5.0", :group => "development"
79
+ gem "cucumber-rails", ">= 0.3.2", :group => "development"
80
+ gem "cucumber", ">= 0.10.0", :group => "development"
81
+ gem "capistrano", "2.5.19", :group => "development"
82
+ gem "heroku", "> 1.15.1", :group => "development"
83
+ gem "heroku_san", :git => "git://github.com/gunnertech/heroku_san.git", :group => "development"
84
+ gem "rails3-generators", "0.17.0", :group => "development"
85
+ gem "nifty-generators", "0.4.2", :group => "development"
86
+
87
+ run 'bundle install'
88
+ end
89
+
90
+ def generate_heroku_setup
91
+ template('config/heroku.yml','config/heroku.yml')
92
+ rake("all heroku:create heroku:rack_env")
93
+
94
+ run("heroku addons:add ssl:piggyback --app #{project_name}-staging")
95
+ run("heroku addons:add cron:daily --app #{project_name}-staging")
96
+ run("heroku addons:add custom_error_pages --app #{project_name}-staging")
97
+ run("heroku addons:add custom_domains:basic --app #{project_name}-staging")
98
+ run("heroku addons:add deployhooks:email --app #{project_name}-staging")
99
+ run("heroku addons:add exceptional:basic --app #{project_name}-staging")
100
+ run("heroku addons:add memcache:5mb --app #{project_name}-staging")
101
+ run("heroku addons:add pgbackups:basic --app #{project_name}-staging")
102
+ run("heroku addons:add sendgrid:free --app #{project_name}-staging")
103
+
104
+ run("heroku addons:add ssl:piggyback --app #{project_name}")
105
+ run("heroku addons:add cron:daily --app #{project_name}")
106
+ run("heroku addons:add custom_error_pages --app #{project_name}")
107
+ run("heroku addons:add custom_domains:basic --app #{project_name}")
108
+ run("heroku addons:add deployhooks:email --app #{project_name}")
109
+ run("heroku addons:add exceptional:basic --app #{project_name}")
110
+ run("heroku addons:add memcache:5mb --app #{project_name}")
111
+ run("heroku addons:add pgbackups:basic --app #{project_name}")
112
+ run("heroku addons:add sendgrid:free --app #{project_name}")
113
+ end
114
+
115
+ def generate_rails_app
116
+ run("gem install --no-ri --no-rdoc rails --version '3.0.4'")
117
+ end
118
+
15
119
  def generate_layout
16
120
  template "app/views/layouts/application.html.erb", "app/views/layouts/application.html.erb"
17
121
  copy_file "app/helpers/gunner_technology_helper.rb", "app/helpers/gunner_technology_helper.rb"
@@ -50,6 +154,14 @@ class ProjectGenerator < Rails::Generators::Base
50
154
  generate("simple_form:install")
51
155
  end
52
156
 
157
+ def generate_rspec
158
+ generate("rspec:install")
159
+ end
160
+
161
+ def generate_cucumber
162
+ generate("cucumber:skeleton --rspec --capybara")
163
+ end
164
+
53
165
  def generate_devise
54
166
  generate("devise:install")
55
167
  generate("devise",devise_model_name)
@@ -66,8 +178,19 @@ class ProjectGenerator < Rails::Generators::Base
66
178
  route("match '/auth/:provider/callback' => 'authentications#create'")
67
179
  end
68
180
 
181
+ def generate_git_configuration
182
+ git :init
183
+ git :add => "."
184
+ git :commit => "-m first commit"
185
+ git :remote => "add origin git@github.com:gunnertech/#{project_name}.git"
186
+ git :push => "origin master"
187
+ git :checkout => "-b staging"
188
+ git :checkout => "-b production"
189
+ git :checkout => "-b working"
190
+ end
191
+
69
192
  private
70
- def file_name
71
- layout_name.underscore
193
+ def project_name
194
+ Rails.root.to_s.split('/').last
72
195
  end
73
196
  end
@@ -0,0 +1,3 @@
1
+ apps:
2
+ production: <%= project_name %>
3
+ staging: <%= project_name %>-staging
@@ -1,3 +1,3 @@
1
1
  module Gunnertechnology
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gunnertechnology
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cody Swann
@@ -142,6 +142,7 @@ files:
142
142
  - lib/generators/project/templates/app/views/shared/_header.html.erb
143
143
  - lib/generators/project/templates/config/facebook_config.yml
144
144
  - lib/generators/project/templates/config/google_analytics_config.yml
145
+ - lib/generators/project/templates/config/heroku.yml
145
146
  - lib/generators/project/templates/config/initializers/load_facebook_config.rb
146
147
  - lib/generators/project/templates/config/initializers/load_google_analytics_config.rb
147
148
  - lib/generators/project/templates/config/initializers/load_seo_config.rb