svnx 0.6.1 → 0.6.2
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.
- checksums.yaml +4 -4
- data/lib/svnx.rb +1 -1
- data/lib/svnx/base/action.rb +6 -4
- data/lib/svnx/io/element.rb +7 -3
- data/test/integration/svnx/io/element_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b1abb67560bed80480390d27d41acd6d3ffe838
|
4
|
+
data.tar.gz: ab058e1531e2de8655d3e3d7c846e5bb7a4cd7b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5128b57a2815eb69da54105dd058e88222701870e6c789f38fc9c0c57b32927524051c59bf0567f512b867fb538db0beda94893c1f3ad1737bac8d05ed524f7c
|
7
|
+
data.tar.gz: 317c11e6d1270022c10c8817b86f60413c933c39359a7a65e421a895457406f9aa85215d593be701566b974e18865891f046651325ab5f0cdba63b487c74bdf9
|
data/lib/svnx.rb
CHANGED
data/lib/svnx/base/action.rb
CHANGED
@@ -8,18 +8,20 @@ module SVNx
|
|
8
8
|
include Logue::Loggable, Comparable
|
9
9
|
|
10
10
|
attr_reader :type
|
11
|
+
attr_reader :char
|
11
12
|
|
12
13
|
STATUS_TO_TYPE = Hash.new
|
13
14
|
STATUS_TO_ACTION = Hash.new
|
14
15
|
|
15
|
-
def initialize type
|
16
|
+
def initialize type, char
|
16
17
|
@type = type
|
18
|
+
@char = char
|
17
19
|
end
|
18
20
|
|
19
21
|
class << self
|
20
22
|
alias_method :orig_new, :new
|
21
23
|
|
22
|
-
def new arg
|
24
|
+
def new arg, char = nil
|
23
25
|
if arg.kind_of? Action
|
24
26
|
arg
|
25
27
|
elsif act = STATUS_TO_ACTION[arg]
|
@@ -27,14 +29,14 @@ module SVNx
|
|
27
29
|
else
|
28
30
|
type = STATUS_TO_TYPE[arg]
|
29
31
|
raise "no such action: #{arg.inspect}" unless type
|
30
|
-
STATUS_TO_ACTION[arg] = orig_new type
|
32
|
+
STATUS_TO_ACTION[arg] = orig_new type, char
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
34
36
|
def add_type str, char
|
35
37
|
sym = str.to_sym
|
36
38
|
STATUS_TO_TYPE[sym] = sym
|
37
|
-
action = SVNx::Action.new
|
39
|
+
action = SVNx::Action.new sym, char
|
38
40
|
SVNx::Action.const_set str.upcase, action
|
39
41
|
[ sym, str, char ].each do |key|
|
40
42
|
STATUS_TO_ACTION[key] = action
|
data/lib/svnx/io/element.rb
CHANGED
@@ -59,9 +59,13 @@ module SVNx::IO
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def in_svn?
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
# svn status can only be a local path:
|
63
|
+
if @local
|
64
|
+
st = SVNx::StatusExec.new path: @local.to_path
|
65
|
+
st.entries.size == 0 || st.entries[0].status.to_s != 'unversioned'
|
66
|
+
else
|
67
|
+
raise "cannot determine svn status without a local path; only target '#{@path}' defined"
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
def find_entries args = Hash.new
|
@@ -33,6 +33,16 @@ module SVNx::IO
|
|
33
33
|
assert !el.directory?
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_is_file
|
37
|
+
el = Element.new local: PENDING_PATH + '/FirstFile.txt'
|
38
|
+
assert el.file?
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_is_not_file
|
42
|
+
el = Element.new local: PENDING_PATH + '/text'
|
43
|
+
assert !el.file?
|
44
|
+
end
|
45
|
+
|
36
46
|
def test_get_info_has_info
|
37
47
|
el = Element.new local: PENDING_PATH + '/FirstFile.txt'
|
38
48
|
inf = el.get_info
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svnx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Pace
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logue
|