Class: Pod::Command::Spec::Doc
- Inherits:
-
Pod::Command::Spec
- Object
- Pod::Command::Spec
- Pod::Command::Spec::Doc
- Defined in:
- lib/pod/command/spec/doc.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Doc
constructor
A new instance of Doc.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Doc
Returns a new instance of Doc.
15 16 17 18 |
# File 'lib/pod/command/spec/doc.rb', line 15 def initialize(argv) @name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 |
# File 'lib/pod/command/spec/doc.rb', line 25 def run path = get_path_of_spec(@name) spec = Specification.from_file(path) UI.puts "Opening #{spec.name} documentation" `open "http://cocoadocs.org/docsets/#{spec.name}"` end |
#validate! ⇒ Object
20 21 22 23 |
# File 'lib/pod/command/spec/doc.rb', line 20 def validate! super help! 'A Pod name is required.' unless @name end |