Module: Sitespec

Defined in:
lib/sitespec.rb,
lib/sitespec/version.rb,
lib/sitespec/artifact.rb,
lib/sitespec/configuration.rb

Defined Under Namespace

Classes: Artifact, Configuration

Constant Summary collapse

VERSION =
"1.2.1"

Class Method Summary collapse

Class Method Details

.artifacts_countInteger

Return how many artifacts (files) generated on this process. This count is to be shown after all examples are finished.

Returns:

  • (Integer)


10
11
12
# File 'lib/sitespec.rb', line 10

def artifacts_count
  @artifacts_count || 0
end

.configurationObject

Provide singleton configuration object shared with the current process. All of user-configuration should be stored in this singleton object.

Examples:

Sitespec.configuration.build_path = "artifacts"


18
19
20
# File 'lib/sitespec.rb', line 18

def configuration
  @configuration ||= Sitespec::Configuration.new
end

.configure(&block) ⇒ Object

Provide friendly interface to access to Sitespec.configuration. The configuration object passed to given block is same with ‘Sitespec.configuration`.

Examples:

Sitespec.configure do |configuration|
  configuration.build_path = "artifacts"
end


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

def configure(&block)
  block.call(configuration)
end

.increment_artifacts_countObject

Use this method when a new artifact is generated. In almost cases, it’s called from Sitespec::Artifact class.



35
36
37
# File 'lib/sitespec.rb', line 35

def increment_artifacts_count
  @artifacts_count = artifacts_count + 1
end