Class: Generamba::CodeModule
- Inherits:
-
Object
- Object
- Generamba::CodeModule
- Defined in:
- lib/generamba/code_generation/code_module.rb
Overview
Represents currently generating code module
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#cartfile_path ⇒ Object
readonly
Returns the value of attribute cartfile_path.
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#custom_parameters ⇒ Object
readonly
Returns the value of attribute custom_parameters.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#podfile_path ⇒ Object
readonly
Returns the value of attribute podfile_path.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#product_module_name ⇒ Object
readonly
Returns the value of attribute product_module_name.
-
#project_file_path ⇒ Object
readonly
Returns the value of attribute project_file_path.
-
#project_group_path ⇒ Object
readonly
Returns the value of attribute project_group_path.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#project_targets ⇒ Object
readonly
Returns the value of attribute project_targets.
-
#test_file_path ⇒ Object
readonly
Returns the value of attribute test_file_path.
-
#test_group_path ⇒ Object
readonly
Returns the value of attribute test_group_path.
-
#test_targets ⇒ Object
readonly
Returns the value of attribute test_targets.
-
#xcodeproj_path ⇒ Object
readonly
Returns the value of attribute xcodeproj_path.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(name, rambafile, options) ⇒ CodeModule
constructor
A new instance of CodeModule.
Constructor Details
#initialize(name, rambafile, options) ⇒ CodeModule
Returns a new instance of CodeModule.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/generamba/code_generation/code_module.rb', line 30 def initialize(name, rambafile, ) # Base initialization @name = name @description = [:description] ? [:description] : "#{name} module" @author = rambafile[AUTHOR_NAME_KEY] ? rambafile[AUTHOR_NAME_KEY] : UserPreferences.obtain_username @company = rambafile[COMPANY_KEY] @year = Time.now.year.to_s @prefix = rambafile[PROJECT_PREFIX_KEY] @project_name = rambafile[PROJECT_NAME_KEY] @product_module_name = rambafile[PRODUCT_MODULE_NAME_KEY] @product_module_name = @project_name.gsub(C99IDENTIFIER, '_') if !@product_module_name && @project_name @xcodeproj_path = rambafile[XCODEPROJ_PATH_KEY] setup_file_and_group_paths(rambafile[PROJECT_FILE_PATH_KEY], rambafile[PROJECT_GROUP_PATH_KEY], PATH_TYPE_PROJECT) setup_file_and_group_paths(rambafile[TEST_FILE_PATH_KEY], rambafile[TEST_GROUP_PATH_KEY], PATH_TYPE_TEST) @project_targets = [rambafile[PROJECT_TARGET_KEY]] if rambafile[PROJECT_TARGET_KEY] @project_targets = rambafile[PROJECT_TARGETS_KEY] if rambafile[PROJECT_TARGETS_KEY] @test_targets = [rambafile[TEST_TARGET_KEY]] if rambafile[TEST_TARGET_KEY] @test_targets = rambafile[TEST_TARGETS_KEY] if rambafile[TEST_TARGETS_KEY] # Custom parameters @custom_parameters = [:custom_parameters] # Options adaptation @author = [:author] if [:author] @project_targets = [:project_targets].split(',') if [:project_targets] @test_targets = [:test_targets].split(',') if [:test_targets] setup_file_and_group_paths([:project_file_path], [:project_group_path], PATH_TYPE_PROJECT) setup_file_and_group_paths([:test_file_path], [:test_group_path], PATH_TYPE_TEST) # The priority is given to `module_path` and 'test_path' options setup_file_and_group_paths([:module_path], [:module_path], PATH_TYPE_PROJECT) setup_file_and_group_paths([:test_path], [:test_path], PATH_TYPE_TEST) @podfile_path = rambafile[PODFILE_PATH_KEY] if rambafile[PODFILE_PATH_KEY] @cartfile_path = rambafile[CARTFILE_PATH_KEY] if rambafile[CARTFILE_PATH_KEY] end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def @author end |
#cartfile_path ⇒ Object (readonly)
Returns the value of attribute cartfile_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def cartfile_path @cartfile_path end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def company @company end |
#custom_parameters ⇒ Object (readonly)
Returns the value of attribute custom_parameters.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def custom_parameters @custom_parameters end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def name @name end |
#podfile_path ⇒ Object (readonly)
Returns the value of attribute podfile_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def podfile_path @podfile_path end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def prefix @prefix end |
#product_module_name ⇒ Object (readonly)
Returns the value of attribute product_module_name.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def product_module_name @product_module_name end |
#project_file_path ⇒ Object (readonly)
Returns the value of attribute project_file_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def project_file_path @project_file_path end |
#project_group_path ⇒ Object (readonly)
Returns the value of attribute project_group_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def project_group_path @project_group_path end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def project_name @project_name end |
#project_targets ⇒ Object (readonly)
Returns the value of attribute project_targets.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def project_targets @project_targets end |
#test_file_path ⇒ Object (readonly)
Returns the value of attribute test_file_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def test_file_path @test_file_path end |
#test_group_path ⇒ Object (readonly)
Returns the value of attribute test_group_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def test_group_path @test_group_path end |
#test_targets ⇒ Object (readonly)
Returns the value of attribute test_targets.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def test_targets @test_targets end |
#xcodeproj_path ⇒ Object (readonly)
Returns the value of attribute xcodeproj_path.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def xcodeproj_path @xcodeproj_path end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
11 12 13 |
# File 'lib/generamba/code_generation/code_module.rb', line 11 def year @year end |