rtfm 0.5.0 → 0.5.1
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.
- data/VERSION +1 -1
- data/lib/rtfm/sections/synopsis.rb +11 -0
- data/lib/rubygems_plugin.rb +0 -1
- metadata +1 -1
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.1
|
|
@@ -2,9 +2,17 @@ module RTFM
|
|
|
2
2
|
class SynopsisSection
|
|
3
3
|
def initialize
|
|
4
4
|
@options = []
|
|
5
|
+
@arguments = []
|
|
5
6
|
yield self if block_given?
|
|
6
7
|
end
|
|
7
8
|
|
|
9
|
+
def add_argument(*args)
|
|
10
|
+
@arguments.concat args
|
|
11
|
+
end
|
|
12
|
+
alias_method :add_arguments, :add_argument
|
|
13
|
+
alias_method :argument, :add_argument
|
|
14
|
+
alias_method :arguments, :add_argument
|
|
15
|
+
|
|
8
16
|
def add_option(*args)
|
|
9
17
|
if args.size == 1 && args.first.is_a?(Option)
|
|
10
18
|
then @options << args.first
|
|
@@ -35,6 +43,9 @@ module RTFM
|
|
|
35
43
|
long_args.each do |opt|
|
|
36
44
|
out << opt.to_groff(:option)
|
|
37
45
|
end
|
|
46
|
+
@arguments.each do |arg|
|
|
47
|
+
out.Ar arg
|
|
48
|
+
end
|
|
38
49
|
end
|
|
39
50
|
end
|
|
40
51
|
end
|
data/lib/rubygems_plugin.rb
CHANGED