Class: LineChange::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/line_change/deploy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, path) ⇒ Deploy

Returns a new instance of Deploy.



7
8
9
# File 'lib/line_change/deploy.rb', line 7

def initialize(id, path)
  @id, @path = id, path
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/line_change/deploy.rb', line 5

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/line_change/deploy.rb', line 5

def path
  @path
end

Instance Method Details

#startObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/line_change/deploy.rb', line 11

def start
  print "Uploading #{most_recent_modified_file_path} to HockeyApp... "

  connection.upload(most_recent_modified_file_path, id).tap do |response|
    puts "Done!" "\n\n"
    puts "Response from HockeyApp:"

    response.body.each do |key, value|
      puts "#{' ' * 4}" "#{key.ljust(19)}: #{value}"
    end
  end
end