Class: Detroit::RubyProject

Inherits:
Project show all
Defined in:
lib/detroit/project.rb

Overview

Ruby Project class.

Instance Attribute Summary

Attributes inherited from Project

#log, #root

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Project

#config, factory, #initialize, lookup, #method_missing, root

Constructor Details

This class inherits a constructor from Detroit::Project

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Detroit::Project

Class Method Details

.project?(root) ⇒ Boolean

TODO:

While this will work well in the vase majority of cases, there may be a few outlays.

looking for a .gemspec file.

Returns:

  • (Boolean)


100
101
102
# File 'lib/detroit/project.rb', line 100

def self.project?(root)
  Dir[File.join(root, "{*,}.gemspec")].first
end

Instance Method Details

#gemspec_fileObject



128
129
130
# File 'lib/detroit/project.rb', line 128

def gemspec_file
Dir[File.join(root, "{*,}.gemspec")].first
end

#index_fileObject



123
124
125
# File 'lib/detroit/project.rb', line 123

def index_file
Dir[File.join(root, ".index")].first
end

#metadataObject



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/detroit/project.rb', line 110

def 
  @metadata ||= (
    if index_file
      Indexer::Metadata.open(root)
    elsif file = gemspec_file
      Indexer::Metadata.from_gemspec(file)
    else
      super # TODO: what metadata?
    end
  )
end