Class Rake::ShipitTask::VC::Git
In: lib/shipit/vc.rb
Parent: Object

Methods

Public Class methods

[Source]

    # File lib/shipit/vc.rb, line 15
15:                 def self.accept?
16:                         File.exist? ".git"
17:                 end

Public Instance methods

[Source]

    # File lib/shipit/vc.rb, line 55
55:                 def are_local_diffs(ver)
56:                         `git diff --no-color #{ver}`.match(/\S/)
57:                 end

[Source]

    # File lib/shipit/vc.rb, line 19
19:                 def commit(msg)
20:                         temp = Tempfile.open("COMMIT_MESSAGE")
21:                         temp << msg
22:                         temp.close
23: 
24:                         system "git", "commit", "-a", "-F", temp.path
25:                 end

[Source]

    # File lib/shipit/vc.rb, line 34
34:                 def exists_tagged_version(ver)
35:                         !`git tag -l #{ver}`.empty?
36:                 end

[Source]

    # File lib/shipit/vc.rb, line 51
51:                 def local_diff(file)
52:                         `git diff --no-color HEAD '#{file}'`
53:                 end

[Source]

    # File lib/shipit/vc.rb, line 27
27:                 def precommit
28:                         unknown = `git ls-files -z --others --exclude-per-directory=.gitignore --exclude-from=.git/info/exclude`
29:                         if unknown.gsub!(/\0/, "\n")
30:                                 raise unknown
31:                         end
32:                 end

[Source]

    # File lib/shipit/vc.rb, line 39
39:                 def tag_version(ver, msg=nil)
40:                         msg = "Tagging version #{ver}." unless msg
41: 
42:                         temp = Tempfile.open("COMMIT_MESSAGE")
43:                         temp << msg
44:                         temp.close
45: 
46:                         tag = ver
47: 
48:                         system "git", "tag", "-a", "-F", temp.path, tag
49:                 end

[Validate]