linen 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -12,6 +12,6 @@ See USAGE[link:files/docs/USAGE.html].
12
12
 
13
13
  == License and Copyright
14
14
 
15
- Linen is copyright (c) 2007, LAIKA Inc.
15
+ Linen is copyright (c) 2007, LAIKA Inc. It is distributed under the terms of the BSD license.
16
16
 
17
17
  Portions of the code (notably the Rakefile) contain snippets from other projects. These instances are documented in the header of the files involved.
@@ -16,7 +16,7 @@
16
16
  #
17
17
  # == Version
18
18
  #
19
- # $Id: linen.rb 276 2007-07-25 21:14:39Z bbleything $
19
+ # $Id: linen.rb 391 2007-11-19 22:21:55Z bbleything $
20
20
  #
21
21
 
22
22
  ### External libraries
@@ -30,8 +30,8 @@ require 'string_extensions'
30
30
 
31
31
 
32
32
  module Linen
33
- VERSION = "0.8.0"
34
- SVNRev = %q$Rev: 276 $
33
+ VERSION = "0.8.1"
34
+ SVNRev = %q$Rev: 391 $
35
35
 
36
36
 
37
37
  def self::plugins
@@ -15,11 +15,11 @@
15
15
  #
16
16
  # == Version
17
17
  #
18
- # $Id: argument.rb 274 2007-07-25 21:06:42Z bbleything $
18
+ # $Id: argument.rb 391 2007-11-19 22:21:55Z bbleything $
19
19
  #
20
20
 
21
21
  class Linen::Plugin::Argument
22
- attr_reader :prompt
22
+ attr_reader :prompt, :name
23
23
 
24
24
  def initialize( plugin, name, opts )
25
25
  @plugin = plugin
@@ -14,7 +14,7 @@
14
14
  #
15
15
  # == Version
16
16
  #
17
- # $Id: simple_command.rb 274 2007-07-25 21:06:42Z bbleything $
17
+ # $Id: simple_command.rb 391 2007-11-19 22:21:55Z bbleything $
18
18
  #
19
19
 
20
20
  class Linen::Plugin::SimpleCommand
@@ -139,6 +139,10 @@ class Linen::Plugin::SimpleCommand
139
139
  def validate_one_of_arguments( arg )
140
140
  results = IndifferentHash.new
141
141
 
142
+ arg ||= Linen::Workspace.handler.prompt(
143
+ "Enter a value for one of the arguments to this command (#{@arguments.map {|a| @plugin.arguments[a].name}.join(', ')}): "
144
+ )
145
+
142
146
  # put the argument onto the command history if it wasn't already there
143
147
  command_line = Linen::Workspace.handler.history.pop.strip
144
148
  command_line << " #{arg}" unless command_line =~ /#{arg}$/
@@ -152,6 +156,8 @@ class Linen::Plugin::SimpleCommand
152
156
  raise Linen::Plugin::ArgumentError,
153
157
  "The value you entered ('#{arg}') is invalid for all arguments." if
154
158
  results.values.compact.empty?
159
+
160
+ return results
155
161
  end
156
162
 
157
163
 
@@ -14,7 +14,7 @@
14
14
  #
15
15
  # == Version
16
16
  #
17
- # $Id: workspace.rb 274 2007-07-25 21:06:42Z bbleything $
17
+ # $Id: workspace.rb 390 2007-11-19 22:21:12Z bbleything $
18
18
  #
19
19
 
20
20
  class Linen::Workspace
@@ -37,8 +37,8 @@ class Linen::Workspace
37
37
  end
38
38
 
39
39
  def add_values( hash )
40
- raise ArgumentError,
41
- "must send a hash" unless hash.is_a? Hash
40
+ raise ArgumentError, "must send a hash" unless
41
+ hash.is_a? Hash
42
42
 
43
43
  hash.each do |k,v|
44
44
  self.set_value k, v
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: linen
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.8.0
7
- date: 2007-09-10 00:00:00 -07:00
6
+ version: 0.8.1
7
+ date: 2007-11-19 00:00:00 -08:00
8
8
  summary: Linen - A pluggable command-line interface library
9
9
  require_paths:
10
10
  - lib