Class: Gast::Repository
- Inherits:
-
Object
- Object
- Gast::Repository
- Defined in:
- lib/gast/repository.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
writeonly
Sets the attribute content.
-
#dir_name ⇒ Object
Returns the value of attribute dir_name.
-
#language ⇒ Object
writeonly
Sets the attribute language.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #commit! ⇒ Object
- #create ⇒ Object
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #log ⇒ Object
- #remove! ⇒ Object
- #save! ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
9 |
# File 'lib/gast/repository.rb', line 9 def initialize; end |
Instance Attribute Details
#content=(value) ⇒ Object (writeonly)
Sets the attribute content
6 7 8 |
# File 'lib/gast/repository.rb', line 6 def content=(value) @content = value end |
#dir_name ⇒ Object
Returns the value of attribute dir_name.
7 8 9 |
# File 'lib/gast/repository.rb', line 7 def dir_name @dir_name end |
#language=(value) ⇒ Object (writeonly)
Sets the attribute language
6 7 8 |
# File 'lib/gast/repository.rb', line 6 def language=(value) @language = value end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/gast/repository.rb', line 5 def path @path end |
Instance Method Details
#commit! ⇒ Object
37 38 39 |
# File 'lib/gast/repository.rb', line 37 def commit! return save! unless changed_of_contents? end |
#create ⇒ Object
11 12 13 14 15 16 |
# File 'lib/gast/repository.rb', line 11 def create new_name_of_repository path_of_repository create_dir setup_repository end |
#log ⇒ Object
23 24 25 26 27 |
# File 'lib/gast/repository.rb', line 23 def log path_of_repository open_reposigory commit_log end |
#remove! ⇒ Object
29 30 31 |
# File 'lib/gast/repository.rb', line 29 def remove! FileUtils.remove_entry_secure(@path) end |
#save! ⇒ Object
33 34 35 |
# File 'lib/gast/repository.rb', line 33 def save! commit_all end |
#write ⇒ Object
18 19 20 21 |
# File 'lib/gast/repository.rb', line 18 def write write_content write_language end |