fast_track 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/tracks/mysql.rb CHANGED
@@ -1,12 +1,10 @@
1
- class FastTrack
2
- class Mysql < Track
3
- gemfile do
4
- gem 'mysql2'
5
- end
1
+ track "mysql" do
2
+ gemfile do
3
+ gem 'mysql2'
4
+ end
6
5
 
7
- # TODO: Add config/database.yml to include mysql2
8
- def invoke
9
- rake "db:create:all"
10
- end
6
+ # TODO: Add config/database.yml to include mysql2
7
+ before_migrate do
8
+ rake "db:create:all"
11
9
  end
12
10
  end
@@ -1,76 +1,75 @@
1
- class FastTrack
2
- # TODO
3
- #
4
- # Add Omniauth without adding any social networks
5
- #
6
- # Based on this gist: https://gist.github.com/schleg/993566
7
- class Omniauth < Track
8
- gemfile do
9
- gem "omniauth"
10
- end
1
+ # Based on this gist: https://gist.github.com/schleg/993566
2
+ track "omniauth" do
3
+ desc "Use Omniauth"
11
4
 
12
- def invoke
13
- migration "add_name_to_users", {
14
- "name" => "string"
15
- }
5
+ gemfile do
6
+ gem "omniauth"
7
+ end
8
+ end
9
+
10
+ track "omniauth_authentications" do
11
+ desc "Omniauth + User Authorization table"
12
+
13
+ before_migrate do
14
+ migration "add_name_to_users", {
15
+ "name" => "string"
16
+ }
16
17
 
17
- model "Authorization", {
18
- "provider" => "string",
19
- "uid" => "string",
20
- "user_id" => "integer",
21
- "token" => "string",
22
- "secret" => "string",
23
- "name" => "string",
24
- "link" => "string"
25
- }
26
- end
18
+ model "Authorization", {
19
+ "provider" => "string",
20
+ "uid" => "string",
21
+ "user_id" => "integer",
22
+ "token" => "string",
23
+ "secret" => "string",
24
+ "name" => "string",
25
+ "link" => "string"
26
+ }
27
27
  end
28
+ end
28
29
 
29
- # TODO
30
- # Devise + Facebook
31
- #
32
- class OmniauthFacebook < Track
33
- def files
34
- {
35
- controller: "devise_facebook/omniauth_controller.rb",
36
- initializer: "devise_facebook/initializer.rb",
37
- config: "devise_facebook/facebook.yml",
38
- user: "devise_facebook/user.rb"
39
- }
40
- end
30
+ track "omniauth_facebook" do
31
+ gemfile do
32
+ gem "omniauth"
33
+ gem "omniauth-facebook"
34
+ end
41
35
 
42
- gemfile do
43
- gem "omniauth"
44
- gem "omniauth-facebook"
45
- end
36
+ before_migration do
37
+ migration "AddUidToUsers", {
38
+ "provider" => "string",
39
+ "uid" => "string",
40
+ "name" => "string"
41
+ }
42
+ end
46
43
 
47
- def invoke
44
+ after_migration do
45
+ gsub_file "config/routes.rb", "devise_for :users", 'devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }'
48
46
 
49
- gsub_file "config/routes.rb", "devise_for :users", 'devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }'
47
+ file "app/controllers/users/omniauth_callbacks_controller.rb", controller_file
48
+ file "config/initializers/devise_facebook.rb", initializer_file
49
+ # TODO:
50
+ file "app/models/user.rb", user_file, :force => true
50
51
 
51
- migration "AddUidToUsers", {
52
- "provider" => "string",
53
- "uid" => "string",
54
- "name" => "string"
55
- }
52
+ # TODO: Use options passed to thor
53
+ file "config/facebook.yml", facebook_yml
54
+ end
55
+
56
+ def template_directory
57
+ "devise_facebook"
58
+ end
56
59
 
57
- file "app/controllers/users/omniauth_callbacks_controller.rb", open_file(:controller)
58
- file "config/initializers/devise_facebook.rb", open_file(:initializer)
59
- file "app/models/user.rb", open_file(:user), :force => true
60
+ def controller_file
61
+ read_file("omniauth_controller.rb")
62
+ end
60
63
 
61
- # TODO: Check if facebook_config is available
62
- # Otherwise, just give the vanilla version
63
- # file "config/facebook.yml", replace(open_file(:config), facebook_config)
64
- file "config/facebook.yml", open_file(:config)
64
+ def initializer_file
65
+ read_file("initializer.rb")
66
+ end
65
67
 
66
- rake "db:migrate"
67
- end
68
+ def facebook_yml
69
+ read_file("facebook.yml")
70
+ end
68
71
 
69
- def facebook_config
70
- {
71
- "[APP_ID]" => config[:app_id],
72
- "[APP_SECRET]" => config[:app_secret]
73
- }
74
- end
72
+ def user_file
73
+ read_file("user.rb")
75
74
  end
76
75
  end
@@ -0,0 +1,7 @@
1
+ track "quiet_assets" do
2
+ desc "Quiet assets removes logs to assets in development"
3
+
4
+ gemfile do
5
+ gem 'quiet_assets'
6
+ end
7
+ end
data/lib/tracks/rolify.rb CHANGED
@@ -1,12 +1,11 @@
1
- class FastTrack
2
- # https://github.com/EppO/rolify/wiki/Tutorial
3
- class Rolify < Track
4
- gemfile do
5
- gem 'rolify'
6
- end
1
+ track "rolify" do
2
+ desc "Add roles to your users"
7
3
 
8
- before_migrate do
9
- generate "rolify:role"
10
- end
4
+ gemfile do
5
+ gem 'rolify'
6
+ end
7
+
8
+ before_migrate do
9
+ generate "rolify:role"
11
10
  end
12
11
  end
@@ -0,0 +1,12 @@
1
+ track "rspec" do
2
+ gemfile do
3
+ gem_group :test do
4
+ gem 'rspec'
5
+ gem 'rspec-rails'
6
+ end
7
+ end
8
+
9
+ before_migrate do
10
+ generate "rspec:install"
11
+ end
12
+ end
@@ -0,0 +1,39 @@
1
+ track "thin" do
2
+ name "Thin"
3
+ desc "Uses the thin rack web server"
4
+
5
+ gemfile do
6
+ gem "thin"
7
+ end
8
+ end
9
+
10
+ track "production_thin" do
11
+ requires "thin"
12
+
13
+ name "Production Thin"
14
+ desc "Install thin on a production server"
15
+
16
+ tutorial_url "http://kvz.io/blog/2010/09/21/ruby-with-nginx-on-ubuntu-lucid/"
17
+ tutorial_url "http://jordanhollinger.com/2011/04/22/how-to-use-thin-effectivly"
18
+
19
+ after_bundle do
20
+ run "rvmsudo thin install"
21
+ create_file "/etc/thin/#{config.app_name}.yml", sample_thin_config
22
+ end
23
+
24
+ def template_directory
25
+ "twitter_bootstrap"
26
+ end
27
+
28
+ def flash_helper
29
+ read_file("bootstrap_flash_helper.rb")
30
+ end
31
+ end
32
+
33
+ track "nginx_thin" do
34
+ requires "thin"
35
+
36
+ tutorial_url "http://www.funonrails.com/2010/03/nginx-and-thin-installation-and.html"
37
+
38
+ # TODO!
39
+ end
@@ -1,74 +1,69 @@
1
- class FastTrack
2
- class TwitterBootstrap < Track
3
- gemfile do
4
- gem "twitter-bootstrap-rails"
5
- gem "less-rails"
6
- gem 'jquery-rails'
1
+ track "twitter_bootstrap" do
2
+ gemfile do
3
+ gem "twitter-bootstrap-rails"
4
+ gem "less-rails"
5
+ gem 'jquery-rails'
7
6
 
8
- gem_group :assets do
9
- gem 'less'
10
- gem 'commonjs'
11
- gem 'therubyracer', :platforms => :ruby
12
- end
7
+ gem_group :assets do
8
+ gem 'less'
9
+ gem 'commonjs'
10
+ gem 'therubyracer', :platforms => :ruby
13
11
  end
12
+ end
14
13
 
15
- def template_directory
16
- "twitter_bootstrap"
17
- end
14
+ def template_directory
15
+ "twitter_bootstrap"
16
+ end
18
17
 
19
- def flash_helper
20
- read_file("bootstrap_flash_helper.rb")
21
- end
18
+ def flash_helper
19
+ read_file("bootstrap_flash_helper.rb")
20
+ end
22
21
 
23
- def application_css
24
- read_file("application.css")
25
- end
22
+ def application_css
23
+ read_file("application.css")
24
+ end
26
25
 
27
- def invoke
28
- generate "controller Home index"
29
- route "root to: 'home#index'"
26
+ before_migrate do
27
+ generate "controller Home index"
28
+ route "root to: 'home#index'"
30
29
 
31
- generate "bootstrap:install less"
32
- generate "bootstrap:layout application fixed --force"
30
+ generate "bootstrap:install less"
31
+ generate "bootstrap:layout application fixed --force"
33
32
 
34
- create_file "app/helpers/bootstrap_flash_helper.rb", flash_helper
35
- create_file "app/assets/stylesheets/application.css", application_css, force: true
36
- end
33
+ create_file "app/helpers/bootstrap_flash_helper.rb", flash_helper
34
+ create_file "app/assets/stylesheets/application.css", application_css, force: true
37
35
  end
36
+ end
38
37
 
39
- # Create a layout that includes a customizable nav bar
40
- class TwitterBootstrapNavBar < Track
41
- def template_directory
42
- "twitter_bootstrap_nav_bar"
43
- end
38
+ track "twitter_boostrap_nav_bar" do
39
+ requires "devise"
44
40
 
45
- def layout_for_application
46
- read_file("application.html.erb")
47
- end
41
+ def template_directory
42
+ "twitter_bootstrap_nav_bar"
43
+ end
48
44
 
49
- def nav_bar
50
- read_file("_navigation.html.erb")
51
- end
45
+ def layout_for_application
46
+ read_file("application.html.erb")
47
+ end
52
48
 
53
- def messages
54
- read_file("_messages.html.erb")
55
- end
49
+ def nav_bar
50
+ read_file("_navigation.html.erb")
51
+ end
56
52
 
57
- def application_helper
58
- read_file("application_helper.rb")
59
- end
53
+ def messages
54
+ read_file("_messages.html.erb")
55
+ end
60
56
 
61
- def invoke
62
- unless FastTrack.tracks.any? {|t| t =~ "devise" }
63
- raise "TwitterBootstrapNavBar requires Devise! Please include it in your --tracks!"
64
- end
57
+ def application_helper
58
+ read_file("application_helper.rb")
59
+ end
65
60
 
66
- create_file "app/views/layouts/application.html.erb", layout_for_application, force: true
67
- create_file "app/helpers/application_helper.rb", application_helper, force: true
61
+ before_migrate do
62
+ create_file "app/views/layouts/application.html.erb", layout_for_application, force: true
63
+ create_file "app/helpers/application_helper.rb", application_helper, force: true
68
64
 
69
- # NOTE: _navigation.html.erb requires Devise to work properly!
70
- create_file "app/views/layouts/_navigation.html.erb", nav_bar
71
- create_file "app/views/layouts/_messages.html.erb", messages
72
- end
65
+ # NOTE: _navigation.html.erb requires Devise to work properly!
66
+ create_file "app/views/layouts/_navigation.html.erb", nav_bar
67
+ create_file "app/views/layouts/_messages.html.erb", messages
73
68
  end
74
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-27 00:00:00.000000000 Z
12
+ date: 2013-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -75,6 +75,54 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: thor
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rails
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: hooks
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
78
126
  description: Leverage the Rails generator to architect new Rails apps with lots of
79
127
  default gems, templates, and other recipes, quickly.
80
128
  email:
@@ -94,10 +142,12 @@ files:
94
142
  - fast_track.gemspec
95
143
  - lib/fast_track.rb
96
144
  - lib/fast_track/app.rb
145
+ - lib/fast_track/commands.rb
97
146
  - lib/fast_track/config.rb
147
+ - lib/fast_track/dsl.rb
98
148
  - lib/fast_track/exceptions.rb
149
+ - lib/fast_track/ext.rb
99
150
  - lib/fast_track/generator.rb
100
- - lib/fast_track/thin.rb
101
151
  - lib/fast_track/track.rb
102
152
  - lib/fast_track/track_methods.rb
103
153
  - lib/fast_track/version.rb
@@ -115,12 +165,16 @@ files:
115
165
  - lib/tracks/devise.rb
116
166
  - lib/tracks/errbit_heroku.rb
117
167
  - lib/tracks/guard.rb
168
+ - lib/tracks/heroku.rb
118
169
  - lib/tracks/jquery.rb
119
170
  - lib/tracks/mysql.rb
120
171
  - lib/tracks/omniauth.rb
172
+ - lib/tracks/quite_assets.rb
121
173
  - lib/tracks/rolify.rb
174
+ - lib/tracks/rspec.rb
175
+ - lib/tracks/thin.rb
122
176
  - lib/tracks/twitter_bootstrap.rb
123
- homepage: ''
177
+ homepage: http://fast-track.io
124
178
  licenses:
125
179
  - MIT
126
180
  post_install_message:
@@ -135,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
189
  version: '0'
136
190
  segments:
137
191
  - 0
138
- hash: 4523048594153792430
192
+ hash: -250593940606032247
139
193
  required_rubygems_version: !ruby/object:Gem::Requirement
140
194
  none: false
141
195
  requirements:
@@ -144,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
198
  version: '0'
145
199
  segments:
146
200
  - 0
147
- hash: 4523048594153792430
201
+ hash: -250593940606032247
148
202
  requirements: []
149
203
  rubyforge_project:
150
204
  rubygems_version: 1.8.25