Class: Build

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#finished_atObject

Returns the value of attribute finished_at

Returns:

  • (Object)

    the current value of finished_at



6
7
8
# File 'lib/buildboard.rb', line 6

def finished_at
  @finished_at
end

#gitObject

Returns the value of attribute git

Returns:

  • (Object)

    the current value of git



6
7
8
# File 'lib/buildboard.rb', line 6

def git
  @git
end

#outputObject

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



6
7
8
# File 'lib/buildboard.rb', line 6

def output
  @output
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



6
7
8
# File 'lib/buildboard.rb', line 6

def path
  @path
end

#projectObject

Returns the value of attribute project

Returns:

  • (Object)

    the current value of project



6
7
8
# File 'lib/buildboard.rb', line 6

def project
  @project
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



6
7
8
# File 'lib/buildboard.rb', line 6

def sha
  @sha
end

#started_atObject

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



6
7
8
# File 'lib/buildboard.rb', line 6

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



6
7
8
# File 'lib/buildboard.rb', line 6

def status
  @status
end

Class Method Details

.load_file(filename) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/buildboard.rb', line 8

def load_file(filename)
  build_data = YAML::load_file(filename)
  new(build_data['sha'],
      Time.parse(build_data['started_at']),
      Time.parse(build_data['finished_at']),
      build_data['status'],
      build_data['output'],
      build_data['project'],
      filename,
      build_data['git'])
end

Instance Method Details

#authorObject



29
30
31
# File 'lib/buildboard.rb', line 29

def author
  git.match(/Author: (.*?) \</).to_a[1]
end

#css_classObject



21
22
23
# File 'lib/buildboard.rb', line 21

def css_class
  status
end

#fileObject



25
26
27
# File 'lib/buildboard.rb', line 25

def file
  File.basename(path)
end