Class: Settings
- Inherits:
-
Object
- Object
- Settings
- Defined in:
- lib/settings.rb
Instance Attribute Summary collapse
-
#deployed_at ⇒ Object
Returns the value of attribute deployed_at.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#host ⇒ Object
Returns the value of attribute host.
-
#icon_path ⇒ Object
Returns the value of attribute icon_path.
-
#icon_source_path ⇒ Object
Returns the value of attribute icon_source_path.
-
#ipa_file ⇒ Object
Returns the value of attribute ipa_file.
-
#is_enterprise ⇒ Object
Returns the value of attribute is_enterprise.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#plist_file ⇒ Object
Returns the value of attribute plist_file.
-
#provision_file_name ⇒ Object
Returns the value of attribute provision_file_name.
-
#remote_user ⇒ Object
Returns the value of attribute remote_user.
-
#template_file ⇒ Object
Returns the value of attribute template_file.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize(options) ⇒ Settings
constructor
A new instance of Settings.
- #user_and_host ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Settings
Returns a new instance of Settings.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/settings.rb', line 5 def initialize() @name = [:name] @filename = [:filename] @url = [:url] @url+= "/" unless @url.match(/\/$/) @host = [:host] @path = [:path] @type = [:type] @remote_user = [:remote_user] @is_enterprise = [:enterprise] if @filename.nil? || @filename.empty? @filename = @name.gsub(" ", "_") end @provision_file_name = "#{@filename}.mobileprovision" @plist_file = "#{@filename}.plist" @ipa_file = "#{@filename}.ipa" @plist_file_url = "#{@url}#{@plist_file}" @template_file = [:template] || "#{COMBAT_ROOT}/templates/template.erb" @deployer = %x(whoami).strip if (type == 'android') @icon_source_path = "res/drawable-hdpi/icon.png" # @qrcode = "http://qrcode.kaywa.com/img.php?s=6&d=#{ERB::Util.url_encode(@url)}#{@filename}.apk" else @icon_source_path = "[email protected]" end @qrcode = "http://qrcode.kaywa.com/img.php?s=6&d=#{ERB::Util.url_encode(@url)}" @icon_path = "icon.png" end |
Instance Attribute Details
#deployed_at ⇒ Object
Returns the value of attribute deployed_at.
3 4 5 |
# File 'lib/settings.rb', line 3 def deployed_at @deployed_at end |
#filename ⇒ Object
Returns the value of attribute filename.
2 3 4 |
# File 'lib/settings.rb', line 2 def filename @filename end |
#host ⇒ Object
Returns the value of attribute host.
2 3 4 |
# File 'lib/settings.rb', line 2 def host @host end |
#icon_path ⇒ Object
Returns the value of attribute icon_path.
3 4 5 |
# File 'lib/settings.rb', line 3 def icon_path @icon_path end |
#icon_source_path ⇒ Object
Returns the value of attribute icon_source_path.
3 4 5 |
# File 'lib/settings.rb', line 3 def icon_source_path @icon_source_path end |
#ipa_file ⇒ Object
Returns the value of attribute ipa_file.
2 3 4 |
# File 'lib/settings.rb', line 2 def ipa_file @ipa_file end |
#is_enterprise ⇒ Object
Returns the value of attribute is_enterprise.
2 3 4 |
# File 'lib/settings.rb', line 2 def is_enterprise @is_enterprise end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/settings.rb', line 2 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/settings.rb', line 2 def path @path end |
#plist_file ⇒ Object
Returns the value of attribute plist_file.
2 3 4 |
# File 'lib/settings.rb', line 2 def plist_file @plist_file end |
#provision_file_name ⇒ Object
Returns the value of attribute provision_file_name.
2 3 4 |
# File 'lib/settings.rb', line 2 def provision_file_name @provision_file_name end |
#remote_user ⇒ Object
Returns the value of attribute remote_user.
2 3 4 |
# File 'lib/settings.rb', line 2 def remote_user @remote_user end |
#template_file ⇒ Object
Returns the value of attribute template_file.
2 3 4 |
# File 'lib/settings.rb', line 2 def template_file @template_file end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/settings.rb', line 2 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/settings.rb', line 2 def url @url end |
Instance Method Details
#get_binding ⇒ Object
42 43 44 |
# File 'lib/settings.rb', line 42 def get_binding binding end |
#user_and_host ⇒ Object
38 39 40 |
# File 'lib/settings.rb', line 38 def user_and_host "#{remote_user}@#{host}" end |
#valid? ⇒ Boolean
46 47 48 |
# File 'lib/settings.rb', line 46 def valid? @name != nil && @url != nil end |