Class: Turntables::Turntable
- Inherits:
-
Object
- Object
- Turntables::Turntable
- Defined in:
- lib/turntables/turntable.rb
Overview
The facade controller to the rest of this library.
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize ⇒ Turntable
constructor
Default constructor, that initializes some standard parameters.
-
#make! ⇒ Object
Create the tables by going through each revision.
-
#make_at!(location) ⇒ Object
Make the repository at a specific location instead of default.
-
#register(repository_root_path) ⇒ Object
Register a revision that needs to be processed later.
Constructor Details
#initialize ⇒ Turntable
Default constructor, that initializes some standard parameters
10 11 12 13 |
# File 'lib/turntables/turntable.rb', line 10 def initialize @revisions = Array.new @repository = Repository.new end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
39 40 41 |
# File 'lib/turntables/turntable.rb', line 39 def repository @repository end |
Instance Method Details
#make! ⇒ Object
Create the tables by going through each revision
30 31 32 33 34 35 36 37 |
# File 'lib/turntables/turntable.rb', line 30 def make! if @repository.malformed? raise TurntableException, "The directory structure at #{@repository.relative_dir} is malformed." else @repository.make! end end |
#make_at!(location) ⇒ Object
Make the repository at a specific location instead of default.
22 23 24 25 26 27 |
# File 'lib/turntables/turntable.rb', line 22 def make_at!(location) DbRegistry.instance.name = location DbRegistry.instance.close! DbRegistry.instance.open! make! end |
#register(repository_root_path) ⇒ Object
Register a revision that needs to be processed later
17 18 19 |
# File 'lib/turntables/turntable.rb', line 17 def register(repository_root_path) @repository.register(repository_root_path) end |