Class: GitIndexCLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGitIndexCLI

Returns a new instance of GitIndexCLI.



3
4
5
# File 'lib/gitindexcli.rb', line 3

def initialize
  @filename = ""
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



2
3
4
# File 'lib/gitindexcli.rb', line 2

def directory
  @directory
end

#pathObject (readonly)

Returns the value of attribute path.



2
3
4
# File 'lib/gitindexcli.rb', line 2

def path
  @path
end

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gitindexcli.rb', line 7

def call
  if !mac_OS?
    puts "Sorry, this gem is only compatible with Mac OS"
  else
    greeting
    input = gets.chomp
    if input.downcase != "exit"
      directory_from_input(input)
      determine_path
      create_file
      `open #{@filename}`
    end
  end
end