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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 520e01a3b50f0db39d0dedcc9af1d4134128a139
4
- data.tar.gz: 33eb076b2f6acac9537433c912dc2f1d38002ebb
3
+ metadata.gz: 7703311a03e657be2fb6172c5b3b7de2f5f9434d
4
+ data.tar.gz: 80d187db92d50e7a81105cd202649c793b4b1c40
5
5
  SHA512:
6
- metadata.gz: 578d7cbbfc9624a929d565bc6ac04d4d57fc768456a2058617cde404eb7ec36ef14c774f86effe296bfb90b3bc1a3b958fe726f337034f8e64fc0b14d68fe306
7
- data.tar.gz: 065360d70d43f4d3b8f958ceb74f5f0ae9fa2bbd2e73097c5e0aad47f4e61bd4f40949f4d919e75c6381984b5f979ca8910a693888be369137118b685194bfab
6
+ metadata.gz: 1f26504dbe28a179d7432d6e9ae30a315ab467efd832828b07f3927e7ce7c99815b827ba78df98533dbd67e16c36329da2bc5240d131da412e1d40dda65e8a9b
7
+ data.tar.gz: 005c59f2e7702a2832aeb104266773810d0ad8c0fb346ab3e274ac4a13d03586815d5ab7588640aaf2d6d448d60b8fa893fa806fd0c56aa2210bdb36e57888fe
@@ -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
- sas = ActionStatus.instance
17
- unless @type = sas.symbol_for(type)
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
- sas = ActionStatus.instance
31
- sas.stati.each do |str|
32
- action = Action.new str
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
@@ -4,11 +4,6 @@
4
4
  require 'svnx/base/entries'
5
5
  require 'svnx/log/entry'
6
6
 
7
- module Svnx
8
- module Log
9
- end
10
- end
11
-
12
7
  module Svnx::Log
13
8
  class Entries < Svnx::Base::Entries
14
9
  def get_elements doc
@@ -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
@@ -3,5 +3,5 @@
3
3
 
4
4
  module Svnx
5
5
  NAME = 'svnx'
6
- VERSION = '2.4.0'
6
+ VERSION = '2.4.1'
7
7
  end
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.0
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-10 00:00:00.000000000 Z
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