joekhoobyar-capsaicin 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +30 -1
- data/VERSION.yml +1 -1
- data/lib/capsaicin/bundle.rb +2 -1
- data/lib/capsaicin/files.rb +2 -1
- data/lib/capsaicin/files/local.rb +36 -0
- data/lib/capsaicin/files/remote.rb +15 -0
- metadata +3 -3
data/Rakefile
CHANGED
@@ -14,6 +14,7 @@ begin
|
|
14
14
|
|
15
15
|
s.authors = ["Joe Khoobyar"]
|
16
16
|
s.email = "joe@ankhcraft.com"
|
17
|
+
s.rubyforge_project = "capsaicin"
|
17
18
|
|
18
19
|
s.add_dependency 'capistrano', ['>= 2.0']
|
19
20
|
s.add_dependency 'archive-tar-minitar', ['>= 0.5']
|
@@ -22,11 +23,39 @@ rescue LoadError
|
|
22
23
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
23
24
|
end
|
24
25
|
|
26
|
+
# These are new tasks
|
27
|
+
begin
|
28
|
+
require 'rake/contrib/sshpublisher'
|
29
|
+
namespace :rubyforge do
|
30
|
+
|
31
|
+
desc "Release gem and RDoc documentation to RubyForge"
|
32
|
+
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
33
|
+
|
34
|
+
namespace :release do
|
35
|
+
desc "Publish RDoc to RubyForge."
|
36
|
+
task :docs => [:rdoc] do
|
37
|
+
config = YAML.load(
|
38
|
+
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
39
|
+
)
|
40
|
+
|
41
|
+
host = "#{config['username']}@rubyforge.org"
|
42
|
+
remote_dir = "/var/www/gforge-projects/capsaicin/"
|
43
|
+
local_dir = 'doc'
|
44
|
+
|
45
|
+
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
rescue LoadError
|
50
|
+
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
51
|
+
end
|
52
|
+
|
53
|
+
|
25
54
|
# --------- RDoc Documentation ---------
|
26
55
|
desc "Generate RDoc documentation"
|
27
56
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
28
57
|
rdoc.options << '--line-numbers' << '--inline-source' <<
|
29
|
-
'--main' << 'README' <<
|
58
|
+
'--main' << 'README.rdoc' <<
|
30
59
|
'--title' << "Capsaicin" <<
|
31
60
|
'--charset' << 'utf-8'
|
32
61
|
rdoc.rdoc_dir = "doc"
|
data/VERSION.yml
CHANGED
data/lib/capsaicin/bundle.rb
CHANGED
data/lib/capsaicin/files.rb
CHANGED
@@ -34,7 +34,8 @@ module Capsaicin
|
|
34
34
|
"def #{m}(*args, &block)\n send(_via.to_s + '_files').#{m}(*args, &block)\nend"
|
35
35
|
end.join("\n"), __FILE__, __LINE__)
|
36
36
|
|
37
|
-
|
37
|
+
|
38
|
+
def _via # :nodoc:
|
38
39
|
if LOCAL_RUN_METHODS.include? @config.fetch(:run_method, nil)
|
39
40
|
:local
|
40
41
|
else
|
@@ -42,6 +42,42 @@ module Capsaicin
|
|
42
42
|
cd dir
|
43
43
|
end
|
44
44
|
|
45
|
+
def tar_c(dest, src, options={}, &filter)
|
46
|
+
logger and
|
47
|
+
logger.trace "tar -cf #{dest} " + Array(src).map { |s| s.gsub ' ', '\\ ' }.join(' ')
|
48
|
+
_tar File.open(dest, 'wb'), src, v, &filter
|
49
|
+
end
|
50
|
+
|
51
|
+
def tar_cz(dest, src, options={}, &filter)
|
52
|
+
require 'zlib' unless defined? Zlib::GzipWriter
|
53
|
+
logger and
|
54
|
+
logger.trace "tar -czf #{dest} " + Array(src).map { |s| s.gsub ' ', '\\ ' }.join(' ')
|
55
|
+
_tar Zlib::GzipWriter.new(File.open(dest, 'wb')), src, options, &filter
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def _tar(os, src, options, &filter)
|
61
|
+
verbose = options[:v] || options[:verbose]
|
62
|
+
require 'find' unless defined? Find
|
63
|
+
unless defined? Archive::Tar::Minitar
|
64
|
+
require 'archive/tar/minitar'
|
65
|
+
end
|
66
|
+
minitar = Archive::Tar::Minitar
|
67
|
+
|
68
|
+
minitar::Output.open os do |outp|
|
69
|
+
Array(src).each do |path|
|
70
|
+
Find.find(path) do |entry|
|
71
|
+
if filter and filter[entry]
|
72
|
+
Find.prune if File.directory? entry
|
73
|
+
else
|
74
|
+
logger.trace " + #{entry}" if verbose
|
75
|
+
minitar.pack_file entry, outp
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
45
81
|
end
|
46
82
|
end
|
47
83
|
end
|
@@ -87,6 +87,21 @@ module Capsaicin
|
|
87
87
|
capture 'pwd', :via => _via
|
88
88
|
end
|
89
89
|
|
90
|
+
def tar_c(dest, src, options={}, &filter)
|
91
|
+
filter and abort "tar_c: remote mode does not support a filtering proc"
|
92
|
+
_r 'tar -cf', Array(src).unshift(dest)
|
93
|
+
end
|
94
|
+
|
95
|
+
def tar_cz(dest, src, options={}, &filter)
|
96
|
+
filter and abort "tar_cz: remote mode does not support a filtering proc"
|
97
|
+
_r 'tar -czf', Array(src).unshift(dest)
|
98
|
+
end
|
99
|
+
|
100
|
+
def tar_cj(dest, src, options={}, &filter)
|
101
|
+
filter and abort "tar_cj: remote mode does not support a filtering proc"
|
102
|
+
_r 'tar -cjf', Array(src).unshift(dest)
|
103
|
+
end
|
104
|
+
|
90
105
|
private
|
91
106
|
|
92
107
|
def _t(cmd, args=nil, min=nil)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joekhoobyar-capsaicin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Khoobyar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version:
|
81
81
|
requirements: []
|
82
82
|
|
83
|
-
rubyforge_project:
|
83
|
+
rubyforge_project: capsaicin
|
84
84
|
rubygems_version: 1.2.0
|
85
85
|
signing_key:
|
86
86
|
specification_version: 3
|