Class: Birdwatcher::Commands::Use

Inherits:
Birdwatcher::Command show all
Defined in:
lib/birdwatcher/commands/use.rb

Constant Summary

Constants inherited from Birdwatcher::Command

Birdwatcher::Command::ARGUMENT_SEPARATOR

Constants included from Birdwatcher::Concerns::Concurrency

Birdwatcher::Concerns::Concurrency::DEFAULT_THREAD_POOL_SIZE

Constants included from Birdwatcher::Concerns::Core

Birdwatcher::Concerns::Core::DATA_DIRECTORY

Instance Attribute Summary

Attributes inherited from Birdwatcher::Command

#arguments

Instance Method Summary collapse

Methods inherited from Birdwatcher::Command

auto_completion, auto_completion_strings, descendants, detailed_usage, #execute, has_name?, meta, meta=

Methods included from Birdwatcher::Concerns::Concurrency

included, #thread_pool

Methods included from Birdwatcher::Concerns::Persistence

included, #save_status, #save_user

Methods included from Birdwatcher::Concerns::Presentation

included, #make_status_summary_output, #make_url_summary_output, #make_user_details_output, #make_user_summary_output, #output_status_summary, #output_user_details, #output_user_summary, #page_text

Methods included from Birdwatcher::Concerns::Outputting

#confirm, #error, #fatal, included, #info, #line_separator, #newline, #output, #output_formatted, #task, #warn

Methods included from Birdwatcher::Concerns::Util

#escape_html, #excerpt, included, #parse_time, #pluralize, #strip_control_characters, #strip_html, #suppress_output, #suppress_warnings, #time_ago_in_words, #unescape_html

Methods included from Birdwatcher::Concerns::Core

#console, #current_workspace, #current_workspace=, #database, included, #klout_client, #read_data_file, #twitter_client

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/birdwatcher/commands/use.rb', line 10

def run
  if !arguments?
    error("You must provide a module path")
    return false
  end

  if !_module = Birdwatcher::Module.module_by_path(arguments.first)
    error("Unknown module: #{arguments.first.bold}")
    return false
  end

  console.current_module = _module
end