svnx 2.4.0 → 2.4.1
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/base/action.rb +35 -17
- data/lib/svnx/log/entries.rb +0 -5
- data/lib/svnx/log/entry.rb +1 -7
- data/lib/svnx/version.rb +1 -1
- metadata +2 -3
- data/lib/svnx/base/action_status.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7703311a03e657be2fb6172c5b3b7de2f5f9434d
|
4
|
+
data.tar.gz: 80d187db92d50e7a81105cd202649c793b4b1c40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f26504dbe28a179d7432d6e9ae30a315ab467efd832828b07f3927e7ce7c99815b827ba78df98533dbd67e16c36329da2bc5240d131da412e1d40dda65e8a9b
|
7
|
+
data.tar.gz: 005c59f2e7702a2832aeb104266773810d0ad8c0fb346ab3e274ac4a13d03586815d5ab7588640aaf2d6d448d60b8fa893fa806fd0c56aa2210bdb36e57888fe
|
data/lib/svnx/base/action.rb
CHANGED
@@ -1,22 +1,34 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
|
-
require 'logue/loggable'
|
5
|
-
require 'singleton'
|
6
|
-
require 'svnx/base/action_status'
|
7
|
-
|
8
4
|
module Svnx
|
9
5
|
class Action
|
10
|
-
include Logue::Loggable
|
11
6
|
include Comparable
|
12
|
-
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def new *args
|
10
|
+
if args.length == 2
|
11
|
+
super
|
12
|
+
else
|
13
|
+
type = args.first
|
14
|
+
types = constants(false)
|
15
|
+
types.each do |t|
|
16
|
+
tc = const_get t
|
17
|
+
if tc.type == type.to_sym || tc.abbrev == type
|
18
|
+
return tc
|
19
|
+
end
|
20
|
+
end
|
21
|
+
raise "not a valid action type: #{type}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
13
26
|
attr_reader :type
|
27
|
+
attr_reader :abbrev
|
14
28
|
|
15
|
-
def initialize type
|
16
|
-
|
17
|
-
|
18
|
-
raise "not a valid action type: #{type}"
|
19
|
-
end
|
29
|
+
def initialize type, abbrev
|
30
|
+
@type = type.to_sym
|
31
|
+
@abbrev = abbrev
|
20
32
|
end
|
21
33
|
|
22
34
|
def <=> other
|
@@ -27,18 +39,24 @@ module Svnx
|
|
27
39
|
@type.to_s
|
28
40
|
end
|
29
41
|
|
30
|
-
|
31
|
-
|
32
|
-
|
42
|
+
Hash[
|
43
|
+
:added => 'A',
|
44
|
+
:deleted => 'D',
|
45
|
+
:modified => 'M',
|
46
|
+
:replaced => 'R',
|
47
|
+
:unversioned => '?',
|
48
|
+
:external => 'X',
|
49
|
+
:normal => 'q' # actually, X, but in a different column than X for external
|
50
|
+
].each do |sym, char|
|
51
|
+
str = sym.to_s
|
52
|
+
action = new str, char
|
33
53
|
Action.const_set str.upcase, action
|
34
|
-
|
35
54
|
methname = str + '?'
|
36
55
|
define_method methname do
|
37
56
|
instance_eval do
|
38
|
-
sym = ActionStatus.instance.symbol_for str
|
39
57
|
@type.to_sym == sym
|
40
58
|
end
|
41
59
|
end
|
42
|
-
end
|
60
|
+
end
|
43
61
|
end
|
44
62
|
end
|
data/lib/svnx/log/entries.rb
CHANGED
data/lib/svnx/log/entry.rb
CHANGED
@@ -6,11 +6,6 @@ require 'svnx/base/action'
|
|
6
6
|
require 'time'
|
7
7
|
require 'svnx/log/entrypath'
|
8
8
|
|
9
|
-
module Svnx
|
10
|
-
module Log
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
9
|
module Svnx::Log
|
15
10
|
class Entry < Svnx::Base::Entry
|
16
11
|
attr_reader :revision, :reverse_merge, :author, :date, :paths, :msg, :entries
|
@@ -21,14 +16,13 @@ module Svnx::Log
|
|
21
16
|
|
22
17
|
set_elmt_vars elmt, 'author', 'date', 'msg'
|
23
18
|
|
24
|
-
# sort, because Subversion is not consistent with order
|
25
19
|
@paths = elmt.elements.to_a('paths/path').collect do |pe|
|
26
20
|
kind = attribute_value pe, 'kind'
|
27
21
|
action = attribute_value pe, 'action'
|
28
22
|
name = pe.text
|
29
23
|
|
30
24
|
EntryPath.new(kind: kind, action: Svnx::Action.new(action), name: name)
|
31
|
-
end.sort
|
25
|
+
end.sort # sorted, because svn is not consistent with order
|
32
26
|
|
33
27
|
@entries = elmt.elements.to_a('logentry').collect do |le|
|
34
28
|
Entry.new le
|
data/lib/svnx/version.rb
CHANGED
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: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Pace
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: command-cacheable
|
@@ -112,7 +112,6 @@ files:
|
|
112
112
|
- README.md
|
113
113
|
- Rakefile
|
114
114
|
- lib/svnx/base/action.rb
|
115
|
-
- lib/svnx/base/action_status.rb
|
116
115
|
- lib/svnx/base/cmdline.rb
|
117
116
|
- lib/svnx/base/command.rb
|
118
117
|
- lib/svnx/base/command_factory.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'singleton'
|
5
|
-
|
6
|
-
module Svnx
|
7
|
-
class ActionStatus
|
8
|
-
include Singleton
|
9
|
-
|
10
|
-
attr_reader :stati
|
11
|
-
|
12
|
-
def initialize
|
13
|
-
@status_to_symbol = Hash.new
|
14
|
-
@stati = Array.new
|
15
|
-
|
16
|
-
add_type 'added', 'A'
|
17
|
-
add_type 'deleted', 'D'
|
18
|
-
add_type 'modified', 'M'
|
19
|
-
add_type 'replaced', 'R'
|
20
|
-
add_type 'unversioned', '?'
|
21
|
-
add_type 'external', 'X'
|
22
|
-
add_type 'normal', 'q' # actually, X, but in a different column than X for external
|
23
|
-
end
|
24
|
-
|
25
|
-
def symbol_for arg
|
26
|
-
@status_to_symbol[arg]
|
27
|
-
end
|
28
|
-
|
29
|
-
def add_type str, char
|
30
|
-
sym = str.to_sym
|
31
|
-
@stati << str
|
32
|
-
[ sym, str, char ].each do |key|
|
33
|
-
@status_to_symbol[key] = sym
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|