public
Fork of cptfinch/utility_scripts
Description: Some utility scripts (the stuff I keep in ~/bin)
Clone URL: git://github.com/patmcnally/utility_scripts.git
Having problems with edge rails, using 2.0.2 for now
patmcnally (author)
Tue May 20 22:18:39 -0700 2008
commit  b9bb2be5c7cf6350fc5a17e86ffbd1d1f9c16b64
tree    26b9599376b0ff0badbff94a417912fda610578c
parent  9615c00d259138de333b7a7606157a3a350e7dc0
...
8
9
10
11
 
 
12
13
14
15
16
17
18
 
 
 
 
 
 
 
 
19
20
21
22
23
24
25
 
 
 
26
27
28
29
30
31
32
 
33
34
35
36
37
 
38
39
40
...
44
45
46
47
 
48
49
50
51
 
52
53
54
...
61
62
63
64
 
65
66
67
...
72
73
74
75
76
77
78
...
88
89
90
91
92
 
 
 
93
94
95
...
103
104
105
 
 
 
 
 
106
107
108
...
119
120
121
122
 
123
124
125
126
127
128
 
129
130
131
132
133
134
 
135
136
137
138
139
140
141
 
142
143
144
145
146
147
 
148
149
150
151
152
153
 
154
155
156
157
158
 
159
160
...
8
9
10
 
11
12
13
14
15
16
17
18
 
19
20
21
22
23
24
25
26
27
28
29
30
31
 
 
32
33
34
35
36
37
38
39
40
 
41
42
43
44
45
 
46
47
48
49
...
53
54
55
 
56
57
58
59
 
60
61
62
63
...
70
71
72
 
73
74
75
76
...
81
82
83
 
84
85
86
...
96
97
98
 
 
99
100
101
102
103
104
...
112
113
114
115
116
117
118
119
120
121
122
...
133
134
135
 
136
137
138
139
140
141
 
142
143
144
145
146
147
 
148
149
 
150
151
152
153
 
154
155
156
157
158
159
 
160
161
162
163
164
165
 
166
167
168
169
170
 
171
172
173
0
@@ -8,33 +8,42 @@
0
 # See http://github.com/foca/utility_scripts/ for the latest version
0
 # Released under a WTFP license (http://sam.zoy.org/wtfpl/)
0
 
0
-RAILS_GIT_CHECKOUT = '/Users/cptfinch/developments/rails/apps/rails_git_checkout/rails'
0
+RAILS_GIT_CHECKOUT = '/Users/pat/Projects/Rails/git_clones/rails'
0
+
0
 
0
 module Helpers
0
   LINE = 80
0
 
0
   def announcing(msg)
0
     print msg
0
- yield
0
+ begin
0
+ yield
0
+ rescue
0
+ print "." * (LINE - msg.size - 8)
0
+ puts "\e[31m[FAILED]\e[0m"
0
+ Process.exit
0
+ return
0
+ end
0
     print "." * (LINE - msg.size - 6)
0
     puts "\e[32m[DONE]\e[0m"
0
   end
0
 
0
   def silent(command)
0
- # system "#{command} &> /dev/null"
0
- system "#{command}"
0
+ unless(system("#{command} #&> /dev/null"))
0
+ raise "Command Failed"
0
+ end
0
   end
0
 
0
   def templates
0
     { :gitignore => %w[config/database.yml tmp/* log/*.log db/*.sqlite3 public/stylesheets/application.css] * "\n",
0
       :routes => ["ActionController::Routing::Routes.draw do |map|", "end"] * "\n" }
0
   end
0
-
0
+
0
   def gitci(message)
0
    silent 'git add .'
0
    silent "git commit -m '#{message}'"
0
   end
0
-
0
+
0
   def braid(repo, dir, type="git")
0
     silent "braid add #{repo} --type #{type} #{dir}"
0
     silent "git merge braid/track"
0
@@ -44,11 +53,11 @@ module Helpers
0
     args = args.map {|name,value| "#{name.to_s.upcase}=#{value}"}.join(" ")
0
     silent "rake #{task} #{args}"
0
   end
0
-
0
+
0
   def gitsub(repo, dir)
0
     silent "git submodule add #{repo} #{dir}"
0
   end
0
-
0
+
0
 end
0
 
0
 if __FILE__ == $0
0
@@ -61,7 +70,7 @@ if __FILE__ == $0
0
   end
0
 
0
   announcing "Creating application layout" do
0
- silent "ruby #{RAILS_GIT_CHECKOUT}/railties/bin/rails #{app_name}"
0
+ silent "rails #{app_name}"
0
   end
0
 
0
   Dir.chdir(app_name) do
0
@@ -72,7 +81,6 @@ if __FILE__ == $0
0
       silent "rm public/images/rails.png"
0
       silent "cp config/database.{,sample.}yml"
0
       silent "rm -r test"
0
- # File.open("config/routes.rb", "w") {|f| f << templates[:routes] }
0
     end
0
 
0
     announcing "Creating databases" do
0
@@ -88,8 +96,9 @@ if __FILE__ == $0
0
     end
0
 
0
     announcing "Freezing rails" do
0
- silent "git submodule add git://github.com/rails/rails.git vendor/rails"
0
- silent "git submodule init"
0
+ rake "rails:freeze:gems"
0
+ #silent "git submodule add git://github.com/rails/rails.git vendor/rails"
0
+ #silent "git submodule init"
0
     end
0
 
0
     announcing "Installing GemsOnrails" do
0
@@ -103,6 +112,11 @@ if __FILE__ == $0
0
       gitci "Froze haml gem and plugin"
0
     end
0
 
0
+ announcing "Installing Shoulda" do
0
+ silent "git submodule add git://github.com/thoughtbot/shoulda.git vendors/plugins/shoulda"
0
+ silent "git submodule init"
0
+ end
0
+
0
     announcing "Installing RSpec" do
0
       silent "git submodule add git://github.com/dchelimsky/rspec.git vendor/plugins/rspec"
0
       silent "git submodule add git://github.com/dchelimsky/rspec-rails.git vendor/plugins/rspec-rails"
0
@@ -119,42 +133,41 @@ if __FILE__ == $0
0
       silent "git submodule init"
0
       gitci "Installed make_resourceful plugin"
0
     end
0
-
0
+
0
     announcing "Installing sexy_scaffold" do
0
       silent "git submodule add git://github.com/dfischer/sexy_scaffold.git vendor/plugins/sexy_scaffold"
0
       silent "git submodule init"
0
       gitci "Installed sexy_scaffold plugin"
0
      end
0
-
0
+
0
     announcing "Installing rspec_on_crack" do
0
       silent "git submodule add git://github.com/technoweenie/rspec_on_rails_on_crack.git vendor/plugins/rspec_on_rails_on_crack"
0
       silent "git submodule init"
0
       gitci "Installed rspec_on_crack plugin"
0
     end
0
-
0
+
0
     announcing "Installing acts_as_list" do
0
- # silent "script/plugin install git://github.com/veilleperso/acts_as_list.git"
0
       silent "git submodule add git://github.com/veilleperso/acts_as_list.git vendor/plugins/acts_as_list"
0
       silent "git submodule init"
0
       gitci "Installed acts_as_list plugin"
0
     end
0
-
0
+
0
     announcing "Installing acts_as_state_machine" do
0
       silent "git submodule add git://github.com/omghax/acts_as_state_machine.git vendor/plugins/acts_as_state_machine"
0
       silent "git submodule init"
0
       gitci "Installed acts_as_state_machine plugin"
0
     end
0
-
0
+
0
     announcing "Installing restful-authentication" do
0
       silent "git submodule add git://github.com/technoweenie/restful-authentication.git vendor/plugins/restful-authentication"
0
       silent "git submodule init"
0
       gitci "Installed restful-authentication plugin"
0
     end
0
-
0
+
0
     announcing "Installing auto_migrations" do
0
       silent "git submodule add git://github.com/pjhyett/auto_migrations.git vendor/plugins/auto_migrations"
0
       silent "git submodule init"
0
       gitci "Installed auto_migrations plugin"
0
- end
0
+ end
0
   end
0
 end

Comments

    No one has commented yet.