Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 323 lines (290 sloc) 12.382 kb
091ef1c @dbloete Use Bundler for dependency management
dbloete authored
1 require "rubygems"
8698a27 @imathis Cleaned out public from repository, updated gitignore, added syntax
authored
2 require "bundler/setup"
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
3 require "stringex"
091ef1c @dbloete Use Bundler for dependency management
dbloete authored
4
a2ab1d4 @imathis 1. Reordered configs in Rakefile based on importance.
authored
5 ## -- Rsync Deploy config -- ##
6 # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
9b52d40 @imathis removed octopress.org rsync deploy config from Rakefile. Oops
authored
7 ssh_user = "user@domain.com"
8 document_root = "~/website.com/"
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
9 deploy_default = "rsync"
10
11 # This will be configured for you when you run config_deploy
12 deploy_branch = "gh-pages"
a2ab1d4 @imathis 1. Reordered configs in Rakefile based on importance.
authored
13
59521e3 @imathis added blog_index_dir configuration and improved update_source
authored
14 ## -- Misc Configs -- ##
a2ab1d4 @imathis 1. Reordered configs in Rakefile based on importance.
authored
15
59521e3 @imathis added blog_index_dir configuration and improved update_source
authored
16 public_dir = "public" # compiled site directory
17 source_dir = "source" # source file directory
18 blog_index_dir = 'source' # directory for your blog's index page (if you put your index in source/blog/index.html, set this to 'source/blog')
19 deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
20 stash_dir = "_stash" # directory to stash posts for speedy generation
21 posts_dir = "_posts" # directory for blog files
22 themes_dir = ".themes" # directory for blog files
23 new_post_ext = "markdown" # default new post file extension when using the new_post task
24 new_page_ext = "markdown" # default new page file extension when using the new_page task
25 server_port = "4000" # port for preview server eg. localhost:4000
399fe77 @imathis updated rakefile to support github user pages, and github project pages ...
authored
26
cc8985d @imathis fixed a few issues with the rakefile, and updated the readme
authored
27
17c59fb @imathis Moved plugins to root directory. I'm ditching the idea of shipping plugi...
authored
28 desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]"
d8b796a @imathis Another massive commit:
authored
29 task :install, :theme do |t, args|
f03c4cd @fhemberger install: Adds confirmation before overwriting existing source_dir
fhemberger authored
30 if File.directory?(source_dir) || File.directory?("sass")
31 abort("rake aborted!") if ask("A theme is already installed, proceeding will overwrite existing files. Are you sure?", ['y', 'n']) == 'n'
32 end
d8b796a @imathis Another massive commit:
authored
33 # copy theme into working Jekyll directories
34 theme = args.theme || 'classic'
17c59fb @imathis Moved plugins to root directory. I'm ditching the idea of shipping plugi...
authored
35 puts "## Copying "+theme+" theme into ./#{source_dir} and ./sass"
9e6a951 @imathis Updated install rake task (now properly copies directory contents) Thank...
authored
36 mkdir_p source_dir
37 cp_r "#{themes_dir}/#{theme}/source/.", source_dir
38 mkdir_p "sass"
39 cp_r "#{themes_dir}/#{theme}/sass/.", "sass"
40 mkdir_p "#{source_dir}/#{posts_dir}"
41 mkdir_p public_dir
d8b796a @imathis Another massive commit:
authored
42 end
43
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
44 #######################
45 # Working with Jekyll #
46 #######################
eefe29e @imathis now Octopress uses partials
authored
47
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
48 desc "Generate jekyll site"
49 task :generate do
b38b613 @imathis Added warning if users try to add posts, pages, or generate their site
authored
50 raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
51 puts "## Generating Site with Jekyll"
52 system "jekyll"
53 end
54
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
55 desc "Watch the site and regenerate when it changes"
56 task :watch do
b38b613 @imathis Added warning if users try to add posts, pages, or generate their site
authored
57 raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
58 puts "Starting to watch source with Jekyll and Compass."
7c1c24f @imathis moved from Posix::Span to Process.span, fixing #46
authored
59 jekyllPid = Process.spawn("jekyll --auto")
60 compassPid = Process.spawn("compass watch")
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
61
62 trap("INT") {
63 Process.kill(9, jekyllPid)
64 Process.kill(9, compassPid)
65 exit 0
66 }
67
68 Process.wait
af719fb @imathis fixed default deploy task
authored
69 end
70
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
71 desc "preview the site in a web browser"
72 task :preview do
b38b613 @imathis Added warning if users try to add posts, pages, or generate their site
authored
73 raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
74 puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
7c1c24f @imathis moved from Posix::Span to Process.span, fixing #46
authored
75 jekyllPid = Process.spawn("jekyll --auto")
76 compassPid = Process.spawn("compass watch")
77 rackupPid = Process.spawn("rackup --port #{server_port}")
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
78
79 trap("INT") {
80 Process.kill(9, jekyllPid)
81 Process.kill(9, compassPid)
82 Process.kill(9, rackupPid)
83 exit 0
84 }
85
86 Process.wait
145f810 @imathis updated rake file, reorganized stylesheets, added google site search, ad...
authored
87 end
88
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
89 # usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
ce66217 @imathis Improved the post and init_deploy rake tasks
authored
90 desc "Begin a new post in #{source_dir}/#{posts_dir}"
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
91 task :new_post, :title do |t, args|
b38b613 @imathis Added warning if users try to add posts, pages, or generate their site
authored
92 raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
9224725 @kent Updated path to plugins.
kent authored
93 require './plugins/titlecase.rb'
ebd5fb0 @imathis sleeps wait, cleaned up rake preview and rake watch a bit
authored
94 mkdir_p "#{source_dir}/#{posts_dir}"
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
95 args.with_defaults(:title => 'new-post')
96 title = args.title
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
97 filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
3f07677 @imathis Added prompt for overwriting posts and pages when a new_post and new_pag...
authored
98 if File.exist?(filename)
b812500 @imathis Updated new_post and new_page taks to use new ask method for dialogs
authored
99 abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
3f07677 @imathis Added prompt for overwriting posts and pages when a new_post and new_pag...
authored
100 end
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
101 puts "Creating new post: #{filename}"
102 open(filename, 'w') do |post|
ebd5fb0 @imathis sleeps wait, cleaned up rake preview and rake watch a bit
authored
103 system "mkdir -p #{source_dir}/#{posts_dir}/";
a6262dc @imathis added a rake task for creating a new post
authored
104 post.puts "---"
e4c2d57 @imathis irrisponsibly massive commit
authored
105 post.puts "layout: post"
98cfd74 @imathis In new_post and new_page rake tasks: adding quotes around title attribut...
authored
106 post.puts "title: \"#{title.gsub(/&/,'&').titlecase}\""
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
107 post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
108 post.puts "comments: true"
17c59fb @imathis Moved plugins to root directory. I'm ditching the idea of shipping plugi...
authored
109 post.puts "categories: "
a6262dc @imathis added a rake task for creating a new post
authored
110 post.puts "---"
111 end
112 end
113
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
114 # usage rake new_page[my-new-page] or rake new_page[my-new-page.html] or rake new_page (defaults to "new-page.markdown")
9189548 @ballou88 Changed description of new_page rake task, to what it does
ballou88 authored
115 desc "Create a new page in #{source_dir}/(filename)/index.#{new_page_ext}"
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
116 task :new_page, :filename do |t, args|
b38b613 @imathis Added warning if users try to add posts, pages, or generate their site
authored
117 raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
118 require './plugins/titlecase.rb'
119 args.with_defaults(:filename => 'new-page')
120 page_dir = source_dir
cc1cfa5 @imathis fixed regular expression for new_page rake task
authored
121 if args.filename =~ /(^.+\/)?([\w_-]+)(\.)?(.+)?/
6006ac8 @imathis new_page rake task now creates pages as page_name/index.[default_format]...
authored
122 page_dir += $4 ? "/#{$1}" : "/#{$1}#{$2}/"
123 name = $4 ? $2 : "index"
124 extension = $4 || "#{new_page_ext}"
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
125 filename = "#{name}.#{extension}"
126 mkdir_p page_dir
127 file = page_dir + filename
3f07677 @imathis Added prompt for overwriting posts and pages when a new_post and new_pag...
authored
128 if File.exist?(file)
b812500 @imathis Updated new_post and new_page taks to use new ask method for dialogs
authored
129 abort("rake aborted!") if ask("#{file} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
3f07677 @imathis Added prompt for overwriting posts and pages when a new_post and new_pag...
authored
130 end
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
131 puts "Creating new page: #{file}"
132 open(file, 'w') do |page|
133 page.puts "---"
134 page.puts "layout: page"
6006ac8 @imathis new_page rake task now creates pages as page_name/index.[default_format]...
authored
135 page.puts "title: \"#{$2.gsub(/[-_]/, ' ').titlecase}\""
4a40323 @imathis Changed rake task 'post' to 'new_post' and updated the yaml front matter...
authored
136 page.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
137 page.puts "comments: true"
138 page.puts "sharing: true"
139 page.puts "footer: true"
140 page.puts "---"
141 end
142 else
143 puts "Syntax error: #{args.filename} contains unsupported characters"
144 end
145 end
146
2f41517 @rwdaigle Update to rakefile to allow working on a single post at a time (and savi...
rwdaigle authored
147 # usage rake isolate[my-post]
148 desc "Move all other posts than the one currently being worked on to a temporary stash location (stash) so regenerating the site happens much quicker."
149 task :isolate, :filename do |t, args|
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
150 stash_dir = "#{source_dir}/#{stash_dir}"
2f41517 @rwdaigle Update to rakefile to allow working on a single post at a time (and savi...
rwdaigle authored
151 FileUtils.mkdir(stash_dir) unless File.exist?(stash_dir)
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
152 Dir.glob("#{source_dir}/#{posts_dir}/*.*") do |post|
2f41517 @rwdaigle Update to rakefile to allow working on a single post at a time (and savi...
rwdaigle authored
153 FileUtils.mv post, stash_dir unless post.include?(args.filename)
154 end
155 end
156
157 desc "Move all stashed posts back into the posts directory, ready for site generation."
158 task :integrate do
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
159 FileUtils.mv Dir.glob("#{source_dir}/#{stash_dir}/*.*"), "#{source_dir}/#{posts_dir}/"
2f41517 @rwdaigle Update to rakefile to allow working on a single post at a time (and savi...
rwdaigle authored
160 end
161
2181305 @imathis 1. Replaced Rdiscount in favor of Kramdown (better html5 support) for ma...
authored
162 desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
163 task :clean do
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
164 rm_rf ["_code_cache/**", "_gist_cache/**", ".sass-cache/**", "source/stylesheets/screen.css"]
2181305 @imathis 1. Replaced Rdiscount in favor of Kramdown (better html5 support) for ma...
authored
165 end
166
19df7e8 @imathis added source_update and sass_update rake tasks, for easily updating a bl...
authored
167 desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
168 task :update_style, :theme do |t, args|
169 theme = args.theme || 'classic'
6244fea @lukearmstrong Fixed rake update_source and rake update_style
lukearmstrong authored
170 if File.directory?("sass.old")
171 puts "removed existing sass.old directory"
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
172 rm_r "sass.old", :secure=>true
6244fea @lukearmstrong Fixed rake update_source and rake update_style
lukearmstrong authored
173 end
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
174 mv "sass", "sass.old"
19df7e8 @imathis added source_update and sass_update rake tasks, for easily updating a bl...
authored
175 puts "## Moved styles into sass.old/"
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
176 cp_r "#{themes_dir}/"+theme+"/sass/", "sass"
19df7e8 @imathis added source_update and sass_update rake tasks, for easily updating a bl...
authored
177 cp_r "sass.old/custom/.", "sass/custom"
178 puts "## Updated Sass ##"
179 end
180
181 desc "Move source to source.old, install source theme updates, replace source/_includes/navigation.html with source.old's navigation"
182 task :update_source, :theme do |t, args|
183 theme = args.theme || 'classic'
6244fea @lukearmstrong Fixed rake update_source and rake update_style
lukearmstrong authored
184 if File.directory?("#{source_dir}.old")
724fd1d @imathis fixed bug where update_source Rake task was not copying over changes fro...
authored
185 puts "## Removed existing #{source_dir}.old directory"
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
186 rm_r "#{source_dir}.old", :secure=>true
6244fea @lukearmstrong Fixed rake update_source and rake update_style
lukearmstrong authored
187 end
724fd1d @imathis fixed bug where update_source Rake task was not copying over changes fro...
authored
188 cp_r "#{source_dir}/.", "#{source_dir}.old"
189 puts "## Copied #{source_dir} into #{source_dir}.old/"
190 cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true
191 cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
192 mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
193 cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir
19df7e8 @imathis added source_update and sass_update rake tasks, for easily updating a bl...
authored
194 puts "## Updated #{source_dir} ##"
195 end
196
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
197 ##############
198 # Deploying #
199 ##############
200
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
201 desc "Default deploy task"
960a57c @fhemberger Generate site before deploying, execute tasks in sequence
fhemberger authored
202 task :deploy do
203 [:generate, :copydot, "#{deploy_default}"].each { |t| Rake::Task[t].execute }
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
204 end
205
206 desc "copy dot files for deployment"
207 task :copydot do
5c27554 @fhemberger Copy dotfiles also for subdirectories
fhemberger authored
208 exclusions = [".", "..", ".DS_Store"]
209 Dir["#{source_dir}/**/.*"].each do |file|
210 if !File.directory?(file) && !exclusions.include?(file)
211 cp(file, file.gsub(/#{source_dir}/, "#{public_dir}"));
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
212 end
213 end
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
214 end
215
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
216 desc "Deploy website via rsync"
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
217 task :rsync do
d8b796a @imathis Another massive commit:
authored
218 puts "## Deploying website via Rsync"
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
219 ok_failed system("rsync -avz --delete #{public_dir}/ #{ssh_user}:#{document_root}")
82d0251 @imathis improved starting point
authored
220 end
221
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
222 desc "deploy public directory to github pages"
35a158d @imathis Somehow I replaced Rakefile with oder version, oops
authored
223 multitask :push do
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
224 puts "## Deploying branch to Github Pages "
225 (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) }
a12b0b7 @imathis updated push rake task to copy contents of public directory into _deploy
authored
226 system "cp -R #{public_dir}/* #{deploy_dir}"
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
227 puts "\n## copying #{public_dir} to #{deploy_dir}"
228 cd "#{deploy_dir}" do
229 system "git add ."
230 system "git add -u"
231 puts "\n## Commiting: Site updated at #{Time.now.utc}"
232 message = "Site updated at #{Time.now.utc}"
233 system "git commit -m '#{message}'"
234 puts "\n## Pushing generated #{deploy_dir} website"
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
235 system "git push origin #{deploy_branch}"
b9b9eb0 @imathis improved rake tasks for deployment, updated .gitignore
authored
236 puts "\n## Github Pages deploy complete"
237 end
54766a0 @imathis updated rakefile to support github pages deployments
authored
238 end
239
1f9b596 @imathis 1. Added rake task for simple configuration of subdirectory deployment.
authored
240 desc "Update configurations to support publishing to root or sub directory"
241 task :set_root_dir, :dir do |t, args|
242 puts ">>> !! Please provide a directory, eg. rake config_dir[publishing/subdirectory]" unless args.dir
243 if args.dir
244 if args.dir == "/"
245 dir = ""
246 else
247 dir = "/" + args.dir.sub(/(\/*)(.+)/, "\\2").sub(/\/$/, '');
248 end
249 rakefile = IO.read(__FILE__)
250 rakefile.sub!(/public_dir(\s*)=(\s*)(["'])[\w\-\/]*["']/, "public_dir\\1=\\2\\3public#{dir}\\3")
251 File.open(__FILE__, 'w') do |f|
252 f.write rakefile
253 end
254 compass_config = IO.read('config.rb')
255 compass_config.sub!(/http_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_path\\1=\\2\\3#{dir}/\\3")
256 compass_config.sub!(/http_images_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_images_path\\1=\\2\\3#{dir}/images\\3")
257 compass_config.sub!(/http_fonts_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_fonts_path\\1=\\2\\3#{dir}/fonts\\3")
258 compass_config.sub!(/css_dir(\s*)=(\s*)(["'])[\w\-\/]*["']/, "css_dir\\1=\\2\\3public#{dir}/stylesheets\\3")
259 File.open('config.rb', 'w') do |f|
260 f.write compass_config
261 end
262 jekyll_config = IO.read('_config.yml')
263 jekyll_config.sub!(/^destination:.+$/, "destination: public#{dir}")
12aed03 @imathis updated rakefile and config to support url mapping in previous commit
authored
264 jekyll_config.sub!(/^subscribe_rss:\s*\/.+$/, "subscribe_rss: #{dir}/atom.xml")
265 jekyll_config.sub!(/^root:.*$/, "root: /#{dir.sub(/^\//, '')}")
1f9b596 @imathis 1. Added rake task for simple configuration of subdirectory deployment.
authored
266 File.open('_config.yml', 'w') do |f|
267 f.write jekyll_config
268 end
12aed03 @imathis updated rakefile and config to support url mapping in previous commit
authored
269 rm_rf public_dir
270 mkdir_p "#{public_dir}#{dir}"
271 puts "## Site's root directory is now '/#{dir.sub(/^\//, '')}' ##"
1f9b596 @imathis 1. Added rake task for simple configuration of subdirectory deployment.
authored
272 end
273 end
274
275 desc "Setup _deploy folder and deploy branch"
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
276 task :config_deploy, :branch do |t, args|
ce66217 @imathis Improved the post and init_deploy rake tasks
authored
277 puts "!! Please provide a deploy branch, eg. rake init_deploy[gh-pages] !!" unless args.branch
278 puts "## Creating a clean #{args.branch} branch in ./#{deploy_dir} for Github pages deployment"
6f4c842 @imathis fixed a bug in init_deploy task
authored
279 cd "#{deploy_dir}" do
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
280 system "git symbolic-ref HEAD refs/heads/#{args.branch}"
281 system "rm .git/index"
282 system "git clean -fdx"
ce66217 @imathis Improved the post and init_deploy rake tasks
authored
283 system "echo 'My Octopress Page is coming soon …' > index.html"
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
284 system "git add ."
ea349cd @imathis Moved themes to .themes to get it out of the way. Updated Rakefile to su...
authored
285 system "git commit -m 'Octopress init'"
286 rakefile = IO.read(__FILE__)
287 rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{args.branch}\\3")
288 rakefile.sub!(/deploy_default(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_default\\1=\\2\\3push\\3")
289 File.open(__FILE__, 'w') do |f|
290 f.write rakefile
291 end
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
292 end
ee7b9dd @imathis Changed _plugins folder to plugins and updated rake tasks accordingly
authored
293 puts "## Deployment configured. Now you can deploy to the #{args.branch} branch with `rake deploy` ##"
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
294 end
82d0251 @imathis improved starting point
authored
295
a128d49 @imathis 1. Improved Deployment and setup tasks in Rakefile
authored
296 def ok_failed(condition)
297 if (condition)
298 puts "OK"
299 else
300 puts "FAILED"
301 end
302 end
82d0251 @imathis improved starting point
authored
303
f03c4cd @fhemberger install: Adds confirmation before overwriting existing source_dir
fhemberger authored
304 def get_stdin(message)
305 print message
306 STDIN.gets.chomp
307 end
308
309 def ask(message, valid_options)
310 if valid_options
311 answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
312 else
313 answer = get_stdin(message)
314 end
315 answer
316 end
317
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
318 desc "list tasks"
319 task :list do
a817f99 @marutanm fix rake-list
marutanm authored
320 puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"
14ba4cf @imathis 1. Reduced dependencies and updated the gemfile
authored
321 puts "(type rake -T for more detail)\n\n"
9bd7133 @gisikw Fixed 'rake preview on fails vanilla install' bug
gisikw authored
322 end
Something went wrong with that request. Please try again.