Class: Bard::CI::Local

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#branchObject

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch



5
6
7
# File 'lib/bard/ci/local.rb', line 5

def branch
  @branch
end

#project_nameObject

Returns the value of attribute project_name

Returns:

  • (Object)

    the current value of project_name



5
6
7
# File 'lib/bard/ci/local.rb', line 5

def project_name
  @project_name
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



5
6
7
# File 'lib/bard/ci/local.rb', line 5

def sha
  @sha
end

Instance Method Details

#consoleObject



27
28
29
# File 'lib/bard/ci/local.rb', line 27

def console
  @console
end

#exists?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bard/ci/local.rb', line 23

def exists?
  true
end

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bard/ci/local.rb', line 6

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