Class: Bard::CLI::CI::Local

Inherits:
Struct
  • Object
show all
Defined in:
lib/bard/ci.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_responseObject

Returns the value of attribute last_response.



129
130
131
# File 'lib/bard/ci.rb', line 129

def last_response
  @last_response
end

#project_nameObject

Returns the value of attribute project_name

Returns:

  • (Object)

    the current value of project_name



103
104
105
# File 'lib/bard/ci.rb', line 103

def project_name
  @project_name
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



103
104
105
# File 'lib/bard/ci.rb', line 103

def sha
  @sha
end

Instance Method Details

#consoleObject



125
126
127
# File 'lib/bard/ci.rb', line 125

def console
  @console
end

#exists?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/bard/ci.rb', line 121

def exists?
  true
end

#runObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/bard/ci.rb', line 104

def run
  start

  start_time = Time.new.to_i
  while building?
    elapsed_time = Time.new.to_i - start_time
    yield elapsed_time, nil
    sleep(2)
  end

  @stdin.close
  @console = @stdout_and_stderr.read
  @stdout_and_stderr.close

  success?
end