Sha256: 85caa7f425d8c4e794c1517f34916a30f0a1934192c4945212958e70564fb93e

Contents?: true

Size: 593 Bytes

Versions: 3

Compression:

Stored size: 593 Bytes

Contents

module Birdwatcher
  module Commands
    class Use < Birdwatcher::Command
      self.meta = {
        :description => "Load specified module",
        :names       => %w(use load),
        :usage       => "use MODULE_PATH"
      }

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
birdwatcher-0.4.0 lib/birdwatcher/commands/use.rb
birdwatcher-0.3.1 lib/birdwatcher/commands/use.rb
birdwatcher-0.1.0 lib/birdwatcher/commands/use.rb