class Stubby::Stub

Attributes

modes[RW]
path[RW]
target[RW]

Public Class Methods

new(path, target=nil) click to toggle source

TODO: target is mode, rename

# File lib/stubby/stub.rb, line 6
def initialize(path, target=nil)
  self.path = path
  self.target = target
end

Public Instance Methods

options() click to toggle source
# File lib/stubby/stub.rb, line 35
def options
  @options ||= expand(modes[@environment] || {})
end
path=(v) click to toggle source
# File lib/stubby/stub.rb, line 20
def path=(v)
  unless v and File.exists?(File.expand_path(v))
    puts "'#{v}' not found. Use --config to specify a different config file"
    exit
  end

  @path = File.expand_path(v)
end
target=(environment) click to toggle source
# File lib/stubby/stub.rb, line 29
def target=(environment)
  @environment = environment 
  @options = nil
  options
end

Private Instance Methods

expand(options) click to toggle source
# File lib/stubby/stub.rb, line 56
def expand(options)
  Stubby::Api.expand_rules(options) 
end