Skip to content

Commit

Permalink
added doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
seanohalpin committed Mar 27, 2009
1 parent 2e5549b commit fe9f021
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 15 deletions.
8 changes: 6 additions & 2 deletions bugs/issue-23f5e62f4ecdd4cbfc0f7a3f680590d27491603d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ type: :task
component: core
release: r0.2.4
reporter: Sean O'Halpin <sean.ohalpin@gmail.com>
status: :unstarted
disposition:
status: :closed
disposition: :reorg
creation_time: 2009-03-19 01:07:06.838756 Z
references: []

Expand All @@ -16,3 +16,7 @@ log_events:
- Sean O'Halpin <sean.ohalpin@gmail.com>
- created
- ""
- - 2009-03-22 14:59:06.991671 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- closed with disposition reorg
- covered by {issue 8025ac435062ddaf6452786b669616dd8e624d25}
18 changes: 18 additions & 0 deletions bugs/issue-3505299da0b044a2098fcfaccd77ab5d53d254fd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- !ditz.rubyforge.org,2008-03-06/issue
title: make to_yaml, to_json, to_xml (and from_x) all use same signature
desc: ""
type: :task
component: extras
release: r0.2.4
reporter: Sean O'Halpin <sean.ohalpin@gmail.com>
status: :unstarted
disposition:
creation_time: 2009-03-23 10:32:05.961002 Z
references: []

id: 3505299da0b044a2098fcfaccd77ab5d53d254fd
log_events:
- - 2009-03-23 10:32:06.840872 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- created
- ""
12 changes: 8 additions & 4 deletions bugs/issue-cf433a4662d6b19c3360bc28aaa9778b11a35494.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
--- !ditz.rubyforge.org,2008-03-06/issue
--- !ditz.rubyforge.org,2008-03-06/issue
title: "class-level #from should be invoked when initializing from single argument of matching class"
desc: this causes some trickiness in doodles derived from core types (see from_spec.rb) but worth it for convenience
type: :feature
component: core
release: r0.2.4
reporter: Sean O'Halpin <sean.ohalpin@gmail.com>
status: :unstarted
disposition:
status: :closed
disposition: :fixed
creation_time: 2009-03-22 04:30:42.265382 Z
references: []

id: cf433a4662d6b19c3360bc28aaa9778b11a35494
log_events:
log_events:
- - 2009-03-22 04:30:43.529053 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- created
- ""
- - 2009-03-22 14:57:01.900261 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- closed with disposition fixed
- ""
22 changes: 22 additions & 0 deletions bugs/issue-cf7bc958975988d38d5f853247f4a23fdd7fddc1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- !ditz.rubyforge.org,2008-03-06/issue
title: "applying class.new before attempting from conversion "
desc: ""
type: :bugfix
component: core
release: r0.2.4
reporter: Sean O'Halpin <sean.ohalpin@gmail.com>
status: :closed
disposition: :fixed
creation_time: 2009-03-22 14:56:25.484546 Z
references: []

id: cf7bc958975988d38d5f853247f4a23fdd7fddc1
log_events:
- - 2009-03-22 14:56:26.254372 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- created
- ""
- - 2009-03-22 14:56:35.036573 Z
- Sean O'Halpin <sean.ohalpin@gmail.com>
- closed with disposition fixed
- ""
17 changes: 8 additions & 9 deletions lib/doodle/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require 'doodle/datatypes'
require 'time'
require 'date'
require 'pp'
#require 'pp'

# note that all the datatypes within doodle do ... end blocks are
# doodle/datatypes - I then go on to define specialized option types
Expand Down Expand Up @@ -62,7 +62,7 @@ class Option < Doodle::DoodleAttribute
has :match, :default => nil, :doc => "regex to match against"
end
end
# specialied Filename attribute
# specialised Filename attribute
# - :existing => true|false (default = false)
class Filename < Option
doodle do
Expand All @@ -78,13 +78,13 @@ class Filename < Option
class << self
public

has :script_name, :default => File.basename($0)
has :doc, :default => $0
has :usage do
has :script_name, :default => File.basename($0), :doc => "base name of script"
has :script_path, :default => File.expand_path(File.dirname($0)), :doc => "directory from which script is executed"
has :doc, :default => $0, :doc => "documentation"
has :usage, :doc => "usage description" do
default { "./#{script_name} #{required_args.map{ |a| %[-#{ a.flag } #{format_kind(a.kind)}]}.join(' ')}" + ((required_args.size - doodle.attributes.size) > 0 ? " [OPTIONS]" : '') }
end
has :examples, :default => nil
alias :example :examples
has :examples, :collect => :example, :doc => "example(s) of use"

def required
@optional = false
Expand Down Expand Up @@ -379,7 +379,6 @@ def params_args(argv)
def from_argv(argv)
params, args = params_args(argv)
args << params
#pp [:args, args]
new(*args)
end
def format_values(values)
Expand Down Expand Up @@ -452,7 +451,7 @@ def help_text
self.usage ? ["Usage: " + self.usage, "\n"] : [],
required.size > 0 ? ["Required args:", required.map(&format_block), "\n"] : [],
options.size > 0 ? ["Options:", options.map(&format_block), "\n"] : [],
(self.examples && self.examples.size > 0) ? "Examples:\n" + " " + self.examples.join("\n ") : [],
(self.examples && self.examples.size > 0) ? "Examples:\n" + " " + [self.examples].flatten.join("\n ") : [],
]
end
end
Expand Down

0 comments on commit fe9f021

Please sign in to comment.