In Files

Parent

Rake::ShipitTask::VC::SVN

Public Class Methods

accept?() click to toggle source
    # File lib/shipit/vc.rb, line 61
61:                 def self.accept?
62:                         File.exist? ".svn"
63:                 end

Public Instance Methods

are_local_diffs(ver) click to toggle source
     # File lib/shipit/vc.rb, line 108
108:                 def are_local_diffs(ver)
109:                         `svn diff`.match(/\S/)
110:                 end
commit(msg) click to toggle source
    # File lib/shipit/vc.rb, line 65
65:                 def commit(msg)
66:                         temp = Tempfile.open("svn-commit")
67:                         temp << msg
68:                         temp.close
69: 
70:                         system "svn", "ci", "--file", temp.path
71:                 end
exists_tagged_version(ver) click to toggle source
    # File lib/shipit/vc.rb, line 92
92:                 def exists_tagged_version(ver)
93:                         !!`svn info '#{tag_url(ver)}'`[/Node Kind: directory/]
94:                 end
local_diff(file) click to toggle source
     # File lib/shipit/vc.rb, line 104
104:                 def local_diff(file)
105:                         `svn diff #{file}`
106:                 end
precommit() click to toggle source
    # File lib/shipit/vc.rb, line 73
73:                 def precommit
74:                         unknown = []
75:                         changes = false
76:                         `svn st`.split(/\n/).each do |l|
77:                                 changes = true
78:                                 next unless l =~ /^\?/
79:                                 unknown << l
80:                         end
81: 
82:                         unless unknown.empty?
83:                                 raise unknown.join("\n")
84:                         end
85: 
86:                         unless changes
87:                                 warn "No locally changed files. skipping commit"
88:                                 return
89:                         end
90:                 end
tag_version(ver, msg) click to toggle source
     # File lib/shipit/vc.rb, line 96
 96:                 def tag_version(ver, msg)
 97:                         temp = Tempfile.open("svn-commit")
 98:                         temp << msg
 99:                         temp.close
100: 
101:                         system 'svn', 'copy', '--file', temp.path, trunk_url.to_s, tag_url(ver).to_s
102:                 end

Private Instance Methods

tag_url(ver) click to toggle source
     # File lib/shipit/vc.rb, line 113
113:                 def tag_url(ver)
114:                         require "uri"
115:                         ENV["LANG"] = "C"
116:                         url = `svn info`[/^URL: (.+)/, 1]
117:                         @url = trunk_url + "."
118:                         unless `svn info '#{(@url + "tags")}'`[/Node Kind: directory/]
119:                                 raise "tags directory is not found"
120:                         end
121:                         @url + "tags/#{ver}"
122:                 end
trunk_url() click to toggle source
     # File lib/shipit/vc.rb, line 124
124:                 def trunk_url
125:                         url = `svn info`[/^URL: (.+)/, 1]
126:                         if url =~ /trunk$/
127:                                 URI(url)
128:                         else
129:                                 raise "Run at trunk! Here is #{url}"
130:                         end
131:                 end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.