Class: Stickler::Repository::Null
- Inherits:
-
Object
- Object
- Stickler::Repository::Null
- Defined in:
- lib/stickler/repository/null.rb
Overview
A null repository. It is in most respecs like a Repository::Local that has nothing in it.
The response to root_dir is set by default to be the class name, or whatever is passed to the initializer.
Instance Attribute Summary collapse
-
#root_dir ⇒ Object
readonly
the root directory of the repository, this is set in the constructor.
Instance Method Summary collapse
- #def(specs) ⇒ Object
- #empty_array(junk = nil) ⇒ Object (also: #specs, #latest_specs, #search_for)
- #empty_string(junk = "") ⇒ Object (also: #uri, #gems_uri)
-
#initialize(root_dir = self.class.name) ⇒ Null
constructor
A new instance of Null.
- #last_modified_time ⇒ Object
- #nilish(junk = nil, &block) ⇒ Object (also: #push, #delete, #yank, #get, #open, #uri_for_gem, #full_path_to_gem, #full_path_to_specification)
Constructor Details
#initialize(root_dir = self.class.name) ⇒ Null
15 16 17 |
# File 'lib/stickler/repository/null.rb', line 15 def initialize( root_dir = self.class.name ) @root_dir = root_dir end |
Instance Attribute Details
#root_dir ⇒ Object (readonly)
the root directory of the repository, this is set in the constructor
13 14 15 |
# File 'lib/stickler/repository/null.rb', line 13 def root_dir @root_dir end |
Instance Method Details
#def(specs) ⇒ Object
48 49 50 51 52 |
# File 'lib/stickler/repository/null.rb', line 48 def def specs Array.new end |
#empty_array(junk = nil) ⇒ Object Also known as: specs, latest_specs, search_for
41 42 43 |
# File 'lib/stickler/repository/null.rb', line 41 def empty_array( junk = nil ) [] end |
#empty_string(junk = "") ⇒ Object Also known as: uri, gems_uri
19 20 21 |
# File 'lib/stickler/repository/null.rb', line 19 def empty_string( junk = "" ) "" end |
#last_modified_time ⇒ Object
37 38 39 |
# File 'lib/stickler/repository/null.rb', line 37 def last_modified_time Time.now end |
#nilish(junk = nil, &block) ⇒ Object Also known as: push, delete, yank, get, open, uri_for_gem, full_path_to_gem, full_path_to_specification
25 26 27 |
# File 'lib/stickler/repository/null.rb', line 25 def nilish( junk = nil, &block ) nil end |