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/README.md +13 -11
- data/bin/track +2 -1
- data/fast_track.gemspec +5 -1
- data/lib/fast_track.rb +42 -65
- data/lib/fast_track/commands.rb +32 -0
- data/lib/fast_track/config.rb +1 -1
- data/lib/fast_track/dsl.rb +14 -0
- data/lib/fast_track/exceptions.rb +1 -1
- data/lib/fast_track/ext.rb +5 -0
- data/lib/fast_track/generator.rb +30 -4
- data/lib/fast_track/track.rb +103 -67
- data/lib/fast_track/track_methods.rb +51 -1
- data/lib/fast_track/version.rb +1 -1
- data/lib/tracks/awesome_defaults.rb +19 -18
- data/lib/tracks/backbone.rb +17 -33
- data/lib/tracks/better_exceptions.rb +11 -15
- data/lib/tracks/cancan.rb +8 -9
- data/lib/tracks/devise.rb +48 -76
- data/lib/tracks/errbit_heroku.rb +2 -6
- data/lib/tracks/guard.rb +18 -17
- data/lib/tracks/heroku.rb +5 -0
- data/lib/tracks/jquery.rb +6 -15
- data/lib/tracks/mysql.rb +7 -9
- data/lib/tracks/omniauth.rb +61 -62
- data/lib/tracks/quite_assets.rb +7 -0
- data/lib/tracks/rolify.rb +8 -9
- data/lib/tracks/rspec.rb +12 -0
- data/lib/tracks/thin.rb +39 -0
- data/lib/tracks/twitter_bootstrap.rb +50 -55
- metadata +60 -6
- data/lib/fast_track/thin.rb +0 -21
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
module FastTrack
|
2
2
|
module TrackMethods
|
3
3
|
# Do a `bundle install`
|
4
4
|
def bundle_install
|
@@ -24,5 +24,55 @@ class FastTrack
|
|
24
24
|
model_columns = columns.map {|k, v| "#{k}:#{v}" }
|
25
25
|
generate "model", model_name, *model_columns
|
26
26
|
end
|
27
|
+
|
28
|
+
# If you need to get the base-level generator object, it's
|
29
|
+
# available here.
|
30
|
+
def g
|
31
|
+
generator
|
32
|
+
end
|
33
|
+
|
34
|
+
# Add a gem
|
35
|
+
#
|
36
|
+
# TODO: Find a way to consolidate all gems at once, so we only have to run
|
37
|
+
# `bundle install` once.
|
38
|
+
def gem(*args)
|
39
|
+
g.gem(*args)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Run rake
|
43
|
+
def rake(*args)
|
44
|
+
g.rake(*args)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Run any command
|
48
|
+
def run(*args)
|
49
|
+
g.run(*args)
|
50
|
+
end
|
51
|
+
|
52
|
+
alias :bundle_install! :bundle_install
|
53
|
+
|
54
|
+
def generate(*args)
|
55
|
+
g.generate(*args)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Add a route to config/routes.rb
|
59
|
+
def route(*args)
|
60
|
+
g.route(*args)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Add a file
|
64
|
+
def create_file(*args)
|
65
|
+
g.create_file(*args)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Create a gem group
|
69
|
+
def gem_group(*args, &block)
|
70
|
+
generator.gem_group(*args, &block)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Read a file from the templates directory
|
74
|
+
def read_file(file_name)
|
75
|
+
File.read(File.join(FastTrack.template_root, template_directory, file_name))
|
76
|
+
end
|
27
77
|
end
|
28
78
|
end
|
data/lib/fast_track/version.rb
CHANGED
@@ -1,22 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
gemfile do
|
4
|
-
gem_group :development do
|
5
|
-
gem 'better_errors'
|
6
|
-
gem 'binding_of_caller'
|
7
|
-
gem 'quiet_assets'
|
8
|
-
gem 'pry'
|
9
|
-
gem 'pry-rails'
|
10
|
-
end
|
1
|
+
track "awesome_defaults" do
|
2
|
+
desc "Adds better_errors, quiet_assets, rspec, factory_girl, email_spec & pry"
|
11
3
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
4
|
+
gemfile do
|
5
|
+
gem_group :development do
|
6
|
+
gem 'better_errors'
|
7
|
+
gem 'binding_of_caller'
|
8
|
+
gem 'quiet_assets'
|
9
|
+
gem 'pry'
|
10
|
+
gem 'pry-rails'
|
11
|
+
end
|
12
|
+
|
13
|
+
gem_group :test do
|
14
|
+
gem 'rspec'
|
15
|
+
gem 'rspec-rails'
|
16
|
+
gem 'factory_girl_rails'
|
17
|
+
gem 'database_cleaner'
|
18
|
+
gem 'email_spec'
|
19
|
+
gem 'pry'
|
20
|
+
gem 'pry-rails'
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
data/lib/tracks/backbone.rb
CHANGED
@@ -1,41 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
github_url "https://github.com/meleyal/backbone-on-rails"
|
5
|
-
github_description "
|
6
|
-
A simple gem for using Backbone.js with Rails (>= 3.1),
|
7
|
-
based on thoughtbot's 'Backbone.js on Rails'.
|
1
|
+
track "backbone_on_rails" do
|
2
|
+
rubygem "backbone-on-rails"
|
3
|
+
github_url "https://github.com/meleyal/backbone-on-rails"
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
gemfile do
|
13
|
-
gem 'backbone-on-rails'
|
14
|
-
end
|
15
|
-
|
16
|
-
def invoke
|
17
|
-
generate "backbone:install"
|
18
|
-
end
|
5
|
+
gemfile do
|
6
|
+
gem 'backbone-on-rails'
|
19
7
|
end
|
20
8
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
github_description "
|
26
|
-
Developing javascript applications on top of rails just got faster thanks to the Rails 3.1 asset pipeline. Like jquery-rails, this gem bundles some javascript files to make them available to your application:
|
9
|
+
before_migrate do
|
10
|
+
generate "backbone:install"
|
11
|
+
end
|
12
|
+
end
|
27
13
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
"
|
14
|
+
track "backbone_rails" do
|
15
|
+
rubygem "backbone-rails"
|
16
|
+
github_url "https://github.com/aflatter/backbone-rails"
|
32
17
|
|
33
|
-
|
34
|
-
|
35
|
-
|
18
|
+
gemfile do
|
19
|
+
gem "rails-backbone"
|
20
|
+
end
|
36
21
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
22
|
+
before_migrate do
|
23
|
+
generate "backbone:install"
|
40
24
|
end
|
41
25
|
end
|
@@ -1,20 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
description "Render your http errors in your layout reducing the need for static files."
|
5
|
-
github_url "https://github.com/eric1234/better_exception_app"
|
6
|
-
rubygem_url "https://rubygems.org/gems/better_exception_app"
|
1
|
+
track "better_exception_app" do
|
2
|
+
rubygem "better_exception_app"
|
3
|
+
github_url "https://github.com/eric1234/better_exception_app"
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
gemfile do
|
6
|
+
gem_group :production do
|
7
|
+
gem 'better_exception_app'
|
12
8
|
end
|
9
|
+
end
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
11
|
+
before_migrate do
|
12
|
+
remove_file "public/404.html"
|
13
|
+
remove_file "public/422.html"
|
14
|
+
remove_file "public/500.html"
|
19
15
|
end
|
20
16
|
end
|
data/lib/tracks/cancan.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
class Cancan < Track
|
4
|
-
gemfile do
|
5
|
-
gem 'cancan'
|
6
|
-
end
|
1
|
+
track "cancan" do
|
2
|
+
desc "Control user authorization using CanCan"
|
7
3
|
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
gemfile do
|
5
|
+
gem 'cancan'
|
6
|
+
end
|
7
|
+
|
8
|
+
before_migrate do
|
9
|
+
generate "cancan:ability"
|
11
10
|
end
|
12
11
|
end
|
data/lib/tracks/devise.rb
CHANGED
@@ -1,94 +1,66 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
gemfile do
|
5
|
-
gem 'devise'
|
6
|
-
end
|
1
|
+
track "devise" do
|
2
|
+
name "Vanilla Devise"
|
3
|
+
desc "Plain devise with no config options"
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
generate "devise", config.user_class
|
11
|
-
end
|
12
|
-
|
13
|
-
def invoke
|
14
|
-
end
|
5
|
+
gemfile do
|
6
|
+
gem 'devise'
|
15
7
|
end
|
16
8
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
9
|
+
before_migrate do
|
10
|
+
generate "devise:install"
|
11
|
+
end
|
12
|
+
end
|
22
13
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
generate "devise:views"
|
27
|
-
end
|
14
|
+
track "devise_user_class" do
|
15
|
+
name "Devise User class"
|
16
|
+
desc "Install devise, and add a devise class called 'User'"
|
28
17
|
|
29
|
-
|
30
|
-
|
18
|
+
before_migrate do
|
19
|
+
generate "devise", "User"
|
31
20
|
end
|
21
|
+
end
|
32
22
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
gem 'devise'
|
37
|
-
end
|
38
|
-
|
39
|
-
before_migrate do
|
40
|
-
generate "devise:install"
|
41
|
-
generate "devise", config.user_class
|
42
|
-
generate "devise:views"
|
43
|
-
end
|
23
|
+
track "devise_views" do
|
24
|
+
name "Devise views"
|
25
|
+
desc "Install devise views"
|
44
26
|
|
45
|
-
|
46
|
-
|
47
|
-
"first_name" => "string",
|
48
|
-
"last_name" => "string",
|
49
|
-
"favorite_color" => "string",
|
50
|
-
"#{config.user_class}_id" => "integer"
|
51
|
-
}
|
52
|
-
end
|
27
|
+
before_migrate do
|
28
|
+
generate "devise:views"
|
53
29
|
end
|
30
|
+
end
|
54
31
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
#
|
59
|
-
# * Member object
|
60
|
-
# * Admin object
|
61
|
-
class DevisePlusAdmin < Track
|
62
|
-
gemfile do
|
63
|
-
gem 'devise'
|
64
|
-
end
|
32
|
+
track "user_profile" do
|
33
|
+
name "User Profile"
|
34
|
+
desc "Given a user class, adds a profile class to store personal information about the user."
|
65
35
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
36
|
+
before_migrate do
|
37
|
+
model "Profile", {
|
38
|
+
"first_name" => "string",
|
39
|
+
"last_name" => "string",
|
40
|
+
"favorite_color" => "string",
|
41
|
+
"user_id" => "integer"
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
70
45
|
|
71
|
-
|
72
|
-
|
46
|
+
track "devise_plus_admin" do
|
47
|
+
gemfile do
|
48
|
+
gem 'devise'
|
73
49
|
end
|
74
50
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
# * Admin object
|
81
|
-
class DeviseThreeTier < Track
|
82
|
-
gemfile do
|
83
|
-
gem 'devise'
|
84
|
-
end
|
51
|
+
before_migrate do
|
52
|
+
generate "devise:install"
|
53
|
+
generate "devise", config.user_class
|
54
|
+
end
|
55
|
+
end
|
85
56
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
57
|
+
track "devise_three_tier" do
|
58
|
+
gemfile do
|
59
|
+
gem 'devise'
|
60
|
+
end
|
90
61
|
|
91
|
-
|
92
|
-
|
62
|
+
before_migrate do
|
63
|
+
generate "devise:install"
|
64
|
+
generate "devise", config.user_class
|
93
65
|
end
|
94
66
|
end
|
data/lib/tracks/errbit_heroku.rb
CHANGED
data/lib/tracks/guard.rb
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
track "guard" do
|
2
|
+
gemfile do
|
3
|
+
gem 'guard'
|
3
4
|
end
|
5
|
+
end
|
6
|
+
|
7
|
+
track "awesome_guard" do
|
8
|
+
requires "guard"
|
4
9
|
|
5
|
-
|
6
|
-
gemfile do
|
7
|
-
gem 'guard'
|
8
|
-
gem 'guard-rspec'
|
9
|
-
gem 'guard-jasmine'
|
10
|
-
gem 'guard-livereload'
|
11
|
-
end
|
10
|
+
desc "Use Guard with RSpec, Jasmine & livereload"
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
gemfile do
|
13
|
+
gem 'guard-rspec'
|
14
|
+
gem 'guard-jasmine'
|
15
|
+
gem 'guard-livereload'
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
def template_directory
|
19
|
+
"guard_awesome_defaults"
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def guard_file
|
23
|
+
read_file("Guardfile")
|
23
24
|
end
|
24
25
|
end
|
data/lib/tracks/jquery.rb
CHANGED
@@ -1,19 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
rubygem "jquery-rails"
|
4
|
-
github_url "https://github.com/indirect/jquery-rails"
|
1
|
+
track "jquery" do
|
2
|
+
desc "Add jQuery to your Rails app"
|
5
3
|
|
6
|
-
|
7
|
-
|
4
|
+
rubygem "jquery-rails"
|
5
|
+
github_url "https://github.com/indirect/jquery-rails"
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
the jQuery UJS adapter
|
12
|
-
assert_select_jquery to test jQuery responses in Ruby tests
|
13
|
-
"
|
14
|
-
|
15
|
-
gemfile do
|
16
|
-
gem 'jquery-rails'
|
17
|
-
end
|
7
|
+
gemfile do
|
8
|
+
gem 'jquery-rails'
|
18
9
|
end
|
19
10
|
end
|