svnx 2.2.0 → 2.3.0
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/cmdline.rb +2 -14
- data/lib/svnx/base/command.rb +4 -4
- data/lib/svnx/version.rb +1 -1
- data/svnx.gemspec +2 -1
- metadata +20 -13
- data/lib/cmdline/arg.rb +0 -12
- data/lib/cmdline/cachefile.rb +0 -37
- data/lib/cmdline/caching.rb +0 -25
- data/lib/cmdline/filename.rb +0 -16
- data/lib/cmdline/gzpathname.rb +0 -26
- data/lib/cmdline/line.rb +0 -57
- data/lib/svnx/base/cmd.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03dc7ad9a32bb28cd8948fbe5921ead0f014fd47
|
4
|
+
data.tar.gz: 16794b57d049be33261365a1537250e6bc4d4833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ca8614a6553fdc808ceb319fd2aaca159b1c84ad745cb0940cd7565843245c4d24135915d300255c6083b9050ab1e975066aace36e6c398ac53a845d3a29fa
|
7
|
+
data.tar.gz: 8a5b6bcd7040e7655a7547a0d5fd295368522b191554222c2a6f0ab4186783f0c0bdcd696f47b5a41b61908868215f6d41388bfec0ce1d007348a642dd41e1f9
|
data/lib/svnx/base/cmdline.rb
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
4
|
require 'logue/loggable'
|
5
|
-
require '
|
6
|
-
require 'cmdline/caching'
|
5
|
+
require 'command/cacheable'
|
7
6
|
require 'svnx/base/env'
|
8
7
|
|
9
8
|
module Svnx
|
@@ -12,16 +11,6 @@ module Svnx
|
|
12
11
|
end
|
13
12
|
|
14
13
|
module Svnx::Base
|
15
|
-
class CachingCommandLine < CmdLine::CachingCommandLine
|
16
|
-
def caching?
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
def cache_dir
|
21
|
-
Svnx::Env.instance.cache_dir
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
14
|
class CommandLine
|
26
15
|
include Logue::Loggable
|
27
16
|
|
@@ -57,8 +46,7 @@ module Svnx::Base
|
|
57
46
|
end
|
58
47
|
|
59
48
|
def command_line cmdargs
|
60
|
-
|
61
|
-
cls.new cmdargs
|
49
|
+
Command::Cacheable::Command.new cmdargs, caching: @caching, dir: Svnx::Env.instance.cache_dir
|
62
50
|
end
|
63
51
|
end
|
64
52
|
end
|
data/lib/svnx/base/command.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
4
|
require 'logue/loggable'
|
5
|
-
require '
|
6
|
-
require 'svnx/base/cmdline'
|
5
|
+
require 'command/cacheable/command'
|
6
|
+
# require 'svnx/base/cmdline'
|
7
7
|
require 'svnx/util/classutil'
|
8
8
|
require 'svnx/base/command_factory'
|
9
9
|
|
@@ -47,7 +47,7 @@ module Svnx::Base
|
|
47
47
|
debug "@cmdline: #{@cmdline}"
|
48
48
|
|
49
49
|
@output = @cmdline.execute
|
50
|
-
debug "@output: #{@output}"
|
50
|
+
debug "@output: #{@output && @output[0 .. 100]}"
|
51
51
|
|
52
52
|
@error = @cmdline.error
|
53
53
|
debug "@error: #{@error}"
|
@@ -60,7 +60,7 @@ module Svnx::Base
|
|
60
60
|
class EntriesCommand < Command
|
61
61
|
attr_reader :entries
|
62
62
|
|
63
|
-
def initialize options, cls:
|
63
|
+
def initialize options, cls: Command::Cacheable::Command, exec: nil, caching: caching?, xml: true, entries_class: nil
|
64
64
|
super options, cls: cls, exec: exec, xml: xml, caching: caching
|
65
65
|
|
66
66
|
if not @output.empty?
|
data/lib/svnx/version.rb
CHANGED
data/svnx.gemspec
CHANGED
@@ -27,9 +27,10 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
+
spec.add_runtime_dependency "command-cacheable", "~> 0.2"
|
30
31
|
spec.add_development_dependency "bundler", "~> 1.12"
|
31
32
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
33
|
spec.add_development_dependency "logue", "~> 1.0.6"
|
33
34
|
spec.add_development_dependency "test-unit", "~> 3.1.5"
|
34
|
-
spec.add_development_dependency "paramesan"
|
35
|
+
spec.add_development_dependency "paramesan", "~> 0.1.1"
|
35
36
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svnx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.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: 2018-
|
11
|
+
date: 2018-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: command-cacheable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +84,16 @@ dependencies:
|
|
70
84
|
name: paramesan
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - "
|
87
|
+
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 0.1.1
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- - "
|
94
|
+
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 0.1.1
|
83
97
|
description: Bridges the Subversion command line, returning Ruby objects.
|
84
98
|
email:
|
85
99
|
- jeugenepace@gmail.com
|
@@ -97,15 +111,8 @@ files:
|
|
97
111
|
- Manifest.txt
|
98
112
|
- README.md
|
99
113
|
- Rakefile
|
100
|
-
- lib/cmdline/arg.rb
|
101
|
-
- lib/cmdline/cachefile.rb
|
102
|
-
- lib/cmdline/caching.rb
|
103
|
-
- lib/cmdline/filename.rb
|
104
|
-
- lib/cmdline/gzpathname.rb
|
105
|
-
- lib/cmdline/line.rb
|
106
114
|
- lib/svnx/base/action.rb
|
107
115
|
- lib/svnx/base/action_status.rb
|
108
|
-
- lib/svnx/base/cmd.rb
|
109
116
|
- lib/svnx/base/cmdline.rb
|
110
117
|
- lib/svnx/base/command.rb
|
111
118
|
- lib/svnx/base/command_factory.rb
|
data/lib/cmdline/arg.rb
DELETED
data/lib/cmdline/cachefile.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'cmdline/line'
|
5
|
-
require 'cmdline/filename'
|
6
|
-
require 'cmdline/gzpathname'
|
7
|
-
|
8
|
-
# A file that has a pathname and output
|
9
|
-
module CmdLine
|
10
|
-
class CacheFile
|
11
|
-
attr_reader :output
|
12
|
-
attr_reader :pathname
|
13
|
-
|
14
|
-
def initialize cache_dir, args
|
15
|
-
@args = args
|
16
|
-
basename = FileName.new(args).name
|
17
|
-
fullname = Pathname(cache_dir) + basename
|
18
|
-
@pathname = GzipPathname.new fullname
|
19
|
-
@output = nil
|
20
|
-
end
|
21
|
-
|
22
|
-
def readlines
|
23
|
-
if @pathname.exist?
|
24
|
-
@output = @pathname.read_file
|
25
|
-
else
|
26
|
-
cl = CommandLine.new @args
|
27
|
-
@output = cl.execute
|
28
|
-
@pathname.save_file @output
|
29
|
-
@output
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def to_s
|
34
|
-
@pathname.to_s
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/cmdline/caching.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'cmdline/line'
|
5
|
-
require 'cmdline/cachefile'
|
6
|
-
|
7
|
-
module CmdLine
|
8
|
-
class CachingCommandLine < CommandLine
|
9
|
-
# caches its input and values.
|
10
|
-
|
11
|
-
def cache_dir
|
12
|
-
@cache_dir ||= '/tmp' + Pathname.new($0).expand_path.to_s
|
13
|
-
@cache_dir
|
14
|
-
end
|
15
|
-
|
16
|
-
def cache_file
|
17
|
-
CacheFile.new cache_dir, @args
|
18
|
-
end
|
19
|
-
|
20
|
-
def execute
|
21
|
-
cachefile = cache_file
|
22
|
-
@output = cachefile.readlines
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/cmdline/filename.rb
DELETED
data/lib/cmdline/gzpathname.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'zlib'
|
5
|
-
require 'pathname'
|
6
|
-
|
7
|
-
module CmdLine
|
8
|
-
# A pathname that reads and writes itself as gzipped
|
9
|
-
class GzipPathname < Pathname
|
10
|
-
def save_file content
|
11
|
-
parent.mkpath unless parent.exist?
|
12
|
-
unlink if exist?
|
13
|
-
Zlib::GzipWriter.open(to_s) do |gz|
|
14
|
-
gz.puts content
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def read_file
|
19
|
-
Array.new.tap do |content|
|
20
|
-
Zlib::GzipReader.open(to_s) do |gz|
|
21
|
-
content.concat gz.readlines
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/lib/cmdline/line.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'logue/loggable'
|
5
|
-
require 'open3'
|
6
|
-
|
7
|
-
module CmdLine
|
8
|
-
class CommandLine
|
9
|
-
include Logue::Loggable
|
10
|
-
|
11
|
-
attr_reader :args
|
12
|
-
attr_reader :output
|
13
|
-
attr_reader :error
|
14
|
-
attr_reader :status
|
15
|
-
|
16
|
-
def initialize *args, debug: false
|
17
|
-
@args = args.dup
|
18
|
-
end
|
19
|
-
|
20
|
-
def << arg
|
21
|
-
@args << arg
|
22
|
-
end
|
23
|
-
|
24
|
-
def execute
|
25
|
-
cmd = to_command
|
26
|
-
debug "cmd: #{cmd}"
|
27
|
-
|
28
|
-
Open3.popen3(cmd) do |stdin, stdout, stderr, wthr|
|
29
|
-
@output = stdout.readlines
|
30
|
-
@error = stderr.readlines
|
31
|
-
@status = wthr.value
|
32
|
-
end
|
33
|
-
|
34
|
-
if false && @output
|
35
|
-
puts "output"
|
36
|
-
@output.each_with_index do |line, idx|
|
37
|
-
debug "output[#{idx}]: #{line}"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
if false && @error
|
42
|
-
puts "error"
|
43
|
-
@error.each_with_index do |line, idx|
|
44
|
-
debug "error[#{idx}]: #{line}"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
debug "@status: #{@status}"
|
49
|
-
|
50
|
-
@output
|
51
|
-
end
|
52
|
-
|
53
|
-
def to_command
|
54
|
-
@args.join ' '
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
data/lib/svnx/base/cmd.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'rexml/document'
|
5
|
-
require 'logue/loggable'
|
6
|
-
|
7
|
-
module Svnx
|
8
|
-
class Cmd
|
9
|
-
include Logue::Loggable
|
10
|
-
|
11
|
-
def initialize xml
|
12
|
-
info "xml: #{xml}"
|
13
|
-
|
14
|
-
@doc = REXML::Document.new xml
|
15
|
-
info "@doc: #{@doc}"
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|