Permalink
Browse files

Version 0.1.0

Added ability to freeze the framework into vendor/
Updated some docs
Added github gemspec
  • Loading branch information...
1 parent 274630a commit 95346c7326e12def14cb7eb0cca10827ceb9b181 @kennethkalmer committed Jan 8, 2009
View
@@ -1,5 +1,7 @@
-== 0.1.0 (not released yet)
+== 0.1.0 2009-01-08
-* Flexible UNIX signal trap configuration
+* Ability to freeze the gem/edge copies of DaemonKit
+* Simple non-evented Jabber generator
+* Flexible UNIX signal trapping configuration
* Basic generator completed
* 1 small step for man, 1 giant leap for mankind
View
@@ -7,6 +7,7 @@ TODO.txt
app_generators/daemon_kit/USAGE
app_generators/daemon_kit/daemon_kit_generator.rb
app_generators/daemon_kit/templates/README
+app_generators/daemon_kit/templates/Rakefile
app_generators/daemon_kit/templates/bin/daemon.erb
app_generators/daemon_kit/templates/config/boot.rb
app_generators/daemon_kit/templates/config/environment.rb
@@ -30,6 +31,8 @@ lib/daemon_kit/application.rb
lib/daemon_kit/initializer.rb
lib/daemon_kit/jabber.rb
lib/daemon_kit/patches/force_kill_wait.rb
+lib/daemon_kit/tasks.rb
+lib/daemon_kit/tasks/framework.rake
rubygems_generators/install_rspec/USAGE
rubygems_generators/install_rspec/install_rspec_generator.rb
rubygems_generators/install_rspec/templates/spec.rb
View
@@ -1,7 +1,6 @@
For more information on daemon-kit, see http://daemon-kit.rubyforge.org
-NOTE: Change this information in PostInstall.txt
-You can also delete it if you don't want it.
+To get started quickly run 'daemon_kit' without any arguments
View
@@ -8,7 +8,7 @@ $hoe = Hoe.new('daemon-kit', DaemonKit::VERSION) do |p|
p.summary = 'Daemon Kit aims to simplify creating Ruby daemons by providing a sound application skeleton (through a generator), task specific generators (jabber bot, etc) and robust environment management code.'
p.developer('Kenneth Kalmer', 'kenneth.kalmer@gmail.com')
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
+ p.post_install_message = IO.read( 'PostInstall.txt' ) # TODO remove if post-install message not required
p.rubyforge_name = p.name # TODO this is default value
p.extra_deps = [
['daemons','>= 1.0.10'],
@@ -41,6 +41,7 @@ def manifest
# Readme
m.template "README", "README"
+ m.template "Rakefile", "Rakefile"
# Executable
m.directory "bin"
@@ -114,8 +115,6 @@ def extract_options
# Templates can access these value via the attr_reader-generated methods, but not the
# raw instance variable value.
# @author = options[:author]
- require 'pp'
- pp options
@installer = options[:installer] || 'default'
end
@@ -0,0 +1,4 @@
+require 'rubygems'
+require 'daemon_kit/tasks'
+
+Dir[File.join(File.dirname(__FILE__), 'tasks/*.rake')].each { |rake| load rake }
View
@@ -0,0 +1,42 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{daemon-kit}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Kenneth Kalmer"]
+ s.date = %q{2009-01-08}
+ s.default_executable = %q{daemon_kit}
+ s.email = ["kenneth.kalmer@gmail.com"]
+ s.executables = ["daemon_kit"]
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "TODO.txt", "website/index.txt"]
+ s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.textile", "Rakefile", "TODO.txt", "app_generators/daemon_kit/USAGE", "app_generators/daemon_kit/daemon_kit_generator.rb", "app_generators/daemon_kit/templates/README", "app_generators/daemon_kit/templates/Rakefile", "app_generators/daemon_kit/templates/bin/daemon.erb", "app_generators/daemon_kit/templates/config/boot.rb", "app_generators/daemon_kit/templates/config/environment.rb", "app_generators/daemon_kit/templates/config/environments/development.rb", "app_generators/daemon_kit/templates/config/environments/production.rb", "app_generators/daemon_kit/templates/config/environments/test.rb", "app_generators/daemon_kit/templates/config/initializers/readme", "app_generators/daemon_kit/templates/libexec/daemon.erb", "bin/daemon_kit", "config/website.yml.sample", "daemon_generators/jabber/USAGE", "daemon_generators/jabber/jabber_generator.rb", "daemon_generators/jabber/templates/config/initializers/jabber.rb", "daemon_generators/jabber/templates/config/jabber.yml", "daemon_generators/jabber/templates/libexec/daemon.rb", "features/development.feature", "features/steps/common.rb", "features/steps/env.rb", "lib/daemon_kit.rb", "lib/daemon_kit/application.rb", "lib/daemon_kit/initializer.rb", "lib/daemon_kit/jabber.rb", "lib/daemon_kit/patches/force_kill_wait.rb", "lib/daemon_kit/tasks.rb", "lib/daemon_kit/tasks/framework.rake", "rubygems_generators/install_rspec/USAGE", "rubygems_generators/install_rspec/install_rspec_generator.rb", "rubygems_generators/install_rspec/templates/spec.rb", "rubygems_generators/install_rspec/templates/spec/spec.opts", "rubygems_generators/install_rspec/templates/spec/spec_helper.rb", "rubygems_generators/install_rspec/templates/tasks/rspec.rake", "script/console", "script/destroy", "script/generate", "script/txt2html", "spec/daemon_kit_spec.rb", "spec/initializer_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rspec.rake", "test/test_daemon-kit_generator.rb", "test/test_generator_helper.rb", "test/test_jabber_generator.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb"]
+ s.has_rdoc = true
+ s.post_install_message = %q{PostInstall.txt}
+ s.rdoc_options = ["--main", "README.textile"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{daemon-kit}
+ s.rubygems_version = %q{1.3.1}
+ s.summary = %q{Daemon Kit aims to simplify creating Ruby daemons by providing a sound application skeleton (through a generator), task specific generators (jabber bot, etc) and robust environment management code.}
+ s.test_files = ["test/test_jabber_generator.rb", "test/test_daemon-kit_generator.rb", "test/test_generator_helper.rb"]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<daemons>, [">= 1.0.10"])
+ s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
+ else
+ s.add_dependency(%q<daemons>, [">= 1.0.10"])
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ end
+ else
+ s.add_dependency(%q<daemons>, [">= 1.0.10"])
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ end
+end
View
@@ -3,8 +3,9 @@
require 'rubygems'
+require 'daemon_kit/initializer'
require 'daemon_kit/application'
module DaemonKit
- VERSION = '0.0.9'
+ VERSION = '0.1.0'
end
View
@@ -0,0 +1,2 @@
+# Load all the take tasks in the gem
+Dir[File.join(File.dirname(__FILE__), '**/*.rake')].each { |rake| load rake }
@@ -0,0 +1,75 @@
+namespace :daemon_kit do
+ namespace :freeze do
+ desc "Lock this application to the current gem (by unpacking it into vendor/daemon_kit)"
+ task :gems do
+ deps = %w()
+ require 'rubygems'
+ require 'rubygems/gem_runner'
+
+ kit = (version = ENV['VERSION']) ?
+ Gem.cache.find_name('daemon-kit', "= #{version}").first :
+ Gem.cache.find_name('daemon-kit').sort_by { |g| g.version }.last
+
+ version ||= kit.version
+
+ unless kit
+ puts "No daemon_kit gem #{version} is installed. Do 'gem list daemon_kit' to see what you have available."
+ exit
+ end
+
+ puts "Freezing the gem for DaemonKit #{kit.version}"
+ rm_rf "vendor/daemon_kit"
+ mkdir_p "vendor/daemon_kit"
+
+ begin
+ chdir("vendor/daemon_kit") do
+ kit.dependencies.select { |g| deps.include? g.name }.each do |g|
+ Gem::GemRunner.new.run(["unpack", g.name, "--version", g.version_requirements.to_s])
+ mv(Dir.glob("#{g.name}*").first, g.name)
+ end
+
+ Gem::GemRunner.new.run(["unpack", "daemon-kit", "--version", "=#{version}"])
+ FileUtils.mv(Dir.glob("daemon-kit*").first, "daemon-kit")
+ end
+ rescue Exception
+ rm_rf "vendor/daemon_kit"
+ raise
+ end
+ end
+
+ desc 'Lock to latest edge daemon_kit'
+ task :edge do
+ require 'open-uri'
+ #version = ENV["RELEASE"] || "edge"
+ commits = "http://github.com/api/v1/yaml/kennethkalmer/daemon-kit/commits/master"
+ url = "http://github.com/kennethkalmer/daemon-kit/zipball/master"
+
+ rm_rf "vendor/daemon_kit"
+ mkdir_p "vendor/daemon_kit"
+
+ chdir 'vendor/daemon_kit' do
+ latest_revision = YAML.load(open(commits))["commits"].first["id"]
+
+ puts "Downloading DaemonKit from #{url}"
+ File.open('daemon-kit.zip', 'wb') do |dst|
+ open url do |src|
+ while chunk = src.read(4096)
+ dst << chunk
+ end
+ end
+ end
+
+ puts 'Unpacking DaemonKit'
+ rm_rf 'daemon-kit'
+ `unzip daemon-kit.zip`
+ FileUtils.mv(Dir.glob("kennethkalmer-daemon-kit*").first, "daemon-kit")
+ %w(daemon-kit.zip).each do |goner|
+ rm_f goner
+ end
+
+ touch "REVISION_#{latest_revision}"
+ end
+ end
+
+ end
+end
@@ -31,6 +31,7 @@ def test_generator_without_options
run_generator('daemon_kit', [APP_ROOT], sources)
assert_generated_file "README"
+ assert_generated_file "Rakefile"
assert_directory_exists "bin"
assert_generated_file "bin/#{daemon_name}"
assert_directory_exists "config"

0 comments on commit 95346c7

Please sign in to comment.