)
s.has_rdoc = true
s.extra_rdoc_files = ["README", "CHANGELOG", 'rails_plugin']
From kato-k at rubyforge.org Wed Jun 6 04:17:32 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 04:17:32 -0400 (EDT)
Subject: [ap4r-devel] [232] trunk/ap4r/Rakefile: Changed copy files from
sample to ap4r.
Message-ID: <20070606081732.6E38C5240BF2@rubyforge.org>
Revision: 232
Author: kato-k
Date: 2007-06-06 04:17:28 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
Changed copy files from sample to ap4r.
Modified Paths:
--------------
trunk/ap4r/Rakefile
Modified: trunk/ap4r/Rakefile
===================================================================
--- trunk/ap4r/Rakefile 2007-06-06 07:26:03 UTC (rev 231)
+++ trunk/ap4r/Rakefile 2007-06-06 08:17:28 UTC (rev 232)
@@ -132,7 +132,9 @@
FileUtils.cp(HELLO_WORLD_DIR + '/db/migrate/001_create_table_for_saf.rb', './lib/ap4r/xxx_create_table_for_saf.rb')
FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/init.rb', './rails_plugin/ap4r/init.rb')
- FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/async_controller.rb', './rails_plugin/ap4r/lib/async_controller.rb')
+ FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/async_helper.rb', './rails_plugin/ap4r/lib/async_helper.rb')
+ FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/ap4r_client.rb', './rails_plugin/ap4r/lib/ap4r_client.rb')
+ FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/message_builder.rb', './rails_plugin/ap4r/lib/message_builder.rb')
end
desc "Make sample tgz"
From kato-k at rubyforge.org Wed Jun 6 04:28:38 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 04:28:38 -0400 (EDT)
Subject: [ap4r-devel] [233] trunk/ap4r/rails_plugin/ap4r/init.rb: Removed
unnecessary file.
Message-ID: <20070606082838.AB0645240BF3@rubyforge.org>
Revision: 233
Author: kato-k
Date: 2007-06-06 04:28:38 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
Removed unnecessary file.
Removed Paths:
-------------
trunk/ap4r/rails_plugin/ap4r/init.rb
Deleted: trunk/ap4r/rails_plugin/ap4r/init.rb
===================================================================
--- trunk/ap4r/rails_plugin/ap4r/init.rb 2007-06-06 08:17:28 UTC (rev 232)
+++ trunk/ap4r/rails_plugin/ap4r/init.rb 2007-06-06 08:28:38 UTC (rev 233)
@@ -1,10 +0,0 @@
-# Author:: Shunichi Shinohara
-# Copyright:: Copyright (c) 2007 Future Architect Inc.
-# Licence:: MIT Licence
-
-require 'async_controller'
-require 'ap4r/stored_message'
-
-class ActionController::Base
- include Ap4r::AsyncController::Base
-end
From kato-k at rubyforge.org Wed Jun 6 04:29:22 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 04:29:22 -0400 (EDT)
Subject: [ap4r-devel] [234] trunk/ap4r/Rakefile: Modified directory path.
Message-ID: <20070606082922.A92995240BF3@rubyforge.org>
Revision: 234
Author: kato-k
Date: 2007-06-06 04:29:22 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
Modified directory path.
Modified Paths:
--------------
trunk/ap4r/Rakefile
Modified: trunk/ap4r/Rakefile
===================================================================
--- trunk/ap4r/Rakefile 2007-06-06 08:28:38 UTC (rev 233)
+++ trunk/ap4r/Rakefile 2007-06-06 08:29:22 UTC (rev 234)
@@ -168,9 +168,9 @@
end
task :execute_migration do
- Dir.chdir('temp/')
+ Dir.chdir('temp/HelloWorld')
`rake db:migrate`
- Dir.chdir('../')
+ Dir.chdir('../../')
end
task :make_tgz do
From kato-k at rubyforge.org Wed Jun 6 05:29:44 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 05:29:44 -0400 (EDT)
Subject: [ap4r-devel] [235] tags/ap4r-0.3.2/: tag 0.3.2
Message-ID: <20070606092944.6670F5240A33@rubyforge.org>
Revision: 235
Author: kato-k
Date: 2007-06-06 05:29:42 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
tag 0.3.2
Added Paths:
-----------
tags/ap4r-0.3.2/
Copied: tags/ap4r-0.3.2 (from rev 234, trunk)
From kato-k at rubyforge.org Wed Jun 6 21:58:50 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 21:58:50 -0400 (EDT)
Subject: [ap4r-devel] [236] trunk/ap4r/lib: Removed gem method which
interferes in working on Windows except with the latest Ruby
and RubyGems.
Message-ID: <20070607015850.24A1A5240BBE@rubyforge.org>
Revision: 236
Author: kato-k
Date: 2007-06-06 21:58:49 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
Removed gem method which interferes in working on Windows except with the latest Ruby and RubyGems.
Modified Paths:
--------------
trunk/ap4r/lib/ap4r/script/setup.rb
trunk/ap4r/lib/ap4r/stored_message.rb
trunk/ap4r/lib/ap4r.rb
Modified: trunk/ap4r/lib/ap4r/script/setup.rb
===================================================================
--- trunk/ap4r/lib/ap4r/script/setup.rb 2007-06-06 09:29:42 UTC (rev 235)
+++ trunk/ap4r/lib/ap4r/script/setup.rb 2007-06-07 01:58:49 UTC (rev 236)
@@ -9,7 +9,6 @@
require 'active_support'
rescue LoadError
require 'rubygems'
- gem 'active_support'
require 'active_support'
end
Modified: trunk/ap4r/lib/ap4r/stored_message.rb
===================================================================
--- trunk/ap4r/lib/ap4r/stored_message.rb 2007-06-06 09:29:42 UTC (rev 235)
+++ trunk/ap4r/lib/ap4r/stored_message.rb 2007-06-07 01:58:49 UTC (rev 236)
@@ -7,9 +7,7 @@
require 'uuid'
rescue LoadError
require 'rubygems'
- gem 'activerecord'
require 'activerecord'
- gem 'uuid'
require 'uuid'
end
Modified: trunk/ap4r/lib/ap4r.rb
===================================================================
--- trunk/ap4r/lib/ap4r.rb 2007-06-06 09:29:42 UTC (rev 235)
+++ trunk/ap4r/lib/ap4r.rb 2007-06-07 01:58:49 UTC (rev 236)
@@ -3,7 +3,6 @@
# Licence:: MIT Licence
require 'rubygems'
-gem 'reliable-msg'
require 'reliable-msg'
hack = true
From kato-k at rubyforge.org Wed Jun 6 22:00:46 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Wed, 6 Jun 2007 22:00:46 -0400 (EDT)
Subject: [ap4r-devel] [237] trunk/ap4r/lib/ap4r/version.rb: Modified version.
Message-ID: <20070607020046.7AF015240BBE@rubyforge.org>
Revision: 237
Author: kato-k
Date: 2007-06-06 22:00:46 -0400 (Wed, 06 Jun 2007)
Log Message:
-----------
Modified version.
Modified Paths:
--------------
trunk/ap4r/lib/ap4r/version.rb
Modified: trunk/ap4r/lib/ap4r/version.rb
===================================================================
--- trunk/ap4r/lib/ap4r/version.rb 2007-06-07 01:58:49 UTC (rev 236)
+++ trunk/ap4r/lib/ap4r/version.rb 2007-06-07 02:00:46 UTC (rev 237)
@@ -8,7 +8,7 @@
module VERSION #:nodoc:
MAJOR = 0
MINOR = 3
- TINY = 2
+ TINY = 3
STRING = [MAJOR, MINOR, TINY].join('.')
end
From kato-k at rubyforge.org Thu Jun 7 06:59:33 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Thu, 7 Jun 2007 06:59:33 -0400 (EDT)
Subject: [ap4r-devel] [238] trunk/samples/HelloWorld/app: Just ported demo
application from zookeeper, maybe it does't work.
Message-ID: <20070607105933.8781F5240A91@rubyforge.org>
Revision: 238
Author: kato-k
Date: 2007-06-07 06:59:33 -0400 (Thu, 07 Jun 2007)
Log Message:
-----------
Just ported demo application from zookeeper, maybe it does't work.
Added Paths:
-----------
trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb
trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
trunk/samples/HelloWorld/app/controllers/shop_controller.rb
trunk/samples/HelloWorld/app/helpers/async_shop_helper.rb
trunk/samples/HelloWorld/app/helpers/msg_retention_helper.rb
trunk/samples/HelloWorld/app/helpers/shop_helper.rb
trunk/samples/HelloWorld/app/models/ap4r.rb
trunk/samples/HelloWorld/app/models/ap4r_group.rb
trunk/samples/HelloWorld/app/views/async_shop/
trunk/samples/HelloWorld/app/views/msg_retention/
trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml
trunk/samples/HelloWorld/app/views/msg_retention/retention.rhtml
trunk/samples/HelloWorld/app/views/msg_retention/status_img.rhtml
trunk/samples/HelloWorld/app/views/shop/
trunk/samples/HelloWorld/app/views/shop/account.rhtml
trunk/samples/HelloWorld/app/views/shop/order.rhtml
Added: trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb (rev 0)
+++ trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,22 @@
+class AsyncShopController < ApplicationController
+
+ def order
+ ap4r.transaction do
+ # ????
+ # ...
+
+ # ???? (??????????????)
+ ap4r.async_to({:action => 'account2'},
+ {:sleep_time => params[:weight]})
+ end
+
+ render :text => 'Order completed successfully.'
+ end
+
+ def account
+ sleep rand(params[:sleep_time])
+
+ render :text => 'true'
+ end
+
+end
Added: trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb (rev 0)
+++ trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,123 @@
+class MsgRetentionController < ApplicationController
+
+ DEFAULT_INTERVAL = 3 #sec
+ DEFAULT_RANGE = 5
+ RETENTION_STATUS = Hash.new
+ AP4R_LIST = Array.new
+ LABEL_LIST = Array.new
+
+ def retention_status_by_gruff
+
+ if params[:interval] != nil then
+ interval = params[:interval].to_i
+ else
+ interval = DEFAULT_INTERVAL
+ end
+
+ if params[:range] != nil then
+ maxRange = params[:range].to_i
+ else
+ maxRange = DEFAULT_RANGE
+ end
+
+ if params[:type] != nil then
+ g = Gruff.const_get(params[:type]).new 500
+ else
+ g = Gruff::Line.new 500
+ end
+
+ if params[:theme] != nil then
+ g.__send__(params[:theme])
+ else
+ g.theme_37signals
+ end
+
+ g.title = "Message retension #{Time.now.to_formatted_s}"
+ g.minimum_value = 0
+ g.maximum_value = 50
+
+ currentTime = Time.now.to_i
+ maxRange.times{|r|
+ LABEL_LIST.push(Time.at(currentTime-(maxRange-r-1)*interval).strftime("%X"))
+ }
+ g.labels = LABEL_LIST.each{|l| "#{l}"}
+
+ qms = OrcaGroup::Default.map{|n, qm| [n, qm]}
+ qms.each{|on|on;AP4R_LIST.push(on[0])}
+
+ #???????????????
+ AP4R_LIST.each{|on|
+ qms.each{|n, qm|
+ if(n == on && qm != nil) then
+ qm.retention.data.each{|qn, stat|
+ stat.each{|time, num|
+ maxRange.times{|r|
+ fromTime =currentTime-(maxRange-r)*interval
+ toTime = currentTime-(maxRange-r-1)*interval
+ if(time.to_i>fromTime && time.to_i<=toTime) then
+ calcAverage(on, qn, r, num)
+ end
+ }
+ }
+ }
+ end
+ }
+ }
+
+ #???????????????
+ RETENTION_STATUS.each{|on, qs|
+ _rs = Hash.new
+ qs.each{|q,rs|
+ rs.each{|r,ave|
+ if(_rs.key?(r) && ((_ave=_rs.fetch(r))!=nil)) then
+ _ave=_ave+ave[0]
+ else
+ _ave=ave[0]
+ end
+ _rs.store(r,_ave)
+ }
+ }
+ qs.store(:'summary',_rs)
+ }
+
+ RETENTION_STATUS.each {|on, qs|
+ sortedNum = Array.new
+ maxRange.times{|r|
+ sortedNum.push(qs.fetch(:'summary').fetch(r))
+ }
+ g.data(on, sortedNum)
+ }
+
+ send_data(g.to_blob,# :filename => "retention_#{Time.now.to_i}.png",
+ :type => 'image/png', :disposition => 'inline')
+ end
+
+
+ def calcAverage(oname, qname, range, num)
+
+ if(RETENTION_STATUS.key?(oname) && (qs=RETENTION_STATUS.fetch(oname)) != nil) then
+ if(qs.key?(qname) && (rs=qs.fetch(qname)) != nil) then
+ if(rs.key?(range) && (ave=rs.fetch(range)) != nil) then
+ ave[0]=(ave[0]*ave[1]+num)/(ave[1]+1)
+ ave[1]=ave[1]+1
+ else
+ ave = [0,0]
+ end
+ rs.store(range,ave)
+ else
+ ave = [0,0]
+ rs = Hash.new
+ rs.store(range,ave)
+ end
+ qs.store(qname,rs)
+ else
+ ave = [0,0]
+ rs = Hash.new
+ rs.store(range,ave)
+ qs = Hash.new
+ qs.store(qname, rs)
+ end
+ RETENTION_STATUS.store(oname,qs)
+ end
+
+end
Added: trunk/samples/HelloWorld/app/controllers/shop_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/shop_controller.rb (rev 0)
+++ trunk/samples/HelloWorld/app/controllers/shop_controller.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,17 @@
+class ShopController < ApplicationController
+
+ def order
+ # ????
+ # ...
+
+ # ???? (??????????????)
+ account params[:weight]
+ end
+
+ def account sleep_time
+ sleep rand(sleep_time)
+
+ render :text => 'Order completed successfully.'
+ end
+
+end
Added: trunk/samples/HelloWorld/app/helpers/async_shop_helper.rb
===================================================================
--- trunk/samples/HelloWorld/app/helpers/async_shop_helper.rb (rev 0)
+++ trunk/samples/HelloWorld/app/helpers/async_shop_helper.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+module AsyncShopHelper
+end
Added: trunk/samples/HelloWorld/app/helpers/msg_retention_helper.rb
===================================================================
--- trunk/samples/HelloWorld/app/helpers/msg_retention_helper.rb (rev 0)
+++ trunk/samples/HelloWorld/app/helpers/msg_retention_helper.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+module MsgRetentionHelper
+end
Added: trunk/samples/HelloWorld/app/helpers/shop_helper.rb
===================================================================
--- trunk/samples/HelloWorld/app/helpers/shop_helper.rb (rev 0)
+++ trunk/samples/HelloWorld/app/helpers/shop_helper.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+module ShopHelper
+end
Added: trunk/samples/HelloWorld/app/models/ap4r.rb
===================================================================
--- trunk/samples/HelloWorld/app/models/ap4r.rb (rev 0)
+++ trunk/samples/HelloWorld/app/models/ap4r.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,12 @@
+require 'drb/drb'
+
+class Ap4r
+ attr_reader :name, :uri, :remote
+
+ def initialize name, uri
+ @name = name
+ @uri = uri
+ @remote = DRb::DRbObject.new_with_uri(uri)
+ end
+
+end
Added: trunk/samples/HelloWorld/app/models/ap4r_group.rb
===================================================================
--- trunk/samples/HelloWorld/app/models/ap4r_group.rb (rev 0)
+++ trunk/samples/HelloWorld/app/models/ap4r_group.rb 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,38 @@
+class Ap4rGroup
+ include Enumerable
+
+ attr_reader :name, :servers
+
+ def initialize name
+ @name = name
+ @servers = {}
+ end
+
+ Default = Ap4rGroup.new('default')
+ GROUPS = {:default => Default}
+
+ def each
+ for name in @servers.keys
+ yield name, @servers[name].remote
+ end
+ end
+
+ def add ap4r_name, uri, key = :default
+ @servers[ap4r_name] = Ap4r.new(ap4r_name, uri)
+ end
+
+ def [](name)
+ @servers[name].remote if @servers[name]
+ end
+
+ def self.get key = :default
+ GROUPS[key]
+ end
+
+ # configuration stub below here
+ default = self.get()
+ 8.upto(8) do |index|
+ default.add("ap4r#{index}", "druby://localhost:643#{index}")
+ end
+
+end
Added: trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml (rev 0)
+++ trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,35 @@
+
+
+ load and replace by JavaScript test
+
+
+
+
+
+
+
+
Added: trunk/samples/HelloWorld/app/views/msg_retention/retention.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/msg_retention/retention.rhtml (rev 0)
+++ trunk/samples/HelloWorld/app/views/msg_retention/retention.rhtml 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,21 @@
+
+
+retention status view
+<%= javascript_include_tag "prototype" %>
+
+
+
+Message Retension Status
+
+
+

+
+
+ <%= periodically_call_remote( :update => 'image',
+ :url => {:action => :status_img},
+ :frequency => 3 )%>
+
+
+
+
Added: trunk/samples/HelloWorld/app/views/msg_retention/status_img.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/msg_retention/status_img.rhtml (rev 0)
+++ trunk/samples/HelloWorld/app/views/msg_retention/status_img.rhtml 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+
Added: trunk/samples/HelloWorld/app/views/shop/account.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/shop/account.rhtml (rev 0)
+++ trunk/samples/HelloWorld/app/views/shop/account.rhtml 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+Shop#account
+Find me in app/views/shop/account.rhtml
Added: trunk/samples/HelloWorld/app/views/shop/order.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/shop/order.rhtml (rev 0)
+++ trunk/samples/HelloWorld/app/views/shop/order.rhtml 2007-06-07 10:59:33 UTC (rev 238)
@@ -0,0 +1,2 @@
+Shop#order
+Find me in app/views/shop/order.rhtml
From kato-k at rubyforge.org Thu Jun 7 20:19:35 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Thu, 7 Jun 2007 20:19:35 -0400 (EDT)
Subject: [ap4r-devel] [239] trunk: Modified message retention monitoring in
an impromptu manner.
Message-ID: <20070608001935.5612C5240C1F@rubyforge.org>
Revision: 239
Author: kato-k
Date: 2007-06-07 20:19:34 -0400 (Thu, 07 Jun 2007)
Log Message:
-----------
Modified message retention monitoring in an impromptu manner.
Modified Paths:
--------------
trunk/ap4r/lib/ap4r/retention_history.rb
trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb
trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
trunk/samples/HelloWorld/app/models/ap4r_group.rb
trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml
trunk/samples/HelloWorld/config/environment.rb
Added Paths:
-----------
trunk/samples/HelloWorld/app/models/ap4r_class.rb
Removed Paths:
-------------
trunk/samples/HelloWorld/app/models/ap4r.rb
Modified: trunk/ap4r/lib/ap4r/retention_history.rb
===================================================================
--- trunk/ap4r/lib/ap4r/retention_history.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/ap4r/lib/ap4r/retention_history.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -12,8 +12,8 @@
class RetentionHistory
include DRbUndumped
- LOOP_INTERVAL = 3.seconds
- SHELF_LIFE = 1.hour
+ LOOP_INTERVAL = 1.seconds
+ SHELF_LIFE = 10.minutes
# SHELF_LIFE = 10.seconds
attr_reader :data
Modified: trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/app/controllers/async_shop_controller.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -1,20 +1,20 @@
class AsyncShopController < ApplicationController
def order
- ap4r.transaction do
+# ap4r.transaction do
# ????
# ...
# ???? (??????????????)
- ap4r.async_to({:action => 'account2'},
- {:sleep_time => params[:weight]})
- end
+ ap4r.async_to({:action => 'account'},
+ {:sleep_time => params[id]})
+# end
render :text => 'Order completed successfully.'
end
def account
- sleep rand(params[:sleep_time])
+ sleep rand(params[:sleep_time].to_i)
render :text => 'true'
end
Modified: trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -1,99 +1,77 @@
class MsgRetentionController < ApplicationController
- DEFAULT_INTERVAL = 3 #sec
- DEFAULT_RANGE = 5
- RETENTION_STATUS = Hash.new
- AP4R_LIST = Array.new
- LABEL_LIST = Array.new
+ RETENTION_STATUS = {}
def retention_status_by_gruff
- if params[:interval] != nil then
- interval = params[:interval].to_i
- else
- interval = DEFAULT_INTERVAL
- end
+ interval = 5
+ max_range = 6
- if params[:range] != nil then
- maxRange = params[:range].to_i
- else
- maxRange = DEFAULT_RANGE
- end
-
- if params[:type] != nil then
- g = Gruff.const_get(params[:type]).new 500
- else
- g = Gruff::Line.new 500
- end
-
- if params[:theme] != nil then
- g.__send__(params[:theme])
- else
- g.theme_37signals
- end
-
- g.title = "Message retension #{Time.now.to_formatted_s}"
+ g = Gruff::Area.new 600
+ g.theme_keynote
+ g.title = "Message retension"
g.minimum_value = 0
g.maximum_value = 50
- currentTime = Time.now.to_i
- maxRange.times{|r|
- LABEL_LIST.push(Time.at(currentTime-(maxRange-r-1)*interval).strftime("%X"))
- }
- g.labels = LABEL_LIST.each{|l| "#{l}"}
+ g.labels = {}
+ current_time = Time.now.to_i
+ max_range.times do |r|
+ g.labels[max_range-r-1] = Time.at(current_time-(max_range-r-1)*interval).strftime("%X")
+ end
- qms = OrcaGroup::Default.map{|n, qm| [n, qm]}
- qms.each{|on|on;AP4R_LIST.push(on[0])}
+ ap4rs = []
+ qms = Ap4rGroup::Default.map{|n, qm| [n, qm]}
+ qms.each{|on| ap4rs << on[0]}
#???????????????
- AP4R_LIST.each{|on|
- qms.each{|n, qm|
+ ap4rs.each do |on|
+ qms.each do |n, qm|
if(n == on && qm != nil) then
- qm.retention.data.each{|qn, stat|
- stat.each{|time, num|
- maxRange.times{|r|
- fromTime =currentTime-(maxRange-r)*interval
- toTime = currentTime-(maxRange-r-1)*interval
- if(time.to_i>fromTime && time.to_i<=toTime) then
- calcAverage(on, qn, r, num)
+ qm.retention.data.each do |qn, stat|
+ stat.each do |time, num|
+ max_range.times do |r|
+ from_time =current_time-(max_range-r)*interval
+ to_time = current_time-(max_range-r-1)*interval
+ if(time.to_i>from_time && time.to_i<=to_time) then
+ calc_average(on, qn, r, num)
end
- }
- }
- }
+ end
+ end
+ end
end
- }
- }
+ end
+ end
#???????????????
- RETENTION_STATUS.each{|on, qs|
+ RETENTION_STATUS.each do |on, qs|
_rs = Hash.new
- qs.each{|q,rs|
- rs.each{|r,ave|
+ qs.each do |q,rs|
+ rs.each do |r,ave|
if(_rs.key?(r) && ((_ave=_rs.fetch(r))!=nil)) then
_ave=_ave+ave[0]
else
_ave=ave[0]
end
_rs.store(r,_ave)
- }
- }
+ end
+ end
qs.store(:'summary',_rs)
- }
+ end
- RETENTION_STATUS.each {|on, qs|
- sortedNum = Array.new
- maxRange.times{|r|
- sortedNum.push(qs.fetch(:'summary').fetch(r))
- }
- g.data(on, sortedNum)
- }
+ RETENTION_STATUS.each do |on, qs|
+ sorted_num = Array.new
+ max_range.times do |r|
+ sorted_num << qs[:summary][r]
+ end
+ g.data(on, sorted_num)
+ end
send_data(g.to_blob,# :filename => "retention_#{Time.now.to_i}.png",
:type => 'image/png', :disposition => 'inline')
end
- def calcAverage(oname, qname, range, num)
+ def calc_average(oname, qname, range, num)
if(RETENTION_STATUS.key?(oname) && (qs=RETENTION_STATUS.fetch(oname)) != nil) then
if(qs.key?(qname) && (rs=qs.fetch(qname)) != nil) then
Deleted: trunk/samples/HelloWorld/app/models/ap4r.rb
===================================================================
--- trunk/samples/HelloWorld/app/models/ap4r.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/app/models/ap4r.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -1,12 +0,0 @@
-require 'drb/drb'
-
-class Ap4r
- attr_reader :name, :uri, :remote
-
- def initialize name, uri
- @name = name
- @uri = uri
- @remote = DRb::DRbObject.new_with_uri(uri)
- end
-
-end
Added: trunk/samples/HelloWorld/app/models/ap4r_class.rb
===================================================================
--- trunk/samples/HelloWorld/app/models/ap4r_class.rb (rev 0)
+++ trunk/samples/HelloWorld/app/models/ap4r_class.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -0,0 +1,12 @@
+require 'drb/drb'
+
+class Ap4rClass
+ attr_reader :name, :uri, :remote
+
+ def initialize name, uri
+ @name = name
+ @uri = uri
+ @remote = DRb::DRbObject.new_with_uri(uri)
+ end
+
+end
Modified: trunk/samples/HelloWorld/app/models/ap4r_group.rb
===================================================================
--- trunk/samples/HelloWorld/app/models/ap4r_group.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/app/models/ap4r_group.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -18,7 +18,7 @@
end
def add ap4r_name, uri, key = :default
- @servers[ap4r_name] = Ap4r.new(ap4r_name, uri)
+ @servers[ap4r_name] = Ap4rClass.new(ap4r_name, uri)
end
def [](name)
@@ -32,7 +32,7 @@
# configuration stub below here
default = self.get()
8.upto(8) do |index|
- default.add("ap4r#{index}", "druby://localhost:643#{index}")
+ default.add("ap4r:643#{index}", "druby://localhost:643#{index}")
end
end
Modified: trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml
===================================================================
--- trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/app/views/msg_retention/load2replace_by_js.rhtml 2007-06-08 00:19:34 UTC (rev 239)
@@ -9,14 +9,14 @@
var url_base = '<%= url_for(:action => :retention_status_by_gruff) %>';
var time = (new Date()).getTime();
var url = url_base + "?time=" + time;
- var type = top.menu.document.gconf.gtype.value;
- var url = url + "&type=" + type;
- var theme = top.menu.document.gconf.gtheme.value;
- var url = url + "&theme=" + theme;
- var interval = top.menu.document.gconf.ginterval.value;
- var url = url + "&interval=" + interval;
- var range = top.menu.document.gconf.grange.value;
- var url = url + "&range=" + range;
+// var type = top.menu.document.gconf.gtype.value;
+// var url = url + "&type=" + type;
+// var theme = top.menu.document.gconf.gtheme.value;
+// var url = url + "&theme=" + theme;
+// var interval = top.menu.document.gconf.ginterval.value;
+// var url = url + "&interval=" + interval;
+// var range = top.menu.document.gconf.grange.value;
+// var url = url + "&range=" + range;
// alert(url);
(new Image()).src=url;
Modified: trunk/samples/HelloWorld/config/environment.rb
===================================================================
--- trunk/samples/HelloWorld/config/environment.rb 2007-06-07 10:59:33 UTC (rev 238)
+++ trunk/samples/HelloWorld/config/environment.rb 2007-06-08 00:19:34 UTC (rev 239)
@@ -1,6 +1,6 @@
# Be sure to restart your web server when you modify this file.
-# Uncomment below to force Rails into production mode when
+# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
@@ -12,7 +12,7 @@
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here
-
+
# Skip frameworks you're not going to use (only works if using vendor/rails)
# config.frameworks -= [ :action_web_service, :action_mailer ]
@@ -22,7 +22,7 @@
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
- # Force all environments to use the same logger level
+ # Force all environments to use the same logger level
# (by default production uses :info, the others :debug)
# config.log_level = :debug
@@ -31,7 +31,7 @@
# config.action_controller.session_store = :active_record_store
# Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
@@ -40,11 +40,11 @@
# Make Active Record use UTC-base instead of local time
# config.active_record.default_timezone = :utc
-
+
# See Rails::Configuration for more options
end
-# Add new inflection rules using the following format
+# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
@@ -57,4 +57,6 @@
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register "application/x-mobile", :mobile
-# Include your application configuration below
\ No newline at end of file
+# Include your application configuration below
+
+require 'gruff'
From kato-k at rubyforge.org Tue Jun 12 20:55:42 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Tue, 12 Jun 2007 20:55:42 -0400 (EDT)
Subject: [ap4r-devel] [240]
trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb:
Refactoring, not yet finished.
Message-ID: <20070613005542.EE1345240B0E@rubyforge.org>
Revision: 240
Author: kato-k
Date: 2007-06-12 20:55:41 -0400 (Tue, 12 Jun 2007)
Log Message:
-----------
Refactoring, not yet finished.
Modified Paths:
--------------
trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
Modified: trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb
===================================================================
--- trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb 2007-06-08 00:19:34 UTC (rev 239)
+++ trunk/samples/HelloWorld/app/controllers/msg_retention_controller.rb 2007-06-13 00:55:41 UTC (rev 240)
@@ -11,7 +11,7 @@
g.theme_keynote
g.title = "Message retension"
g.minimum_value = 0
- g.maximum_value = 50
+ g.maximum_value = 100
g.labels = {}
current_time = Time.now.to_i
From shino at rubyforge.org Fri Jun 15 04:30:13 2007
From: shino at rubyforge.org (shino at rubyforge.org)
Date: Fri, 15 Jun 2007 04:30:13 -0400 (EDT)
Subject: [ap4r-devel] [241] trunk/ap4r/rails_plugin/: remove rails plugin
dir.
Message-ID: <20070615083013.D0BCA5240943@rubyforge.org>
Revision: 241
Author: shino
Date: 2007-06-15 04:30:10 -0400 (Fri, 15 Jun 2007)
Log Message:
-----------
remove rails plugin dir. it has been deprecated.
Removed Paths:
-------------
trunk/ap4r/rails_plugin/
From kato-k at rubyforge.org Fri Jun 22 05:53:47 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Fri, 22 Jun 2007 05:53:47 -0400 (EDT)
Subject: [ap4r-devel] [242] trunk/samples/HelloWorld/config/environment.rb:
Removed require gruff.
Message-ID: <20070622095347.6A5165240A7C@rubyforge.org>
Revision: 242
Author: kato-k
Date: 2007-06-22 05:53:46 -0400 (Fri, 22 Jun 2007)
Log Message:
-----------
Removed require gruff.
Modified Paths:
--------------
trunk/samples/HelloWorld/config/environment.rb
Modified: trunk/samples/HelloWorld/config/environment.rb
===================================================================
--- trunk/samples/HelloWorld/config/environment.rb 2007-06-15 08:30:10 UTC (rev 241)
+++ trunk/samples/HelloWorld/config/environment.rb 2007-06-22 09:53:46 UTC (rev 242)
@@ -58,5 +58,3 @@
# Mime::Type.register "application/x-mobile", :mobile
# Include your application configuration below
-
-require 'gruff'
From kato-k at rubyforge.org Fri Jun 22 06:13:03 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Fri, 22 Jun 2007 06:13:03 -0400 (EDT)
Subject: [ap4r-devel] [243] trunk/ap4r: Modified Rakefile with hoe.
Message-ID: <20070622101303.C81475240AB4@rubyforge.org>
Revision: 243
Author: kato-k
Date: 2007-06-22 06:13:03 -0400 (Fri, 22 Jun 2007)
Log Message:
-----------
Modified Rakefile with hoe.
Modified Paths:
--------------
trunk/ap4r/Rakefile
Added Paths:
-----------
trunk/ap4r/History.txt
trunk/ap4r/Manifest.txt
trunk/ap4r/README.txt
Removed Paths:
-------------
trunk/ap4r/CHANGELOG
trunk/ap4r/README
Deleted: trunk/ap4r/CHANGELOG
===================================================================
--- trunk/ap4r/CHANGELOG 2007-06-22 09:53:46 UTC (rev 242)
+++ trunk/ap4r/CHANGELOG 2007-06-22 10:13:03 UTC (rev 243)
@@ -1,40 +0,0 @@
-== 0.3.x
-
-=== 0.3.2 (June 7th, 2007)
-* Fixed: util/loc.rb doesn't work.
-* Changed: Argument order of async_dispatch has changed, backward INCOMPATIBLE.
-* Added: Dynamic configuration with ERb.
-* Added: Script to run AP4R on Mongrel.
-* Changed: How to plugin and main API names have changed.
-* Added: Support of several Content-type on asynchronous call.
-* Added: Block style for async_to.
-* Added: Url rewrite filter.
-
-=== 0.3.1 (April 24th, 2007)
-
-* Changed: @delete_mode of AsyncController to @@saf_delete_mode with accessor.
-* Changed: default value of dispatch_mode, from :XMLRPC to :HTTP.
-* Added: Bootstrap script to let ap4r run on mongrel, experimental yet.
-
-=== 0.3.0 (April 6th, 2007)
-
-* Changed: name space from "AP4R" to "Ap4r".
-* Added: support the latest version for Ruby(1.8.6) and RubyGems(0.9.2) and Rails(1.2.3) .
-
-== 0.2.x
-
-=== 0.2.0 (October 17th, 2006)
-
-* Added: Protocols to invoke asynchronous logics.
-* Added: At-lease-once QoS.
-
-== 0.1.x
-
-=== 0.1.1 (October 5th, 2006)
-
-* Changed: Enriched RDoc.
-* Changed: Enriched README.
-
-=== 0.1.0 (September 1st, 2006)
-
-* Initial release.
Added: trunk/ap4r/History.txt
===================================================================
--- trunk/ap4r/History.txt (rev 0)
+++ trunk/ap4r/History.txt 2007-06-22 10:13:03 UTC (rev 243)
@@ -0,0 +1,43 @@
+== 0.3.x
+
+=== 0.3.3 (June ?, 2007)
+* Added: support with hoe.
+
+=== 0.3.2 (June 7th, 2007)
+* Fixed: util/loc.rb doesn't work.
+* Changed: Argument order of async_dispatch has changed, backward INCOMPATIBLE.
+* Added: Dynamic configuration with ERb.
+* Added: Script to run AP4R on Mongrel.
+* Changed: How to plugin and main API names have changed.
+* Added: Support of several Content-type on asynchronous call.
+* Added: Block style for async_to.
+* Added: Url rewrite filter.
+
+=== 0.3.1 (April 24th, 2007)
+
+* Changed: @delete_mode of AsyncController to @@saf_delete_mode with accessor.
+* Changed: default value of dispatch_mode, from :XMLRPC to :HTTP.
+* Added: Bootstrap script to let ap4r run on mongrel, experimental yet.
+
+=== 0.3.0 (April 6th, 2007)
+
+* Changed: name space from "AP4R" to "Ap4r".
+* Added: support the latest version for Ruby(1.8.6) and RubyGems(0.9.2) and Rails(1.2.3) .
+
+== 0.2.x
+
+=== 0.2.0 (October 17th, 2006)
+
+* Added: Protocols to invoke asynchronous logics.
+* Added: At-lease-once QoS.
+
+== 0.1.x
+
+=== 0.1.1 (October 5th, 2006)
+
+* Changed: Enriched RDoc.
+* Changed: Enriched README.
+
+=== 0.1.0 (September 1st, 2006)
+
+* Initial release.
Added: trunk/ap4r/Manifest.txt
===================================================================
--- trunk/ap4r/Manifest.txt (rev 0)
+++ trunk/ap4r/Manifest.txt 2007-06-22 10:13:03 UTC (rev 243)
@@ -0,0 +1,38 @@
+History.txt
+MIT-LICENSE
+Rakefile
+README.txt
+bin/ap4r_setup
+config/ap4r_settings.rb
+config/log4r.yaml
+config/queues.cfg
+config/queues_disk.cfg
+config/queues_mysql.cfg
+lib/ap4r.rb
+lib/ap4r/carrier.rb
+lib/ap4r/dispatcher.rb
+lib/ap4r/message_store_ext.rb
+lib/ap4r/mongrel.rb
+lib/ap4r/mongrel_ap4r.rb
+lib/ap4r/multi_queue.rb
+lib/ap4r/queue_manager_ext.rb
+lib/ap4r/queue_manager_ext_debug.rb
+lib/ap4r/retention_history.rb
+lib/ap4r/script/base.rb
+lib/ap4r/script/queue_manager_control.rb
+lib/ap4r/script/setup.rb
+lib/ap4r/script/workspace_generator.rb
+lib/ap4r/start_with_log4r.rb
+lib/ap4r/store_and_forward.rb
+lib/ap4r/stored_message.rb
+lib/ap4r/util/irm.rb
+lib/ap4r/util/queue_client.rb
+lib/ap4r/version.rb
+script/irm
+script/loop.cmd
+script/loop.rb
+script/mongrel_ap4r
+script/start
+script/stop
+spec/local/dispatcher_base_spec.rb
+spec/spec_helper.rb
Deleted: trunk/ap4r/README
===================================================================
--- trunk/ap4r/README 2007-06-22 09:53:46 UTC (rev 242)
+++ trunk/ap4r/README 2007-06-22 10:13:03 UTC (rev 243)
@@ -1,55 +0,0 @@
-== What is AP4R?
-
-AP4R, Asynchronous Processing for Ruby, is the implementation of reliable asynchronous message processing. It provides message queuing, and message dispatching.
-Using asynchronous processing, we can cut down turn-around-time of web applications by queuing, or can utilize more machine power by load-balancing.
-Also AP4R nicely ties with your Ruby on Rails applications. See Hello World sample application from rubyforge.
-
-For more information, please step in AP4R homepage!
-
-http://ap4r.rubyforge.org/wiki/wiki.pl
-
-== Features
-
-1. Business logics can be implemented as simple Web applications, or ruby code, whether it's called asynchronously or synchronously.
-1. Asynchronous messaging is reliable by RDBMS persistence (now MySQL only) or file persistence, under the favor of reliable-msg.
-1. Load balancing over multiple AP4R processes on single/multiple servers is supported.
-1. Asynchronous logics are called via various protocols, such as XML-RPC, SOAP, HTTP PUT, and more.
-1. Using store and forward function, at-least-omce QoS level is provided.
-
-== Typical process flow
-
-1. A client(e.g. a web browser) makes a request to a web server (Apache, Lighttpd, etc...).
-1. A rails application (a synchronous logic) is executed on mongrel via mod_proxy or something.
-1. At the last of the synchronous logic, message(s) are put to AP4R (AP4R provides a helper).
-1. Once the synchronous logic is done, the clients receives a response immediately.
-1. AP4R queues the message, and requests it to the web server asynchronously.
-1. An asynchronous logic, implemented as usual rails action, is executed.
-
-
-== Installation
-
-Use RubyGems command.
-
- $ sudo gem install ap4r --include-dependencies
-
-== References
-
-* Ruby Homepage
- * http://www.ruby-lang.org/
-* Ruby on Rails tutorial
- * http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html
-* MySQL tutorial
- * http://dev.mysql.com/doc/refman/5.0/en/index.html
-* reliable-msg
- * http://trac.labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging
-
-== Licence
-
-This licence is licensed under the MIT license.
-Copyright(c) 2007 Future Architect Inc.
-
-== Authors
-
-* Kiwamu Kato
-* Shunichi Shinohara
-
Added: trunk/ap4r/README.txt
===================================================================
--- trunk/ap4r/README.txt (rev 0)
+++ trunk/ap4r/README.txt 2007-06-22 10:13:03 UTC (rev 243)
@@ -0,0 +1,82 @@
+Ap4r
+* by Kiwamu Kato, Shun'ichi Shinohara
+* http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage
+* ap4r-user at rubyforge.org
+
+== DESCRIPTION:
+
+AP4R, Asynchronous Processing for Ruby, is the implementation of reliable asynchronous message processing. It provides message queuing, and message dispatching.
+Using asynchronous processing, we can cut down turn-around-time of web applications by queuing, or can utilize more machine power by load-balancing.
+Also AP4R nicely ties with your Ruby on Rails applications. See Hello World sample application from rubyforge.
+
+For more information, please step in AP4R homepage!
+
+
+== FEATURES/PROBLEMS:
+
+* Business logics can be implemented as simple Web applications, or ruby code, whether it's called asynchronously or synchronously.
+* Asynchronous messaging is reliable by RDBMS persistence (now MySQL only) or file persistence, under the favor of reliable-msg.
+* Load balancing over multiple AP4R processes on single/multiple servers is supported.
+* Asynchronous logics are called via various protocols, such as XML-RPC, SOAP, HTTP PUT, and more.
+* Using store and forward function, at-least-omce QoS level is provided.
+
+== TYPICAL PROCESS FLOW:
+
+1. A client(e.g. a web browser) makes a request to a web server (Apache, Lighttpd, etc...).
+1. A rails application (a synchronous logic) is executed on mongrel via mod_proxy or something.
+1. At the last of the synchronous logic, message(s) are put to AP4R (AP4R provides a helper).
+1. Once the synchronous logic is done, the clients receives a response immediately.
+1. AP4R queues the message, and requests it to the web server asynchronously.
+1. An asynchronous logic, implemented as usual rails action, is executed.
+
+
+== SYNOPSIS:
+
+* FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+Use RubyGems command.
+
+ $ sudo gem install ap4r --include-dependencies
+
+
+== REFERENCES:
+
+* Ruby Homepage
+ * http://www.ruby-lang.org/
+* Ruby on Rails tutorial
+ * http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html
+* MySQL tutorial
+ * http://dev.mysql.com/doc/refman/5.0/en/index.html
+* reliable-msg
+ * http://trac.labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging
+
+
+== LICENSE:
+
+* This licence is licensed under the MIT license.
+* Copyright(c) 2007 Future Architect Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Modified: trunk/ap4r/Rakefile
===================================================================
--- trunk/ap4r/Rakefile 2007-06-22 09:53:46 UTC (rev 242)
+++ trunk/ap4r/Rakefile 2007-06-22 10:13:03 UTC (rev 243)
@@ -1,102 +1,70 @@
-# Author:: Kiwamu Kato
-# Copyright:: Copyright (c) 2007 Future Architect Inc.
-# Licence:: MIT Licence
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
-
-require 'date'
-require 'find'
-require 'rbconfig'
-
+require 'rubygems'
+require 'hoe'
require File.join(File.dirname(__FILE__), 'lib/ap4r', 'version')
-PKG_VERSION = Ap4r::VERSION::STRING
+HelloWorld = '../samples/HelloWorld'
-TEMP_DIR = './temp'
-PKG_DIR = './pkg'
-RELEASE_DIR = './release'
-HELLO_WORLD_DIR = '../samples/HelloWorld'
+# AP4R release tasks --------------------------------------------------------
-# Generate GEM ----------------------------------------------------------------------------
+# copy rails plugin from sample before gem build
+FileUtils.mkdir_p('./rails_plugin/ap4r/lib')
+FileUtils.cp(HelloWorld + '/db/migrate/001_create_table_for_saf.rb', './lib/ap4r/')
+FileUtils.cp(HelloWorld + '/vendor/plugins/ap4r/init.rb', './rails_plugin/ap4r/')
+FileUtils.cp(HelloWorld + '/vendor/plugins/ap4r/lib/async_helper.rb', './rails_plugin/ap4r/lib/')
+FileUtils.cp(HelloWorld + '/vendor/plugins/ap4r/lib/ap4r_client.rb', './rails_plugin/ap4r/lib/')
+FileUtils.cp(HelloWorld + '/vendor/plugins/ap4r/lib/message_builder.rb', './rails_plugin/ap4r/lib/')
-
-PKG_FILES = FileList[
- '[a-zA-Z]*',
- 'bin/**/*',
- 'config/**/*',
- 'rails_plugin/**/*',
- 'script/**/*',
- 'lib/**/*'
-]
-
-HELLO_WORLD_SAMPLE_FILES = FileList[
- '[a-zA-Z]*',
- 'app/**/*',
- 'components/**/*',
- 'config/**/*',
- 'db/**/*',
- 'doc/**/*',
- 'lib/**/*',
- 'log/**/*',
- 'public/**/*',
- 'script/**/*',
- 'test/**/*',
- 'tmp/**/*',
- 'vendor/**/*',
-]
-
-
-spec = Gem::Specification.new do |s|
- s.name = 'ap4r'
- s.version = PKG_VERSION
- s.summary = "Asynchronous Processing for Ruby."
- s.description = <<-EOF
+Hoe.new('ap4r', Ap4r::VERSION::STRING) do |p|
+ p.author = ["Shunichi Shinohara", "Kiwamu Kato"]
+ p.changes = p.paragraphs_of('History.txt', 1..2).join("\n\n")
+ #p.clean_globs =
+ p.description = <<-EOF
Asynchronous Processing for Ruby.
EOF
+ p.email = %q{shinohara.shunichi at future.co.jp, kato.kiwamu at future.co.jp}
- s.add_dependency(%q, ["= 1.1.0"])
- s.add_dependency(%q)
- s.add_dependency(%q)
- s.add_dependency(%q)
+ p.extra_deps << ['reliable-msg', '=1.1.0']
+ p.extra_deps << ['activesupport']
+ p.extra_deps << ['mongrel']
+ p.extra_deps << ['rake']
+ p.extra_deps << ['hoe']
- s.has_rdoc = true
- s.extra_rdoc_files = ["README", "CHANGELOG", 'rails_plugin']
- s.rdoc_options << "--main" << "README"
- s.rdoc_options << "--title" << "Asynchronous Processing for Ruby"
- s.rdoc_options << "--line-numbers"
+ p.name = 'ap4r'
+ p.need_tar = false
+ p.need_zip = false
+ #p.rdoc_pattern =
+ #p.remote_rdoc_dir =
+ #p.rsync =
+ p.rubyforge_name = 'ap4r'
+ #p.spec_extra =
+ p.summary = 'Asynchronous Processing for Ruby.'
+ p.test_globs = 'spec/**/*_spec.rb'
+ p.url = 'http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage'
+ p.version = Ap4r::VERSION::STRING
+end
- s.files = PKG_FILES.to_a.delete_if {|f| f.include?('.svn')}
- s.require_path = 'lib'
- s.autorequire = %q{ap4r.rb}
+# Sample release tasks ------------------------------------------------------
+desc 'Make samle tarball (Now only HelloWorld sample).'
+task :sample do
+ FileUtils.mkdir_p('./pkg/samples')
+ FileUtils.rm_rf('./pkg/samples/HelloWorld')
+
+ FileUtils.cp_r(HelloWorld, './pkg/samples/')
+ Find.find('./pkg/samples') do |path|
+ next unless File.file? path
+ FileUtils.rm_rf(path) if path =~ /\.svn|tmp$|CVS|.rb\~/
+ end
- s.bindir = "bin" # Use these for applications.
- s.executables = ["ap4r_setup"]
- s.default_executable = "ap4r_setup"
-
- s.authors = ["Shunichi Shinohara", "Kiwamu Kato"]
- s.email = %q{shinohara.shunichi at future.co.jp, kato.kiwamu at future.co.jp}
- s.homepage = %q{http://rubyforge.org/projects/ap4r/}
- s.rubyforge_project = "ap4r"
+ Dir.chdir('./pkg/samples/HelloWorld')
+ `rake db:migrate`
+ Dir.chdir('../../')
+
+ `tar czvf HelloWorld-#{Ap4r::VERSION::STRING}.tar.gz ./samples/HelloWorld/`
+ Dir.chdir('../')
end
-Rake::GemPackageTask.new(spec) do |pkg|
-end
-# Generate documentation ------------------------------------------------------------------
-
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=rw'
- rdoc.rdoc_files.include('README', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.include('rails_plugin/**/*.rb')
-}
-
# Spec tasks ----------------------------------------------------------------
require 'spec/rake/spectask'
@@ -123,71 +91,7 @@
end
end
-# AP4R release ----------------------------------------------------------------
-desc "Make gem"
-task :gem_release => [ :make_release_dir, :copy_to_ap4r_from_sample, :gem]
-
-task :copy_to_ap4r_from_sample do
- FileUtils.cp(HELLO_WORLD_DIR + '/db/migrate/001_create_table_for_saf.rb', './lib/ap4r/xxx_create_table_for_saf.rb')
-
- FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/init.rb', './rails_plugin/ap4r/init.rb')
- FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/async_helper.rb', './rails_plugin/ap4r/lib/async_helper.rb')
- FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/ap4r_client.rb', './rails_plugin/ap4r/lib/ap4r_client.rb')
- FileUtils.cp(HELLO_WORLD_DIR + '/vendor/plugins/ap4r/lib/message_builder.rb', './rails_plugin/ap4r/lib/message_builder.rb')
-end
-
-desc "Make sample tgz"
-task :sample_release => [ :make_release_dir, :make_sample_tgz, :copy_to_release_dir ]
-
-task :make_sample_tgz => [ :make_temp_dir, :copy_sample, :execute_migration, :make_tgz ]
-
-task :make_release_dir do
- make_dir RELEASE_DIR
-end
-
-task :make_temp_dir do
- make_dir TEMP_DIR
-end
-
-def make_dir(path)
- if(File.exist?(path))
- FileUtils.remove_entry(path, true)
- end
- FileUtils.mkdir_p(path)
-end
-
-
-task :copy_sample do
- FileUtils.cp_r(HELLO_WORLD_DIR, TEMP_DIR)
- Find.find(TEMP_DIR) {|f|
- if f.include?('.svn')
- FileUtils.rm_rf(f)
- end
- }
-end
-
-task :execute_migration do
- Dir.chdir('temp/HelloWorld')
- `rake db:migrate`
- Dir.chdir('../../')
-end
-
-task :make_tgz do
- Dir.chdir('temp/')
- `tar czvf HelloWorld.tar.gz HelloWorld/`
- Dir.chdir('../')
-end
-
-task :copy_to_release_dir do
- Dir.foreach(PKG_DIR) {|f|
- FileUtils.cp(PKG_DIR + '/' + f, RELEASE_DIR) if File.fnmatch("*.gem", f)
- }
- Dir.foreach(TEMP_DIR) {|f|
- FileUtils.cp(TEMP_DIR + '/' + f, RELEASE_DIR) if File.fnmatch("*.tar.gz", f)
- }
-end
-
# AP4R misc tools ----------------------------------------------------------------
desc "display code statistics"
From shino at rubyforge.org Sun Jun 24 20:28:52 2007
From: shino at rubyforge.org (shino at rubyforge.org)
Date: Sun, 24 Jun 2007 20:28:52 -0400 (EDT)
Subject: [ap4r-devel] [244] trunk/ap4r/README.txt: FIXED: typos
Message-ID: <20070625002852.366EB5240A6F@rubyforge.org>
Revision: 244
Author: shino
Date: 2007-06-24 20:28:47 -0400 (Sun, 24 Jun 2007)
Log Message:
-----------
FIXED: typos
Modified Paths:
--------------
trunk/ap4r/README.txt
Modified: trunk/ap4r/README.txt
===================================================================
--- trunk/ap4r/README.txt 2007-06-22 10:13:03 UTC (rev 243)
+++ trunk/ap4r/README.txt 2007-06-25 00:28:47 UTC (rev 244)
@@ -18,11 +18,11 @@
* Asynchronous messaging is reliable by RDBMS persistence (now MySQL only) or file persistence, under the favor of reliable-msg.
* Load balancing over multiple AP4R processes on single/multiple servers is supported.
* Asynchronous logics are called via various protocols, such as XML-RPC, SOAP, HTTP PUT, and more.
-* Using store and forward function, at-least-omce QoS level is provided.
+* Using store and forward function, at-least-once QoS level is provided.
== TYPICAL PROCESS FLOW:
-1. A client(e.g. a web browser) makes a request to a web server (Apache, Lighttpd, etc...).
+1. A client (e.g. a web browser) makes a request to a web server (Apache, Lighttpd, etc...).
1. A rails application (a synchronous logic) is executed on mongrel via mod_proxy or something.
1. At the last of the synchronous logic, message(s) are put to AP4R (AP4R provides a helper).
1. Once the synchronous logic is done, the clients receives a response immediately.
@@ -59,7 +59,7 @@
== LICENSE:
-* This licence is licensed under the MIT license.
+* This software is licensed under the MIT license.
* Copyright(c) 2007 Future Architect Inc.
Permission is hereby granted, free of charge, to any person obtaining
From kato-k at rubyforge.org Mon Jun 25 03:44:30 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Mon, 25 Jun 2007 03:44:30 -0400 (EDT)
Subject: [ap4r-devel] [245] trunk/ap4r: Added create_manifest task.
Message-ID: <20070625074430.6214B5240BAA@rubyforge.org>
Revision: 245
Author: kato-k
Date: 2007-06-25 03:44:28 -0400 (Mon, 25 Jun 2007)
Log Message:
-----------
Added create_manifest task.
Modified Paths:
--------------
trunk/ap4r/Manifest.txt
trunk/ap4r/Rakefile
Modified: trunk/ap4r/Manifest.txt
===================================================================
--- trunk/ap4r/Manifest.txt 2007-06-25 00:28:47 UTC (rev 244)
+++ trunk/ap4r/Manifest.txt 2007-06-25 07:44:28 UTC (rev 245)
@@ -1,7 +1,8 @@
History.txt
MIT-LICENSE
+Manifest.txt
+README.txt
Rakefile
-README.txt
bin/ap4r_setup
config/ap4r_settings.rb
config/log4r.yaml
@@ -9,6 +10,7 @@
config/queues_disk.cfg
config/queues_mysql.cfg
lib/ap4r.rb
+lib/ap4r/001_create_table_for_saf.rb
lib/ap4r/carrier.rb
lib/ap4r/dispatcher.rb
lib/ap4r/message_store_ext.rb
@@ -28,6 +30,10 @@
lib/ap4r/util/irm.rb
lib/ap4r/util/queue_client.rb
lib/ap4r/version.rb
+rails_plugin/ap4r/init.rb
+rails_plugin/ap4r/lib/ap4r_client.rb
+rails_plugin/ap4r/lib/async_helper.rb
+rails_plugin/ap4r/lib/message_builder.rb
script/irm
script/loop.cmd
script/loop.rb
Modified: trunk/ap4r/Rakefile
===================================================================
--- trunk/ap4r/Rakefile 2007-06-25 00:28:47 UTC (rev 244)
+++ trunk/ap4r/Rakefile 2007-06-25 07:44:28 UTC (rev 245)
@@ -44,6 +44,27 @@
end
+desc 'Create Manifest.txt'
+task :create_manifest do
+
+ path_list = []
+ Find.find('.') do |path|
+ next unless File.file? path
+ next if path =~ /\.svn|tmp$|CVS|.rb\~/
+ path_list << path
+ end
+
+ File.open('Manifest.txt', 'w') do |manifest|
+ path_list.sort.each do |path|
+ /.\// =~ path
+ manifest.puts($~.post_match)
+ end
+ end
+
+end
+
+
+
# Sample release tasks ------------------------------------------------------
desc 'Make samle tarball (Now only HelloWorld sample).'
task :sample do
From kato-k at rubyforge.org Tue Jun 26 03:46:16 2007
From: kato-k at rubyforge.org (kato-k at rubyforge.org)
Date: Tue, 26 Jun 2007 03:46:16 -0400 (EDT)
Subject: [ap4r-devel] [246] trunk/samples/HelloWorld: Added hoe support to
HelloWorld sample.
Message-ID: <20070626074616.609845240BE2@rubyforge.org>
Revision: 246
Author: kato-k
Date: 2007-06-26 03:46:15 -0400 (Tue, 26 Jun 2007)
Log Message:
-----------
Added hoe support to HelloWorld sample.
Modified Paths:
--------------
trunk/samples/HelloWorld/Rakefile
Added Paths:
-----------
trunk/samples/HelloWorld/History.txt
trunk/samples/HelloWorld/Manifest.txt
trunk/samples/HelloWorld/README.txt
Added: trunk/samples/HelloWorld/History.txt
===================================================================
--- trunk/samples/HelloWorld/History.txt (rev 0)
+++ trunk/samples/HelloWorld/History.txt 2007-06-26 07:46:15 UTC (rev 246)
@@ -0,0 +1,5 @@
+== 1.0.0 / 2007-06-25
+
+* 1 major enhancement
+ * Birthday!
+
Added: trunk/samples/HelloWorld/Manifest.txt
===================================================================
--- trunk/samples/HelloWorld/Manifest.txt (rev 0)
+++ trunk/samples/HelloWorld/Manifest.txt 2007-06-26 07:46:15 UTC (rev 246)
@@ -0,0 +1,92 @@
+History.txt
+Manifest.txt
+README
+README.txt
+Rakefile
+app/apis/async_world_api.rb
+app/controllers/application.rb
+app/controllers/async_shop_controller.rb
+app/controllers/async_world_controller.rb
+app/controllers/msg_retention_controller.rb
+app/controllers/saf_controller.rb
+app/controllers/shop_controller.rb
+app/controllers/sync_hello_controller.rb
+app/helpers/application_helper.rb
+app/helpers/async_shop_helper.rb
+app/helpers/async_world_helper.rb
+app/helpers/msg_retention_helper.rb
+app/helpers/saf_helper.rb
+app/helpers/shop_helper.rb
+app/helpers/sync_hello_helper.rb
+app/models/ap4r_class.rb
+app/models/ap4r_group.rb
+app/models/world_request.rb
+app/views/async_world/execute.rhtml
+app/views/layouts/application.rhtml
+app/views/layouts/saf.rhtml
+app/views/msg_retention/load2replace_by_js.rhtml
+app/views/msg_retention/retention.rhtml
+app/views/msg_retention/status_img.rhtml
+app/views/saf/_form.rhtml
+app/views/saf/edit.rhtml
+app/views/saf/list.rhtml
+app/views/saf/new.rhtml
+app/views/saf/show.rhtml
+app/views/shop/account.rhtml
+app/views/shop/order.rhtml
+app/views/sync_hello/index.rhtml
+config/ap4r.yml.sample
+config/boot.rb
+config/database.yml
+config/environment.rb
+config/environments/development.rb
+config/environments/production.rb
+config/environments/test.rb
+config/mongrel_cluster.yml
+config/routes.rb
+db/hello_world_development.db
+db/hello_world_production.db
+db/migrate/001_create_table_for_saf.rb
+db/schema.rb
+public/.htaccess
+public/404.html
+public/500.html
+public/dispatch.cgi
+public/dispatch.fcgi
+public/dispatch.rb
+public/favicon.ico
+public/images/rails.png
+public/javascripts/application.js
+public/javascripts/controls.js
+public/javascripts/dragdrop.js
+public/javascripts/effects.js
+public/javascripts/prototype.js
+public/public_original.html
+public/robots.txt
+public/stylesheets/scaffold.css
+script/about
+script/breakpointer
+script/console
+script/destroy
+script/generate
+script/performance/benchmarker
+script/performance/profiler
+script/plugin
+script/process/inspector
+script/process/reaper
+script/process/spawner
+script/runner
+script/server
+test/async/ap4r_test_helper.rb
+test/async/hello_world_stories_test.rb
+test/functional/async_shop_controller_test.rb
+test/functional/msg_retention_controller_test.rb
+test/functional/shop_controller_test.rb
+test/integration/ap4r_queue_stub.rb
+test/integration/hello_rails_integration_with_ap4r_test.rb
+test/test_helper.rb
+tmp/sessions/hoge.txt
+vendor/plugins/ap4r/init.rb
+vendor/plugins/ap4r/lib/ap4r_client.rb
+vendor/plugins/ap4r/lib/async_helper.rb
+vendor/plugins/ap4r/lib/message_builder.rb
Added: trunk/samples/HelloWorld/README.txt
===================================================================
--- trunk/samples/HelloWorld/README.txt (rev 0)
+++ trunk/samples/HelloWorld/README.txt 2007-06-26 07:46:15 UTC (rev 246)
@@ -0,0 +1,48 @@
+HelloWorld
+ by FIX (your name)
+ FIX (url)
+
+== DESCRIPTION:
+
+FIX (describe your package)
+
+== FEATURES/PROBLEMS:
+
+* FIX (list of features or problems)
+
+== SYNOPSIS:
+
+ FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+* FIX (sudo gem install, anything else)
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2007 FIX
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Modified: trunk/samples/HelloWorld/Rakefile
===================================================================
--- trunk/samples/HelloWorld/Rakefile 2007-06-25 07:44:28 UTC (rev 245)
+++ trunk/samples/HelloWorld/Rakefile 2007-06-26 07:46:15 UTC (rev 246)
@@ -1,10 +1,95 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+require 'rubygems'
+require 'hoe'
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+require File.join(File.dirname(__FILE__), 'config', 'boot')
+require 'tasks/rails'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
+VERSION = '0.3.3'
-require 'tasks/rails'
+# HelloWorld release tasks --------------------------------------------------------
+
+Hoe.new('HelloWorld', VERSION) do |p|
+ p.author = ["Shunichi Shinohara", "Kiwamu Kato"]
+ p.changes = p.paragraphs_of('History.txt', 1..2).join("\n\n")
+ #p.clean_globs =
+ p.description = <<-EOF
+ One of AP4R's sample applications.
+ EOF
+ p.email = %q{shinohara.shunichi at future.co.jp, kato.kiwamu at future.co.jp}
+
+ #p.extra_deps <<
+ p.name = 'HelloWorld'
+ p.need_tar = false
+ p.need_zip = false
+ #p.rdoc_pattern =
+ #p.remote_rdoc_dir =
+ #p.rsync =
+ p.rubyforge_name = 'ap4r'
+ #p.spec_extra =
+ p.summary = 'One of AP4Rs sample applications'
+ #p.test_globs = 'test/**/*_test.rb'
+ p.url = 'http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage'
+ p.version = VERSION
+end
+
+
+desc 'Create Manifest.txt'
+task :create_manifest do
+ path_list = []
+ Find.find('.') do |path|
+ next unless File.file? path
+ next if path =~ /\.svn|tmp$|CVS|.rb\~|.log|.pid/
+ path_list << path
+ end
+
+ File.open('Manifest.txt', 'w') do |manifest|
+ path_list.sort.each do |path|
+ /.\// =~ path
+ manifest.puts($~.post_match)
+ end
+ end
+end
+
+
+# Sample release tasks ------------------------------------------------------
+desc 'Create sample HelloWorld tarball'
+task :tar do
+
+ FileUtils.mkdir_p('../temp/samples/HelloWorld')
+ FileUtils.rm_rf('../temp/samples/HelloWorld')
+
+ FileUtils.cp_r('.', '../temp/samples/HelloWorld')
+ Find.find('../temp/samples') do |path|
+ next unless File.file? path
+ FileUtils.rm_rf(path) if path =~ /\.svn|tmp$|CVS|.rb\~|.log|.pid/
+ end
+
+ FileUtils.mkdir_p('./pkg')
+ FileUtils.cp_r('../temp/samples/HelloWorld','./pkg')
+ FileUtils.rm_rf('../temp')
+
+ Dir.chdir('./pkg/HelloWorld')
+ `rake db:migrate`
+ Dir.chdir('../')
+
+ sh "tar czf HelloWorld-#{VERSION}.tar.gz ./HelloWorld/"
+ Dir.chdir('../')
+
+end
+
+
+# misc tools ----------------------------------------------------------------
+
+desc "display code statistics"
+task :stats do
+ require 'rubygems'
+ require 'active_support'
+ require 'code_statistics'
+ CodeStatistics::TEST_TYPES.concat(["Local specs"])
+ CodeStatistics.new(
+ ["Core Sources", "lib"],
+ ["Rails plugin", "rails_plugin"],
+ ["Scripts", "script"],
+ ["Local specs", "spec/local"]
+ ).to_s
+end