Module: Rid::Commands

Defined in:
lib/rid/commands.rb

Overview

Rid Commands module defines the available Rid commands. A Rid command is a commander command. See github.com/visionmedia/commander for more information.

Class Method Summary collapse

Class Method Details

.gemsObject

List all installed rid gems, which starts with rid-.



39
40
41
42
43
44
45
46
# File 'lib/rid/commands.rb', line 39

def self.gems
  Gem.path.
    map { |p| Dir[File.join(p, 'gems/rid-*')] }.
    flatten.
    map { |g| File.basename(g).sub /-(\d+\.)*(\d+)$/, '' }.
    uniq.
    sort
end

.versionObject

Returns the version specified in VERSION file at project root.



9
10
11
12
# File 'lib/rid/commands.rb', line 9

def self.version
  versionfile = File.expand_path('../../../VERSION', __FILE__)
  File.read(versionfile) if File.file?(versionfile)
end