drydock 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +16 -0
- data/LICENSE.txt +22 -0
- data/README.rdoc +70 -0
- data/Rakefile +72 -0
- data/bin/example +152 -0
- data/doc/classes/Drydock.html +535 -0
- data/doc/classes/Drydock/Command.html +180 -0
- data/doc/classes/Drydock/InvalidArgument.html +118 -0
- data/doc/classes/Drydock/MissingArgument.html +88 -0
- data/doc/classes/Drydock/NoCommandsDefined.html +88 -0
- data/doc/classes/Drydock/UnknownCommand.html +118 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGES_txt.html +100 -0
- data/doc/files/LICENSE_txt.html +87 -0
- data/doc/files/README_rdoc.html +119 -0
- data/doc/files/bin/example.html +104 -0
- data/doc/files/lib/drydock_rb.html +75 -0
- data/doc/fr_class_index.html +19 -0
- data/doc/fr_file_index.html +24 -0
- data/doc/fr_method_index.html +4459 -0
- data/doc/index.html +15 -0
- data/doc/rdoc-style.css +319 -0
- data/drydock.gemspec +53 -0
- data/lib/drydock.rb +482 -0
- data/test/command_test.rb +40 -0
- metadata +90 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/../lib/drydock"
|
2
|
+
require "rubygems"
|
3
|
+
require "test/spec"
|
4
|
+
require "mocha"
|
5
|
+
|
6
|
+
class Test::Unit::TestCase
|
7
|
+
def test_command_direct(cmd, argv, &b)
|
8
|
+
Drydock::Command.new(cmd, &b).call(*argv)
|
9
|
+
end
|
10
|
+
def test_command(*args, &b)
|
11
|
+
command(*args, &b)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class JohnWestSmokedOysters < Drydock::Command; end;
|
16
|
+
|
17
|
+
Drydock.run = false
|
18
|
+
|
19
|
+
context "command" do
|
20
|
+
|
21
|
+
setup do
|
22
|
+
@mock = mock()
|
23
|
+
end
|
24
|
+
|
25
|
+
specify "should know a command alias" do
|
26
|
+
@mock.expects(:called).with(:eat_alias)
|
27
|
+
test_command_direct(:eat, [:eat_alias]) { |obj,argv|
|
28
|
+
@mock.called(obj.alias)
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
specify "should accept a custom command class" do
|
33
|
+
@mock.expects(:called).with(JohnWestSmokedOysters)
|
34
|
+
test_command(:eat => JohnWestSmokedOysters) { |obj,argv|
|
35
|
+
@mock.called(obj.class)
|
36
|
+
}
|
37
|
+
Drydock.run!(['eat'])
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: drydock
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Delano Mandelbaum
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-08-17 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: A seaworthy DSL for writing command line apps inspired by Blake Mizerany's Frylock
|
17
|
+
email: delano@solutious.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- LICENSE.txt
|
25
|
+
- CHANGES.txt
|
26
|
+
files:
|
27
|
+
- CHANGES.txt
|
28
|
+
- LICENSE.txt
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- bin/example
|
32
|
+
- drydock.gemspec
|
33
|
+
- lib/drydock.rb
|
34
|
+
- test/command_test.rb
|
35
|
+
- doc
|
36
|
+
- doc/classes
|
37
|
+
- doc/classes/Drydock
|
38
|
+
- doc/classes/Drydock/Command.html
|
39
|
+
- doc/classes/Drydock/InvalidArgument.html
|
40
|
+
- doc/classes/Drydock/MissingArgument.html
|
41
|
+
- doc/classes/Drydock/NoCommandsDefined.html
|
42
|
+
- doc/classes/Drydock/UnknownCommand.html
|
43
|
+
- doc/classes/Drydock.html
|
44
|
+
- doc/created.rid
|
45
|
+
- doc/files
|
46
|
+
- doc/files/bin
|
47
|
+
- doc/files/bin/example.html
|
48
|
+
- doc/files/CHANGES_txt.html
|
49
|
+
- doc/files/lib
|
50
|
+
- doc/files/lib/drydock_rb.html
|
51
|
+
- doc/files/LICENSE_txt.html
|
52
|
+
- doc/files/README_rdoc.html
|
53
|
+
- doc/fr_class_index.html
|
54
|
+
- doc/fr_file_index.html
|
55
|
+
- doc/fr_method_index.html
|
56
|
+
- doc/index.html
|
57
|
+
- doc/rdoc-style.css
|
58
|
+
has_rdoc: true
|
59
|
+
homepage: http://github.com/delano/drydock
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options:
|
62
|
+
- --line-numbers
|
63
|
+
- --inline-source
|
64
|
+
- --title
|
65
|
+
- "Drydock: a DSL for command-line apps"
|
66
|
+
- --main
|
67
|
+
- README.rdoc
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
version:
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: drydock
|
85
|
+
rubygems_version: 1.2.0
|
86
|
+
signing_key:
|
87
|
+
specification_version: 1
|
88
|
+
summary: A seaworthy DSL for writing command line apps
|
89
|
+
test_files: []
|
90
|
+
|