Module: Qdocs
- Defined in:
- lib/qdocs.rb,
lib/qdocs/server.rb,
lib/qdocs/version.rb,
lib/qdocs/active_record.rb
Defined Under Namespace
Modules: ActiveRecord, Base, Helpers
Classes: InvalidArgumentError, Server, UnknownClassError, UnknownMethodError, UnknownMethodTypeError, UnknownPatternError
Constant Summary
collapse
- METHOD_REGEXP =
/(?:[a-zA-Z_]+|\[\])[?!=]?/.freeze
- CONST_REGEXP =
/[[:upper:]]\w*(?:::[[:upper:]]\w*)*/.freeze
- Handler =
if Object.const_defined? :ActiveRecord
require_relative "qdocs/active_record"
Qdocs::ActiveRecord
else
Qdocs::Base
end
- VERSION =
"0.3.0"
Class Method Summary
collapse
Class Method Details
.load_env(dir_level = nil) ⇒ Object
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
# File 'lib/qdocs.rb', line 196
def self.load_env(dir_level = nil)
check_dir = dir_level || ["."]
project_top_level = Pathname(File.join(*check_dir, "Gemfile")).exist? ||
Pathname(File.join(*check_dir, ".git")).exist?
if project_top_level && Pathname(File.join(*check_dir, "config", "environment.rb")).exist?
require File.join(*check_dir, "config", "environment.rb")
elsif project_top_level
else
dir_level ||= []
dir_level << ".."
Qdocs.load_env(dir_level)
end
end
|