lib/lotus.rb in lotusrb-0.3.1 vs lib/lotus.rb in lotusrb-0.3.2
- old
+ new
@@ -8,10 +8,21 @@
#
# @since 0.1.0
#
# @see http://lotusrb.org
module Lotus
+ # Return root of the project (top level directory).
+ #
+ # @return [Pathname] root path
+ #
+ # @since 0.3.2
+ #
+ # @example
+ # Lotus.root # => #<Pathname:/Users/luca/Code/bookshelf>
+ def self.root
+ environment.root
+ end
# Return the current environment
#
# @return [String] the current environment
#
@@ -20,11 +31,11 @@
# @see Lotus::Environment#environment
#
# @example
# Lotus.env => "development"
def self.env
- Environment.new.environment
+ environment.environment
end
# Check to see if specified environment(s) matches the current environment.
#
# If multiple names are given, it returns true, if at least one of them
@@ -48,8 +59,18 @@
# puts ENV['LOTUS_ENV'] # => "development"
#
# Lotus.env?(:development, :test) # => true
# Lotus.env?(:production, :staging) # => false
def self.env?(*names)
- Environment.new.environment?(*names)
+ environment.environment?(*names)
+ end
+
+ # Return environment
+ #
+ # @return [Lotus::Environment] environment
+ #
+ # @api private
+ # @since 0.3.2
+ def self.environment
+ Environment.new
end
end