Module: Vendor::CLI::Console

Defined in:
lib/vendor/cli/console.rb

Constant Summary collapse

RESOURCE_PATH =
File.join(Vendor.root, "..", "spec", "support", "resources")
PROJECT_RESOURCE_PATH =
File.join(RESOURCE_PATH, "projects")

Class Method Summary collapse

Class Method Details

.example_project!(name) ⇒ Object



24
25
26
# File 'lib/vendor/cli/console.rb', line 24

def self.example_project!(name)
  Vendor::XCode::Project.new(File.join(PROJECT_RESOURCE_PATH, "#{name}/#{name}.xcodeproj"))
end

.reload!Object

This reload method kinda works. It works if you change/add methods, but if you remove methods from a class, they still seem to hang around. I believe there is a fair amount of magic in rails that lets you call a reload!, but for the save of Vendor development, this will suffice.



14
15
16
17
18
19
20
21
22
# File 'lib/vendor/cli/console.rb', line 14

def self.reload!
  begin
    old_verbose, $VERBOSE = $VERBOSE, nil
    $".grep(/\/lib\/vendor/).each {|e| $".delete(e) && require(e) }
  ensure
    $VERBOSE = old_verbose
  end
  "Reloaded!"
end