cap-taffy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.0.3 / 2010-01-26
2
+ * 1 major fix
3
+ * Fixed for Heroku 1.6.3
4
+
1
5
  == 0.0.2 / 2009-09-14
2
6
  * 1 minor enhancement
3
7
  * Added authorizing SSH public keys on remote server(s).
data/Rakefile CHANGED
@@ -32,3 +32,4 @@ PROJ.summary = "Capistrano recipes for deploying databases (managing database.ym
32
32
  PROJ.ignore_file = '.gitignore'
33
33
  PROJ.spec.opts << '--color'
34
34
  PROJ.exclude << "bin"
35
+ PROJ.rcov.opts << IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
@@ -1,8 +1,7 @@
1
-
2
1
  module CapTaffy
3
2
 
4
3
  # :stopdoc:
5
- VERSION = '0.0.2'
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
@@ -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 taps"
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
@@ -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
 
@@ -1,4 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), %w[spec_helper])
2
2
 
3
3
  describe CapTaffy do
4
+ it "should get the version" do
5
+ CapTaffy::VERSION.should == CapTaffy.version
6
+ end
4
7
  end
@@ -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.2
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: 2009-09-17 00:00:00 -07:00
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