class Reposit::SetupChecker

Attributes

lines[RW]

Public Class Methods

check() click to toggle source
# File lib/reposit.rb, line 72
def self.check
  new.check
end
new() click to toggle source
# File lib/reposit.rb, line 68
def initialize
  @lines = 0
end

Public Instance Methods

both_lines_have_text?() click to toggle source
# File lib/reposit.rb, line 93
def both_lines_have_text?
  lines.all? {|line| line && line.size > 0}
end
check() click to toggle source
# File lib/reposit.rb, line 76
def check
  if file_exists?
    has_two_lines? && both_lines_have_text?
  else
    false
  end
end
file_exists?() click to toggle source
# File lib/reposit.rb, line 84
def file_exists?
  File.exist?(File.expand_path('~') + '/.reposit')
end
has_two_lines?() click to toggle source
# File lib/reposit.rb, line 88
def has_two_lines?
  self.lines = Reposit::CredentialsReader.new.get_credentials
  lines.size == 2
end