shipit 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/ChangeLog +13 -2
  2. data/README +29 -1
  3. data/Rakefile +2 -1
  4. data/lib/shipit.rb +31 -3
  5. metadata +1 -1
data/ChangeLog CHANGED
@@ -1,4 +1,15 @@
1
- == 0.0.1 / 2008-01-05
1
+ 2008-01-05 cho45
2
2
 
3
- * initial release
3
+ * [r4044] Rakefile:
4
+
5
+ 引数間違い
6
+
7
+ * [r4043] README, Rakefile, lib/shipit.rb:
8
+
9
+ description とか
10
+
11
+ * [r4042] ., ChangeLog, README, Rakefile, lib, lib/shipit.rb, test,
12
+ test/shipit_test.rb, test/test_helper.rb:
13
+
14
+ import
4
15
 
data/README CHANGED
@@ -4,7 +4,12 @@
4
4
 
5
5
  == Description
6
6
 
7
- shipit is automation of release process.
7
+ shipit is automation of release process with Rake tasks.
8
+
9
+ This is a port of ShipIt, originally written in Perl by Brad Fitzpatrick.
10
+ But this is very different from original version (don't use .shipit and
11
+ always use with Rake.) because almost ruby libraries use Rakefile to release
12
+ process.
8
13
 
9
14
 
10
15
  == Installation
@@ -20,9 +25,32 @@ shipit is automation of release process.
20
25
 
21
26
  == Features/Problems
22
27
 
28
+ * svn only...
23
29
 
24
30
  == Synopsis
25
31
 
32
+ Example (This is from shipit gem Rakefile):
33
+
34
+ Rake::ShipitTask.new do |s|
35
+ s.Step.new {
36
+ system("svn", "up")
37
+ }.and {}
38
+ s.Ask
39
+ s.Task :rubyforge
40
+ s.Step.new {
41
+ raise "svn2cl.sh is not found" unless system("svn2cl.sh", "--version")
42
+ }.and {
43
+ system("svn2cl.sh --break-before-msg=2 --group-by-day --include-rev --separate-daylogs")
44
+ }
45
+ s.ChangeVersion
46
+ s.Commit
47
+ s.Task :clean, :package
48
+ s.RubyForge
49
+ s.Tag
50
+ s.Twitter
51
+ end
52
+
53
+
26
54
 
27
55
  == Copyright
28
56
 
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ DESCRIPTION = "Automated release tasks."
19
19
  RUBYFORGE_PROJECT = "lowreal"
20
20
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
21
21
  BIN_FILES = %w( )
22
- VERS = "0.0.0"
22
+ VERS = "0.0.1"
23
23
 
24
24
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
25
25
  CLEAN.include ['**/.*.sw?', '*.gem', '.config']
@@ -126,6 +126,7 @@ Rake::ShipitTask.new do |s|
126
126
  s.Commit
127
127
  s.Task :clean, :package
128
128
  s.RubyForge
129
+ s.Tag
129
130
  s.Twitter
130
131
  end
131
132
 
data/lib/shipit.rb CHANGED
@@ -63,7 +63,7 @@ class Rake::ShipitTask::Step::Step
63
63
  end
64
64
 
65
65
  class Rake::ShipitTask::Step::Twitter
66
- def initialize(msg="Released #{NAME} #{VERS} (#{DESCRIPTION})")
66
+ def initialize(msg=nil)
67
67
  @msg = msg
68
68
  end
69
69
 
@@ -84,6 +84,7 @@ class Rake::ShipitTask::Step::Twitter
84
84
  end
85
85
 
86
86
  def run
87
+ @msg ||= "Released #{NAME} #{VERS} (#{DESCRIPTION})"
87
88
  @client.status(:post, @msg)
88
89
  end
89
90
  end
@@ -116,7 +117,7 @@ class Rake::ShipitTask::Step::ChangeVersion
116
117
  end
117
118
 
118
119
  class Rake::ShipitTask::Step::Commit
119
- def initialize(msg="Release #{VERS}")
120
+ def initialize(msg=nil)
120
121
  @msg = msg
121
122
  end
122
123
 
@@ -124,7 +125,7 @@ class Rake::ShipitTask::Step::Commit
124
125
  end
125
126
 
126
127
  def run
127
- system "svn", "ci", "-m", @msg
128
+ system "svn", "ci", "-m", @msg || "Release #{VERS}"
128
129
  end
129
130
  end
130
131
 
@@ -191,6 +192,33 @@ class Rake::ShipitTask::Step::Ask
191
192
  end
192
193
  end
193
194
 
195
+ class Rake::ShipitTask::Step::Tag
196
+ def initialize(format="release-%s")
197
+ @format = format
198
+ end
199
+
200
+ def prepare
201
+ require "uri"
202
+ ENV["LANG"] = "C"
203
+ url = `svn info`[/^URL: (.+)/, 1]
204
+ if url =~ /trunk$/
205
+ @url = URI(url) + "."
206
+ unless `svn info '#{(@url + "tags")}'`[/Node Kind: directory/]
207
+ raise "tag directory is not found"
208
+ end
209
+ else
210
+ raise "Run at trunk!"
211
+ end
212
+ end
213
+
214
+ def run
215
+ trunk = @url + "trunk"
216
+ tag = @url + ("tags/#{@format}" % VERS)
217
+ command = ["svn", "cp", trunk, tag].map {|i| i.to_s }
218
+ system(*command)
219
+ end
220
+ end
221
+
194
222
 
195
223
  __END__
196
224
  require "shipit"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cho45