svnx 2.5.3 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/lib/svnx/add/command.rb +11 -0
- data/lib/svnx/add/options.rb +15 -0
- data/lib/svnx/base/options.rb +27 -17
- data/lib/svnx/blame/options.rb +1 -7
- data/lib/svnx/cat/options.rb +1 -11
- data/lib/svnx/commit/options.rb +1 -10
- data/lib/svnx/diff/options.rb +4 -12
- data/lib/svnx/info/options.rb +1 -11
- data/lib/svnx/log/entry.rb +2 -6
- data/lib/svnx/log/entrypath.rb +21 -5
- data/lib/svnx/log/options.rb +4 -12
- data/lib/svnx/merge/options.rb +5 -13
- data/lib/svnx/propget/options.rb +3 -13
- data/lib/svnx/propset/options.rb +5 -15
- data/lib/svnx/status/options.rb +1 -11
- data/lib/svnx/update/options.rb +1 -10
- data/lib/svnx/util/objutil.rb +18 -8
- data/lib/svnx/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50079e8c0d3f86c8a009821814c9e9a78c45bdeb
|
4
|
+
data.tar.gz: c49d4ebfdad90bd3c802bee3a594568a403382e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50257c6d0088444a0f6e879dfb88b6b4fe532637e2f4f5d35a7b9a23953dd56688b1b640a35f118addb9286773ee418764d6d53ac33e8cbf74e8f9f85c9a277e
|
7
|
+
data.tar.gz: 7810f14c074ef37485d10a18073852d3b9350446b3cf37b7a21759319cd50a9fedad75d3ac18523d3e4f72fc5634812f8108b83d96fc620d1841f18f966ee1b5
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/lib/svnx/base/options.rb
CHANGED
@@ -9,28 +9,42 @@ module Svnx
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module Svnx::Base
|
12
|
-
REVISION_FIELD = Proc.new { |x| [ "-r", x.revision ] }
|
13
|
-
IGNORE_WHITESPACE = { ignorewhitespace: %w{ -x -bw -x --ignore-eol-style } }
|
14
|
-
|
15
|
-
REVISION_PATHS_URLS_FIELDS = Hash.new.tap do |h|
|
16
|
-
h[:revision] = REVISION_FIELD
|
17
|
-
h[:paths] = nil
|
18
|
-
h[:urls] = nil
|
19
|
-
end
|
20
|
-
|
21
12
|
class Options
|
22
13
|
include Svnx::ObjectUtil
|
23
14
|
|
24
15
|
class << self
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
def mapping field
|
17
|
+
case field
|
18
|
+
when :revision
|
19
|
+
Proc.new { |x| [ "-r", x.revision ] }
|
20
|
+
when :ignorewhitespace, :ignore_whitespace
|
21
|
+
%w{ -x -bw -x --ignore-eol-style }
|
22
|
+
when :paths
|
23
|
+
nil
|
24
|
+
when :path
|
25
|
+
nil
|
26
|
+
when :urls
|
27
|
+
nil
|
28
|
+
when :url
|
29
|
+
nil
|
30
|
+
when :file
|
31
|
+
Proc.new { |x| [ "-F", x.file ] }
|
32
|
+
else
|
33
|
+
raise "invalid field '#{field}'"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def has(*fields)
|
38
|
+
fields.each do |field|
|
39
|
+
arg = mapping field
|
40
|
+
has_field field, arg
|
41
|
+
end
|
29
42
|
end
|
30
43
|
end
|
31
44
|
|
32
45
|
def initialize args
|
33
46
|
fkeys = fields.keys
|
47
|
+
|
34
48
|
assign args, fkeys
|
35
49
|
validate args, fkeys
|
36
50
|
end
|
@@ -40,10 +54,6 @@ module Svnx::Base
|
|
40
54
|
[ fld, get_args(fld) ]
|
41
55
|
end
|
42
56
|
end
|
43
|
-
|
44
|
-
def fields
|
45
|
-
raise "not implemented for #{self.class}"
|
46
|
-
end
|
47
57
|
|
48
58
|
def to_args
|
49
59
|
options_to_args.collect do |opt|
|
data/lib/svnx/blame/options.rb
CHANGED
@@ -10,12 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Blame
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
has_fields FIELDS.keys
|
16
|
-
|
17
|
-
def fields
|
18
|
-
FIELDS
|
19
|
-
end
|
13
|
+
has :revision, :paths, :urls, :ignorewhitespace
|
20
14
|
end
|
21
15
|
end
|
data/lib/svnx/cat/options.rb
CHANGED
@@ -10,16 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Cat
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
h[:revision] = Svnx::Base::REVISION_FIELD
|
15
|
-
h[:path] = nil
|
16
|
-
h[:url] = nil
|
17
|
-
end
|
18
|
-
|
19
|
-
has_fields FIELDS.keys
|
20
|
-
|
21
|
-
def fields
|
22
|
-
FIELDS
|
23
|
-
end
|
13
|
+
has :revision, :path, :url
|
24
14
|
end
|
25
15
|
end
|
data/lib/svnx/commit/options.rb
CHANGED
@@ -10,15 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Commit
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
h[:file] = Proc.new { |x| [ "-F", x.file ] }
|
15
|
-
h[:paths] = nil
|
16
|
-
end
|
17
|
-
|
18
|
-
has_fields FIELDS.keys
|
19
|
-
|
20
|
-
def fields
|
21
|
-
FIELDS
|
22
|
-
end
|
13
|
+
has :file, :paths
|
23
14
|
end
|
24
15
|
end
|
data/lib/svnx/diff/options.rb
CHANGED
@@ -10,18 +10,10 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Diff
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
h[:depth] = Proc.new { |x| [ "--depth", x.depth ] }
|
17
|
-
h[:paths] = nil
|
18
|
-
h[:url] = nil
|
19
|
-
end.merge(Svnx::Base::IGNORE_WHITESPACE)
|
20
|
-
|
21
|
-
has_fields FIELDS.keys
|
13
|
+
has_fields commit: Proc.new { |x| [ "-c", x.commit ] },
|
14
|
+
ignoreproperties: "--ignore-properties",
|
15
|
+
depth: Proc.new { |x| [ "--depth", x.depth ] }
|
22
16
|
|
23
|
-
|
24
|
-
FIELDS
|
25
|
-
end
|
17
|
+
has :ignorewhitespace, :paths, :url
|
26
18
|
end
|
27
19
|
end
|
data/lib/svnx/info/options.rb
CHANGED
@@ -10,16 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Info
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
h[:revision] = Svnx::Base::REVISION_FIELD
|
15
|
-
h[:path] = nil
|
16
|
-
h[:url] = nil
|
17
|
-
end
|
18
|
-
|
19
|
-
has_fields FIELDS.keys
|
20
|
-
|
21
|
-
def fields
|
22
|
-
FIELDS
|
23
|
-
end
|
13
|
+
has :revision, :path, :url
|
24
14
|
end
|
25
15
|
end
|
data/lib/svnx/log/entry.rb
CHANGED
@@ -17,11 +17,7 @@ module Svnx::Log
|
|
17
17
|
set_elmt_vars elmt, 'author', 'date', 'msg'
|
18
18
|
|
19
19
|
@paths = elmt.xpath('paths/path').collect do |pe|
|
20
|
-
|
21
|
-
action = attribute_value pe, 'action'
|
22
|
-
name = pe.text
|
23
|
-
|
24
|
-
EntryPath.new(kind: kind, action: Svnx::Action.new(action), name: name)
|
20
|
+
EntryPath.new attr: pe
|
25
21
|
end.sort # sorted, because svn is not consistent with order
|
26
22
|
|
27
23
|
@entries = elmt.xpath('logentry').collect do |le|
|
@@ -34,7 +30,7 @@ module Svnx::Log
|
|
34
30
|
end
|
35
31
|
|
36
32
|
def to_s
|
37
|
-
[ @revision, @author, @date, @msg
|
33
|
+
[ @revision, @author, @date, @msg ].collect { |x| x.to_s }.join " "
|
38
34
|
end
|
39
35
|
|
40
36
|
def match action, filter
|
data/lib/svnx/log/entrypath.rb
CHANGED
@@ -12,12 +12,23 @@ module Svnx::Log
|
|
12
12
|
class EntryPath
|
13
13
|
include Comparable
|
14
14
|
|
15
|
-
attr_reader :kind, :action, :name
|
15
|
+
attr_reader :kind, :action, :name, :prop_mods, :text_mods
|
16
16
|
|
17
|
-
def initialize
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
def initialize attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil
|
18
|
+
if attr
|
19
|
+
@kind = attribute_value attr, 'kind'
|
20
|
+
act = attribute_value attr, 'action'
|
21
|
+
@action = Svnx::Action.new act
|
22
|
+
@name = attr.text
|
23
|
+
@prop_mods = "true" == attribute_value(attr, 'prop-mods')
|
24
|
+
@text_mods = "true" == attribute_value(attr, 'text-mods')
|
25
|
+
else
|
26
|
+
@kind = kind
|
27
|
+
@action = action
|
28
|
+
@name = name
|
29
|
+
@prop_mods = prop_mods
|
30
|
+
@text_mods = text_mods
|
31
|
+
end
|
21
32
|
end
|
22
33
|
|
23
34
|
def to_s
|
@@ -31,5 +42,10 @@ module Svnx::Log
|
|
31
42
|
def match? action, filter
|
32
43
|
@action.to_s == action.to_s && @name.start_with?(filter)
|
33
44
|
end
|
45
|
+
|
46
|
+
def attribute_value xmlelement, attrname, meth = nil
|
47
|
+
value = xmlelement[attrname.to_s]
|
48
|
+
meth ? value.send(meth) : value
|
49
|
+
end
|
34
50
|
end
|
35
51
|
end
|
data/lib/svnx/log/options.rb
CHANGED
@@ -10,18 +10,10 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Log
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
h[:verbose] = "-v"
|
16
|
-
h[:revision] = Proc.new { |x| "-r" + x.revision.to_s }
|
17
|
-
h[:url] = nil
|
18
|
-
h[:path] = nil
|
19
|
-
end
|
13
|
+
has_fields limit: Proc.new { |x| [ "--limit", x.limit ] },
|
14
|
+
verbose: "-v",
|
20
15
|
|
21
|
-
|
22
|
-
|
23
|
-
def fields
|
24
|
-
FIELDS
|
25
|
-
end
|
16
|
+
revision: Proc.new { |x| "-r" + x.revision.to_s }
|
17
|
+
has :url, :path
|
26
18
|
end
|
27
19
|
end
|
data/lib/svnx/merge/options.rb
CHANGED
@@ -10,18 +10,10 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Merge
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
h[:to] = nil
|
19
|
-
end
|
20
|
-
|
21
|
-
has_fields FIELDS.keys
|
22
|
-
|
23
|
-
def fields
|
24
|
-
FIELDS
|
25
|
-
end
|
13
|
+
has_fields commit: Proc.new { |x| [ "-c", x.commit ] },
|
14
|
+
range: Proc.new { |x| [ "-r", x.range ] },
|
15
|
+
accept: Proc.new { |x| [ "--accept", x.accept ] },
|
16
|
+
from: nil,
|
17
|
+
to: nil
|
26
18
|
end
|
27
19
|
end
|
data/lib/svnx/propget/options.rb
CHANGED
@@ -10,18 +10,8 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Propget
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
h[:name] = nil
|
17
|
-
h[:url] = nil
|
18
|
-
h[:path] = nil
|
19
|
-
end
|
20
|
-
|
21
|
-
has_fields FIELDS.keys
|
22
|
-
|
23
|
-
def fields
|
24
|
-
FIELDS
|
25
|
-
end
|
13
|
+
has_fields revprop: "--revprop",
|
14
|
+
name: nil
|
15
|
+
has :revision, :url, :path
|
26
16
|
end
|
27
17
|
end
|
data/lib/svnx/propset/options.rb
CHANGED
@@ -10,20 +10,10 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Propset
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
h[:value] = nil
|
19
|
-
h[:url] = nil
|
20
|
-
h[:path] = nil
|
21
|
-
end
|
22
|
-
|
23
|
-
has_fields FIELDS.keys
|
24
|
-
|
25
|
-
def fields
|
26
|
-
FIELDS
|
27
|
-
end
|
13
|
+
has_fields name: nil,
|
14
|
+
revision: Proc.new { |x| [ "--revprop", "-r", x.revision ] }
|
15
|
+
has :file
|
16
|
+
has_fields value: nil
|
17
|
+
has :url, :path
|
28
18
|
end
|
29
19
|
end
|
data/lib/svnx/status/options.rb
CHANGED
@@ -10,16 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Status
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
h[:revision] = Svnx::Base::REVISION_FIELD
|
15
|
-
h[:paths] = nil
|
16
|
-
h[:url] = nil
|
17
|
-
end
|
18
|
-
|
19
|
-
has_fields FIELDS.keys
|
20
|
-
|
21
|
-
def fields
|
22
|
-
FIELDS
|
23
|
-
end
|
13
|
+
has :revision, :paths, :url
|
24
14
|
end
|
25
15
|
end
|
data/lib/svnx/update/options.rb
CHANGED
@@ -10,15 +10,6 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Update
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
h[:revision] = Svnx::Base::REVISION_FIELD
|
15
|
-
h[:paths] = nil
|
16
|
-
end
|
17
|
-
|
18
|
-
has_fields FIELDS.keys
|
19
|
-
|
20
|
-
def fields
|
21
|
-
FIELDS
|
22
|
-
end
|
13
|
+
has :revision, :paths
|
23
14
|
end
|
24
15
|
end
|
data/lib/svnx/util/objutil.rb
CHANGED
@@ -26,22 +26,32 @@ module Svnx
|
|
26
26
|
end.join(" ")
|
27
27
|
end
|
28
28
|
|
29
|
+
def fields
|
30
|
+
self.class.instance_variable_get '@fields'
|
31
|
+
end
|
32
|
+
|
29
33
|
module ClassMethods
|
30
34
|
def attr_readers(*symbols)
|
31
35
|
what = Array(symbols).flatten
|
32
36
|
attr_reader(*what)
|
33
37
|
end
|
34
|
-
|
38
|
+
|
35
39
|
# Creates a reader method for each field, and assigns and validates them from an initialize
|
36
40
|
# method, which is also created.
|
37
|
-
def
|
38
|
-
|
39
|
-
|
41
|
+
def has_fields fields = Hash.new
|
42
|
+
@fields ||= Hash.new
|
43
|
+
@fields.merge! fields
|
44
|
+
|
45
|
+
fields.keys.each do |field|
|
46
|
+
attr_reader field
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def has_field name, arg
|
51
|
+
@fields ||= Hash.new
|
52
|
+
@fields.merge! name => arg
|
40
53
|
|
41
|
-
|
42
|
-
assign args, what
|
43
|
-
validate args, what
|
44
|
-
end
|
54
|
+
attr_reader name
|
45
55
|
end
|
46
56
|
end
|
47
57
|
|
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
|
+
version: 2.6.0
|
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-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: command-cacheable
|
@@ -139,6 +139,8 @@ files:
|
|
139
139
|
- Manifest.txt
|
140
140
|
- README.md
|
141
141
|
- Rakefile
|
142
|
+
- lib/svnx/add/command.rb
|
143
|
+
- lib/svnx/add/options.rb
|
142
144
|
- lib/svnx/base/action.rb
|
143
145
|
- lib/svnx/base/cmdline.rb
|
144
146
|
- lib/svnx/base/command.rb
|
@@ -219,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
221
|
version: '0'
|
220
222
|
requirements: []
|
221
223
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.6.3
|
223
225
|
signing_key:
|
224
226
|
specification_version: 4
|
225
227
|
summary: Ruby objects from the Subversion command line
|