Class: Yolo::Formatters::ProgressFormatter

Inherits:
XcodeBuild::Formatters::ProgressFormatter
  • Object
show all
Defined in:
lib/yolo/formatters/progress_formatter.rb

Overview

Outputs formatted progress messages to the console

Author:

  • Alex Fish

Instance Method Summary collapse

Instance Method Details

#config_created(config) ⇒ Object

Outputs a green string stating that the config file was created

Parameters:

  • config (String)

    The path to the config file



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

Parameters:

  • config (String)

    The path to the config file



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_releaseObject

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

Parameters:

  • url (String)

    The URL to the deployed Application

  • password (String)

    The password for the deployed application



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

Parameters:

  • ipa (String)

    The path to the ipa being deployred



59
60
61
62
63
64
65
66
67
# File 'lib/yolo/formatters/progress_formatter.rb', line 59

def deploying_ipa(ipa)
  puts
  deploying = "Deploying IPA"
  puts bold(deploying)
  puts deploying.length.times.map {"="}.join
  puts
  puts ("#{filesize(ipa)}MB")
  puts
end

#email_sent(to) ⇒ Object

Outputs a green string stating the email was sent

Parameters:

  • to (Array)

    the users the email was sent to



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

Parameters:

  • file (String)

    The full path to the file

Returns:

  • (Number)

    The size of the file in MBs



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_ipaObject

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 generating_ipa
  puts
  generating = "Generating IPA"
  puts bold(generating)
  puts generating.length.times.map {"="}.join
  puts
end

#generating_notesObject

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 generating_notes
  puts
  notes = "Generating release notes"
  puts bold(notes)
  puts notes.length.times.map {"="}.join
  puts
end

#github_releasedObject

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_uploadingObject

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

Parameters:

  • ipa (String)

    The path to the ipa



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

Parameters:

  • commit (String)

    The commit hash



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

Parameters:

  • tag (String)

    The tag



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_commitObject

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_tagObject

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

Parameters:

  • notes (String)

    The path to the release notes



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

Parameters:

  • file (String)

    The path to the rakefile

Returns:

  • (type)
    description


25
26
27
# File 'lib/yolo/formatters/progress_formatter.rb', line 25

def rakefile_created(file)
  puts green("Rakefile created: #{file}")
end

#sending_emailObject

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_completeObject

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

Parameters:

  • directory (String)

    The path to the tests



81
82
83
# File 'lib/yolo/formatters/progress_formatter.rb', line 81

def tests_generated(directory)
  puts green("Test reports saved to: #{directory}")
end