pvn 0.0.10 → 0.0.11

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.
@@ -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
@@ -25,6 +25,5 @@ module PVN::Diff
25
25
  has_option :revision, PVN::MultipleRevisionsRegexpOption
26
26
  has_option :change, ChangeOption
27
27
  has_option :whitespace, WhitespaceOption
28
- has_option :help, PVN::Command::HelpOption
29
28
  end
30
29
  end
@@ -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
@@ -7,6 +7,5 @@ require 'pvn/command/options'
7
7
  module PVN::Pct
8
8
  class OptionSet < PVN::Command::OptionSet
9
9
  has_option :revision, PVN::MultipleRevisionsRegexpOption
10
- has_option :help, PVN::Command::HelpOption
11
10
  end
12
11
  end
@@ -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}".red
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}".cyan
36
+ info "paths: #{paths}"
35
37
 
36
- info "options.revision: #{options.revision}".bold.black.on_cyan
38
+ info "options.revision: #{options.revision}"
37
39
 
38
40
  seektype = options.removed ? :removed : :added
39
41
 
@@ -43,6 +43,5 @@ module PVN::Seek
43
43
  has_option :color, PVN::Command::ColorOption
44
44
  # has_option :match, MatchOption
45
45
  has_option :removed, RemovedOption
46
- has_option :help, PVN::Command::HelpOption
47
46
  end
48
47
  end
data/lib/pvn/seek/path.rb CHANGED
@@ -29,6 +29,8 @@ module PVN::Seek
29
29
  def revision; @revision; end
30
30
  def user; nil; end
31
31
  def use_cache; nil; end
32
+
33
+ def files; end
32
34
  end
33
35
 
34
36
  class Path
@@ -6,7 +6,6 @@ require 'pvn/command/color_option'
6
6
 
7
7
  module PVN::Status
8
8
  class OptionSet < PVN::Command::OptionSet
9
- has_option :color, PVN::Command::ColorOption
10
- has_option :help, PVN::Command::HelpOption
9
+ has_option :color, PVN::Command::ColorOption
11
10
  end
12
11
  end
data/lib/pvn.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PVN
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
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
- opts = @@options_for_class[self.class]
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
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-05 00:00:00 -05:00
18
+ date: 2012-11-06 00:00:00 -05:00
19
19
  default_executable: pvn
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency