Class: Yolo::Formatters::ProgressFormatter
- Inherits:
-
XcodeBuild::Formatters::ProgressFormatter
- Object
- XcodeBuild::Formatters::ProgressFormatter
- Yolo::Formatters::ProgressFormatter
- Defined in:
- lib/yolo/formatters/progress_formatter.rb
Overview
Outputs formatted progress messages to the console
Instance Method Summary collapse
-
#config_created(config) ⇒ Object
Outputs a green string stating that the config file was created.
-
#config_updated(config) ⇒ Object
Outputs a green string stating that the config file was updated.
-
#created_release(version) ⇒ Object
Outputs a green string stating that the github release was created.
-
#creating_github_release ⇒ Object
Outputs a string stating that the github release is being generated.
-
#deploy_complete(url, password) ⇒ Object
Outputs a formatted string stating that the OTA deploy is complete.
-
#deploying_ipa(ipa) ⇒ Object
Outputs an underlined bold string stating the ipa is being deployed and it’s file size.
-
#email_sent(to) ⇒ Object
Outputs a green string stating the email was sent.
-
#filesize(file) ⇒ Number
Calculates the size of a file.
-
#generating_ipa ⇒ Object
Outputs an underlined bold string stating that the ipa is being generated.
-
#generating_notes ⇒ Object
Outputs an underlined bold string stating that the release notes are being generated.
-
#github_released ⇒ Object
Outputs a green string stating that the github release finished.
-
#github_uploading ⇒ Object
Outputs an underlined bold string stating that the is uploading.
-
#ipa_generated(ipa) ⇒ Object
Outputs a green string stating that the ipa was deployed.
-
#new_commit(commit) ⇒ Object
Outputs a cyan string stating that a new commit has been found.
-
#new_tag(tag) ⇒ Object
Outputs a cyan string stating that a new tag has been found.
-
#no_new_commit ⇒ Object
Outputs a red string stating that no new commit was found.
-
#no_new_tag ⇒ Object
Outputs a red string stating that no new tag was found.
-
#notes_generated(notes) ⇒ Object
Outputs a green string stating that the release notes have been generated.
-
#rakefile_created(file) ⇒ type
Outputs a green string stating that the rakefile was created.
-
#sending_email ⇒ Object
Outputs an underlined bold string stating that the notification email is being sent.
-
#setup_complete ⇒ Object
Outputs a green string stating that setup is complete.
-
#tests_generated(directory) ⇒ Object
Outputs a green string stating that the calabash tests ran.
Instance Method Details
#config_created(config) ⇒ Object
Outputs a green string stating that the config file was created
16 17 18 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 16 def config_created(config) puts green("Config file created in: #{config}") end |
#config_updated(config) ⇒ Object
Outputs a green string stating that the config file was updated
40 41 42 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 40 def config_updated(config) puts green("Config updated at: #{config}") end |
#created_release(version) ⇒ Object
Outputs a green string stating that the github release was created
109 110 111 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 109 def created_release(version) puts green("Release #{version} created") end |
#creating_github_release ⇒ Object
Outputs a string stating that the github release is being generated
99 100 101 102 103 104 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 99 def creating_github_release github = "Generating Github release" puts bold(github) puts github.length.times.map {"="}.join puts end |
#deploy_complete(url, password) ⇒ Object
Outputs a formatted string stating that the OTA deploy is complete
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 193 def deploy_complete(url,password) puts deployed = "IPA deployed" puts bold(deployed) puts deployed.length.times.map {"="}.join puts puts green("URL") puts green(url) puts if password puts green("Password") puts green(password) puts end end |
#deploying_ipa(ipa) ⇒ Object
Outputs an underlined bold string stating the ipa is being deployed and it’s file size
59 60 61 62 63 64 65 66 67 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 59 def (ipa) puts = "Deploying IPA" puts bold() puts .length.times.map {"="}.join puts puts ("#{filesize(ipa)}MB") puts end |
#email_sent(to) ⇒ Object
Outputs a green string stating the email was sent
184 185 186 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 184 def email_sent(to) puts green("Notification sent to: #{to}") end |
#filesize(file) ⇒ Number
Calculates the size of a file
214 215 216 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 214 def filesize(file) '%.2f' % (File.size(file).to_f / 2**20) end |
#generating_ipa ⇒ Object
Outputs an underlined bold string stating that the ipa is being generated
47 48 49 50 51 52 53 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 47 def puts = "Generating IPA" puts bold() puts .length.times.map {"="}.join puts end |
#generating_notes ⇒ Object
Outputs an underlined bold string stating that the release notes are being generated
88 89 90 91 92 93 94 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 88 def puts notes = "Generating release notes" puts bold(notes) puts notes.length.times.map {"="}.join puts end |
#github_released ⇒ Object
Outputs a green string stating that the github release finished
116 117 118 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 116 def github_released puts green("Release completed") end |
#github_uploading ⇒ Object
Outputs an underlined bold string stating that the is uploading
123 124 125 126 127 128 129 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 123 def github_uploading puts github = "Uploading package" puts bold(github) puts github.length.times.map {"="}.join puts end |
#ipa_generated(ipa) ⇒ Object
Outputs a green string stating that the ipa was deployed
73 74 75 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 73 def ipa_generated(ipa) puts green("IPA saved to: #{ipa}") end |
#new_commit(commit) ⇒ Object
Outputs a cyan string stating that a new commit has been found
151 152 153 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 151 def new_commit(commit) puts cyan("Found new commit: #{commit}") end |
#new_tag(tag) ⇒ Object
Outputs a cyan string stating that a new tag has been found
143 144 145 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 143 def new_tag(tag) puts cyan("Found new tag: #{tag}") end |
#no_new_commit ⇒ Object
Outputs a red string stating that no new commit was found
158 159 160 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 158 def no_new_commit puts red("No new commit found") end |
#no_new_tag ⇒ Object
Outputs a red string stating that no new tag was found
165 166 167 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 165 def no_new_tag puts red("No new tag found") end |
#notes_generated(notes) ⇒ Object
Outputs a green string stating that the release notes have been generated
135 136 137 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 135 def notes_generated(notes) puts green("Release notes generated: #{notes}") end |
#rakefile_created(file) ⇒ type
Outputs a green string stating that the rakefile was created
25 26 27 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 25 def rakefile_created(file) puts green("Rakefile created: #{file}") end |
#sending_email ⇒ Object
Outputs an underlined bold string stating that the notification email is being sent
172 173 174 175 176 177 178 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 172 def sending_email puts email = "Sending notification email" puts bold(email) puts email.length.times.map {"="}.join puts end |
#setup_complete ⇒ Object
Outputs a green string stating that setup is complete
32 33 34 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 32 def setup_complete puts green("Setup complete") end |
#tests_generated(directory) ⇒ Object
Outputs a green string stating that the calabash tests ran
81 82 83 |
# File 'lib/yolo/formatters/progress_formatter.rb', line 81 def tests_generated(directory) puts green("Test reports saved to: #{directory}") end |