Class: Git::Confident

Inherits:
Base
  • Object
show all
Defined in:
lib/git/confident.rb

Defined Under Namespace

Modules: VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Confident

Returns a new instance of Confident.


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/git/confident.rb', line 19

def initialize( options )
  @path      = options[ :path ].clone
  @files     = options[ :files ]
  @no_commit = options[ :no_commit ] ? true : false

  raise "Git repository not found at '#{ @path }'" if ! File.directory?( "#{ @path }/.git" )

  super( { :working_directory => @path } )
  @elements = Git::Elements.new( @path )

  case options[ :action ]
  when :backup
    backup
  when :diff
    diff
  when :list
    list
  when :restore
    restore
  end
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements


17
18
19
# File 'lib/git/confident.rb', line 17

def elements
  @elements
end