Class: Cocoaout::Command
- Inherits:
-
Thor
- Object
- Thor
- Cocoaout::Command
- Includes:
- Thor::Actions
- Defined in:
- lib/cocoaout/command.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/cocoaout/command.rb', line 7 def config @config end |
Instance Method Details
#build ⇒ Object
30 31 32 33 34 |
# File 'lib/cocoaout/command.rb', line 30 def build load_cocoaout_file config_name = [:configration_name] || "Release" self.build_project(config_name) end |
#clean ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/cocoaout/command.rb', line 58 def clean load_cocoaout_file output = `#{Cocoaout::xcode_build} clean -scheme #{Cocoaout::config.app_name}` if not $?.success? puts output and exit 0 else puts "Clean successed." end end |
#deploy ⇒ Object
41 42 43 44 45 46 |
# File 'lib/cocoaout/command.rb', line 41 def deploy load_cocoaout_file config_name = [:configration_name] || "Release" self.build_project(config_name) self.create_dmg_with_release([:output]) end |
#init(app_name = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cocoaout/command.rb', line 14 def init(app_name = nil) puts "Generate Cocoaoutfile." @sdk = [:sdk] @app_name = app_name || Dir.pwd.split("/").last @bg_file_name = [:bg_file_name] create_file "Cocoaoutfile" do src = "#{__dir__}/templates/Cocoaoutfile.erb" ERB.new(File.read src).result binding end end |