public
Rubygem
Description: JSON Web App Framework
Homepage: http://halcyon.rubyforge.org/
Clone URL: git://github.com/mtodd/halcyon.git
Search Repo:
Click here to lend your support to: halcyon and make a donation at www.pledgie.com !
Fixed some of the general documentation for the project and stole some 
code from Rack for Rakefile and for bin/halcyon.

git-svn-id: svn+ssh://rubyforge.org/var/svn/halcyon/trunk@3 
334d6d1c-2662-47f5-9f2d-00d938bdab95
mtodd (author)
Fri Dec 14 01:38:21 -0800 2007
commit  e75f4a96cc33072feab97b329153ca9d48fcab53
tree    b18e2d9f3431ce1ef4e99e47ef7ffc41278c4c8f
parent  986ea3a4a65ea8f064cd1edc9a77a4aca3e2a657
...
 
...
1
0
@@ -1 +1,2 @@
0
+* Matt Todd <chiology@gmail.com>
0
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
0
@@ -1 +1,59 @@
0
+= Halcyon JSON Server Framework
0
+
0
+A JSON Web Server Framework designed to provide for simple applications dealing
0
+solely with JSON requests and responses from AJAX client applications or for
0
+lightweight server-side message transport.
0
+
0
+== On Rack
0
+
0
+Halcyon is based off of Rack.
0
+
0
+== Quick start
0
+
0
+Check out the documentation for the Aurora SAS at http://aurora.rubyforge.org/
0
+to see Halcyon in use.
0
+
0
+== Installing with RubyGems
0
+
0
+A Gem of Halcyon is available. You can install it with:
0
+
0
+$ sudo gem install halcyon
0
+
0
+== Contact
0
+
0
+Please mail bugs, suggestions and patches to
0
+<mailto:chiology@gmail.com>.
0
+
0
+You are also welcome to join the #halcyon channel on irc.freenode.net.
0
+
0
+== License and Copyright
0
+
0
+Copyright (C) 2007 Matt Todd <http://purl.org/net/maraby>.
0
+
0
+Permission is hereby granted, free of charge, to any person obtaining a copy
0
+of this software and associated documentation files (the "Software"), to
0
+deal in the Software without restriction, including without limitation the
0
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
0
+sell copies of the Software, and to permit persons to whom the Software is
0
+furnished to do so, subject to the following conditions:
0
+
0
+The above copyright notice and this permission notice shall be included in
0
+all copies or substantial portions of the Software.
0
+
0
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
0
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
0
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
+
0
+== Links
0
+
0
+Halcyon:: <http://halcyon.rubyforge.org/>
0
+Aurora:: <http://aurora.rubyforge.org/>
0
+
0
+Rack:: <http://rack.rubyforge.org/>
0
+JSON:: <http://json.rubyforge.org/>
0
+
0
+Matt TOdd:: <http://maraby.org/>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
0
@@ -1 +1,176 @@
0
+# Rakefile for Rack. -*-ruby-*-
0
+require 'rake/rdoctask'
0
+require 'rake/testtask'
0
+
0
+
0
+desc "Run all the tests"
0
+task :default => [:test]
0
+
0
+desc "Do predistribution stuff"
0
+task :predist => [:chmod, :changelog, :rdoc]
0
+
0
+
0
+desc "Make an archive as .tar.gz"
0
+task :dist => :fulltest do
0
+ sh "export DARCS_REPO=#{File.expand_path "."}; " +
0
+ "darcs dist -d rack-#{get_darcs_tree_version}"
0
+end
0
+
0
+# Helper to retrieve the "revision number" of the darcs tree.
0
+def get_darcs_tree_version
0
+ unless File.directory? "_darcs"
0
+ $: << "lib"
0
+ require 'rack'
0
+ return Rack.version
0
+ end
0
+
0
+ changes = `darcs changes`
0
+ count = 0
0
+ tag = "0.0"
0
+
0
+ changes.each("\n\n") { |change|
0
+ head, title, desc = change.split("\n", 3)
0
+
0
+ if title =~ /^ \*/
0
+ # Normal change.
0
+ count += 1
0
+ elsif title =~ /tagged (.*)/
0
+ # Tag. We look for these.
0
+ tag = $1
0
+ break
0
+ else
0
+ warn "Unparsable change: #{change}"
0
+ end
0
+ }
0
+
0
+ tag + "." + count.to_s
0
+end
0
+
0
+def manifest
0
+ `darcs query manifest`.split("\n").map { |f| f.gsub(/\A\.\//, '') }
0
+end
0
+
0
+
0
+desc "Make binaries executable"
0
+task :chmod do
0
+ Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
0
+ Dir["test/cgi/test*"].each { |binary| File.chmod(0775, binary) }
0
+end
0
+
0
+desc "Generate a ChangeLog"
0
+task :changelog do
0
+ sh "darcs changes --repo=#{ENV["DARCS_REPO"] || "."} >ChangeLog"
0
+end
0
+
0
+
0
+desc "Generate RDox"
0
+task "RDOX" do
0
+ sh "specrb -Ilib:test -a --rdox >RDOX"
0
+end
0
+
0
+desc "Generate Rack Specification"
0
+task "SPEC" do
0
+ File.open("SPEC", "wb") { |file|
0
+ IO.foreach("lib/rack/lint.rb") { |line|
0
+ if line =~ /## (.*)/
0
+ file.puts $1
0
+ end
0
+ }
0
+ }
0
+end
0
+
0
+desc "Run all the fast tests"
0
+task :test do
0
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS'] || '-t "^(?!Rack::Handler|Rack::Adapter)"'}"
0
+end
0
+
0
+desc "Run all the tests"
0
+task :fulltest do
0
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS']}"
0
+end
0
+
0
+begin
0
+ $" << "sources" if defined? FromSrc
0
+ require 'rubygems'
0
+
0
+ require 'rake'
0
+ require 'rake/clean'
0
+ require 'rake/packagetask'
0
+ require 'rake/gempackagetask'
0
+ require 'fileutils'
0
+rescue LoadError
0
+ # Too bad.
0
+else
0
+ spec = Gem::Specification.new do |s|
0
+ s.name = "rack"
0
+ s.version = get_darcs_tree_version
0
+ s.platform = Gem::Platform::RUBY
0
+ s.summary = "a modular Ruby webserver interface"
0
+
0
+ s.description = <<-EOF
0
+Rack provides minimal, modular and adaptable interface for developing
0
+web applications in Ruby. By wrapping HTTP requests and responses in
0
+the simplest way possible, it unifies and distills the API for web
0
+servers, web frameworks, and software in between (the so-called
0
+middleware) into a single method call.
0
+
0
+Also see http://rack.rubyforge.org.
0
+ EOF
0
+
0
+ s.files = manifest + %w(SPEC RDOX)
0
+ s.bindir = 'bin'
0
+ s.executables << 'rackup'
0
+ s.require_path = 'lib'
0
+ s.has_rdoc = true
0
+ s.extra_rdoc_files = ['README', 'SPEC', 'RDOX', 'KNOWN-ISSUES']
0
+ s.test_files = Dir['test/{test,spec}_*.rb']
0
+
0
+ s.author = 'Christian Neukirchen'
0
+ s.email = 'chneukirchen@gmail.com'
0
+ s.homepage = 'http://rack.rubyforge.org'
0
+ s.rubyforge_project = 'rack'
0
+ end
0
+
0
+ Rake::GemPackageTask.new(spec) do |p|
0
+ p.gem_spec = spec
0
+ p.need_tar = false
0
+ p.need_zip = false
0
+ end
0
+end
0
+
0
+desc "Generate RDoc documentation"
0
+Rake::RDocTask.new(:rdoc) do |rdoc|
0
+ rdoc.options << '--line-numbers' << '--inline-source' <<
0
+ '--main' << 'README' <<
0
+ '--title' << 'Rack Documentation' <<
0
+ '--charset' << 'utf-8'
0
+ rdoc.rdoc_dir = "doc"
0
+ rdoc.rdoc_files.include 'README'
0
+ rdoc.rdoc_files.include 'KNOWN-ISSUES'
0
+ rdoc.rdoc_files.include 'SPEC'
0
+ rdoc.rdoc_files.include 'RDOX'
0
+ rdoc.rdoc_files.include('lib/rack.rb')
0
+ rdoc.rdoc_files.include('lib/rack/*.rb')
0
+ rdoc.rdoc_files.include('lib/rack/*/*.rb')
0
+end
0
+task :rdoc => ["SPEC", "RDOX"]
0
+
0
+task :pushsite => [:rdoc] do
0
+ sh "rsync -avz doc/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
0
+ sh "rsync -avz site/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/"
0
+end
0
+
0
+begin
0
+ require 'rcov/rcovtask'
0
+
0
+ Rcov::RcovTask.new do |t|
0
+ t.test_files = FileList['test/{spec,test}_*.rb']
0
+ t.verbose = true # uncomment to see the executed command
0
+ t.rcov_opts = ["--text-report",
0
+ "-Ilib:test",
0
+ "--include-file", "^lib,^test",
0
+ "--exclude-only", "^/usr,^/home/.*/src,active_"]
0
+ end
0
+rescue LoadError
0
+end
...
20
21
22
23
 
24
25
26
...
36
37
38
 
 
 
 
39
40
41
...
70
71
72
73
 
 
74
75
...
20
21
22
 
23
24
25
26
...
36
37
38
39
40
41
42
43
44
45
...
74
75
76
 
77
78
79
80
0
@@ -20,7 +20,7 @@
0
 }
0
 
0
 opts = OptionParser.new("", 24, ' ') do |opts|
0
- opts.banner = "Usage: halcyon [options] [config_file.yaml]"
0
+ opts.banner = "Usage: halcyon [options] [app]"
0
   
0
   opts.separator ""
0
   opts.separator "Options:"
0
@@ -36,6 +36,10 @@
0
     require library
0
   end
0
   
0
+ opts.on("-c", "--config PATH", "configuration stored in PATH") do |conf|
0
+ options[:config_file] = conf
0
+ end
0
+
0
   opts.on("-s", "--server SERVER", "serve using SERVER (default: #{options[:server]})") do |serv|
0
     options[:server] = serv
0
   end
0
@@ -70,7 +74,8 @@
0
   opts.parse! ARGV
0
 end
0
 
0
-options[:config_file] = ARGV.shift unless ARGV[0].nil?
0
+fail("Halcyon needs an app to run. Try: halcyon -h") if ARGV.empty?
0
+options[:app] = ARGV.shift
0
 
0
 puts options.inspect

Comments

    No one has commented yet.