Module: Develry
- Extended by:
- Platform
- Defined in:
- lib/develry.rb,
lib/develry/site.rb,
lib/develry/config.rb,
lib/develry/project.rb,
lib/develry/platform.rb,
lib/develry/site/initializer.rb,
lib/develry/project/initializer.rb,
lib/develry/project/initializer/rake.rb,
lib/develry/project/initializer/rspec.rb
Overview
Provides access to metric tools
Defined Under Namespace
Modules: Platform Classes: Config, Project, Site
Constant Summary collapse
- ROOT =
Pathname.new(__FILE__).parent.parent.freeze
- PROJECT_ROOT =
Pathname.pwd.freeze
- SHARED_PATH =
ROOT.join('shared').freeze
- SHARED_SPEC_PATH =
SHARED_PATH.join('spec').freeze
- SHARED_GEMFILE_PATH =
SHARED_PATH.join('Gemfile').freeze
- DEFAULT_CONFIG_PATH =
ROOT.join('default/config').freeze
- RAKE_FILES_GLOB =
ROOT.join('tasks/**/*.rake').to_s.freeze
- LIB_DIRECTORY_NAME =
'lib'.freeze
- SPEC_DIRECTORY_NAME =
'spec'.freeze
- RB_FILE_PATTERN =
'**/*.rb'.freeze
- RAKE_FILE_NAME =
'Rakefile'.freeze
- DEFAULT_GEMFILE_NAME =
'Gemfile'.freeze
- GEMFILE_NAME =
'Gemfile.develry'.freeze
- EVAL_GEMFILE =
"eval_gemfile '#{GEMFILE_NAME}'".freeze
- BUNDLE_UPDATE =
'bundle update'.freeze
- REQUIRE =
"require 'develry'".freeze
- INIT_RAKE_TASKS =
'Develry.init_rake_tasks'.freeze
- SHARED_SPEC_PATTERN =
'{shared,support}/**/*.rb'.freeze
- UNIT_TEST_PATH_REGEXP =
%r{\bspec/unit/}.freeze
- DEFAULT_CONFIG_DIR_NAME =
'config'.freeze
- ANNOTATION_WRAPPER =
"\n# Added by develry\n%s".freeze
- SITE =
Provides develry for a project
Site.new(Project.new(PROJECT_ROOT))
- MASTER_BRANCH =
'master'.freeze
Constants included from Platform
Class Method Summary collapse
-
.fail_on_branch ⇒ Array[String]
private
Return the branches the build should fail on because of metrics.
-
.fail_on_current_branch? ⇒ Boolean
private
Test if the build should fail because of metrics on this branch.
-
.init ⇒ undefined
Initialize develry using default config.
-
.init_rake_tasks ⇒ self
Initialize project and load tasks.
-
.init_spec_helper ⇒ self
Initialize project and load shared specs.
-
.notify(msg) ⇒ undefined
private
Notify or abort depending on the branch.
-
.project ⇒ Project
private
Return project.
-
.require_files(dir, pattern) ⇒ self
private
Require shared examples.
-
.sync ⇒ undefined
Sync Gemfile.develry.
-
.update ⇒ undefined
Sync Gemfile.develry and run bundle update.
Methods included from Platform
jit?, jruby?, rbx?, ruby18?, ruby19?, ruby20?, ruby_engine, rvm, rvm_name
Class Method Details
.fail_on_branch ⇒ Array[String]
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the branches the build should fail on because of metrics
150 151 152 |
# File 'lib/develry.rb', line 150 def self.fail_on_branch project.develry.fail_on_branch end |
.fail_on_current_branch? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if the build should fail because of metrics on this branch
141 142 143 |
# File 'lib/develry.rb', line 141 def self.fail_on_current_branch? fail_on_branch.include?(current_branch) end |
.init ⇒ undefined
Initialize develry using default config
77 78 79 80 |
# File 'lib/develry.rb', line 77 def self.init SITE.init self end |
.init_rake_tasks ⇒ self
Initialize project and load tasks
Should only be called from your $application_root/Rakefile
55 56 57 58 |
# File 'lib/develry.rb', line 55 def self.init_rake_tasks Project::Initializer::Rake.call self end |
.init_spec_helper ⇒ self
Initialize project and load shared specs
Expects to be called from $application_root/spec/spec_helper.rb
67 68 69 70 |
# File 'lib/develry.rb', line 67 def self.init_spec_helper SITE.init_spec_helper self end |
.notify(msg) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Notify or abort depending on the branch
132 133 134 |
# File 'lib/develry.rb', line 132 def self.notify(msg) fail_on_current_branch? ? abort(msg) : puts(msg) end |
.project ⇒ Project
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return project
105 106 107 |
# File 'lib/develry.rb', line 105 def self.project SITE.project end |
.require_files(dir, pattern) ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Require shared examples
120 121 122 123 |
# File 'lib/develry.rb', line 120 def self.require_files(dir, pattern) Dir[dir.join(pattern)].each { |file| require file } self end |
.sync ⇒ undefined
Sync Gemfile.develry
87 88 89 |
# File 'lib/develry.rb', line 87 def self.sync SITE.sync end |
.update ⇒ undefined
Sync Gemfile.develry and run bundle update
96 97 98 |
# File 'lib/develry.rb', line 96 def self.update SITE.update end |