Sha256: 6415e936056f236b00f9c542b0b71761e7095ba83d7cca2bb85366d5aad7c545

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

module Cumuli
  class Commander
    attr_reader :args

    def initialize(args)
      @args = args
    end

    def build
      "#{rvm_preface} foreman start #{args.foreman_options}"
    end

    def rvm_preface
      "rvm ruby-#{rvm_version} exec" if rvmrc?
    end

    def rvmrc_descriptor
      './.rvmrc'
    end

    def rvmrc?
      File.exist?(rvmrc_descriptor)
    end

    def rvm_version
      File.read(rvmrc_descriptor).match(/(\d\.\d\.\d@\w+)/)[0]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cumuli-0.1.0 lib/cumuli/cli/commander.rb