Module: Devtools
- Extended by:
- Platform
- Defined in:
- lib/devtools.rb,
lib/devtools/site.rb,
lib/devtools/config.rb,
lib/devtools/project.rb,
lib/devtools/platform.rb,
lib/devtools/site/initializer.rb,
lib/devtools/project/initializer.rb,
lib/devtools/project/initializer/rake.rb,
lib/devtools/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
- 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
- REQUIRE =
"require 'devtools'".freeze
- INIT_RAKE_TASKS =
'Devtools.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 devtools\n%s\n".freeze
- SITE =
Provides devtools for a project
Site.new(Project.new(PROJECT_ROOT))
Constants included from Platform
Class Method Summary collapse
-
.ci? ⇒ Boolean
private
Detect ci.
-
.circle_ci? ⇒ Boolean
private
Detect circle ci.
-
.init ⇒ undefined
Initialize devtools using default config.
-
.init_rake_tasks ⇒ self
Initialize project and load tasks.
-
.init_spec_helper ⇒ self
Initialize project and load shared specs.
-
.notify_metric_violation(msg) ⇒ undefined
private
React to metric violation.
-
.project ⇒ Project
private
Return project.
-
.require_files(dir, pattern) ⇒ self
private
Require shared examples.
-
.travis? ⇒ Boolean
private
Detect travis ci.
Methods included from Platform
jit?, jruby?, rbx?, ruby18?, ruby19?, ruby20?, ruby_engine, rvm, rvm_name
Class Method Details
.ci? ⇒ 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.
Detect ci
119 120 121 |
# File 'lib/devtools.rb', line 119 def self.ci? ENV.key?('CI') end |
.circle_ci? ⇒ 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.
Detect circle ci
129 130 131 |
# File 'lib/devtools.rb', line 129 def self.circle_ci? ENV.key?('CIRCLECI') end |
.init ⇒ undefined
Initialize devtools using default config
83 84 85 86 |
# File 'lib/devtools.rb', line 83 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
61 62 63 64 |
# File 'lib/devtools.rb', line 61 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
73 74 75 76 |
# File 'lib/devtools.rb', line 73 def self.init_spec_helper SITE.init_spec_helper self end |
.notify_metric_violation(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.
React to metric violation
50 51 52 |
# File 'lib/devtools.rb', line 50 def self.notify_metric_violation(msg) abort(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
93 94 95 |
# File 'lib/devtools.rb', line 93 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
108 109 110 111 |
# File 'lib/devtools.rb', line 108 def self.require_files(dir, pattern) Dir[dir.join(pattern)].each { |file| require file } self end |
.travis? ⇒ 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.
Detect travis ci
139 140 141 |
# File 'lib/devtools.rb', line 139 def self.travis? ENV.key?('TRAVIS') end |