Class: Dev::Scm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScm

Returns a new instance of Scm.



5
6
7
8
9
# File 'lib/dev/Scm.rb', line 5

def initialize
  @scm_type="?"
  @scm_type="svn" if File.exists?(".svn")
  @scm_type="git" if File.exists?(".git")
end

Instance Attribute Details

#scm_typeObject

Returns the value of attribute scm_type.



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

def scm_type
  @scm_type
end

Instance Method Details

#file_tracked?(file) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/dev/Scm.rb', line 10

def file_tracked?(file)
  if @scm_type=="git"
    call=Dev::SystemCall.new("git ls-files #{file} -error_unmatch")
    return true if call.status==0
  end
  false
end