mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Zip file goes in download directory.
Moving the zip file to the source tree so it can be downloaded.
This commit is contained in:
20
Rakefile
20
Rakefile
@@ -5,17 +5,14 @@ require 'rake/clean'
|
|||||||
|
|
||||||
SRC_DIR = 'src'
|
SRC_DIR = 'src'
|
||||||
PROB_DIR = 'koans'
|
PROB_DIR = 'koans'
|
||||||
DIST_DIR = 'dist'
|
DOWNLOAD_DIR = 'download'
|
||||||
|
|
||||||
SRC_FILES = FileList["#{SRC_DIR}/*"]
|
SRC_FILES = FileList["#{SRC_DIR}/*"]
|
||||||
KOAN_FILES = SRC_FILES.pathmap("#{PROB_DIR}/%f")
|
KOAN_FILES = SRC_FILES.pathmap("#{PROB_DIR}/%f")
|
||||||
|
|
||||||
today = Time.now.strftime("%Y-%m-%d")
|
ZIP_FILE = "#{DOWNLOAD_DIR}/rubykoans.zip"
|
||||||
TAR_FILE = "#{DIST_DIR}/rubykoans-#{today}.tgz"
|
|
||||||
ZIP_FILE = "#{DIST_DIR}/rubykoans-#{today}.zip"
|
|
||||||
|
|
||||||
CLEAN.include("**/*.rbc")
|
CLEAN.include("**/*.rbc")
|
||||||
CLOBBER.include(DIST_DIR)
|
|
||||||
|
|
||||||
module Koans
|
module Koans
|
||||||
extend Rake::DSL if defined?(Rake::DSL)
|
extend Rake::DSL if defined?(Rake::DSL)
|
||||||
@@ -85,23 +82,18 @@ task :walk_the_path do
|
|||||||
ruby 'path_to_enlightenment.rb'
|
ruby 'path_to_enlightenment.rb'
|
||||||
end
|
end
|
||||||
|
|
||||||
directory DIST_DIR
|
directory DOWNLOAD_DIR
|
||||||
directory PROB_DIR
|
directory PROB_DIR
|
||||||
|
|
||||||
file ZIP_FILE => KOAN_FILES + [DIST_DIR] do
|
file ZIP_FILE => KOAN_FILES + [DOWNLOAD_DIR] do
|
||||||
sh "zip #{ZIP_FILE} #{PROB_DIR}/*"
|
sh "zip #{ZIP_FILE} #{PROB_DIR}/*"
|
||||||
end
|
end
|
||||||
|
|
||||||
file TAR_FILE => KOAN_FILES + [DIST_DIR] do
|
|
||||||
sh "tar zcvf #{TAR_FILE} #{PROB_DIR}"
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Create packaged files for distribution"
|
desc "Create packaged files for distribution"
|
||||||
task :package => [TAR_FILE, ZIP_FILE]
|
task :package => [ZIP_FILE]
|
||||||
|
|
||||||
desc "Upload the package files to the web server"
|
desc "Upload the package files to the web server"
|
||||||
task :upload => [TAR_FILE, ZIP_FILE] do
|
task :upload => [ZIP_FILE] do
|
||||||
sh "scp #{TAR_FILE} linode:sites/onestepback.org/download"
|
|
||||||
sh "scp #{ZIP_FILE} linode:sites/onestepback.org/download"
|
sh "scp #{ZIP_FILE} linode:sites/onestepback.org/download"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
BIN
download/rubykoans.zip
Normal file
BIN
download/rubykoans.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user