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
- #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
Returns a new instance of Null.
13 14 15 |
# File 'lib/stickler/repository/null.rb', line 13 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
11 12 13 |
# File 'lib/stickler/repository/null.rb', line 11 def root_dir @root_dir end |
Instance Method Details
#empty_array(junk = nil) ⇒ Object Also known as: specs, latest_specs, search_for
39 40 41 |
# File 'lib/stickler/repository/null.rb', line 39 def empty_array( junk = nil ) [] end |
#empty_string(junk = "") ⇒ Object Also known as: uri, gems_uri
17 18 19 |
# File 'lib/stickler/repository/null.rb', line 17 def empty_string( junk = "" ) "" end |
#last_modified_time ⇒ Object
35 36 37 |
# File 'lib/stickler/repository/null.rb', line 35 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
23 24 25 |
# File 'lib/stickler/repository/null.rb', line 23 def nilish( junk = nil, &block ) nil end |