salicio (owner)

Forks

Revisions

gist: 7519 Download_button fork
public
Public Clone URL: git://gist.github.com/7519.git
Embed All Files: show embed
test_tog.sh #
1
2
3
4
5
6
7
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/usr/bin/env bash
 
G="\033[1;32m"
R="\033[1;31m"
B="\033[1;34m"
N="\033[0m"
 
if [ $# -ne 1 ]
then
echo "Usage: `basename $0` app_name"
  exit 65
fi
 
exec(){
  printf "$G$1$N\n"
  $1
  if [ $? -ne 0 ]
  then
printf "$R>>> ERROR <<<$N\n"
    exit 1
  fi
}
 
section(){
  printf "\n\n$B>>>>> $1 $N \n\n"
}
 
 
section "CREATE RAILS APP"
exec "rm -fr $1"
exec "rails -q $1"
exec "rm $1/public/index.html"
exec "cd $1"
 
section "INSTALL TOG"
exec "script/plugin install git://github.com/thoughtbot/shoulda.git" # for test
exec "script/plugin install http://juixe.com/svn/acts_as_commentable"
MIGRATION_FILE=`script/generate migration create_comments | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
MIGRATION='class CreateComments < ActiveRecord::Migration
def self.up
create_table "comments", :force => true do |t|
t.column "title", :string, :limit => 50, :default => ""
t.column "comment", :text, :default => ""
t.column "created_at", :datetime, :null => false
t.column "commentable_id", :integer, :default => 0, :null => false
t.column "commentable_type", :string, :limit => 15, :default => "", :null => false
t.column "user_id", :integer, :default => 0, :null => false
end
add_index "comments", ["user_id"], :name => "fk_comments_user"
end
def self.down
drop_table :comments
end
end'
echo "$MIGRATION" > $MIGRATION_FILE
 
exec "script/plugin install http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk"
 
#exec "script/plugin install http://svn.redshiftmedia.com/svn/plugins/seo_urls"
exec "cp -R /Users/roberto/softwork/larnaby.svn/instamat/trunk/vendor/plugins/seo_urls vendor/plugins"
 
exec "script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids"
exec "script/generate acts_as_taggable_migration"
 
exec "script/plugin install http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk"
 
exec "script/plugin install git://github.com/linkingpaths/acts_as_scribe.git"
exec "script/generate acts_as_scribe_migration"
 
exec "script/plugin install git://github.com/linkingpaths/acts_as_abusable.git"
exec "script/generate acts_as_abusable_migration"
 
exec "togify . --development"
exec "rake db:migrate"
 
 
section "INSTALL VAULT"
exec "script/plugin install git://github.com/salicio/fckeditor.git"
exec "script/plugin install acts_as_tree"
exec "git clone git@github.com:tog/tog_vault.git vendor/plugins/tog_vault"
#exec "script/plugin install git@github.com:tog/tog_vault.git"
MIGRATION_FILE=`script/generate migration integrate_vault | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
MIGRATION='class IntegrateVault < ActiveRecord::Migration
def self.up
migrate_plugin "tog_vault", 3
end
def self.down
migrate_plugin "tog_vault", 0
end
end'
echo "$MIGRATION" > $MIGRATION_FILE
exec "rake db:migrate"
 
printf "$G"
printf "cat config/routes.rb | awk '{ gsub(/# The priority/, \"map.routes_from_plugin \x27tog_vault\x27\ n # The priority\",$ 0); print }'$N\n"
ROUTES=`cat config/routes.rb | awk '{ gsub(/# The priority/, "map.routes_from_plugin \x27tog_vault\x27\n # The priority",$0); print }'`
echo "$ROUTES" > config/routes.rb
 
 
section "INSTALL CONVERSATIO"
exec "git clone git@github.com:tog/tog_conversatio.git vendor/plugins/tog_conversatio"
#exec "script/plugin install git@github.com:tog/tog_conversatio.git"
MIGRATION_FILE=`script/generate migration integrate_conversatio | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
MIGRATION='class IntegrateConversatio < ActiveRecord::Migration
def self.up
migrate_plugin "tog_conversatio", 4
end
def self.down
migrate_plugin "tog_conversatio", 0
end
end'
echo "$MIGRATION" > $MIGRATION_FILE
exec "rake db:migrate"
 
printf "$G"
printf "cat config/routes.rb | awk '{ gsub(/# The priority/, \"map.routes_from_plugin \x27tog_conversatio\x27\ n # The priority\",$ 0); print }'$N\n"
ROUTES=`cat config/routes.rb | awk '{ gsub(/# The priority/, "map.routes_from_plugin \x27tog_conversatio\x27\n # The priority",$0); print }'`
echo "$ROUTES" > config/routes.rb
 
 
section "INSTALL PICTO"
exec "script/plugin install git://github.com/rails/acts_as_list.git"
exec "script/plugin install git://github.com/andry1/acts_as_rateable.git"
MIGRATION_FILE=`script/generate migration add_ratings | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
MIGRATION='class AddRatings < ActiveRecord::Migration
def self.up
create_table :ratings do |t|
t.column :rating, :integer
t.column :rateable_id, :integer, :null => false
t.column :rateable_type, :string, :null => false
end
add_index :ratings, [:rateable_id, :rating]
end
 
def self.down
drop_table :ratings
end
end'
echo "$MIGRATION" > $MIGRATION_FILE
exec "rake db:migrate"
 
 
exec "git clone git@github.com:tog/tog_picto.git vendor/plugins/tog_picto"
#exec "script/plugin install git@github.com:tog/tog_picto.git"
MIGRATION_FILE=`script/generate migration integrate_picto | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
MIGRATION='class IntegratePicto < ActiveRecord::Migration
def self.up
migrate_plugin "tog_picto", 6
end
def self.down
migrate_plugin "tog_picto", 0
end
end'
echo "$MIGRATION" > $MIGRATION_FILE
exec "rake db:migrate"
 
printf "$G"
printf "cat config/routes.rb | awk '{ gsub(/# The priority/, \"map.routes_from_plugin \x27tog_picto\x27\ n # The priority\",$ 0); print }'$N\n"
ROUTES=`cat config/routes.rb | awk '{ gsub(/# The priority/, "map.routes_from_plugin \x27tog_picto\x27\n # The priority",$0); print }'`
echo "$ROUTES" > config/routes.rb
 
 
#section "INSTALL TAXONOMY"
#exec "script/plugin install git://github.com/funkensturm/acts_as_category.git"
#exec "script/plugin install git://github.com/pyrat/wee_lightbox.git"
#
#exec "git clone git@github.com:tog/tog_taxonomy.git vendor/plugins/tog_taxonomy"
##exec "script/plugin install git@github.com:tog/tog_taxonomy.git"
#MIGRATION_FILE=`script/generate migration integrate_taxonomy | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
#MIGRATION='class IntegrateTaxonomy < ActiveRecord::Migration
# def self.up
# migrate_plugin "tog_taxonomy", 1
# end
# def self.down
# migrate_plugin "tog_taxonomy", 0
# end
#end'
#echo "$MIGRATION" > $MIGRATION_FILE
#exec "rake db:migrate"
#
#printf "$G"
#printf "cat config/routes.rb | awk '{ gsub(/# The priority/, \"map.routes_from_plugin \x27tog_taxonomy\x27\ n # The priority\",$ 0); print }'$N\n"
#ROUTES=`cat config/routes.rb | awk '{ gsub(/# The priority/, "map.routes_from_plugin \x27tog_taxonomy\x27\n # The priority",$0); print }'`
#echo "$ROUTES" > config/routes.rb
 
 
#section "INSTALL BOOKMARKS"
#exec "git clone git@github.com:tog/tog_bookmarks.git vendor/plugins/tog_bookmarks"
##exec "script/plugin install git@github.com:tog/tog_bookmarks.git"
#MIGRATION_FILE=`script/generate migration integrate_bookmarks | grep "create db/migrate/" | sed -e 's/[ ]*create[ ]*//'`
#MIGRATION='class IntegrateBookmarks < ActiveRecord::Migration
# def self.up
# migrate_plugin "tog_bookmarks", 1
# end
# def self.down
# migrate_plugin "tog_bookmarks", 0
# end
#end'
#echo "$MIGRATION" > $MIGRATION_FILE
#exec "rake db:migrate"
#
#printf "$G"
#printf "cat config/routes.rb | awk '{ gsub(/# The priority/, \"map.routes_from_plugin \x27tog_bookmarks\x27\ n # The priority\",$ 0); print }'$N\n"
#ROUTES=`cat config/routes.rb | awk '{ gsub(/# The priority/, "map.routes_from_plugin \x27tog_bookmarks\x27\n # The priority",$0); print }'`
#echo "$ROUTES" > config/routes.rb
 
 
 
section "COPY RESOURCES"
exec "rake tog:plugins:copy_resources"
 
section "FAKE COMMUNITY"
exec "script/runner ../fake_community.rb"
 
section "START SERVER"
exec "script/server"