Class: Calatrava::Project

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, overrides = {}) ⇒ Project

Returns a new instance of Project.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/calatrava/project.rb', line 15

def initialize(name, overrides = {})
  @name = name
  @slug = name.gsub(" ", "_").downcase
  @title = @name[0..0].upcase + @name[1..-1]
  @options = {}
  if File.exists?(@name) && File.directory?(@name)
    @path = File.expand_path(@name)
    @options = YAML.load(IO.read(File.join(@name, 'calatrava.yml')))
    @name = @options[:project_name]
  end
  @options.merge! overrides

  @config = Configuration.new
  @kernel = Kernel.new(@path)
  @shell = Shell.new(@path)
  @mobile_web = MobileWebApp.new(@path, Manifest.new(@path, 'web', @kernel, @shell))
  @ios = IosApp.new(@path, Manifest.new(@path, 'ios', @kernel, @shell))
  @droid = DroidApp.new(@path, @name, Manifest.new(@path, 'droid', @kernel, @shell))
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def config
  @config
end

#droidObject (readonly)

Returns the value of attribute droid.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def droid
  @droid
end

#iosObject (readonly)

Returns the value of attribute ios.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def ios
  @ios
end

#kernelObject (readonly)

Returns the value of attribute kernel.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def kernel
  @kernel
end

#mobile_webObject (readonly)

Returns the value of attribute mobile_web.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def mobile_web
  @mobile_web
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/calatrava/project.rb', line 13

def name
  @name
end

Class Method Details

.currentObject



9
10
11
# File 'lib/calatrava/project.rb', line 9

def self.current
  @@current
end

.here(directory) ⇒ Object



5
6
7
# File 'lib/calatrava/project.rb', line 5

def self.here(directory)
  @@current = Project.new(directory)
end