Class: Dev::Scm
- Inherits:
-
Object
- Object
- Dev::Scm
- Defined in:
- lib/dev/Scm.rb
Instance Attribute Summary collapse
-
#scm_type ⇒ Object
Returns the value of attribute scm_type.
Instance Method Summary collapse
- #file_tracked?(file) ⇒ Boolean
-
#initialize ⇒ Scm
constructor
A new instance of Scm.
Constructor Details
#initialize ⇒ Scm
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_type ⇒ Object
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
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 |