Class: Workshop::Project::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/workshop/project/configuration.rb,
lib/workshop/project/configuration/build.rb,
lib/workshop/project/configuration/upload.rb

Defined Under Namespace

Classes: Build, Upload

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
# File 'lib/workshop/project/configuration.rb', line 7

def initialize
  self.arduino_app_directory = '/Applications/Arduino.app'
  self.project_name = default_project_name
  self.source_directory = default_source_directory
  self.build_directory = default_build_directory
  self.libraries = []
  self.build = Build.new
  self.upload = Upload.new
end

Instance Attribute Details

#arduino_app_directoryObject

Returns the value of attribute arduino_app_directory.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def arduino_app_directory
  @arduino_app_directory
end

#buildObject

Returns the value of attribute build.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def build
  @build
end

#build_directoryObject

Returns the value of attribute build_directory.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def build_directory
  @build_directory
end

#librariesObject

Returns the value of attribute libraries.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def libraries
  @libraries
end

#main_filenameObject

Returns the value of attribute main_filename.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def main_filename
  @main_filename
end

#project_nameObject

Returns the value of attribute project_name.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def project_name
  @project_name
end

#source_directoryObject

Returns the value of attribute source_directory.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def source_directory
  @source_directory
end

#uploadObject

Returns the value of attribute upload.



4
5
6
# File 'lib/workshop/project/configuration.rb', line 4

def upload
  @upload
end

Instance Method Details

#app_directoryObject



33
34
35
# File 'lib/workshop/project/configuration.rb', line 33

def app_directory
  Dir.pwd
end

#build_coreObject



37
38
39
# File 'lib/workshop/project/configuration.rb', line 37

def build_core
  build.core
end

#build_f_cpuObject



49
50
51
# File 'lib/workshop/project/configuration.rb', line 49

def build_f_cpu
  build.f_cpu
end

#build_mcuObject



45
46
47
# File 'lib/workshop/project/configuration.rb', line 45

def build_mcu
  build.mcu
end

#build_pidObject



57
58
59
# File 'lib/workshop/project/configuration.rb', line 57

def build_pid
  build.pid
end

#build_variantObject



41
42
43
# File 'lib/workshop/project/configuration.rb', line 41

def build_variant
  build.variant
end

#build_vidObject



53
54
55
# File 'lib/workshop/project/configuration.rb', line 53

def build_vid
  build.vid
end

#default_build_directoryObject



25
26
27
# File 'lib/workshop/project/configuration.rb', line 25

def default_build_directory
  app_directory + '/build'
end

#default_project_nameObject



21
22
23
# File 'lib/workshop/project/configuration.rb', line 21

def default_project_name
  app_directory.split('/').last.parameterize.underscore
end

#default_source_directoryObject



29
30
31
# File 'lib/workshop/project/configuration.rb', line 29

def default_source_directory
  app_directory + '/src'
end

#includesObject



17
18
19
# File 'lib/workshop/project/configuration.rb', line 17

def includes
  build.includes
end

#upload_protocolObject



61
62
63
# File 'lib/workshop/project/configuration.rb', line 61

def upload_protocol
  upload.protocol
end

#upload_speedObject



65
66
67
# File 'lib/workshop/project/configuration.rb', line 65

def upload_speed
  upload.speed
end