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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b26c875be76cfc8f01f4115645f771f25176ea74
4
- data.tar.gz: 618146c66fb69d4787cfd324647d1f44ec6ffcc0
3
+ metadata.gz: 0b1abb67560bed80480390d27d41acd6d3ffe838
4
+ data.tar.gz: ab058e1531e2de8655d3e3d7c846e5bb7a4cd7b5
5
5
  SHA512:
6
- metadata.gz: 9d43d558eef7455020f5ecce59ff3bf08fc0a79436d8f72482259c5095a38b3428b56dc25452f5724a8739d4318472cbdb7e35125b77e4bbe9a3eee750f58fd4
7
- data.tar.gz: 05d86caa3b805f11dc0d87ddd851312ed598a1afce73c153281e70c3fd9e87fcb7ea0bd0830558272a390c2e3b782b2da9cfd137d113f09baade194617f15c82
6
+ metadata.gz: 5128b57a2815eb69da54105dd058e88222701870e6c789f38fc9c0c57b32927524051c59bf0567f512b867fb538db0beda94893c1f3ad1737bac8d05ed524f7c
7
+ data.tar.gz: 317c11e6d1270022c10c8817b86f60413c933c39359a7a65e421a895457406f9aa85215d593be701566b974e18865891f046651325ab5f0cdba63b487c74bdf9
data/lib/svnx.rb CHANGED
@@ -3,5 +3,5 @@
3
3
 
4
4
  module SVNx
5
5
  NAME = 'svnx'
6
- VERSION = '0.6.1'
6
+ VERSION = '0.6.2'
7
7
  end
@@ -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(sym)
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
@@ -59,9 +59,13 @@ module SVNx::IO
59
59
  end
60
60
 
61
61
  def in_svn?
62
- usepath = @local ? @local.to_path : @path
63
- st = SVNx::StatusExec.new path: usepath
64
- st.entries.size == 0 || st.entries[0].status.to_s != 'unversioned'
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2013-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logue