module Develry

Provides access to metric tools

Constants

ANNOTATION_WRAPPER
BUNDLE_UPDATE
DEFAULT_CONFIG_DIR_NAME
DEFAULT_CONFIG_PATH
DEFAULT_GEMFILE_NAME
EVAL_GEMFILE
GEMFILE_NAME
INIT_RAKE_TASKS
LIB_DIRECTORY_NAME
MASTER_BRANCH
PROJECT_ROOT
RAKE_FILES_GLOB
RAKE_FILE_NAME
RB_FILE_PATTERN
REQUIRE
ROOT
SHARED_GEMFILE_PATH
SHARED_PATH
SHARED_SPEC_PATH
SHARED_SPEC_PATTERN
SITE

Provides develry for a project

SPEC_DIRECTORY_NAME
UNIT_TEST_PATH_REGEXP

Public Class Methods

fail_on_branch() click to toggle source

Return the branches the build should fail on because of metrics

@return [Array]

@api private

# File lib/develry.rb, line 150
def self.fail_on_branch
  project.develry.fail_on_branch
end
fail_on_current_branch?() click to toggle source

Test if the build should fail because of metrics on this branch

@return [Boolean]

@api private

# File lib/develry.rb, line 141
def self.fail_on_current_branch?
  fail_on_branch.include?(current_branch)
end
init() click to toggle source

Initialize develry using default config

@return [undefined]

@api public

# File lib/develry.rb, line 77
def self.init
  SITE.init
  self
end
init_rake_tasks() click to toggle source

Initialize project and load tasks

Should only be called from your $application_root/Rakefile

@return [self]

@api public

# File lib/develry.rb, line 55
def self.init_rake_tasks
  Project::Initializer::Rake.call
  self
end
init_spec_helper() click to toggle source

Initialize project and load shared specs

Expects to be called from $application_root/spec/spec_helper.rb

@return [self]

@api public

# File lib/develry.rb, line 67
def self.init_spec_helper
  SITE.init_spec_helper
  self
end
notify(msg) click to toggle source

Notify or abort depending on the branch

@param [String] msg

@return [undefined]

@api private

# File lib/develry.rb, line 132
def self.notify(msg)
  fail_on_current_branch? ? abort(msg) : puts(msg)
end
project() click to toggle source

Return project

@return [Project]

@api private

# File lib/develry.rb, line 105
def self.project
  SITE.project
end
require_files(dir, pattern) click to toggle source

Require shared examples

@param [Pathname] dir

the directory containing the files to require

@param [String] pattern

the file pattern to match inside directory

@return [self]

@api private

# File lib/develry.rb, line 120
def self.require_files(dir, pattern)
  Dir[dir.join(pattern)].each { |file| require file }
  self
end
sync() click to toggle source

Sync Gemfile.develry

@return [undefined]

@api public

# File lib/develry.rb, line 87
def self.sync
  SITE.sync
end
update() click to toggle source

Sync Gemfile.develry and run bundle update

@return [undefined]

@api public

# File lib/develry.rb, line 96
def self.update
  SITE.update
end

Private Class Methods

current_branch() click to toggle source

Return current git branch

@return [String]

@api private

# File lib/develry.rb, line 159
def self.current_branch
  `git rev-parse --abbrev-ref HEAD`.rstrip
end