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



37
38
39
# File 'lib/gast/repository.rb', line 37

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

#logObject



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

#writeObject



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

def write
  write_content
  write_language
end