Class: Gast::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/gast/repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

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

Parameters:

  • value

    the value to set the attribute content to.


6
7
8
# File 'lib/gast/repository.rb', line 6

def content=(value)
  @content = value
end

#dir_nameObject

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

Parameters:

  • value

    the value to set the attribute language to.


6
7
8
# File 'lib/gast/repository.rb', line 6

def language=(value)
  @language = value
end

#pathObject (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


31
32
33
# File 'lib/gast/repository.rb', line 31

def commit!
  return save! unless changed_of_contents?
end

#createObject


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

#remove!Object


23
24
25
# File 'lib/gast/repository.rb', line 23

def remove!
  FileUtils.remove_entry_secure(@path)
end

#save!Object


27
28
29
# File 'lib/gast/repository.rb', line 27

def save!
  commit_all
end

#writeObject


18
19
20
21
# File 'lib/gast/repository.rb', line 18

def write
  write_content
  write_language
end