tyrantmanager 1.6.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY.rdoc +13 -0
- data/LICENSE +1 -1
- data/README.rdoc +21 -10
- data/Rakefile +53 -0
- data/TODO.taskpaper +11 -0
- data/bin/tyrantmanager +1 -2
- data/lib/tyrant_manager/cli.rb +6 -3
- data/lib/tyrant_manager/command.rb +5 -0
- data/lib/tyrant_manager/commands/archive_ulogs.rb +5 -0
- data/lib/tyrant_manager/commands/create_instance.rb +5 -0
- data/lib/tyrant_manager/commands/list.rb +5 -0
- data/lib/tyrant_manager/commands/replication_status.rb +5 -0
- data/lib/tyrant_manager/commands/start.rb +5 -0
- data/lib/tyrant_manager/commands/stats.rb +5 -0
- data/lib/tyrant_manager/commands/status.rb +5 -0
- data/lib/tyrant_manager/commands/stop.rb +5 -0
- data/lib/tyrant_manager/log.rb +5 -0
- data/lib/tyrant_manager/paths.rb +5 -0
- data/lib/tyrant_manager/runner.rb +5 -0
- data/lib/tyrant_manager/tyrant_instance.rb +5 -0
- data/lib/tyrant_manager/util.rb +5 -0
- data/lib/tyrant_manager/version.rb +3 -3
- data/lib/tyrant_manager.rb +19 -5
- data/lib/tyrantmanager.rb +5 -0
- data/spec/spec_helper.rb +8 -9
- data/spec/tyrant_instance_spec.rb +1 -1
- data/spec/tyrant_manager_spec.rb +24 -2
- metadata +93 -76
- data/gemspec.rb +0 -53
- data/tasks/announce.rake +0 -43
- data/tasks/config.rb +0 -99
- data/tasks/distribution.rake +0 -45
- data/tasks/documentation.rake +0 -32
- data/tasks/gemcutter.rake +0 -15
- data/tasks/rspec.rake +0 -29
- data/tasks/rubyforge.rake +0 -51
- data/tasks/utils.rb +0 -80
data/HISTORY.rdoc
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
= Changelog
|
2
|
+
== Version 1.7.1 2011-05-15
|
3
|
+
|
4
|
+
* fix mistaking the instance config.rb for the manager's config.rb [GH #11].
|
5
|
+
* force an FFI dependency that for some reason does not resolve in rufus-tokyo [GH #8]
|
6
|
+
* fix documentation of 'process-status' [GH #9]
|
7
|
+
* switch to Bones for project management tasks
|
8
|
+
* update dependencies to latest versions
|
9
|
+
** rufus-tokyo 1.0.7
|
10
|
+
** rspec 2.6.0
|
11
|
+
** loquacious 1.7.1
|
12
|
+
** logging 1.5.0
|
13
|
+
** main 4.4.0
|
14
|
+
|
2
15
|
== Version 1.6.0 2010-06-17
|
3
16
|
|
4
17
|
* update to loquacious 1.6.x
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
== Tyrant Manager
|
2
2
|
|
3
|
-
* Homepage[http://copiousfreetime.
|
4
|
-
* {Rubyforge project}[http://rubyforge.org/projects/copiousfreetime/]
|
3
|
+
* Homepage[http://copiousfreetime.org/projects/tyrantmanager]
|
5
4
|
* email jeremy at copiousfreetime dot org
|
6
|
-
*
|
5
|
+
* {Github}[https://github.com/copiousfreetime/tyrantmanager]
|
6
|
+
* {Bug Tracking}[https://github.com/copiousfreetime/tyrantmanager/issue]
|
7
7
|
* git clone git://github.com/copiousfreetime/tyrantmanager.git
|
8
8
|
|
9
9
|
== INSTALLATION
|
@@ -12,7 +12,8 @@
|
|
12
12
|
|
13
13
|
== SYNOPSIS
|
14
14
|
|
15
|
-
tyrantmanager
|
15
|
+
tyrantmanager
|
16
|
+
(setup|create-instance|start|stop|process-status|replication-status|stats|list) [options]+
|
16
17
|
|
17
18
|
== DESCRIPTION
|
18
19
|
|
@@ -37,8 +38,18 @@ Once the manager home is setup, all other commands need to know about it.
|
|
37
38
|
This can be achieved in 3 ways.
|
38
39
|
|
39
40
|
* use the --home option on all commands
|
40
|
-
* set the TYRANT_MANAGER_HOME environment variable
|
41
41
|
* execute the commands when the current working directory is the tyrant home.
|
42
|
+
* set the TYRANT_MANAGER_HOME environment variable
|
43
|
+
|
44
|
+
This is also the attempt order when looking for the manager home. The process
|
45
|
+
is:
|
46
|
+
|
47
|
+
1. Check if --home is used, and that it is a valid tyrantmanager home. If that
|
48
|
+
is the case then use it.
|
49
|
+
2. If --home is not used, then check if the current working directory has a
|
50
|
+
valid 'config.rb' file that is also a top level manager config. If it is
|
51
|
+
then use that as the tyrant manager home.
|
52
|
+
3. If all else fails, use the TYRANT_MAMAGER_HOME environment variable.
|
42
53
|
|
43
54
|
=== Creating a new tyrant instance
|
44
55
|
|
@@ -177,7 +188,7 @@ the ttserver command line that was used is output.
|
|
177
188
|
|
178
189
|
As you can see the commandline used to start the tyrant server is output.
|
179
190
|
|
180
|
-
jeremy@playground:/tmp/tyrant % tyrantmanager status
|
191
|
+
jeremy@playground:/tmp/tyrant % tyrantmanager process-status
|
181
192
|
00:52:17 INFO : bar is running as pid 28658
|
182
193
|
00:52:17 INFO : baz is running as pid 28670
|
183
194
|
00:52:17 INFO : foo is running as pid 28682
|
@@ -194,7 +205,7 @@ As you can see the commandline used to start the tyrant server is output.
|
|
194
205
|
|
195
206
|
And see that they are all done
|
196
207
|
|
197
|
-
jeremy@playground:/tmp/tyrant % tyrantmanager status
|
208
|
+
jeremy@playground:/tmp/tyrant % tyrantmanager process-status
|
198
209
|
00:53:15 INFO : bar is not running, or its pid file is gone
|
199
210
|
00:53:15 INFO : baz is not running, or its pid file is gone
|
200
211
|
00:53:15 INFO : foo is not running, or its pid file is gone
|
@@ -209,7 +220,7 @@ And see that they are all done
|
|
209
220
|
|
210
221
|
Foo and baz are started, bar is still stopped
|
211
222
|
|
212
|
-
jeremy@playground:/tmp/tyrant % tyrantmanager status
|
223
|
+
jeremy@playground:/tmp/tyrant % tyrantmanager process-status
|
213
224
|
00:54:38 INFO : bar is not running, or its pid file is gone
|
214
225
|
00:54:38 INFO : baz is running as pid 28708
|
215
226
|
00:54:38 INFO : foo is running as pid 28720
|
@@ -222,7 +233,7 @@ Foo and baz are started, bar is still stopped
|
|
222
233
|
|
223
234
|
And baz is still running
|
224
235
|
|
225
|
-
jeremy@playground:/tmp/tyrant % tyrantmanager status
|
236
|
+
jeremy@playground:/tmp/tyrant % tyrantmanager process-status
|
226
237
|
00:55:51 INFO : bar is not running, or its pid file is gone
|
227
238
|
00:55:51 INFO : baz is running as pid 28708
|
228
239
|
00:55:51 INFO : foo is not running, or its pid file is gone
|
@@ -261,7 +272,7 @@ You can also look at the server statistics of each running instance
|
|
261
272
|
|
262
273
|
== LICENSE
|
263
274
|
|
264
|
-
Copyright (c) 2009, Jeremy Hinegardner
|
275
|
+
Copyright (c) 2009-2011, Jeremy Hinegardner. All rights reserved
|
265
276
|
|
266
277
|
Permission to use, copy, modify, and/or distribute this software for any
|
267
278
|
purpose with or without fee is hereby granted, provided that the above
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009-2011 Jeremy Hinegardner
|
3
|
+
# All rights reserved. See LICENSE and/or COPYING for details.
|
4
|
+
#++
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'bones'
|
8
|
+
rescue LoadError
|
9
|
+
abort '### Please install the "bones" gem ###'
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => 'spec:run'
|
13
|
+
task 'gem:release' => 'spec:run'
|
14
|
+
|
15
|
+
$:.unshift( "lib" )
|
16
|
+
require 'tyrant_manager/version'
|
17
|
+
|
18
|
+
Bones {
|
19
|
+
name "tyrantmanager"
|
20
|
+
author "Jeremy Hinegardner"
|
21
|
+
email "jeremy@copiousfreetime.org"
|
22
|
+
url "http://www.copiousfreetime.org/projects/tyrant_manager"
|
23
|
+
version TyrantManager::VERSION
|
24
|
+
|
25
|
+
ruby_opts %w[ -W0 -rubygems ]
|
26
|
+
readme_file "README.rdoc"
|
27
|
+
ignore_file ".gitignore"
|
28
|
+
history_file "HISTORY.rdoc"
|
29
|
+
|
30
|
+
rdoc.include << "README.rdoc" << "HISTORY.rdoc" << "LICENSE"
|
31
|
+
|
32
|
+
summary 'A command line tool for managing Tokyo Tyrant instances.'
|
33
|
+
description <<_
|
34
|
+
A command line tool for managing Tokyo Tyrant instances. It allows for the
|
35
|
+
creation, starting, stopping, listing, stating of many tokyo tyrant instances
|
36
|
+
all on the same machine. The commands can be applied to a single or multiple
|
37
|
+
instances.
|
38
|
+
_
|
39
|
+
|
40
|
+
depend_on "loquacious" ,"~> 1.7.1"
|
41
|
+
depend_on "rufus-tokyo" ,"~> 1.0.7"
|
42
|
+
depend_on "logging" ,"~> 1.5.0"
|
43
|
+
depend_on "main" ,"~> 4.4.0"
|
44
|
+
depend_on "ffi" ,"~> 1.0.7" #unsure why this doesn't get resolved with rufus-tokyo
|
45
|
+
|
46
|
+
|
47
|
+
depend_on "bones" , "~> 3.6.5", :development
|
48
|
+
depend_on "bones-extras", "~> 1.3.0", :development
|
49
|
+
depend_on "rspec" , "~> 2.6.0", :development
|
50
|
+
|
51
|
+
spec.opts << "--colour" << "--format documentation"
|
52
|
+
}
|
53
|
+
|
data/TODO.taskpaper
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Tyrant Manager:
|
2
|
+
|
3
|
+
Startup Script:
|
4
|
+
- startup script generation -- simple shell, executes the tyrant-manager
|
5
|
+
- main command line -- all the commands, and they take an optional instance
|
6
|
+
or all -- no default
|
7
|
+
- remove -- not yet
|
8
|
+
Configuration:
|
9
|
+
- Fix cascading config so it is not a work around for Loquacious
|
10
|
+
nattering on about undefined values. A proper merged config
|
11
|
+
would be better.
|
data/bin/tyrantmanager
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2009
|
4
|
+
# Copyright (c) 2009-2011 Jeremy Hinegardner
|
5
5
|
# All rights reserved. See LICENSE and/or COPYING for details.
|
6
6
|
#++
|
7
7
|
|
8
8
|
$:.unshift File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
|
9
9
|
require 'tyrant_manager'
|
10
|
-
#::TyrantManager::Cli.new( ARGV, ENV ).run
|
11
10
|
::TyrantManager::Cli.build( ARGV, ENV ).new.run
|
data/lib/tyrant_manager/cli.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
|
2
|
-
#
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009-2011 Jeremy Hinegardner
|
3
|
+
# All rights reserved. See LICENSE and/or COPYING for details.
|
4
|
+
#++
|
5
|
+
|
3
6
|
require 'main'
|
4
7
|
require 'tyrant_manager'
|
5
8
|
|
6
9
|
class TyrantManager
|
7
10
|
Cli = Main.create {
|
8
|
-
author "Copyright
|
11
|
+
author "Copyright (c) 2009-2011 Jeremy Hinegardner. All rights reserved"
|
9
12
|
version ::TyrantManager::VERSION
|
10
13
|
|
11
14
|
description <<-txt
|
data/lib/tyrant_manager/log.rb
CHANGED
data/lib/tyrant_manager/paths.rb
CHANGED
data/lib/tyrant_manager/util.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2009 Jeremy Hinegardner
|
2
|
+
# Copyright (c) 2009-2011 Jeremy Hinegardner
|
3
3
|
# All rights reserved. See LICENSE and/or COPYING for details
|
4
4
|
#++
|
5
5
|
|
6
6
|
class TyrantManager
|
7
7
|
module Version
|
8
8
|
MAJOR = 1
|
9
|
-
MINOR =
|
10
|
-
BUILD =
|
9
|
+
MINOR = 7
|
10
|
+
BUILD = 1
|
11
11
|
|
12
12
|
def to_a
|
13
13
|
[MAJOR, MINOR, BUILD]
|
data/lib/tyrant_manager.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2009 Jeremy Hinegardner
|
2
|
+
# Copyright (c) 2009-2011 Jeremy Hinegardner
|
3
3
|
# All rights reserved. See LICENSE and/or COPYING for details.
|
4
4
|
#++
|
5
5
|
|
@@ -31,13 +31,27 @@ class TyrantManager
|
|
31
31
|
"tyrant"
|
32
32
|
end
|
33
33
|
|
34
|
+
MAGIC_LINE = 'Loquacious::Configuration.for( "manager" ) do'
|
35
|
+
|
34
36
|
#
|
35
37
|
# is the given directory a tyrant root directory. A tyrant root has a
|
36
|
-
# +config_file_basename+ file in the top level
|
38
|
+
# +config_file_basename+ file in the top level. And that
|
39
|
+
# +config_file_basename+ file has the following line in it.
|
40
|
+
#
|
41
|
+
# Loquacious::Configuration.for( "manager" ) do
|
42
|
+
#
|
43
|
+
# Consider this a 'magic line' in the config file. If this line is in the
|
44
|
+
# config file then it is considered the top level tyrant root config file.
|
45
|
+
# This is done by line detection instead of evaluation since the
|
46
|
+
# configuration is not evaluated until later.
|
37
47
|
#
|
38
48
|
def is_tyrant_root?( dir )
|
39
49
|
cfg = File.join( dir, config_file_basename )
|
40
|
-
|
50
|
+
if File.directory?( dir ) and File.exist?( cfg ) then
|
51
|
+
IO.readlines( cfg ).each do |line|
|
52
|
+
return true if line.index( MAGIC_LINE )
|
53
|
+
end
|
54
|
+
end
|
41
55
|
return false
|
42
56
|
end
|
43
57
|
|
@@ -92,7 +106,7 @@ class TyrantManager
|
|
92
106
|
dd = defaults.shift
|
93
107
|
break if dd or defaults.empty?
|
94
108
|
end
|
95
|
-
raise Error, "No
|
109
|
+
raise Error, "No default Tyrant Manager home directory found" unless dd
|
96
110
|
return dd
|
97
111
|
end
|
98
112
|
|
@@ -150,7 +164,7 @@ class TyrantManager
|
|
150
164
|
if File.exist?( self.config_file ) then
|
151
165
|
configuration # force a load
|
152
166
|
else
|
153
|
-
raise Error, "#{home_dir} is not a valid
|
167
|
+
raise Error, "#{home_dir} is not a valid TyrantManager home. #{self.config_file} does not exist"
|
154
168
|
end
|
155
169
|
end
|
156
170
|
|
data/lib/tyrantmanager.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'spec'
|
1
|
+
require 'rspec'
|
3
2
|
require 'logging'
|
4
3
|
|
5
4
|
$:.unshift File.expand_path( File.join( File.dirname( __FILE__ ),"..","lib"))
|
@@ -7,7 +6,7 @@ $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ),"..","lib"))
|
|
7
6
|
|
8
7
|
Logging::Logger['TyrantManager'].level = :all
|
9
8
|
|
10
|
-
module
|
9
|
+
module RSpec
|
11
10
|
module Log
|
12
11
|
def self.io
|
13
12
|
@io ||= StringIO.new
|
@@ -43,16 +42,16 @@ module Spec
|
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
|
-
|
47
|
-
config.include
|
45
|
+
RSpec.configure do |config|
|
46
|
+
config.include RSpec::Helpers
|
48
47
|
|
49
48
|
config.before do
|
50
|
-
|
51
|
-
|
49
|
+
RSpec::Log.io.rewind
|
50
|
+
RSpec::Log.io.truncate( 0 )
|
52
51
|
end
|
53
52
|
|
54
53
|
config.after do
|
55
|
-
|
56
|
-
|
54
|
+
RSpec::Log.io.rewind
|
55
|
+
RSpec::Log.io.truncate( 0 )
|
57
56
|
end
|
58
57
|
end
|
data/spec/tyrant_manager_spec.rb
CHANGED
@@ -8,6 +8,7 @@ describe TyrantManager do
|
|
8
8
|
TyrantManager::Log.silent {
|
9
9
|
@mgr = TyrantManager.setup( @tdir )
|
10
10
|
}
|
11
|
+
ENV.delete( 'TYRANT_MANAGER_HOME' )
|
11
12
|
#TyrantManager::Log.level = :debug
|
12
13
|
end
|
13
14
|
|
@@ -27,6 +28,27 @@ describe TyrantManager do
|
|
27
28
|
ENV['TYRANT_MANAGER_HOME'] = @tdir
|
28
29
|
TyrantManager.default_directory.should == @tdir
|
29
30
|
end
|
31
|
+
|
32
|
+
context "When the current directory is an instance's home directory" do
|
33
|
+
before do
|
34
|
+
ENV['TYRANT_MANAGER_HOME'] = @tdir
|
35
|
+
idir = @mgr.instances_path( "test" )
|
36
|
+
@test_instance = TyrantManager::TyrantInstance.setup( idir )
|
37
|
+
end
|
38
|
+
|
39
|
+
it "falls back to TYRANT_MANAGER_HOME if the current directory is not a valid tyrant manager home" do
|
40
|
+
Dir.chdir( @test_instance.home_dir ) do |d|
|
41
|
+
TyrantManager.default_directory.should == @tdir
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it "raises an error if no default can be found" do
|
46
|
+
ENV.delete('TYRANT_MANAGER_HOME')
|
47
|
+
Dir.chdir( @test_instance.home_dir ) do |d|
|
48
|
+
lambda { TyrantManager.default_directory }.should raise_error( TyrantManager::Error, "No default Tyrant Manager home directory found" )
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
30
52
|
end
|
31
53
|
|
32
54
|
it "initializes with an existing directory" do
|
@@ -35,7 +57,7 @@ describe TyrantManager do
|
|
35
57
|
end
|
36
58
|
|
37
59
|
it "raises an error if attempting to initialize from a non-existent tyrnat home" do
|
38
|
-
lambda { TyrantManager.new( "/tmp" ) }.should raise_error( TyrantManager::Error, /\/tmp is not a valid
|
60
|
+
lambda { TyrantManager.new( "/tmp" ) }.should raise_error( TyrantManager::Error, /\/tmp is not a valid TyrantManager home/ )
|
39
61
|
end
|
40
62
|
|
41
63
|
it "#config_file" do
|
@@ -44,7 +66,7 @@ describe TyrantManager do
|
|
44
66
|
end
|
45
67
|
|
46
68
|
it "#configuration" do
|
47
|
-
@mgr.configuration.
|
69
|
+
@mgr.configuration.nil?.should == false
|
48
70
|
end
|
49
71
|
|
50
72
|
it "has the location of the ttserver command" do
|
metadata
CHANGED
@@ -1,111 +1,143 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tyrantmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 1.7.1
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
|
7
|
+
authors: []
|
8
|
+
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date:
|
13
|
+
date: 2011-05-15 00:00:00 -06:00
|
13
14
|
default_executable:
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: loquacious
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
20
21
|
requirements:
|
21
22
|
- - ~>
|
22
23
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
24
|
-
|
24
|
+
version: 1.7.1
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rufus-tokyo
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
30
32
|
requirements:
|
31
33
|
- - ~>
|
32
34
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.
|
34
|
-
|
35
|
+
version: 1.0.7
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
35
38
|
- !ruby/object:Gem::Dependency
|
36
39
|
name: logging
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
40
43
|
requirements:
|
41
44
|
- - ~>
|
42
45
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
44
|
-
|
46
|
+
version: 1.5.0
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
45
49
|
- !ruby/object:Gem::Dependency
|
46
50
|
name: main
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 4.4.0
|
47
58
|
type: :runtime
|
48
|
-
|
49
|
-
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: ffi
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
50
65
|
requirements:
|
51
66
|
- - ~>
|
52
67
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
54
|
-
|
68
|
+
version: 1.0.7
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id005
|
55
71
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
57
|
-
|
58
|
-
|
59
|
-
|
72
|
+
name: bones
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
60
76
|
requirements:
|
61
77
|
- - ~>
|
62
78
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
-
|
79
|
+
version: 3.6.5
|
80
|
+
type: :runtime
|
81
|
+
version_requirements: *id006
|
65
82
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
67
|
-
|
68
|
-
|
69
|
-
|
83
|
+
name: bones-extras
|
84
|
+
prerelease: false
|
85
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
70
87
|
requirements:
|
71
88
|
- - ~>
|
72
89
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
74
|
-
|
75
|
-
|
90
|
+
version: 1.3.0
|
91
|
+
type: :runtime
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: rspec
|
95
|
+
prerelease: false
|
96
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 2.6.0
|
102
|
+
type: :runtime
|
103
|
+
version_requirements: *id008
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: bones
|
106
|
+
prerelease: false
|
107
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 3.6.5
|
113
|
+
type: :development
|
114
|
+
version_requirements: *id009
|
115
|
+
description: |
|
76
116
|
A command line tool for managing Tokyo Tyrant instances. It allows for the
|
77
117
|
creation, starting, stopping, listing, stating of many tokyo tyrant instances
|
78
118
|
all on the same machine. The commands can be applied to a single or multiple
|
79
119
|
instances.
|
120
|
+
|
80
121
|
email: jeremy@copiousfreetime.org
|
81
122
|
executables:
|
82
123
|
- tyrantmanager
|
83
124
|
extensions: []
|
84
125
|
|
85
126
|
extra_rdoc_files:
|
86
|
-
- README.rdoc
|
87
127
|
- HISTORY.rdoc
|
88
128
|
- LICENSE
|
89
|
-
-
|
90
|
-
-
|
91
|
-
- lib/tyrant_manager/commands/archive_ulogs.rb
|
92
|
-
- lib/tyrant_manager/commands/create_instance.rb
|
93
|
-
- lib/tyrant_manager/commands/list.rb
|
94
|
-
- lib/tyrant_manager/commands/replication_status.rb
|
95
|
-
- lib/tyrant_manager/commands/start.rb
|
96
|
-
- lib/tyrant_manager/commands/stats.rb
|
97
|
-
- lib/tyrant_manager/commands/status.rb
|
98
|
-
- lib/tyrant_manager/commands/stop.rb
|
99
|
-
- lib/tyrant_manager/log.rb
|
100
|
-
- lib/tyrant_manager/paths.rb
|
101
|
-
- lib/tyrant_manager/runner.rb
|
102
|
-
- lib/tyrant_manager/tyrant_instance.rb
|
103
|
-
- lib/tyrant_manager/util.rb
|
104
|
-
- lib/tyrant_manager/version.rb
|
105
|
-
- lib/tyrant_manager.rb
|
106
|
-
- lib/tyrantmanager.rb
|
129
|
+
- README.rdoc
|
130
|
+
- bin/tyrantmanager
|
107
131
|
files:
|
132
|
+
- HISTORY.rdoc
|
133
|
+
- LICENSE
|
134
|
+
- README.rdoc
|
135
|
+
- Rakefile
|
136
|
+
- TODO.taskpaper
|
108
137
|
- bin/tyrantmanager
|
138
|
+
- data/config.rb
|
139
|
+
- data/default_instance_config.rb
|
140
|
+
- lib/tyrant_manager.rb
|
109
141
|
- lib/tyrant_manager/cli.rb
|
110
142
|
- lib/tyrant_manager/command.rb
|
111
143
|
- lib/tyrant_manager/commands/archive_ulogs.rb
|
@@ -122,7 +154,6 @@ files:
|
|
122
154
|
- lib/tyrant_manager/tyrant_instance.rb
|
123
155
|
- lib/tyrant_manager/util.rb
|
124
156
|
- lib/tyrant_manager/version.rb
|
125
|
-
- lib/tyrant_manager.rb
|
126
157
|
- lib/tyrantmanager.rb
|
127
158
|
- spec/command_spec.rb
|
128
159
|
- spec/paths_spec.rb
|
@@ -130,22 +161,8 @@ files:
|
|
130
161
|
- spec/tyrant_instance_spec.rb
|
131
162
|
- spec/tyrant_manager_spec.rb
|
132
163
|
- spec/version_spec.rb
|
133
|
-
- data/config.rb
|
134
|
-
- data/default_instance_config.rb
|
135
|
-
- README.rdoc
|
136
|
-
- HISTORY.rdoc
|
137
|
-
- LICENSE
|
138
|
-
- tasks/announce.rake
|
139
|
-
- tasks/distribution.rake
|
140
|
-
- tasks/documentation.rake
|
141
|
-
- tasks/gemcutter.rake
|
142
|
-
- tasks/rspec.rake
|
143
|
-
- tasks/rubyforge.rake
|
144
|
-
- tasks/config.rb
|
145
|
-
- tasks/utils.rb
|
146
|
-
- gemspec.rb
|
147
164
|
has_rdoc: true
|
148
|
-
homepage: http://copiousfreetime.
|
165
|
+
homepage: http://www.copiousfreetime.org/projects/tyrant_manager
|
149
166
|
licenses: []
|
150
167
|
|
151
168
|
post_install_message:
|
@@ -155,23 +172,23 @@ rdoc_options:
|
|
155
172
|
require_paths:
|
156
173
|
- lib
|
157
174
|
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
158
176
|
requirements:
|
159
177
|
- - ">="
|
160
178
|
- !ruby/object:Gem::Version
|
161
179
|
version: "0"
|
162
|
-
version:
|
163
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
164
182
|
requirements:
|
165
183
|
- - ">="
|
166
184
|
- !ruby/object:Gem::Version
|
167
185
|
version: "0"
|
168
|
-
version:
|
169
186
|
requirements: []
|
170
187
|
|
171
|
-
rubyforge_project:
|
172
|
-
rubygems_version: 1.
|
188
|
+
rubyforge_project: tyrantmanager
|
189
|
+
rubygems_version: 1.5.2
|
173
190
|
signing_key:
|
174
191
|
specification_version: 3
|
175
|
-
summary: A command line tool for managing Tokyo Tyrant instances
|
192
|
+
summary: A command line tool for managing Tokyo Tyrant instances.
|
176
193
|
test_files: []
|
177
194
|
|
data/gemspec.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'tyrant_manager/version'
|
3
|
-
require 'tasks/config'
|
4
|
-
|
5
|
-
TyrantManager::GEM_SPEC = Gem::Specification.new do |spec|
|
6
|
-
proj = Configuration.for('project')
|
7
|
-
spec.name = proj.name
|
8
|
-
spec.version = TyrantManager::VERSION
|
9
|
-
|
10
|
-
spec.author = proj.author
|
11
|
-
spec.email = proj.email
|
12
|
-
spec.homepage = proj.homepage
|
13
|
-
spec.summary = proj.summary
|
14
|
-
spec.description = proj.description
|
15
|
-
spec.platform = Gem::Platform::RUBY
|
16
|
-
|
17
|
-
|
18
|
-
pkg = Configuration.for('packaging')
|
19
|
-
spec.files = pkg.files.all
|
20
|
-
spec.executables = pkg.files.bin.collect { |b| File.basename(b) }
|
21
|
-
|
22
|
-
# add dependencies here
|
23
|
-
spec.add_dependency( "loquacious", "~> 1.6.4")
|
24
|
-
spec.add_dependency( "rufus-tokyo", "~> 1.0.1")
|
25
|
-
spec.add_dependency( "logging", "~> 1.4.3" )
|
26
|
-
spec.add_dependency( "main", "~> 4.2.0" )
|
27
|
-
|
28
|
-
# development dependencies
|
29
|
-
spec.add_development_dependency("configuration", "~> 1.1.0")
|
30
|
-
spec.add_development_dependency( "rake", "~> 0.8.3")
|
31
|
-
|
32
|
-
if ext_conf = Configuration.for_if_exist?("extension") then
|
33
|
-
spec.extensions << ext_conf.configs
|
34
|
-
spec.extensions.flatten!
|
35
|
-
end
|
36
|
-
|
37
|
-
if rdoc = Configuration.for_if_exist?('rdoc') then
|
38
|
-
spec.has_rdoc = true
|
39
|
-
spec.extra_rdoc_files = pkg.files.rdoc
|
40
|
-
spec.rdoc_options = rdoc.options + [ "--main" , rdoc.main_page ]
|
41
|
-
else
|
42
|
-
spec.has_rdoc = false
|
43
|
-
end
|
44
|
-
|
45
|
-
if test = Configuration.for_if_exist?('testing') then
|
46
|
-
spec.test_files = test.files
|
47
|
-
end
|
48
|
-
|
49
|
-
if rf = Configuration.for_if_exist?('rubyforge') then
|
50
|
-
spec.rubyforge_project = rf.project
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
data/tasks/announce.rake
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
#-------------------------------------------------------------------------------
|
3
|
-
# announcement methods
|
4
|
-
#-------------------------------------------------------------------------------
|
5
|
-
|
6
|
-
proj_config = Configuration.for('project')
|
7
|
-
namespace :announce do
|
8
|
-
desc "create email for ruby-talk"
|
9
|
-
task :email do
|
10
|
-
info = Utils.announcement
|
11
|
-
|
12
|
-
File.open("email.txt", "w") do |mail|
|
13
|
-
mail.puts "From: #{proj_config.author} <#{proj_config.email}>"
|
14
|
-
mail.puts "To: ruby-talk@ruby-lang.org"
|
15
|
-
mail.puts "Date: #{Time.now.rfc2822}"
|
16
|
-
mail.puts "Subject: [ANN] #{info[:subject]}"
|
17
|
-
mail.puts
|
18
|
-
mail.puts info[:title]
|
19
|
-
mail.puts
|
20
|
-
mail.puts "{{ Release notes for Version #{TyrantManager::VERSION} }}"
|
21
|
-
mail.puts
|
22
|
-
mail.puts info[:release_notes]
|
23
|
-
mail.puts
|
24
|
-
mail.puts " #{info[:urls]}"
|
25
|
-
mail.puts
|
26
|
-
mail.puts "=== Installation"
|
27
|
-
mail.puts
|
28
|
-
mail.puts " gem install #{TyrantManager::GEM_SPEC.name}"
|
29
|
-
mail.puts
|
30
|
-
mail.puts "=== Description"
|
31
|
-
mail.puts
|
32
|
-
mail.puts info[:description]
|
33
|
-
mail.puts
|
34
|
-
end
|
35
|
-
puts "Created the following as email.txt:"
|
36
|
-
puts "-" * 72
|
37
|
-
puts File.read("email.txt")
|
38
|
-
puts "-" * 72
|
39
|
-
end
|
40
|
-
|
41
|
-
CLOBBER << "email.txt"
|
42
|
-
end
|
43
|
-
|
data/tasks/config.rb
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
require 'configuration'
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
require 'tasks/utils'
|
5
|
-
|
6
|
-
#-----------------------------------------------------------------------
|
7
|
-
# General project configuration
|
8
|
-
#-----------------------------------------------------------------------
|
9
|
-
Configuration.for('project') {
|
10
|
-
name "tyrantmanager"
|
11
|
-
version TyrantManager::VERSION
|
12
|
-
author "Jeremy Hinegardner"
|
13
|
-
email "jeremy@copiousfreetime.org"
|
14
|
-
homepage "http://copiousfreetime.rubyforge.org/tyrantmanager/"
|
15
|
-
description Utils.section_of("README.rdoc", "description")
|
16
|
-
summary description.split(".").first
|
17
|
-
history "HISTORY.rdoc"
|
18
|
-
license FileList["LICENSE"]
|
19
|
-
readme "README.rdoc"
|
20
|
-
}
|
21
|
-
|
22
|
-
#-----------------------------------------------------------------------
|
23
|
-
# Packaging
|
24
|
-
#-----------------------------------------------------------------------
|
25
|
-
Configuration.for('packaging') {
|
26
|
-
# files in the project
|
27
|
-
proj_conf = Configuration.for('project')
|
28
|
-
files {
|
29
|
-
bin FileList["bin/*"]
|
30
|
-
ext FileList["ext/*.{c,h,rb}"]
|
31
|
-
lib FileList["lib/**/*.rb"]
|
32
|
-
test FileList["spec/**/*.rb", "test/**/*.rb"]
|
33
|
-
data FileList["data/**/*"]
|
34
|
-
tasks FileList["tasks/**/*.r{ake,b}"]
|
35
|
-
rdoc FileList[proj_conf.readme, proj_conf.history,
|
36
|
-
proj_conf.license] + lib
|
37
|
-
all bin + ext + lib + test + data + rdoc + tasks
|
38
|
-
}
|
39
|
-
|
40
|
-
# ways to package the results
|
41
|
-
formats {
|
42
|
-
tgz true
|
43
|
-
zip true
|
44
|
-
rubygem Configuration::Table.has_key?('rubygem')
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
#-----------------------------------------------------------------------
|
49
|
-
# Gem packaging
|
50
|
-
#-----------------------------------------------------------------------
|
51
|
-
Configuration.for("rubygem") {
|
52
|
-
spec "gemspec.rb"
|
53
|
-
Configuration.for('packaging').files.all << spec
|
54
|
-
}
|
55
|
-
|
56
|
-
#-----------------------------------------------------------------------
|
57
|
-
# Testing
|
58
|
-
# - change mode to 'testunit' to use unit testing
|
59
|
-
#-----------------------------------------------------------------------
|
60
|
-
Configuration.for('test') {
|
61
|
-
mode "spec"
|
62
|
-
files Configuration.for("packaging").files.test
|
63
|
-
options %w[ --format specdoc --color ]
|
64
|
-
ruby_opts %w[ ]
|
65
|
-
}
|
66
|
-
|
67
|
-
#-----------------------------------------------------------------------
|
68
|
-
# Rcov
|
69
|
-
#-----------------------------------------------------------------------
|
70
|
-
Configuration.for('rcov') {
|
71
|
-
output_dir "coverage"
|
72
|
-
libs %w[ lib ]
|
73
|
-
rcov_opts %w[ --html ]
|
74
|
-
ruby_opts %w[ ]
|
75
|
-
test_files Configuration.for('packaging').files.test
|
76
|
-
}
|
77
|
-
|
78
|
-
#-----------------------------------------------------------------------
|
79
|
-
# Rdoc
|
80
|
-
#-----------------------------------------------------------------------
|
81
|
-
Configuration.for('rdoc') {
|
82
|
-
files Configuration.for('packaging').files.rdoc
|
83
|
-
main_page files.first
|
84
|
-
title Configuration.for('project').name
|
85
|
-
options %w[ ]
|
86
|
-
output_dir "doc"
|
87
|
-
}
|
88
|
-
|
89
|
-
#-----------------------------------------------------------------------
|
90
|
-
# Rubyforge
|
91
|
-
#-----------------------------------------------------------------------
|
92
|
-
Configuration.for('rubyforge') {
|
93
|
-
project "copiousfreetime"
|
94
|
-
user "jjh"
|
95
|
-
host "rubyforge.org"
|
96
|
-
rdoc_location "#{user}@#{host}:/var/www/gforge-projects/#{project}/tyrantmanager/"
|
97
|
-
}
|
98
|
-
|
99
|
-
|
data/tasks/distribution.rake
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------------
|
4
|
-
# Distribution and Packaging
|
5
|
-
#-------------------------------------------------------------------------------
|
6
|
-
if pkg_config = Configuration.for_if_exist?("packaging") then
|
7
|
-
|
8
|
-
require 'gemspec'
|
9
|
-
require 'rake/gempackagetask'
|
10
|
-
require 'rake/contrib/sshpublisher'
|
11
|
-
|
12
|
-
namespace :dist do
|
13
|
-
|
14
|
-
Rake::GemPackageTask.new(TyrantManager::GEM_SPEC) do |pkg|
|
15
|
-
pkg.need_tar = pkg_config.formats.tgz
|
16
|
-
pkg.need_zip = pkg_config.formats.zip
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Install as a gem"
|
20
|
-
task :install => [:clobber, :package] do
|
21
|
-
sh "sudo gem install pkg/#{TyrantManager::GEM_SPEC.full_name}.gem --no-rdoc --no-ri --local"
|
22
|
-
end
|
23
|
-
|
24
|
-
desc "Uninstall gem"
|
25
|
-
task :uninstall do
|
26
|
-
sh "sudo gem uninstall -x #{TyrantManager::GEM_SPEC.name}"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "dump gemspec"
|
30
|
-
task :gemspec do
|
31
|
-
puts TyrantManager::GEM_SPEC.to_ruby
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "reinstall gem"
|
35
|
-
task :reinstall => [:uninstall, :repackage, :install]
|
36
|
-
|
37
|
-
desc "distribute copiously"
|
38
|
-
task :copious => [:clean, :package ] do
|
39
|
-
Rake::SshFilePublisher.new('jeremy@copiousfreetime.org',
|
40
|
-
'/var/www/vhosts/www.copiousfreetime.org/htdocs/gems/gems',
|
41
|
-
'pkg', "#{TyrantManager::GEM_SPEC.full_name}.gem").upload
|
42
|
-
sh "ssh jeremy@copiousfreetime.org rake -f /var/www/vhosts/www.copiousfreetime.org/htdocs/gems/Rakefile"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/tasks/documentation.rake
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Documentation
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
|
7
|
-
if rdoc_config = Configuration.for_if_exist?('rdoc') then
|
8
|
-
|
9
|
-
namespace :doc do
|
10
|
-
|
11
|
-
require 'rdoc'
|
12
|
-
require 'rake/rdoctask'
|
13
|
-
|
14
|
-
# generating documentation locally
|
15
|
-
Rake::RDocTask.new do |rdoc|
|
16
|
-
rdoc.rdoc_dir = rdoc_config.output_dir
|
17
|
-
rdoc.options = rdoc_config.options
|
18
|
-
rdoc.rdoc_files = rdoc_config.files
|
19
|
-
rdoc.title = rdoc_config.title
|
20
|
-
rdoc.main = rdoc_config.main_page
|
21
|
-
end
|
22
|
-
|
23
|
-
if rubyforge_config = Configuration.for_if_exist?('rubyforge') then
|
24
|
-
desc "Deploy the RDoc documentation to #{rubyforge_config.rdoc_location}"
|
25
|
-
task :deploy => :rerdoc do
|
26
|
-
sh "rsync -zav --delete #{rdoc_config.output_dir}/ #{rubyforge_config.rdoc_location}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
data/tasks/gemcutter.rake
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Gemcutter additions to the task library
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
namespace :dist do
|
7
|
-
desc "Release files to gemcutter"
|
8
|
-
|
9
|
-
task :push => :gem do
|
10
|
-
gem_file = File.expand_path( File.join( "pkg", "#{TyrantManager::GEM_SPEC.full_name}.gem" ) )
|
11
|
-
%x[ gem push -V #{gem_file} ].each do |line|
|
12
|
-
puts line
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/tasks/rspec.rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'tasks/config'
|
3
|
-
|
4
|
-
#--------------------------------------------------------------------------------
|
5
|
-
# configuration for running rspec. This shows up as the test:default task
|
6
|
-
#--------------------------------------------------------------------------------
|
7
|
-
if spec_config = Configuration.for_if_exist?("test") then
|
8
|
-
if spec_config.mode == "spec" then
|
9
|
-
namespace :test do
|
10
|
-
|
11
|
-
task :default => :spec
|
12
|
-
|
13
|
-
require 'spec/rake/spectask'
|
14
|
-
Spec::Rake::SpecTask.new do |r|
|
15
|
-
r.ruby_opts = spec_config.ruby_opts
|
16
|
-
r.libs = [ TyrantManager.lib_path,
|
17
|
-
TyrantManager.install_dir ]
|
18
|
-
r.spec_files = spec_config.files
|
19
|
-
r.spec_opts = spec_config.options
|
20
|
-
|
21
|
-
if rcov_config = Configuration.for_if_exist?('rcov') then
|
22
|
-
r.rcov = true
|
23
|
-
r.rcov_dir = rcov_config.output_dir
|
24
|
-
r.rcov_opts = rcov_config.rcov_opts
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/tasks/rubyforge.rake
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Rubyforge additions to the task library
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
if rf_conf = Configuration.for_if_exist?("rubyforge") then
|
7
|
-
|
8
|
-
abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
|
9
|
-
|
10
|
-
proj_conf = Configuration.for('project')
|
11
|
-
|
12
|
-
namespace :dist do
|
13
|
-
desc "Release files to rubyforge"
|
14
|
-
task :rubyforge => [:clean, :package] do
|
15
|
-
|
16
|
-
rubyforge = RubyForge.new
|
17
|
-
|
18
|
-
config = {}
|
19
|
-
config["release_notes"] = proj_conf.description
|
20
|
-
config["release_changes"] = Utils.release_notes_from(proj_conf.history)[TyrantManager::VERSION]
|
21
|
-
config["Prefomatted"] = true
|
22
|
-
|
23
|
-
rubyforge.configure
|
24
|
-
|
25
|
-
# make sure this release doesn't already exist
|
26
|
-
releases = rubyforge.autoconfig['release_ids']
|
27
|
-
if releases.has_key?(TyrantManager::GEM_SPEC.name) and releases[TyrantManager::GEM_SPEC.name][TyrantManager::VERSION] then
|
28
|
-
abort("Release #{TyrantManager::VERSION} already exists! Unable to release.")
|
29
|
-
end
|
30
|
-
|
31
|
-
puts "Uploading to rubyforge..."
|
32
|
-
files = FileList[File.join("pkg","#{TyrantManager::GEM_SPEC.name}-#{TyrantManager::VERSION}*.*")].to_a
|
33
|
-
rubyforge.login
|
34
|
-
rubyforge.add_release(TyrantManager::GEM_SPEC.rubyforge_project, TyrantManager::GEM_SPEC.name, TyrantManager::VERSION, *files)
|
35
|
-
puts "done."
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
namespace :announce do
|
40
|
-
desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
|
41
|
-
task :rubyforge do
|
42
|
-
info = Utils.announcement
|
43
|
-
rubyforge = RubyForge.new
|
44
|
-
rubyforge.configure
|
45
|
-
rubyforge.login
|
46
|
-
rubyforge.post_news(rf_conf.project, info[:subject], "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}")
|
47
|
-
puts "Posted to rubyforge"
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
end
|
data/tasks/utils.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'tyrant_manager/version'
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------------
|
4
|
-
# Additions to the Configuration class that are useful
|
5
|
-
#-------------------------------------------------------------------------------
|
6
|
-
class Configuration
|
7
|
-
class << self
|
8
|
-
def exist?( name )
|
9
|
-
Configuration::Table.has_key?( name )
|
10
|
-
end
|
11
|
-
|
12
|
-
def for_if_exist?( name )
|
13
|
-
if self.exist?( name ) then
|
14
|
-
self.for( name )
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
#-------------------------------------------------------------------------------
|
21
|
-
# some useful utilitiy methods for the tasks
|
22
|
-
#-------------------------------------------------------------------------------
|
23
|
-
module Utils
|
24
|
-
class << self
|
25
|
-
|
26
|
-
# Try to load the given _library_ using the built-in require, but do not
|
27
|
-
# raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
|
28
|
-
# successfully loaded; returns +false+ otherwise.
|
29
|
-
#
|
30
|
-
def try_require( lib )
|
31
|
-
require lib
|
32
|
-
true
|
33
|
-
rescue LoadError
|
34
|
-
false
|
35
|
-
end
|
36
|
-
|
37
|
-
# partition an rdoc file into sections, and return the text of the section
|
38
|
-
# given.
|
39
|
-
def section_of(file, section_name)
|
40
|
-
File.read(file).split(/^(?==)/).each do |section|
|
41
|
-
lines = section.split("\n")
|
42
|
-
return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
|
43
|
-
end
|
44
|
-
nil
|
45
|
-
end
|
46
|
-
|
47
|
-
# Get an array of all the changes in the application for a particular
|
48
|
-
# release. This is done by looking in the history file and grabbing the
|
49
|
-
# information for the most recent release. The history file is assumed to
|
50
|
-
# be in RDoc format and version release are 2nd tier sections separated by
|
51
|
-
# '== Version X.Y.Z'
|
52
|
-
#
|
53
|
-
# returns:: A hash of notes keyed by version number
|
54
|
-
#
|
55
|
-
def release_notes_from(history_file)
|
56
|
-
releases = {}
|
57
|
-
File.read(history_file).split(/^(?==)/).each do |section|
|
58
|
-
lines = section.split("\n")
|
59
|
-
md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
|
60
|
-
next unless md
|
61
|
-
releases[md[1]] = lines[1..-1].join("\n").strip
|
62
|
-
end
|
63
|
-
return releases
|
64
|
-
end
|
65
|
-
|
66
|
-
# return a hash of useful information for the latest release
|
67
|
-
# urls, subject, title, description and latest release notes
|
68
|
-
#
|
69
|
-
def announcement
|
70
|
-
cfg = Configuration.for("project")
|
71
|
-
{
|
72
|
-
:subject => "#{cfg.name} #{TyrantManager::VERSION} Released",
|
73
|
-
:title => "#{cfg.name} version #{TyrantManager::VERSION} has been released.",
|
74
|
-
:urls => "#{cfg.homepage}",
|
75
|
-
:description => "#{cfg.description.rstrip}",
|
76
|
-
:release_notes => Utils.release_notes_from(cfg.history)[TyrantManager::VERSION].rstrip
|
77
|
-
}
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end # << self
|