Module: Gamefic::Sdk::Tasks::Common

Included in:
Ruby, Web
Defined in:
lib/gamefic-sdk/tasks/common.rb

Overview

Common methods for Rake tasks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



12
13
14
# File 'lib/gamefic-sdk/tasks/common.rb', line 12

def directory
  @directory
end

Instance Method Details

#absolute_pathObject



18
19
20
# File 'lib/gamefic-sdk/tasks/common.rb', line 18

def absolute_path
  @absolute_path ||= Pathname.new(directory).realpath.to_s
end

#initialize(directory = '.') ⇒ Object



14
15
16
# File 'lib/gamefic-sdk/tasks/common.rb', line 14

def initialize directory = '.'
  @directory = directory
end

#plot_classObject



22
23
24
# File 'lib/gamefic-sdk/tasks/common.rb', line 22

def plot_class
  GAMEFIC_PLOT_CLASS
end

#string_to_constant(string) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/gamefic-sdk/tasks/common.rb', line 26

def string_to_constant string
  space = Object
  string.split('::').each do |part|
    space = space.const_get(part)
  end
  space
end