pit 0.0.3 → 0.0.4

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 +57 -11
  2. data/Rakefile +22 -24
  3. data/bin/pit +17 -3
  4. data/lib/pit.rb +7 -6
  5. metadata +2 -2
data/ChangeLog CHANGED
@@ -1,12 +1,58 @@
1
- 2008-01-02 SATOH Hiroh <cho45@lowreal.net>
2
-
3
- * Release 0.0.1:
4
- * Release 0.0.2:
5
- * change second argument of Pit.get
6
- Pit.get("twitter.com", :require => {
7
- "username" => "default value",
8
- "password" => "default value"
9
- })
10
- * Release 0.0.3:
11
- * Fix Pig.get with :require returning value
1
+ 2008-01-05 cho45
2
+
3
+ * [r4067] Rakefile, bin/pit, lib/pit.rb:
4
+
5
+ shipit つかうように
6
+ pit コマンドの --version が矛盾してしまっていたので修正
7
+
8
+ * [r4066] bin/pit:
9
+
10
+ implemented help subcommand.
11
+ help コマンドを実装していなかった……
12
+
13
+ * [r4065] ChangeLog, lib/pit.rb:
14
+
15
+ リファクタリング。
16
+ set でエディタをひらき、何も変更しなかった場合に何も返さなかった問題を修正
17
+
18
+ 2008-01-04 cho45
19
+
20
+ * [r4031] .:
21
+
22
+ set svn ignore
23
+
24
+ 2008-01-02 cho45
25
+
26
+ * [r3979] ChangeLog, Rakefile, test/pit_test.rb:
27
+
28
+ テストたしてりりーす
29
+
30
+ * [r3978] lib/pit.rb:
31
+
32
+ get :require がちゃんと設定をかえしてなかった
33
+
34
+ * [r3973] ChangeLog, README, Rakefile, lib/pit.rb:
35
+
36
+ Pit.get のだいにひきすうをかっこよく
37
+
38
+ * [r3972] Rakefile:
39
+
40
+ released 0.0.1
41
+
42
+ * [r3971] README, bin/pit, lib/pit.rb:
43
+
44
+ とりあえずつかえるぐらいに
45
+
46
+ * [r3970] lib/pit.rb, test/pit_test.rb:
47
+
48
+ implemented switch
49
+
50
+ * [r3969] Rakefile:
51
+
52
+ Rakefile
53
+
54
+ * [r3968] ., ChangeLog, README, Rakefile, bin, bin/pit, lib,
55
+ lib/pit.rb, test, test/pit_test.rb, test/test_helper.rb:
56
+
57
+ import
12
58
 
data/Rakefile CHANGED
@@ -10,6 +10,8 @@ require 'rake/contrib/sshpublisher'
10
10
  require 'fileutils'
11
11
  include FileUtils
12
12
 
13
+ require "lib/pit"
14
+
13
15
  NAME = "pit"
14
16
  AUTHOR = "cho45"
15
17
  EMAIL = "cho45@lowreal.net"
@@ -17,7 +19,7 @@ DESCRIPTION = "pit: account management tool"
17
19
  RUBYFORGE_PROJECT = "lowreal"
18
20
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
19
21
  BIN_FILES = %w( pit )
20
- VERS = "0.0.3"
22
+ VERS = Pit::VERSION
21
23
 
22
24
 
23
25
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
@@ -110,27 +112,23 @@ task :rubyforge => [:rdoc, :package] do
110
112
  sh %{rsync -r --delete --verbose #{@local_dir}/ #{@host}:#{@remote_dir}}
111
113
  end
112
114
 
113
- desc 'Package and upload the release to rubyforge.'
114
- task :release => [:clean, :package] do |t|
115
- require 'rubyforge'
116
- v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
117
- abort "Versions don't match #{v} vs #{VERS}" unless v == VERS
118
- pkg = "pkg/#{NAME}-#{VERS}"
119
-
120
- rf = RubyForge.new
121
- puts "Logging in"
122
- rf.login
123
-
124
- c = rf.userconfig
125
- # c["release_notes"] = description if description
126
- # c["release_changes"] = changes if changes
127
- c["preformatted"] = true
128
-
129
- files = [
130
- "#{pkg}.tgz",
131
- "#{pkg}.gem"
132
- ].compact
133
-
134
- puts "Releasing #{NAME} v. #{VERS}"
135
- rf.add_release RUBYFORGE_PROJECT, NAME, VERS, *files
115
+ require "shipit"
116
+ Rake::ShipitTask.new do |s|
117
+ s.Step.new {
118
+ system("svn", "up")
119
+ }.and {}
120
+ s.Ask
121
+ s.Task :rubyforge
122
+ s.Step.new {
123
+ raise "svn2cl.sh is not found" unless system("svn2cl.sh", "--version")
124
+ }.and {
125
+ system("svn2cl.sh --break-before-msg=2 --group-by-day --include-rev --separate-daylogs")
126
+ }
127
+ s.ChangeVersion "lib/pit.rb", "VERSION"
128
+ s.Commit
129
+ s.Task :clean, :package
130
+ s.RubyForge
131
+ # s.Tag
132
+ s.Twitter
136
133
  end
134
+
data/bin/pit CHANGED
@@ -7,7 +7,7 @@ require "pathname"
7
7
  require "pit"
8
8
 
9
9
  class PitCommand
10
- VERSION = "0.0.1"
10
+ VERSION = Pit::VERSION
11
11
  NAME = "pit"
12
12
 
13
13
  def self.run(argv)
@@ -97,7 +97,7 @@ class PitCommand
97
97
  name, = @argv
98
98
  exit if name.nil?
99
99
  if $stdout.tty?
100
- $stderr.puts "do not output to tty."
100
+ warn "do not output to tty."
101
101
  else
102
102
  puts Pit.get(name).to_yaml
103
103
  end
@@ -114,7 +114,21 @@ class PitCommand
114
114
  profile = "default" if profile.nil?
115
115
  profile.gsub(/[^a-z0-9.-]/i, "")
116
116
  Pit.switch(profile)
117
- $stderr.puts "Switch profile to #{profile}"
117
+ warn "Switch profile to #{profile}"
118
+ end
119
+
120
+ def cmd_help
121
+ subcommand, = @argv
122
+ if subcommand
123
+ if @subparsers.key? subcommand
124
+ puts @subparsers[subcommand].help
125
+ else
126
+ puts "No such subcommand `#{subcommand}'"
127
+ puts @parser.help
128
+ end
129
+ else
130
+ puts @parser.help
131
+ end
118
132
  end
119
133
  end
120
134
 
data/lib/pit.rb CHANGED
@@ -4,11 +4,13 @@ require "pathname"
4
4
  require "tempfile"
5
5
 
6
6
  module Pit
7
+ VERSION = "0.0.4"
7
8
  Directory = Pathname.new("~/.pit").expand_path
8
9
  @@config = Directory + "pit.yaml"
9
10
  @@profile = Directory + "default.yaml"
10
11
 
11
12
  def self.set(name, opts={})
13
+ profile = self.load
12
14
  if opts.key?(:data)
13
15
  result = opts[:data]
14
16
  else
@@ -20,15 +22,14 @@ module Pit
20
22
  t.open
21
23
  result = t.read
22
24
  if result == c
23
- $stderr.puts "No Changes"
24
- return
25
+ warn "No Changes"
26
+ return profile[name]
25
27
  end
26
28
  result = YAML.load(result)
27
29
  end
28
- config = self.load
29
- config[name] = result
30
- @@profile.open("w") {|f| YAML.dump(config, f) }
31
- config[name]
30
+ profile[name] = result
31
+ @@profile.open("w") {|f| YAML.dump(profile, f) }
32
+ result
32
33
  end
33
34
 
34
35
  def self.get(name, opts={})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - cho45
@@ -9,7 +9,7 @@ autorequire: pit
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-02 00:00:00 +09:00
12
+ date: 2008-01-06 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15