jackowayed-tyrantmanager 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
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
@@ -0,0 +1,51 @@
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
@@ -0,0 +1,80 @@
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
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jackowayed-tyrantmanager
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy Hinegardner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-22 00:00:00 -07:00
13
+ default_executable: tyrantmanager
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: loquacious
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rufus-tokyo
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: logging
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 1.1.4
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: main
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 2.8.4
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: configuration
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 0.0.5
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: rake
67
+ type: :development
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ version: 0.8.3
74
+ version:
75
+ description: A command line tool for managing Tokyo Tyrant instances. It allows for the creation, starting, stopping, listing, stating of many tokyo tyrant instances all on the same machine. The commands can be applied to a single or multiple instances.
76
+ email: jeremy@copiousfreetime.org
77
+ executables:
78
+ - tyrantmanager
79
+ extensions: []
80
+
81
+ extra_rdoc_files:
82
+ - HISTORY.rdoc
83
+ - LICENSE
84
+ - README.rdoc
85
+ - lib/tyrant_manager.rb
86
+ - lib/tyrant_manager/cli.rb
87
+ - lib/tyrant_manager/command.rb
88
+ - lib/tyrant_manager/commands/create_instance.rb
89
+ - lib/tyrant_manager/commands/list.rb
90
+ - lib/tyrant_manager/commands/replication_status.rb
91
+ - lib/tyrant_manager/commands/start.rb
92
+ - lib/tyrant_manager/commands/stats.rb
93
+ - lib/tyrant_manager/commands/status.rb
94
+ - lib/tyrant_manager/commands/stop.rb
95
+ - lib/tyrant_manager/log.rb
96
+ - lib/tyrant_manager/paths.rb
97
+ - lib/tyrant_manager/runner.rb
98
+ - lib/tyrant_manager/tyrant_instance.rb
99
+ - lib/tyrant_manager/version.rb
100
+ - lib/tyrantmanager.rb
101
+ files:
102
+ - HISTORY.rdoc
103
+ - LICENSE
104
+ - README.rdoc
105
+ - bin/tyrantmanager
106
+ - data/config.rb
107
+ - data/default_instance_config.rb
108
+ - gemspec.rb
109
+ - lib/tyrant_manager.rb
110
+ - lib/tyrant_manager/cli.rb
111
+ - lib/tyrant_manager/command.rb
112
+ - lib/tyrant_manager/commands/create_instance.rb
113
+ - lib/tyrant_manager/commands/list.rb
114
+ - lib/tyrant_manager/commands/replication_status.rb
115
+ - lib/tyrant_manager/commands/start.rb
116
+ - lib/tyrant_manager/commands/stats.rb
117
+ - lib/tyrant_manager/commands/status.rb
118
+ - lib/tyrant_manager/commands/stop.rb
119
+ - lib/tyrant_manager/log.rb
120
+ - lib/tyrant_manager/paths.rb
121
+ - lib/tyrant_manager/runner.rb
122
+ - lib/tyrant_manager/tyrant_instance.rb
123
+ - lib/tyrant_manager/version.rb
124
+ - lib/tyrantmanager.rb
125
+ - spec/command_spec.rb
126
+ - spec/paths_spec.rb
127
+ - spec/spec_helper.rb
128
+ - spec/tyrant_instance_spec.rb
129
+ - spec/tyrant_manager_spec.rb
130
+ - spec/version_spec.rb
131
+ - tasks/announce.rake
132
+ - tasks/config.rb
133
+ - tasks/distribution.rake
134
+ - tasks/documentation.rake
135
+ - tasks/rspec.rake
136
+ - tasks/rubyforge.rake
137
+ - tasks/utils.rb
138
+ has_rdoc: false
139
+ homepage: http://copiousfreetime.rubyforge.org/tyrantmanager/
140
+ licenses:
141
+ post_install_message:
142
+ rdoc_options:
143
+ - --main
144
+ - README.rdoc
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: "0"
152
+ version:
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: "0"
158
+ version:
159
+ requirements: []
160
+
161
+ rubyforge_project: copiousfreetime
162
+ rubygems_version: 1.3.5
163
+ signing_key:
164
+ specification_version: 3
165
+ summary: A command line tool for managing Tokyo Tyrant instances
166
+ test_files:
167
+ - spec/paths_spec.rb
168
+ - spec/tyrant_instance_spec.rb
169
+ - spec/tyrant_manager_spec.rb
170
+ - spec/spec_helper.rb
171
+ - spec/command_spec.rb
172
+ - spec/version_spec.rb