Class: Pod::Command::Open
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::Open
- Defined in:
- lib/pod/command/open.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Open
constructor
A new instance of Open.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Open
Returns a new instance of Open.
17 18 19 20 21 |
# File 'lib/pod/command/open.rb', line 17 def initialize(argv) @use_appcode = (argv.shift_argument == '-a') @workspace = find_workspace_in(Pathname.pwd) super end |
Class Method Details
.options ⇒ Object
11 12 13 14 15 |
# File 'lib/pod/command/open.rb', line 11 def self. [ ['-a', 'Open in AppCode.'] ] end |
Instance Method Details
#run ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/pod/command/open.rb', line 31 def run if @use_appcode `#{appcode_executable} "#{@workspace}"` else `open "#{@workspace}"` end end |
#validate! ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/pod/command/open.rb', line 23 def validate! super raise Informative, "No xcode workspace found" unless @workspace if @use_appcode raise Informative, "Can't find `#{appcode_executable}` command line launcher. Have you created it? 'AppCode->Tools->Create Command line launcher'" unless appcode_available? end end |