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
- .build ⇒ Object
- .build_dir ⇒ Object
- .build_number ⇒ Object
- .commit_changes? ⇒ Boolean
-
.config ⇒ Object
Configuration Attributes.
- .developer_name ⇒ 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
Helper Methods.
- .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
- .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
144 145 146 147 148 149 |
# File 'lib/testflight/config.rb', line 144 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
79 80 81 |
# File 'lib/testflight/config.rb', line 79 def self.api_token testflight["api_token"] end |
.application_name ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/testflight/config.rb', line 124 def self.application_name @application_name ||= begin name = workspace_name || project_name name = name.split(".")[0..-2].join(".") if name name end end |
.build ⇒ Object
43 44 45 |
# File 'lib/testflight/config.rb', line 43 def self.build config["build"] end |
.build_dir ⇒ Object
132 133 134 |
# File 'lib/testflight/config.rb', line 132 def self.build_dir "#{project_dir}/build" end |
.build_number ⇒ Object
173 174 175 |
# File 'lib/testflight/config.rb', line 173 def self.build_number project_info["CFBundleVersion"] end |
.commit_changes? ⇒ Boolean
63 64 65 |
# File 'lib/testflight/config.rb', line 63 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 |
.developer_name ⇒ Object
47 48 49 |
# File 'lib/testflight/config.rb', line 47 def self.developer_name build["developer_name"] end |
.distribution_file ⇒ Object
151 152 153 |
# File 'lib/testflight/config.rb', line 151 def self.distribution_file "#{distributions_dir}/#{application_name}_#{project_version_short}.ipa" end |
.distribution_lists ⇒ Object
75 76 77 |
# File 'lib/testflight/config.rb', line 75 def self.distribution_lists testflight["distribution_lists"] end |
.distributions_dir ⇒ Object
140 141 142 |
# File 'lib/testflight/config.rb', line 140 def self.distributions_dir "#{project_dir}/Distributions" end |
.file_name_by_ext(ext) ⇒ Object
99 100 101 |
# File 'lib/testflight/config.rb', line 99 def self.file_name_by_ext(ext) project_files.select{|file| file.match(/#{ext}$/)}.first end |
.git ⇒ Object
59 60 61 |
# File 'lib/testflight/config.rb', line 59 def self.git config["git"] end |
.increment_bundle? ⇒ Boolean
51 52 53 |
# File 'lib/testflight/config.rb', line 51 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
120 121 122 |
# File 'lib/testflight/config.rb', line 120 def self.project? type == "project" end |
.project_dir ⇒ Object
Helper Methods
91 92 93 |
# File 'lib/testflight/config.rb', line 91 def self.project_dir Dir.pwd end |
.project_files ⇒ Object
95 96 97 |
# File 'lib/testflight/config.rb', line 95 def self.project_files @project_files ||= Dir.entries(project_dir) end |
.project_info ⇒ Object
165 166 167 |
# File 'lib/testflight/config.rb', line 165 def self.project_info @project_info ||= Plist::parse_xml(project_info_path) end |
.project_info_file_name ⇒ Object
155 156 157 |
# File 'lib/testflight/config.rb', line 155 def self.project_info_file_name "#{application_name}-Info.plist" end |
.project_info_path ⇒ Object
159 160 161 162 163 |
# File 'lib/testflight/config.rb', line 159 def self.project_info_path files = Dir["**/#{project_info_file_name}"] return nil if files.empty? files.first end |
.project_name ⇒ Object
107 108 109 |
# File 'lib/testflight/config.rb', line 107 def self.project_name @project_name ||= file_name_by_ext('xcodeproj') end |
.project_version ⇒ Object
177 178 179 |
# File 'lib/testflight/config.rb', line 177 def self.project_version "#{version} (#{build_number})" end |
.project_version_short ⇒ Object
181 182 183 |
# File 'lib/testflight/config.rb', line 181 def self.project_version_short "#{version}.#{build_number}" end |
.provisioning_dir ⇒ Object
136 137 138 |
# File 'lib/testflight/config.rb', line 136 def self.provisioning_dir "#{project_dir}/Provisioning" end |
.sdk_version ⇒ Object
55 56 57 |
# File 'lib/testflight/config.rb', line 55 def self.sdk_version build["sdk"] end |
.tag_build? ⇒ Boolean
67 68 69 |
# File 'lib/testflight/config.rb', line 67 def self.tag_build? git["tag_build"] end |
.team_token ⇒ Object
83 84 85 |
# File 'lib/testflight/config.rb', line 83 def self.team_token testflight["team_token"] end |
.testflight ⇒ Object
71 72 73 |
# File 'lib/testflight/config.rb', line 71 def self.testflight config["testflight"] end |
.type ⇒ Object
111 112 113 114 |
# File 'lib/testflight/config.rb', line 111 def self.type return "unknown" if workspace_name.nil? and project_name.nil? @type ||= workspace_name ? 'workspace' : 'project' end |
.version ⇒ Object
169 170 171 |
# File 'lib/testflight/config.rb', line 169 def self.version project_info["CFBundleShortVersionString"] end |
.workspace? ⇒ Boolean
116 117 118 |
# File 'lib/testflight/config.rb', line 116 def self.workspace? type == "workspace" end |
.workspace_name ⇒ Object
103 104 105 |
# File 'lib/testflight/config.rb', line 103 def self.workspace_name @workspace_name ||= file_name_by_ext('xcworkspace') end |