vlad-hg 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Manifest.txt +1 -0
- data/README.txt +2 -2
- data/lib/vlad/mercurial.rb +2 -2
- data/test/vlad_test_case.rb +72 -0
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
data/lib/vlad/mercurial.rb
CHANGED
@@ -3,7 +3,7 @@ require 'vlad'
|
|
3
3
|
module Vlad
|
4
4
|
class Mercurial
|
5
5
|
|
6
|
-
VERSION = '2.0.
|
6
|
+
VERSION = '2.0.2'.freeze
|
7
7
|
|
8
8
|
set :source, Vlad::Mercurial.new
|
9
9
|
set :hg_cmd, "hg"
|
@@ -38,7 +38,7 @@ module Vlad
|
|
38
38
|
# into a mercurial changeset ID.
|
39
39
|
|
40
40
|
def revision(revision)
|
41
|
-
"`#{hg_cmd} identify -R #{repository} | cut -f1 -d\\ `"
|
41
|
+
"`#{hg_cmd} identify -R #{repository} -r #{revision} | cut -f1 -d\\ `"
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'stringio'
|
3
|
+
require 'vlad'
|
4
|
+
|
5
|
+
class StringIO
|
6
|
+
def readpartial(size) read end # suck!
|
7
|
+
end
|
8
|
+
|
9
|
+
module Process
|
10
|
+
def self.expected status
|
11
|
+
@@expected ||= []
|
12
|
+
@@expected << status
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
alias :waitpid2_old :waitpid2
|
17
|
+
|
18
|
+
def waitpid2(pid)
|
19
|
+
[ @@expected.shift ]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class Rake::RemoteTask
|
25
|
+
attr_accessor :commands, :action, :input, :output, :error
|
26
|
+
|
27
|
+
Status = Struct.new :exitstatus
|
28
|
+
|
29
|
+
class Status
|
30
|
+
def success?() exitstatus == 0 end
|
31
|
+
end
|
32
|
+
|
33
|
+
def system *command
|
34
|
+
@commands << command
|
35
|
+
self.action ? self.action[command.join(' ')] : true
|
36
|
+
end
|
37
|
+
|
38
|
+
def popen4 *command
|
39
|
+
@commands << command
|
40
|
+
|
41
|
+
@input = StringIO.new
|
42
|
+
out = StringIO.new @output.shift.to_s
|
43
|
+
err = StringIO.new @error.shift.to_s
|
44
|
+
|
45
|
+
raise if block_given?
|
46
|
+
|
47
|
+
status = self.action ? self.action[command.join(' ')] : 0
|
48
|
+
Process.expected Status.new(status)
|
49
|
+
|
50
|
+
return 42, @input, out, err
|
51
|
+
end
|
52
|
+
|
53
|
+
def select reads, writes, errs, timeout
|
54
|
+
[reads, writes, errs]
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
class VladTestCase < MiniTest::Unit::TestCase
|
60
|
+
def setup
|
61
|
+
@vlad = Rake::RemoteTask
|
62
|
+
@vlad.reset
|
63
|
+
Rake.application.clear
|
64
|
+
@task_count = Rake.application.tasks.size
|
65
|
+
@vlad.set :domain, "example.com"
|
66
|
+
end
|
67
|
+
|
68
|
+
def util_set_hosts
|
69
|
+
@vlad.host "app.example.com", :app
|
70
|
+
@vlad.host "db.example.com", :db
|
71
|
+
end
|
72
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vlad-hg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin R. Bullock
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
5V3Udl4ET3bsEOJ+8xs=
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2009-08-
|
33
|
+
date: 2009-08-28 00:00:00 -05:00
|
34
34
|
default_executable:
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -63,8 +63,9 @@ files:
|
|
63
63
|
- Rakefile
|
64
64
|
- lib/vlad/mercurial.rb
|
65
65
|
- test/test_vlad_mercurial.rb
|
66
|
+
- test/vlad_test_case.rb
|
66
67
|
has_rdoc: true
|
67
|
-
homepage: http://
|
68
|
+
homepage: http://hitsquad.rubyforge.org/vlad-hg/
|
68
69
|
licenses: []
|
69
70
|
|
70
71
|
post_install_message:
|
metadata.gz.sig
CHANGED
Binary file
|