Class: Slicecraft::Syncer

Inherits:
Object
  • Object
show all
Defined in:
lib/slicecraft.rb

Direct Known Subclasses

Delivery, Preview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Syncer

Returns a new instance of Syncer.



31
32
33
# File 'lib/slicecraft.rb', line 31

def initialize(options)
  @path = options[:directory]
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



28
29
30
# File 'lib/slicecraft.rb', line 28

def path
  @path
end

#settingsObject

Returns the value of attribute settings.



29
30
31
# File 'lib/slicecraft.rb', line 29

def settings
  @settings
end

Instance Method Details

#build_pathObject



47
48
49
# File 'lib/slicecraft.rb', line 47

def build_path
  "#{@path}/build/"
end

#hashed_pathObject



35
36
37
# File 'lib/slicecraft.rb', line 35

def hashed_path
  "#{project_name}_#{Digest::SHA1.hexdigest('12RThh' + project_name)}"
end

#project_nameObject



43
44
45
# File 'lib/slicecraft.rb', line 43

def project_name
  @path.split('/').last
end

#result_urlObject



39
40
41
# File 'lib/slicecraft.rb', line 39

def result_url
  "#{settings['result_url']}/#{hashed_path}"
end