svnx 1.0.1 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.glarkrc +1 -0
  4. data/Features.txt +7 -0
  5. data/Gemfile +4 -0
  6. data/History.txt +4 -0
  7. data/LICENSE +20 -0
  8. data/Manifest.txt +0 -0
  9. data/README.md +12 -0
  10. data/Rakefile +12 -0
  11. data/lib/svnx/base/action.rb +57 -52
  12. data/lib/svnx/base/cmdline.rb +58 -0
  13. data/lib/svnx/base/command.rb +49 -41
  14. data/lib/svnx/base/entries.rb +46 -45
  15. data/lib/svnx/base/entry.rb +51 -38
  16. data/lib/svnx/base/env.rb +26 -0
  17. data/lib/svnx/base/options.rb +25 -0
  18. data/lib/svnx/cat/command.rb +3 -64
  19. data/lib/svnx/cat/options.rb +28 -0
  20. data/lib/svnx/commit/command.rb +9 -0
  21. data/lib/svnx/commit/options.rb +29 -0
  22. data/lib/svnx/diff/command.rb +17 -0
  23. data/lib/svnx/diff/elements.rb +84 -0
  24. data/lib/svnx/diff/options.rb +35 -0
  25. data/lib/svnx/diff/parser.rb +105 -0
  26. data/lib/svnx/info/command.rb +4 -47
  27. data/lib/svnx/info/entries.rb +6 -8
  28. data/lib/svnx/info/entry.rb +21 -23
  29. data/lib/svnx/info/options.rb +28 -0
  30. data/lib/svnx/io/directory.rb +9 -5
  31. data/lib/svnx/io/element.rb +93 -95
  32. data/lib/svnx/log/command.rb +7 -3
  33. data/lib/svnx/log/entries.rb +17 -14
  34. data/lib/svnx/log/entry.rb +61 -49
  35. data/lib/svnx/log/options.rb +31 -0
  36. data/lib/svnx/merge/command.rb +9 -0
  37. data/lib/svnx/merge/options.rb +34 -0
  38. data/lib/svnx/project.rb +74 -0
  39. data/lib/svnx/propget/command.rb +9 -0
  40. data/lib/svnx/propget/entries.rb +15 -0
  41. data/lib/svnx/propget/entry.rb +23 -0
  42. data/lib/svnx/propget/options.rb +31 -0
  43. data/lib/svnx/propset/command.rb +9 -0
  44. data/lib/svnx/propset/options.rb +33 -0
  45. data/lib/svnx/revision/argfactory.rb +2 -2
  46. data/lib/svnx/revision/argument.rb +7 -3
  47. data/lib/svnx/revision/date.rb +27 -0
  48. data/lib/svnx/revision/error.rb +2 -2
  49. data/lib/svnx/revision/range.rb +5 -2
  50. data/lib/svnx/status/command.rb +4 -42
  51. data/lib/svnx/status/entries.rb +11 -12
  52. data/lib/svnx/status/entry.rb +43 -41
  53. data/lib/svnx/status/options.rb +28 -0
  54. data/lib/svnx/update/command.rb +9 -0
  55. data/lib/svnx/update/options.rb +25 -0
  56. data/lib/svnx/util/dateutil.rb +35 -0
  57. data/lib/svnx/util/objutil.rb +14 -0
  58. data/lib/{svnx.rb → svnx/version.rb} +2 -2
  59. data/lib/system/command/arg.rb +6 -5
  60. data/lib/system/command/cachefile.rb +29 -21
  61. data/lib/system/command/caching.rb +12 -25
  62. data/lib/system/command/line.rb +41 -30
  63. data/svnx.gemspec +34 -0
  64. metadata +85 -61
  65. data/lib/svnx/base/args.rb +0 -24
  66. data/lib/svnx/log/args.rb +0 -57
  67. data/lib/svnx/log/exec.rb +0 -27
  68. data/lib/svnx/log/line.rb +0 -42
  69. data/test/integration/info/info_test.rb +0 -21
  70. data/test/integration/log/log_test.rb +0 -74
  71. data/test/integration/status/status_test.rb +0 -35
  72. data/test/integration/svnx/io/element_test.rb +0 -235
  73. data/test/unit/svnx/base/action_test.rb +0 -49
  74. data/test/unit/svnx/cat/command_test.rb +0 -55
  75. data/test/unit/svnx/info/entries_test.rb +0 -22
  76. data/test/unit/svnx/log/args_test.rb +0 -15
  77. data/test/unit/svnx/log/entries_test.rb +0 -87
  78. data/test/unit/svnx/log/entry_test.rb +0 -15
  79. data/test/unit/svnx/log/exec_test.rb +0 -15
  80. data/test/unit/svnx/log/line_test.rb +0 -14
  81. data/test/unit/svnx/revision/argfactory_test.rb +0 -50
  82. data/test/unit/svnx/revision/argument_test.rb +0 -167
  83. data/test/unit/svnx/revision/range_test.rb +0 -48
  84. data/test/unit/svnx/status/entries_test.rb +0 -20
  85. data/test/unit/system/command/cachefile_test.rb +0 -52
  86. data/test/unit/system/command/caching_test.rb +0 -92
  87. data/test/unit/system/command/line_test.rb +0 -63
@@ -4,33 +4,20 @@
4
4
  require 'system/command/line'
5
5
  require 'system/command/cachefile'
6
6
 
7
- module System
8
- class CachingCommandLine < CommandLine
9
- # caches its input and values.
7
+ class System::CachingCommandLine < System::CommandLine
8
+ # caches its input and values.
10
9
 
11
- @@cache_dir = '/tmp' + Pathname.new($0).expand_path.to_s
12
-
13
- class << self
14
- def cache_dir
15
- @@cache_dir
16
- end
17
-
18
- def cache_dir= dir
19
- @@cache_dir = dir
20
- end
21
- end
22
-
23
- def cache_dir
24
- @@cache_dir
25
- end
10
+ def cache_dir
11
+ @cache_dir ||= '/tmp' + Pathname.new($0).expand_path.to_s
12
+ @cache_dir
13
+ end
26
14
 
27
- def cache_file
28
- CacheFile.new cache_dir, @args
29
- end
15
+ def cache_file
16
+ System::CacheFile.new cache_dir, @args
17
+ end
30
18
 
31
- def execute
32
- cachefile = cache_file
33
- @output = cachefile.readlines
34
- end
19
+ def execute
20
+ cachefile = cache_file
21
+ @output = cachefile.readlines
35
22
  end
36
23
  end
@@ -1,47 +1,58 @@
1
1
  #!/usr/bin/ruby -w
2
2
  # -*- ruby -*-
3
3
 
4
- require 'system/command/arg'
5
4
  require 'logue/loggable'
6
5
  require 'open3'
7
- require 'rainbow/ext/string'
8
6
 
9
7
  module System
10
- class CommandLine
11
- include Logue::Loggable
8
+ end
12
9
 
13
- attr_reader :args
14
- attr_reader :output
15
- attr_reader :error
16
- attr_reader :status
10
+ class System::CommandLine
11
+ include Logue::Loggable
17
12
 
18
- def initialize args = Array.new
19
- @args = args.dup
20
- end
13
+ attr_reader :args
14
+ attr_reader :output
15
+ attr_reader :error
16
+ attr_reader :status
21
17
 
22
- def << arg
23
- @args << arg
24
- end
18
+ def initialize args = Array.new
19
+ @args = args.dup
20
+ end
25
21
 
26
- def execute
27
- cmd = to_command
28
- debug "cmd: #{cmd}".color("8A8A43")
29
-
30
- Open3.popen3(cmd) do |stdin, stdout, stderr, wthr|
31
- @output = stdout.readlines
32
- @error = stderr.readlines
33
- @status = wthr.value
34
- end
22
+ def << arg
23
+ @args << arg
24
+ end
35
25
 
36
- debug "@output: #{@output}"
37
- debug "@error: #{@error}"
38
- debug "@status: #{@status}"
39
-
40
- @output
26
+ def execute
27
+ cmd = to_command
28
+ $stderr.puts "cmd: #{cmd}"
29
+
30
+ Open3.popen3(cmd) do |stdin, stdout, stderr, wthr|
31
+ @output = stdout.readlines
32
+ @error = stderr.readlines
33
+ @status = wthr.value
41
34
  end
42
35
 
43
- def to_command
44
- @args.join ' '
36
+ if false && @output
37
+ puts "output"
38
+ @output.each_with_index do |line, idx|
39
+ debug "output[#{idx}]: #{line}"
40
+ end
41
+ end
42
+
43
+ if false && @error
44
+ puts "error"
45
+ @error.each_with_index do |line, idx|
46
+ debug "error[#{idx}]: #{line}"
47
+ end
45
48
  end
49
+
50
+ debug "@status: #{@status}"
51
+
52
+ @output
53
+ end
54
+
55
+ def to_command
56
+ @args.join ' '
46
57
  end
47
58
  end
data/svnx.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'svnx/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "svnx"
8
+ spec.version = Svnx::VERSION
9
+ spec.authors = ["Jeff Pace"]
10
+ spec.email = ["jeugenepace@gmail.com"]
11
+
12
+ spec.summary = %q{Ruby objects from the Subversion command line}
13
+ spec.description = %q{Bridges the Subversion command line, returning Ruby objects.}
14
+ spec.homepage = "https://github.com/jpace/svnx"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.12"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "logue", "~> 1.0.6"
33
+ spec.add_development_dependency "test-unit", "~> 3.1.5"
34
+ end
metadata CHANGED
@@ -1,102 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svnx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Pace
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-09 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: logue
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :runtime
47
+ version: 1.0.6
48
+ type: :development
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
- version: '1.0'
54
+ version: 1.0.6
27
55
  - !ruby/object:Gem::Dependency
28
- name: rainbow
56
+ name: test-unit
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: '2.1'
34
- type: :runtime
61
+ version: 3.1.5
62
+ type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '2.1'
41
- description: A bridge between Subversion functionality, via the command line, and
42
- Ruby.
43
- email: jeugenepace@gmail.com
68
+ version: 3.1.5
69
+ description: Bridges the Subversion command line, returning Ruby objects.
70
+ email:
71
+ - jeugenepace@gmail.com
44
72
  executables: []
45
73
  extensions: []
46
74
  extra_rdoc_files: []
47
75
  files:
48
- - lib/svnx.rb
76
+ - ".gitignore"
77
+ - ".glarkrc"
78
+ - Features.txt
79
+ - Gemfile
80
+ - History.txt
81
+ - LICENSE
82
+ - Manifest.txt
83
+ - README.md
84
+ - Rakefile
49
85
  - lib/svnx/base/action.rb
50
- - lib/svnx/base/args.rb
86
+ - lib/svnx/base/cmdline.rb
51
87
  - lib/svnx/base/command.rb
52
88
  - lib/svnx/base/entries.rb
53
89
  - lib/svnx/base/entry.rb
90
+ - lib/svnx/base/env.rb
91
+ - lib/svnx/base/options.rb
54
92
  - lib/svnx/cat/command.rb
93
+ - lib/svnx/cat/options.rb
94
+ - lib/svnx/commit/command.rb
95
+ - lib/svnx/commit/options.rb
96
+ - lib/svnx/diff/command.rb
97
+ - lib/svnx/diff/elements.rb
98
+ - lib/svnx/diff/options.rb
99
+ - lib/svnx/diff/parser.rb
55
100
  - lib/svnx/info/command.rb
56
101
  - lib/svnx/info/entries.rb
57
102
  - lib/svnx/info/entry.rb
103
+ - lib/svnx/info/options.rb
58
104
  - lib/svnx/io/directory.rb
59
105
  - lib/svnx/io/element.rb
60
- - lib/svnx/log/args.rb
61
106
  - lib/svnx/log/command.rb
62
107
  - lib/svnx/log/entries.rb
63
108
  - lib/svnx/log/entry.rb
64
- - lib/svnx/log/exec.rb
65
- - lib/svnx/log/line.rb
109
+ - lib/svnx/log/options.rb
110
+ - lib/svnx/merge/command.rb
111
+ - lib/svnx/merge/options.rb
112
+ - lib/svnx/project.rb
113
+ - lib/svnx/propget/command.rb
114
+ - lib/svnx/propget/entries.rb
115
+ - lib/svnx/propget/entry.rb
116
+ - lib/svnx/propget/options.rb
117
+ - lib/svnx/propset/command.rb
118
+ - lib/svnx/propset/options.rb
66
119
  - lib/svnx/revision/argfactory.rb
67
120
  - lib/svnx/revision/argument.rb
121
+ - lib/svnx/revision/date.rb
68
122
  - lib/svnx/revision/error.rb
69
123
  - lib/svnx/revision/range.rb
70
124
  - lib/svnx/status/command.rb
71
125
  - lib/svnx/status/entries.rb
72
126
  - lib/svnx/status/entry.rb
127
+ - lib/svnx/status/options.rb
128
+ - lib/svnx/update/command.rb
129
+ - lib/svnx/update/options.rb
130
+ - lib/svnx/util/dateutil.rb
131
+ - lib/svnx/util/objutil.rb
132
+ - lib/svnx/version.rb
73
133
  - lib/system/command/arg.rb
74
134
  - lib/system/command/cachefile.rb
75
135
  - lib/system/command/caching.rb
76
136
  - lib/system/command/line.rb
77
- - test/integration/info/info_test.rb
78
- - test/integration/log/log_test.rb
79
- - test/integration/status/status_test.rb
80
- - test/integration/svnx/io/element_test.rb
81
- - test/unit/svnx/base/action_test.rb
82
- - test/unit/svnx/cat/command_test.rb
83
- - test/unit/svnx/info/entries_test.rb
84
- - test/unit/svnx/log/args_test.rb
85
- - test/unit/svnx/log/entries_test.rb
86
- - test/unit/svnx/log/entry_test.rb
87
- - test/unit/svnx/log/exec_test.rb
88
- - test/unit/svnx/log/line_test.rb
89
- - test/unit/svnx/revision/argfactory_test.rb
90
- - test/unit/svnx/revision/argument_test.rb
91
- - test/unit/svnx/revision/range_test.rb
92
- - test/unit/svnx/status/entries_test.rb
93
- - test/unit/system/command/cachefile_test.rb
94
- - test/unit/system/command/caching_test.rb
95
- - test/unit/system/command/line_test.rb
96
- homepage: http://github.com/jpace/svnx
137
+ - svnx.gemspec
138
+ homepage: https://github.com/jpace/svnx
97
139
  licenses:
98
140
  - MIT
99
- metadata: {}
141
+ metadata:
142
+ allowed_push_host: https://rubygems.org
100
143
  post_install_message:
101
144
  rdoc_options: []
102
145
  require_paths:
@@ -113,27 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
156
  version: '0'
114
157
  requirements: []
115
158
  rubyforge_project:
116
- rubygems_version: 2.5.1
159
+ rubygems_version: 2.6.3
117
160
  signing_key:
118
161
  specification_version: 4
119
- summary: Wrapper around Subversion command line.
120
- test_files:
121
- - test/integration/info/info_test.rb
122
- - test/integration/log/log_test.rb
123
- - test/integration/status/status_test.rb
124
- - test/integration/svnx/io/element_test.rb
125
- - test/unit/svnx/base/action_test.rb
126
- - test/unit/svnx/cat/command_test.rb
127
- - test/unit/svnx/info/entries_test.rb
128
- - test/unit/svnx/log/args_test.rb
129
- - test/unit/svnx/log/entries_test.rb
130
- - test/unit/svnx/log/entry_test.rb
131
- - test/unit/svnx/log/exec_test.rb
132
- - test/unit/svnx/log/line_test.rb
133
- - test/unit/svnx/revision/argfactory_test.rb
134
- - test/unit/svnx/revision/argument_test.rb
135
- - test/unit/svnx/revision/range_test.rb
136
- - test/unit/svnx/status/entries_test.rb
137
- - test/unit/system/command/cachefile_test.rb
138
- - test/unit/system/command/caching_test.rb
139
- - test/unit/system/command/line_test.rb
162
+ summary: Ruby objects from the Subversion command line
163
+ test_files: []
@@ -1,24 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'system/command/line'
5
- require 'logue/loggable'
6
- require 'system/command/caching'
7
-
8
- # this replaces svnx/lib/command/svncommand.
9
-
10
- module SVNx
11
- class CommandArgs
12
- include Logue::Loggable
13
-
14
- attr_accessor :path
15
-
16
- def initialize args = Hash.new
17
- @path = args[:path]
18
- end
19
-
20
- def to_a
21
- [ @path ].compact
22
- end
23
- end
24
- end
data/lib/svnx/log/args.rb DELETED
@@ -1,57 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'system/command/line'
5
- require 'system/command/caching'
6
- require 'svnx/base/command'
7
- require 'logue/loggable'
8
- require 'svnx/base/args'
9
-
10
- module SvnLog
11
- class Args < SVNx::CommandArgs
12
- include Logue::Loggable
13
-
14
- attr_reader :limit
15
- attr_reader :verbose
16
- attr_reader :revision
17
- attr_reader :use_cache
18
-
19
- def initialize args
20
- @limit = args[:limit]
21
- @verbose = args[:verbose]
22
- @use_cache = args.key?(:use_cache) ? args[:use_cache] : false
23
- @revision = args[:revision]
24
- super
25
- end
26
-
27
- def to_a
28
- ary = Array.new
29
- if @limit
30
- ary << '--limit' << @limit
31
- end
32
- if @verbose
33
- ary << '-v'
34
- end
35
-
36
- if @revision
37
- [ @revision ].flatten.each do |rev|
38
- ary << "-r#{rev}"
39
- end
40
- end
41
-
42
- if @path
43
- ary << @path
44
- end
45
-
46
- ary.compact
47
- end
48
- end
49
- end
50
-
51
- # the old name and module
52
- module SVNx
53
- module LogCmdLine
54
- class LogCommandArgs < SvnLog::Args
55
- end
56
- end
57
- end