Class: Slick::Project

Inherits:
Object show all
Defined in:
lib/slick/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProject

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_namesObject (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_pathsObject (readonly)

Returns the value of attribute load_paths.



5
6
7
# File 'lib/slick/project.rb', line 5

def load_paths
  @load_paths
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/slick/project.rb', line 5

def name
  @name
end

#root_pathObject (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

Returns:

  • (Boolean)


18
19
20
# File 'lib/slick/project.rb', line 18

def exist?
    !@name.nil?
end