Class: Slick::Project
Instance Attribute Summary collapse
-
#lib_names ⇒ Object
readonly
Returns the value of attribute lib_names.
-
#load_paths ⇒ Object
readonly
Returns the value of attribute load_paths.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize ⇒ Project
Returns a new instance of Project.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/slick/project.rb', line 7 def initialize @root_path = find_root_path(Dir.pwd) @load_paths = $LOAD_PATH.map{|load_path| find_root_path(load_path) }.compact if @root_path @name = gem_name(@root_path) @load_paths.unshift(@root_path) unless @load_paths.include?(@root_path) end @lib_names = @load_paths.map{|load_path| gem_name(load_path) } end |
Instance Attribute Details
#lib_names ⇒ Object (readonly)
Returns the value of attribute lib_names.
5 6 7 |
# File 'lib/slick/project.rb', line 5 def lib_names @lib_names end |
#load_paths ⇒ Object (readonly)
Returns the value of attribute load_paths.
5 6 7 |
# File 'lib/slick/project.rb', line 5 def load_paths @load_paths end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/slick/project.rb', line 5 def name @name end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
5 6 7 |
# File 'lib/slick/project.rb', line 5 def root_path @root_path end |
Instance Method Details
#exist? ⇒ Boolean
18 19 20 |
# File 'lib/slick/project.rb', line 18 def exist? !@name.nil? end |