Class: Ocean::Framework
- Inherits:
-
Object
- Object
- Ocean::Framework
- Defined in:
- lib/swordfish/helpers/framework.rb,
lib/swordfish/helpers/framework_builder.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#fwk_path ⇒ Object
readonly
Returns the value of attribute fwk_path.
-
#headers_path ⇒ Object
readonly
Returns the value of attribute headers_path.
-
#module_map_path ⇒ Object
readonly
Returns the value of attribute module_map_path.
-
#resources_path ⇒ Object
readonly
Returns the value of attribute resources_path.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#swift_module_path ⇒ Object
readonly
Returns the value of attribute swift_module_path.
-
#versions_path ⇒ Object
readonly
Returns the value of attribute versions_path.
Instance Method Summary collapse
- #delete_resources ⇒ Object
-
#initialize(name, platform) ⇒ Framework
constructor
A new instance of Framework.
- #make ⇒ Object
- #remove_current_version ⇒ Object
Constructor Details
#initialize(name, platform) ⇒ Framework
Returns a new instance of Framework.
13 14 15 16 |
# File 'lib/swordfish/helpers/framework.rb', line 13 def initialize(name, platform) @name = name @platform = platform end |
Instance Attribute Details
#fwk_path ⇒ Object (readonly)
Returns the value of attribute fwk_path.
11 12 13 |
# File 'lib/swordfish/helpers/framework.rb', line 11 def fwk_path @fwk_path end |
#headers_path ⇒ Object (readonly)
Returns the value of attribute headers_path.
5 6 7 |
# File 'lib/swordfish/helpers/framework.rb', line 5 def headers_path @headers_path end |
#module_map_path ⇒ Object (readonly)
Returns the value of attribute module_map_path.
6 7 8 |
# File 'lib/swordfish/helpers/framework.rb', line 6 def module_map_path @module_map_path end |
#resources_path ⇒ Object (readonly)
Returns the value of attribute resources_path.
7 8 9 |
# File 'lib/swordfish/helpers/framework.rb', line 7 def resources_path @resources_path end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
8 9 10 |
# File 'lib/swordfish/helpers/framework.rb', line 8 def root_path @root_path end |
#swift_module_path ⇒ Object (readonly)
Returns the value of attribute swift_module_path.
10 11 12 |
# File 'lib/swordfish/helpers/framework.rb', line 10 def swift_module_path @swift_module_path end |
#versions_path ⇒ Object (readonly)
Returns the value of attribute versions_path.
9 10 11 |
# File 'lib/swordfish/helpers/framework.rb', line 9 def versions_path @versions_path end |
Instance Method Details
#delete_resources ⇒ Object
26 27 28 29 |
# File 'lib/swordfish/helpers/framework.rb', line 26 def delete_resources Pathname.new(@resources_path).rmtree if File.exist? (@resources_path) (Pathname.new(@fwk_path) + Pathname.new('Resources')).delete if File.exist?(Pathname.new(@fwk_path) + Pathname.new('Resources')) end |
#make ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/swordfish/helpers/framework.rb', line 18 def make make_root make_framework make_headers make_resources make_current_version end |
#remove_current_version ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/swordfish/helpers/framework.rb', line 31 def remove_current_version FileUtils.rm_f(File.join(@fwk_path,@name)) FileUtils.rm_f(File.join(@fwk_path,"Headers")) FileUtils.rm_f(File.join(@fwk_path,"Resources")) FileUtils.cp_r("#{@versions_path}/.", @fwk_path) # FileUtils.remove_dir(@versions_path) FileUtils.remove_dir("#{@fwk_path}/Versions") # current_version_path = @versions_path + Pathname.new('../Current') # `ln -sf A #{current_version_path}` # `ln -sf Versions/Current/Headers #{@fwk_path}/` # `ln -sf Versions/Current/Resources #{@fwk_path}/` # `ln -sf Versions/Current/#{@name} #{@fwk_path}/` end |