Class: Vendor::CLI::App
- Inherits:
-
Thor
- Object
- Thor
- Vendor::CLI::App
- Defined in:
- lib/vendor/cli/app.rb
Defined Under Namespace
Classes: Library
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Exit with 1 if thor encounters an error (such as command missing).
Instance Method Summary collapse
- #auth ⇒ Object
- #console ⇒ Object
- #init ⇒ Object
-
#initialize ⇒ App
constructor
A new instance of App.
- #install ⇒ Object
- #version ⇒ Object
Constructor Details
Class Method Details
.exit_on_failure? ⇒ Boolean
Exit with 1 if thor encounters an error (such as command missing)
128 129 130 |
# File 'lib/vendor/cli/app.rb', line 128 def self.exit_on_failure? true end |
Instance Method Details
#auth ⇒ Object
105 106 107 108 109 110 111 112 113 |
# File 'lib/vendor/cli/app.rb', line 105 def auth begin Vendor::CLI::Auth.with_api_key do |api_key| Vendor.ui.success "Successfully authenticated" end rescue Vendor::API::Error => e Vendor.ui.error "Error: #{e.}" end end |
#console ⇒ Object
116 117 118 119 120 |
# File 'lib/vendor/cli/app.rb', line 116 def console # Need to clear the arguments otherwise they are passed through to RIPL ARGV.clear Ripl.start :binding => Vendor::CLI::Console.instance_eval{ binding } end |
#init ⇒ Object
100 101 102 |
# File 'lib/vendor/cli/app.rb', line 100 def init Vendor::Template.copy "Vendorfile" end |
#install ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/vendor/cli/app.rb', line 74 def install vendorfile = File.("Vendorfile") unless File.exist?(vendorfile) Vendor.ui.error "Could not find Vendorfile" exit 1 end project_paths = Dir["*.xcodeproj"] loader = Vendor::VendorFile::Loader.new loader.load vendorfile project_paths.each do |project_path| Vendor.ui.info "Examining #{project_path}" loader.libraries_to_install do |library,targets| library.download Vendor::XCode::Project.new(project_path).install(library,targets) end end end |