Class: InchCI::Badge

Inherits:
Struct
  • Object
show all
Includes:
BadgeMethods
Defined in:
lib/inch_ci/badge.rb

Constant Summary

Constants included from BadgeMethods

InchCI::BadgeMethods::DEFAULT_IMAGE_FORMAT, InchCI::BadgeMethods::DEFAULT_IMAGE_STYLE, InchCI::BadgeMethods::IMAGE_FORMATS, InchCI::BadgeMethods::IMAGE_STYLES

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from BadgeMethods

#filename, included, #local_filename

Instance Attribute Details

#branchObject

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch


44
45
46
# File 'lib/inch_ci/badge.rb', line 44

def branch
  @branch
end

#projectObject

Returns the value of attribute project

Returns:

  • (Object)

    the current value of project


44
45
46
# File 'lib/inch_ci/badge.rb', line 44

def project
  @project
end

Class Method Details

.create(project, branch, counts) ⇒ Object


47
48
49
50
51
52
53
54
# File 'lib/inch_ci/badge.rb', line 47

def self.create(project, branch, counts)
  badge = new(project, branch)
  each_image_combination do |format, style|
    filename = badge.local_filename(format, style)
    FileUtils.mkdir_p File.dirname(filename)
    Inch::Badge::Image.create(filename, counts, {:style => style})
  end
end