Class: Testflight::Config
- Inherits:
-
Object
- Object
- Testflight::Config
- Defined in:
- lib/testflight/config.rb
Class Method Summary collapse
- .ad_hoc_provisioning_name ⇒ Object
- .api_token ⇒ Object
- .application_name ⇒ Object
- .architecture ⇒ Object
- .build ⇒ Object
- .build_dir ⇒ Object
- .build_name ⇒ Object
- .build_number ⇒ Object
- .commit_changes? ⇒ Boolean
-
.config ⇒ Object
Configuration Attributes.
- .configuration ⇒ Object
- .developer_name ⇒ Object
- .distribution_dsym_file ⇒ Object
- .distribution_file ⇒ Object
- .distribution_lists ⇒ Object
- .distributions_dir ⇒ Object
- .file_name_by_ext(ext) ⇒ Object
- .git ⇒ Object
- .increment_bundle? ⇒ Boolean
- .path ⇒ Object
- .project? ⇒ Boolean
- .project_dir ⇒ Object
- .project_files ⇒ Object
- .project_info ⇒ Object
- .project_info_file_name ⇒ Object
- .project_info_path ⇒ Object
- .project_name ⇒ Object
- .project_version ⇒ Object
- .project_version_short ⇒ Object
- .provisioning_dir ⇒ Object
-
.release_dir ⇒ Object
Helper Methods.
- .sdk ⇒ Object
- .sdk_version ⇒ Object
- .tag_build? ⇒ Boolean
- .team_token ⇒ Object
- .testflight ⇒ Object
- .type ⇒ Object
- .version ⇒ Object
- .workspace? ⇒ Boolean
- .workspace_name ⇒ Object
Class Method Details
.ad_hoc_provisioning_name ⇒ Object
164 165 166 167 168 169 |
# File 'lib/testflight/config.rb', line 164 def self.ad_hoc_provisioning_name @ad_hoc_provisioning_name ||= begin files = Dir.entries(provisioning_dir) files.select{|file| file.match(/mobileprovision$/)}.first end end |
.api_token ⇒ Object
95 96 97 |
# File 'lib/testflight/config.rb', line 95 def self.api_token testflight["api_token"] end |
.application_name ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/testflight/config.rb', line 144 def self.application_name @application_name ||= begin name = workspace_name || project_name name = name.split(".")[0..-2].join(".") if name name end end |
.architecture ⇒ Object
63 64 65 |
# File 'lib/testflight/config.rb', line 63 def self.architecture build["architecture"] end |
.build ⇒ Object
43 44 45 |
# File 'lib/testflight/config.rb', line 43 def self.build config["build"] end |
.build_dir ⇒ Object
152 153 154 |
# File 'lib/testflight/config.rb', line 152 def self.build_dir "#{project_dir}/build" end |
.build_name ⇒ Object
47 48 49 |
# File 'lib/testflight/config.rb', line 47 def self.build_name build["name"] || application_name end |
.build_number ⇒ Object
197 198 199 |
# File 'lib/testflight/config.rb', line 197 def self.build_number project_info["CFBundleVersion"] end |
.commit_changes? ⇒ Boolean
79 80 81 |
# File 'lib/testflight/config.rb', line 79 def self.commit_changes? git["commit_changes"] end |
.config ⇒ Object
Configuration Attributes
39 40 41 |
# File 'lib/testflight/config.rb', line 39 def self.config @config ||= YAML::load(File.open(path)) end |
.configuration ⇒ Object
67 68 69 |
# File 'lib/testflight/config.rb', line 67 def self.configuration build["configuration"] end |
.developer_name ⇒ Object
51 52 53 |
# File 'lib/testflight/config.rb', line 51 def self.developer_name build["developer_name"] end |
.distribution_dsym_file ⇒ Object
175 176 177 |
# File 'lib/testflight/config.rb', line 175 def self.distribution_dsym_file "#{distributions_dir}/#{application_name}_#{project_version_short}.app.dSYM.zip" end |
.distribution_file ⇒ Object
171 172 173 |
# File 'lib/testflight/config.rb', line 171 def self.distribution_file "#{distributions_dir}/#{application_name}_#{project_version_short}.ipa" end |
.distribution_lists ⇒ Object
91 92 93 |
# File 'lib/testflight/config.rb', line 91 def self.distribution_lists testflight["distribution_lists"] end |
.distributions_dir ⇒ Object
160 161 162 |
# File 'lib/testflight/config.rb', line 160 def self.distributions_dir "#{project_dir}/Distributions" end |
.file_name_by_ext(ext) ⇒ Object
119 120 121 |
# File 'lib/testflight/config.rb', line 119 def self.file_name_by_ext(ext) project_files.select{|file| file.match(/#{ext}$/)}.first end |
.git ⇒ Object
75 76 77 |
# File 'lib/testflight/config.rb', line 75 def self.git config["git"] end |
.increment_bundle? ⇒ Boolean
55 56 57 |
# File 'lib/testflight/config.rb', line 55 def self.increment_bundle? build["increment_bundle"] end |
.path ⇒ Object
31 32 33 |
# File 'lib/testflight/config.rb', line 31 def self.path '.testflight' end |
.project? ⇒ Boolean
140 141 142 |
# File 'lib/testflight/config.rb', line 140 def self.project? type == "project" end |
.project_dir ⇒ Object
111 112 113 |
# File 'lib/testflight/config.rb', line 111 def self.project_dir Dir.pwd end |
.project_files ⇒ Object
115 116 117 |
# File 'lib/testflight/config.rb', line 115 def self.project_files @project_files ||= Dir.entries(project_dir) end |
.project_info ⇒ Object
189 190 191 |
# File 'lib/testflight/config.rb', line 189 def self.project_info @project_info ||= Plist::parse_xml(project_info_path) end |
.project_info_file_name ⇒ Object
179 180 181 |
# File 'lib/testflight/config.rb', line 179 def self.project_info_file_name "#{application_name}-Info.plist" end |
.project_info_path ⇒ Object
183 184 185 186 187 |
# File 'lib/testflight/config.rb', line 183 def self.project_info_path files = Dir["**/#{project_info_file_name}"] return nil if files.empty? files.first end |
.project_name ⇒ Object
127 128 129 |
# File 'lib/testflight/config.rb', line 127 def self.project_name @project_name ||= file_name_by_ext('xcodeproj') end |
.project_version ⇒ Object
201 202 203 |
# File 'lib/testflight/config.rb', line 201 def self.project_version "#{version} (#{build_number})" end |
.project_version_short ⇒ Object
205 206 207 |
# File 'lib/testflight/config.rb', line 205 def self.project_version_short "#{version}.#{build_number}" end |
.provisioning_dir ⇒ Object
156 157 158 |
# File 'lib/testflight/config.rb', line 156 def self.provisioning_dir "#{project_dir}/Provisioning" end |
.release_dir ⇒ Object
Helper Methods
107 108 109 |
# File 'lib/testflight/config.rb', line 107 def self.release_dir "#{build_dir}/#{configuration}-iphoneos" end |
.sdk ⇒ Object
71 72 73 |
# File 'lib/testflight/config.rb', line 71 def self.sdk build["sdk"] end |
.sdk_version ⇒ Object
59 60 61 |
# File 'lib/testflight/config.rb', line 59 def self.sdk_version build["sdk"] end |
.tag_build? ⇒ Boolean
83 84 85 |
# File 'lib/testflight/config.rb', line 83 def self.tag_build? git["tag_build"] end |
.team_token ⇒ Object
99 100 101 |
# File 'lib/testflight/config.rb', line 99 def self.team_token testflight["team_token"] end |
.testflight ⇒ Object
87 88 89 |
# File 'lib/testflight/config.rb', line 87 def self.testflight config["testflight"] end |
.type ⇒ Object
131 132 133 134 |
# File 'lib/testflight/config.rb', line 131 def self.type return "unknown" if workspace_name.nil? and project_name.nil? @type ||= workspace_name ? 'workspace' : 'project' end |
.version ⇒ Object
193 194 195 |
# File 'lib/testflight/config.rb', line 193 def self.version project_info["CFBundleShortVersionString"] end |
.workspace? ⇒ Boolean
136 137 138 |
# File 'lib/testflight/config.rb', line 136 def self.workspace? type == "workspace" end |
.workspace_name ⇒ Object
123 124 125 |
# File 'lib/testflight/config.rb', line 123 def self.workspace_name @workspace_name ||= file_name_by_ext('xcworkspace') end |