Module: QED
- Defined in:
- lib/qed.rb,
lib/qed/scope.rb,
lib/qed/advice.rb,
lib/qed/config.rb,
lib/qed/parser.rb,
lib/qed/script.rb,
lib/qed/command.rb,
lib/qed/session.rb,
lib/qed/applique.rb,
lib/qed/evaluator.rb,
lib/qedoc/document.rb,
lib/qed/advice/events.rb,
lib/qed/reporter/html.rb,
lib/qed/advice/patterns.rb,
lib/qed/reporter/bullet.rb,
lib/qed/reporter/abstract.rb,
lib/qed/reporter/verbatim.rb,
lib/qedoc/document/markup.rb,
lib/qed/reporter/dotprogress.rb
Defined Under Namespace
Modules: Reporter Classes: Advice, Applique, Command, Document, Evaluator, Parser, Patterns, Profile, Scope, Script, Session, Template
Constant Summary collapse
- DIRECTORY =
File.dirname(__FILE__) + '/qed'
- PROFILE =
YAML.load(File.new(DIRECTORY + '/profile.yml')) rescue {}
- PACKAGE =
YAML.load(File.new(DIRECTORY + '/package.yml')) rescue {}
- VERSION =
PACKAGE.values_at('major','minor','patch','build').compact.join('.')
Class Method Summary collapse
- .const_missing(name) ⇒ Object
-
.root(path = nil) ⇒ Object
Is there no perfect way to find root directory of a project?.
Class Method Details
.const_missing(name) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/qed.rb', line 12 def self.const_missing(name) key = name.to_s.downcase if PACKAGE.key?(key) PACKAGE[key] elsif PROFILE.key?(key) PROFILE[key] else super(name) end end |
.root(path = nil) ⇒ Object
Is there no perfect way to find root directory of a project?
269 270 271 272 273 274 275 276 277 278 |
# File 'lib/qed/command.rb', line 269 def self.root(path=nil) path ||= Dir.pwd path = File.dirname(path) unless File.directory?(path) until path == File.dirname(path) mark = Dir[File.join(path, 'README*')].first return path if mark path = File.dirname(path) end nil end |