summaryrefslogtreecommitdiff
path: root/rake_helpers
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-03-31 22:17:06 +0000
committermurphy <murphy@rubychan.de>2010-03-31 22:17:06 +0000
commit862bc9aa6b002f6b29cf74f93ca66e63cf370819 (patch)
tree45e8a8731fadca8df5fe86595dc2e8f6dc7a3782 /rake_helpers
parentcce5dad0dce285a2b7c4f1fe0ec79d10c71a8403 (diff)
downloadcoderay-862bc9aa6b002f6b29cf74f93ca66e63cf370819.tar.gz
Upporting changes from 0.9.2 (vs. 0.9.1).
Diffstat (limited to 'rake_helpers')
-rw-r--r--rake_helpers/del_vim_orphans.rb43
-rw-r--r--rake_helpers/ftp.rb47
2 files changed, 0 insertions, 90 deletions
diff --git a/rake_helpers/del_vim_orphans.rb b/rake_helpers/del_vim_orphans.rb
deleted file mode 100644
index abf825e..0000000
--- a/rake_helpers/del_vim_orphans.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-$saveable = 0.0
-
-puts
-puts 'Searching for vim backup files...'
-puts
-
-for sw in Dir['**/.*.sw*']
- file = File.join(File.dirname(sw), File.basename(sw)[/^.(.*).sw.$/, 1])
-
- status =
- if not File.exist? file
- 'MISSING!'
- elsif File.mtime(sw) > File.mtime(file)
- 'changed'
- else
- 'deprecated'
- end
- deprecated = (status == 'deprecated' or ARGV.include? '-A')
-
- size = File.size(sw).to_f / 1024
- $saveable += size if deprecated
-
- action =
- if ARGV.include? '-D'
- if deprecated
- begin
- File.delete sw
- rescue => boom
- boom.class.name
- else
- 'delete'
- end
- end
- else
- ''
- end
-
- puts " %-13s [%3.0f KB] %-60s %-13s" % [
- status, size, file, action]
-end
-
-puts
-puts '%3.0f KB can be saved.' % $saveable
diff --git a/rake_helpers/ftp.rb b/rake_helpers/ftp.rb
deleted file mode 100644
index 1127c71..0000000
--- a/rake_helpers/ftp.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-FTP_YAML = File.expand_path(File.join(File.dirname(__FILE__), '..', 'ftp.yaml'))
-FTP_DOMAIN = 'cycnus.de'
-FTP_CODERAY_DIR = 'public_html/raindark/coderay'
-
-def prepare_ftp
- require 'net/ftp'
- require 'yaml'
- $username = File.exist?(FTP_YAML) ? YAML.load_file(FTP_YAML)[:username] : 'anonymous'
- g "ftp login, password for #$username needed: "
- $password = $stdin.gets.chomp
-end
-
-def cYcnus_ftp
- prepare_ftp unless $password
- Net::FTP.open(FTP_DOMAIN) do |ftp|
- g "login for #$username..."
- ftp.login $username, $password
- gn 'logged in.'
- yield ftp
- end
-end
-
-def uploader_for ftp
- proc do |l, *r|
- r = r.first || l
- raise 'File %s not found!' % l unless File.exist? l
- if l == r
- g 'Uploading %s...' % [l]
- else
- g 'Uploading %s to %s...' % [l, r]
- end
- ftp.putbinaryfile l, r
- gd
- end
-end
-
-def g msg
- $stderr.print msg
-end
-
-def gn msg = ''
- $stderr.puts msg
-end
-
-def gd
- gn 'done.'
-end