Class: Phase::IPA::App

Inherits:
Object
  • Object
show all
Defined in:
lib/phase/kit/ipa/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(qualified_path, version) ⇒ App

Returns a new instance of App.



7
8
9
10
# File 'lib/phase/kit/ipa/app.rb', line 7

def initialize(qualified_path, version)
  @qualified_path, @version = qualified_path, version
  @name = ::File.basename(qualified_path, ".ipa")
end

Instance Attribute Details

#download_urlObject

Returns the value of attribute download_url.



5
6
7
# File 'lib/phase/kit/ipa/app.rb', line 5

def download_url
  @download_url
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/phase/kit/ipa/app.rb', line 4

def name
  @name
end

#qualified_pathObject (readonly)

Returns the value of attribute qualified_path.



4
5
6
# File 'lib/phase/kit/ipa/app.rb', line 4

def qualified_path
  @qualified_path
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/phase/kit/ipa/app.rb', line 4

def version
  @version
end

Instance Method Details

#ipa_filenameObject



12
13
14
# File 'lib/phase/kit/ipa/app.rb', line 12

def ipa_filename
  "#{bundle_name}-#{version}.ipa"
end

#plist_filenameObject



16
17
18
# File 'lib/phase/kit/ipa/app.rb', line 16

def plist_filename
  "#{bundle_name}-#{version}.plist"
end

#plist_xmlObject



20
21
22
23
24
25
26
27
28
29
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
# File 'lib/phase/kit/ipa/app.rb', line 20

def plist_xml
  <<-EOXML.strip_heredoc
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>items</key>
      <array>
        <dict>
          <key>assets</key>
          <array>
            <dict>
              <key>kind</key>
              <string>software-package</string>
              <key>url</key>
              <string>https://s3.amazonaws.com/orca-static-assets/apps/#{ipa_filename}</string>
            </dict>
          </array>
          <key>metadata</key>
          <dict>
            <key>bundle-identifier</key>
            <string>#{bundle_id_prefix}.#{bundle_name}</string>
            <key>bundle-version</key>
            <string>#{version}</string>
            <key>kind</key>
            <string>software</string>
            <key>title</key>
            <string>#{human_name}</string>
          </dict>
        </dict>
      </array>
    </dict>
    </plist>
  EOXML
end