cap-taffy 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Rakefile +1 -0
- data/lib/cap-taffy.rb +1 -32
- data/lib/cap-taffy/parse.rb +2 -1
- data/spec/cap-taffy/db_spec.rb +20 -1
- data/spec/cap-taffy_spec.rb +3 -0
- data/spec/rcov.opts +1 -0
- metadata +3 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/cap-taffy.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
1
|
module CapTaffy
|
3
2
|
|
4
3
|
# :stopdoc:
|
5
|
-
VERSION = '0.0.
|
4
|
+
VERSION = '0.0.3'
|
6
5
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
7
6
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
8
7
|
# :startdoc:
|
@@ -12,34 +11,4 @@ module CapTaffy
|
|
12
11
|
def self.version
|
13
12
|
VERSION
|
14
13
|
end
|
15
|
-
|
16
|
-
# Returns the library path for the module. If any arguments are given,
|
17
|
-
# they will be joined to the end of the libray path using
|
18
|
-
# <tt>File.join</tt>.
|
19
|
-
#
|
20
|
-
def self.libpath( *args )
|
21
|
-
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Returns the lpath for the module. If any arguments are given,
|
25
|
-
# they will be joined to the end of the path using
|
26
|
-
# <tt>File.join</tt>.
|
27
|
-
#
|
28
|
-
def self.path( *args )
|
29
|
-
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Utility method used to require all files ending in .rb that lie in the
|
33
|
-
# directory below this file that has the same name as the filename passed
|
34
|
-
# in. Optionally, a specific _directory_ name can be passed in such that
|
35
|
-
# the _filename_ does not have to be equivalent to the directory.
|
36
|
-
#
|
37
|
-
def self.require_all_libs_relative_to( fname, dir = nil )
|
38
|
-
dir ||= ::File.basename(fname, '.*')
|
39
|
-
search_me = ::File.expand_path(
|
40
|
-
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
41
|
-
|
42
|
-
Dir.glob(search_me).sort.each {|rb| require rb}
|
43
|
-
end
|
44
|
-
|
45
14
|
end
|
data/lib/cap-taffy/parse.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
begin
|
3
3
|
require 'heroku'
|
4
|
+
require 'heroku/command'
|
4
5
|
require 'heroku/commands/base'
|
5
6
|
require 'heroku/commands/db'
|
6
7
|
rescue LoadError
|
7
|
-
error "Install the Heroku gem. On most systems this will be:\nsudo gem install
|
8
|
+
error "Install the Heroku gem. On most systems this will be:\nsudo gem install heroku"
|
8
9
|
end
|
9
10
|
|
10
11
|
module CapTaffy
|
data/spec/cap-taffy/db_spec.rb
CHANGED
@@ -32,6 +32,25 @@ module CapTaffy
|
|
32
32
|
@namespace.instance_variable_get(:@local_database_url).should == "local_db_url"
|
33
33
|
end
|
34
34
|
|
35
|
+
for_task :detect, :roles => :app, :in => :Db, :it => "should be safe if dry run" do
|
36
|
+
@mod.expects(:remote_database_url).raises Exception
|
37
|
+
@mod.expects(:local_database_url).raises Exception
|
38
|
+
@namespace.stubs(:dry_run).returns(true)
|
39
|
+
|
40
|
+
load 'lib/cap-taffy/db.rb'
|
41
|
+
|
42
|
+
@namespace.instance_variable_get(:@remote_database_url).should == ""
|
43
|
+
@namespace.instance_variable_get(:@local_database_url).should == ""
|
44
|
+
end
|
45
|
+
|
46
|
+
for_task :detect, :roles => :app, :in => :Db, :it => "should raise as usual if not dry run" do
|
47
|
+
class SpecialError < StandardError; end
|
48
|
+
@mod.expects(:remote_database_url).raises SpecialError
|
49
|
+
@namespace.stubs(:dry_run).returns(false)
|
50
|
+
|
51
|
+
lambda { load 'lib/cap-taffy/db.rb' }.should raise_error(SpecialError)
|
52
|
+
end
|
53
|
+
|
35
54
|
def load_taffy_db # :nodoc:
|
36
55
|
with_logger do
|
37
56
|
load 'lib/cap-taffy/db.rb'
|
@@ -83,7 +102,7 @@ module CapTaffy
|
|
83
102
|
end
|
84
103
|
end
|
85
104
|
|
86
|
-
context "after capistrano" do
|
105
|
+
context "after capistrano loaded" do
|
87
106
|
include CapistranoHelpers
|
88
107
|
include TaffyHelpers
|
89
108
|
|
data/spec/cap-taffy_spec.rb
CHANGED
data/spec/rcov.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--exclude "spec/*,gems/*"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-taffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Hsu
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-26 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- spec/cap-taffy/parse_spec.rb
|
84
84
|
- spec/cap-taffy/ssh_spec.rb
|
85
85
|
- spec/cap-taffy_spec.rb
|
86
|
+
- spec/rcov.opts
|
86
87
|
- spec/spec.opts
|
87
88
|
- spec/spec_helper.rb
|
88
89
|
- tasks/ann.rake
|