pvn 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pvn/command/options.rb +13 -0
- data/lib/pvn/diff/options.rb +0 -1
- data/lib/pvn/log/options.rb +0 -7
- data/lib/pvn/pct/options.rb +0 -1
- data/lib/pvn/seek/command.rb +5 -3
- data/lib/pvn/seek/options.rb +0 -1
- data/lib/pvn/seek/path.rb +2 -0
- data/lib/pvn/status/options.rb +1 -2
- data/lib/pvn.rb +1 -1
- data/lib/synoption/set.rb +7 -2
- metadata +4 -4
data/lib/pvn/command/options.rb
CHANGED
@@ -15,7 +15,20 @@ module PVN::Command
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
class VerboseOption < PVN::BooleanOption
|
19
|
+
def initialize optargs = Hash.new
|
20
|
+
super :verbose, '-v', [ "display verbose output" ], false
|
21
|
+
end
|
22
|
+
|
23
|
+
def set_value val
|
24
|
+
RIEL::Log.level = RIEL::Log::DEBUG
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
18
28
|
class OptionSet < PVN::OptionSet
|
29
|
+
has_option :help, HelpOption
|
30
|
+
has_option :verbose, VerboseOption
|
31
|
+
|
19
32
|
def name
|
20
33
|
self.class.to_s.split('::')[-2].downcase
|
21
34
|
end
|
data/lib/pvn/diff/options.rb
CHANGED
data/lib/pvn/log/options.rb
CHANGED
@@ -18,12 +18,6 @@ module PVN::Log
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
class VerboseOption < PVN::BooleanOption
|
22
|
-
def initialize optargs = Hash.new
|
23
|
-
super :verbose, '-v', [ "include the files in the change" ], false
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
21
|
class FilesOption < PVN::BooleanOption
|
28
22
|
def initialize optargs = Hash.new
|
29
23
|
super :files, '-f', [ "list the files in the change" ], false
|
@@ -39,7 +33,6 @@ module PVN::Log
|
|
39
33
|
class OptionSet < PVN::Command::OptionSet
|
40
34
|
has_option :revision, PVN::MultipleRevisionsRegexpOption, [ :unsets => :limit ]
|
41
35
|
has_option :color, PVN::Command::ColorOption
|
42
|
-
has_option :help, PVN::Command::HelpOption
|
43
36
|
has_option :limit, LimitOption
|
44
37
|
has_option :user, UserOption
|
45
38
|
has_option :files, FilesOption
|
data/lib/pvn/pct/options.rb
CHANGED
data/lib/pvn/seek/command.rb
CHANGED
@@ -23,17 +23,19 @@ module PVN::Seek
|
|
23
23
|
example "pvn seek --removed 'void\\s+reinitialize()' *.java", "Looks through Java files for the latest revision when 'void reinitialize() does not match."
|
24
24
|
|
25
25
|
def init options
|
26
|
-
info "options: #{options.inspect}"
|
26
|
+
info "options: #{options.inspect}"
|
27
27
|
|
28
28
|
paths = options.paths
|
29
29
|
|
30
30
|
pattern = paths.shift
|
31
31
|
info "pattern: #{pattern}"
|
32
|
+
|
33
|
+
raise "error: no pattern given to seek command" unless pattern
|
32
34
|
|
33
35
|
paths = %w{ . } if paths.empty?
|
34
|
-
info "paths: #{paths}"
|
36
|
+
info "paths: #{paths}"
|
35
37
|
|
36
|
-
info "options.revision: #{options.revision}"
|
38
|
+
info "options.revision: #{options.revision}"
|
37
39
|
|
38
40
|
seektype = options.removed ? :removed : :added
|
39
41
|
|
data/lib/pvn/seek/options.rb
CHANGED
data/lib/pvn/seek/path.rb
CHANGED
data/lib/pvn/status/options.rb
CHANGED
data/lib/pvn.rb
CHANGED
data/lib/synoption/set.rb
CHANGED
@@ -18,7 +18,6 @@ module PVN
|
|
18
18
|
class << self
|
19
19
|
def has_option name, optcls, optargs = Hash.new
|
20
20
|
attr_reader name
|
21
|
-
|
22
21
|
@@options_for_class[self] << { :name => name, :class => optcls, :args => optargs }
|
23
22
|
|
24
23
|
define_method name do
|
@@ -38,7 +37,13 @@ module PVN
|
|
38
37
|
@options = options
|
39
38
|
@arguments = Array.new
|
40
39
|
|
41
|
-
|
40
|
+
[ self.class, self.class.superclass ].each do |cls|
|
41
|
+
add_options_for_class cls
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_options_for_class cls
|
46
|
+
opts = @@options_for_class[cls]
|
42
47
|
|
43
48
|
opts.each do |option|
|
44
49
|
name = option[:name]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pvn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeff Pace
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-11-
|
18
|
+
date: 2012-11-06 00:00:00 -05:00
|
19
19
|
default_executable: pvn
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|