waves 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/waves +8 -7
- data/doc/VERSION +1 -1
- data/lib/commands/help.rb +2 -2
- data/lib/dispatchers/base.rb +1 -1
- data/lib/dispatchers/default.rb +0 -4
- data/lib/foundations/classic.rb +3 -1
- data/lib/layers/orm/migration.rb +1 -1
- data/lib/resources/mixin.rb +2 -2
- data/lib/runtime/configuration.rb +0 -5
- data/templates/classic/Rakefile +21 -61
- data/templates/classic/controllers/.gitignore +0 -0
- data/templates/classic/helpers/.gitignore +0 -0
- data/templates/classic/lib/tasks/.gitignore +0 -0
- data/templates/classic/models/.gitignore +0 -0
- data/templates/classic/public/css/.gitignore +0 -0
- data/templates/classic/public/flash/.gitignore +0 -0
- data/templates/classic/public/images/.gitignore +0 -0
- data/templates/classic/public/javascript/.gitignore +0 -0
- data/templates/classic/resources/.gitignore +0 -0
- data/templates/classic/schema/migrations/.gitignore +0 -0
- data/templates/classic/templates/errors/not_found_404.mab +6 -1
- data/templates/classic/templates/errors/server_error_500.mab +5 -0
- data/templates/classic/tmp/sessions/.gitignore +0 -0
- data/templates/classic/views/.gitignore +0 -0
- metadata +70 -48
data/bin/waves
CHANGED
@@ -8,20 +8,21 @@ require 'rubygems'
|
|
8
8
|
WAVES = "#{File.dirname(__FILE__)}/.." unless defined? WAVES
|
9
9
|
|
10
10
|
waves = [
|
11
|
-
|
12
|
-
].compact.map { |dir| File.join(dir, 'lib') }.find
|
11
|
+
WAVES, ENV['WAVES'], './waves'
|
12
|
+
].compact.map { |dir| File.join(dir, 'lib') }.find { |d|
|
13
|
+
File.exist? File.join( d, 'waves.rb' )
|
14
|
+
}
|
13
15
|
if waves
|
14
|
-
|
15
|
-
|
16
|
+
$: << waves
|
17
|
+
waves = File.join( waves, 'waves' )
|
16
18
|
else
|
17
|
-
|
19
|
+
waves = 'waves'
|
18
20
|
end
|
19
|
-
require waves
|
20
21
|
|
22
|
+
require waves
|
21
23
|
|
22
24
|
puts "** Waves #{Waves.version} **"
|
23
25
|
|
24
|
-
|
25
26
|
begin
|
26
27
|
require "commands/#{ARGV.first}"
|
27
28
|
rescue LoadError => e
|
data/doc/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
data/lib/commands/help.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
puts <<-HELP
|
2
|
-
Usage: waves [
|
2
|
+
Usage: waves [ generate | server | console ] [ options ]
|
3
3
|
Run a waves command with the given options. Use --help with any command to learn
|
4
|
-
more about that command. EXAMPLE: waves
|
4
|
+
more about that command. EXAMPLE: waves generate --help
|
5
5
|
HELP
|
data/lib/dispatchers/base.rb
CHANGED
@@ -8,7 +8,7 @@ module Waves
|
|
8
8
|
|
9
9
|
# Redirect exceptions are rescued by the Waves dispatcher and used to set the
|
10
10
|
# response status and location.
|
11
|
-
class Redirect <
|
11
|
+
class Redirect < SignalException
|
12
12
|
attr_reader :path, :status
|
13
13
|
def initialize( path, status = '302' )
|
14
14
|
@path = path
|
data/lib/dispatchers/default.rb
CHANGED
data/lib/foundations/classic.rb
CHANGED
@@ -14,6 +14,7 @@ module Waves
|
|
14
14
|
require 'layers/inflect/english'
|
15
15
|
require 'helpers/extended'
|
16
16
|
require 'layers/renderers/erubis'
|
17
|
+
require 'layers/renderers/markaby'
|
17
18
|
|
18
19
|
app.module_eval do
|
19
20
|
|
@@ -21,7 +22,7 @@ module Waves
|
|
21
22
|
|
22
23
|
app.auto_create_module( :Configurations ) do
|
23
24
|
include AutoCode
|
24
|
-
auto_create_class :Default
|
25
|
+
auto_create_class :Default, Waves::Configurations::Default
|
25
26
|
auto_load :Default, :directories => [ :configurations ]
|
26
27
|
end
|
27
28
|
|
@@ -51,6 +52,7 @@ module Waves
|
|
51
52
|
include Waves::Layers::Inflect::English
|
52
53
|
include Waves::Layers::MVC
|
53
54
|
include Waves::Renderers::Erubis
|
55
|
+
include Waves::Renderers::Markaby
|
54
56
|
|
55
57
|
end
|
56
58
|
|
data/lib/layers/orm/migration.rb
CHANGED
@@ -56,7 +56,7 @@ module Waves
|
|
56
56
|
# <em>orm</em> can be a symbol or string
|
57
57
|
def self.migration_template(orm, name=nil)
|
58
58
|
file = ( name || 'empty' ) + '.rb.erb'
|
59
|
-
source = File.dirname(__FILE__) / orm / :migrations / file
|
59
|
+
source = File.dirname(__FILE__) / :providers / orm / :migrations / file
|
60
60
|
end
|
61
61
|
|
62
62
|
# Given a migration name, returns the path of the file that would be created.
|
data/lib/resources/mixin.rb
CHANGED
@@ -82,7 +82,6 @@ module Waves
|
|
82
82
|
response.status = ( StatusCodes[ e.class ] || 500 )
|
83
83
|
( body = handler( e ) ) rescue raise e
|
84
84
|
Waves::Logger.warn e.to_s
|
85
|
-
Waves::Logger.debug "#{e.class.name} : #{e.message}"
|
86
85
|
e.backtrace.each { |t| Waves::Logger.debug " #{t}" }
|
87
86
|
ensure
|
88
87
|
always
|
@@ -98,7 +97,7 @@ module Waves
|
|
98
97
|
begin
|
99
98
|
Waves.main::Resources[ resource ]
|
100
99
|
rescue NameError
|
101
|
-
raise Waves::Dispatchers::NotFoundError
|
100
|
+
raise Waves::Dispatchers::NotFoundError
|
102
101
|
end
|
103
102
|
Waves.main::Resources[ resource ]
|
104
103
|
end
|
@@ -113,6 +112,7 @@ module Waves
|
|
113
112
|
def deferred? ; false ; end
|
114
113
|
|
115
114
|
before {} ; after {} ; always {}
|
115
|
+
handler( Waves::Dispatchers::Redirect ) { |e| raise e }
|
116
116
|
|
117
117
|
%w( post get put delete head ).each do | method |
|
118
118
|
on( method ) { not_found }
|
@@ -52,9 +52,6 @@ module Waves
|
|
52
52
|
# parameters for the database connection, varies by ORM
|
53
53
|
attribute( :database )
|
54
54
|
|
55
|
-
# options for the session: options for duration and path
|
56
|
-
attribute( :session )
|
57
|
-
|
58
55
|
# set the debug mode flag; typically done in dev / test configurations
|
59
56
|
attribute( :debug )
|
60
57
|
|
@@ -85,7 +82,6 @@ module Waves
|
|
85
82
|
|
86
83
|
# default options
|
87
84
|
debug true
|
88
|
-
session :duration => 30.minutes, :path => '/tmp/sessions'
|
89
85
|
log :level => :info, :output => $stderr
|
90
86
|
reloadable []
|
91
87
|
dependencies []
|
@@ -97,7 +93,6 @@ module Waves
|
|
97
93
|
:path => '/',
|
98
94
|
:expire_after => 2592000,
|
99
95
|
:secret => 'Change it'
|
100
|
-
|
101
96
|
run ::Waves::Dispatchers::Default.new
|
102
97
|
}
|
103
98
|
end
|
data/templates/classic/Rakefile
CHANGED
@@ -4,83 +4,43 @@
|
|
4
4
|
# application with the waves script. Accordingly, you may
|
5
5
|
# wish to keep your tasks in .rb or .rake files in lib/tasks
|
6
6
|
|
7
|
+
require 'rubygems'
|
8
|
+
|
9
|
+
WAVES = "#{File.dirname(__FILE__)}/.." unless defined? WAVES
|
10
|
+
|
11
|
+
waves = [
|
12
|
+
WAVES, ENV['WAVES'], './waves'
|
13
|
+
].compact.map { |dir| File.join(dir, 'lib') }.find { |d|
|
14
|
+
File.exist? File.join( d, 'waves.rb' )
|
15
|
+
}
|
16
|
+
if waves
|
17
|
+
$: << waves
|
18
|
+
waves = File.join( waves, 'waves' )
|
19
|
+
else
|
20
|
+
waves = 'waves'
|
21
|
+
end
|
22
|
+
|
23
|
+
require waves
|
24
|
+
require 'runtime/console'
|
25
|
+
|
7
26
|
begin
|
8
|
-
require 'startup'
|
9
27
|
Waves::Console.load(:mode => ENV['mode'])
|
10
28
|
|
11
29
|
# load tasks from waves framework
|
12
|
-
%w(
|
30
|
+
%w( generate gem ).each { |task| require "tasks/#{task}.rb" }
|
13
31
|
|
14
32
|
# load tasks from this app's lib/tasks
|
15
33
|
Dir["lib/tasks/*.{rb,rake}"].each { |task| require task }
|
16
34
|
|
17
35
|
rescue LoadError => e
|
18
36
|
if e.message == 'no such file to load -- waves'
|
19
|
-
puts "Can't find Waves source. Install gem, freeze Waves, or define WAVES
|
37
|
+
puts "Can't find Waves source. Install gem, freeze Waves, or define WAVES at the top of the Rakefile"
|
20
38
|
puts
|
21
39
|
else
|
22
40
|
raise e
|
23
41
|
end
|
24
42
|
end
|
25
43
|
|
26
|
-
namespace :dep do
|
27
|
-
|
28
|
-
desc "check if all the dependencies specified in the configuration"
|
29
|
-
task :check do
|
30
|
-
|
31
|
-
gems = Gem::SourceIndex.from_installed_gems.to_a.to_s
|
32
|
-
missing = Array.new
|
33
|
-
|
34
|
-
puts "\nApplication-level dependencies:"
|
35
|
-
puts " ('*' means gem is installed and available)"
|
36
|
-
|
37
|
-
Waves.config.dependencies.each do |dep|
|
38
|
-
pattern = /=#{dep}\s/
|
39
|
-
print "\t#{dep}:\t\t"
|
40
|
-
print "\t" if dep.length < 7 # keep our formatting pretty, please.
|
41
|
-
unless pattern.match(gems).nil?
|
42
|
-
print "[*]\n"
|
43
|
-
else
|
44
|
-
print "[ ]\n"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "install any missing dependencies specified in the configuration"
|
50
|
-
task :install do
|
51
|
-
|
52
|
-
gems = Gem::SourceIndex.from_installed_gems.to_a.to_s
|
53
|
-
missing = Array.new
|
54
|
-
|
55
|
-
Waves.config.dependencies.each do |dep|
|
56
|
-
pattern = /=#{dep}\s/
|
57
|
-
missing << dep if pattern.match(gems).nil?
|
58
|
-
end
|
59
|
-
|
60
|
-
missing.each do |m|
|
61
|
-
dep,ver = m.is_a?(String) ? [m,''] : m
|
62
|
-
puts "Installing dependency: #{dep}"
|
63
|
-
puts ver
|
64
|
-
begin
|
65
|
-
require 'rubygems/dependency_installer'
|
66
|
-
if Gem::RubyGemsVersion =~ /^1\.0\./
|
67
|
-
Gem::DependencyInstaller.new(dep).install
|
68
|
-
else
|
69
|
-
# as of 1.1.0
|
70
|
-
Gem::DependencyInstaller.new.install(dep)
|
71
|
-
end
|
72
|
-
rescue LoadError # < rubygems 1.0.1
|
73
|
-
require 'rubygems/remote_installer'
|
74
|
-
Gem::RemoteInstaller.new.install(dep)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
puts "Environment complete. Nothing to install." if missing.empty?
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
|
84
44
|
namespace :waves do
|
85
45
|
|
86
46
|
desc "freeze src=<wherever> to ./waves"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,2 +1,7 @@
|
|
1
|
+
style <<-STYLE
|
2
|
+
body { background: #933; padding: 20px; font-family: verdana, sans-serif; }
|
3
|
+
h1 { font-size: 60px; font-weight: bold; margin: 0px; }
|
4
|
+
p { font-size: 24px; margin: 0px; }
|
5
|
+
STYLE
|
1
6
|
h1 '404'
|
2
|
-
p
|
7
|
+
p { 'That URL does not exist on this server.' }
|
@@ -1,2 +1,7 @@
|
|
1
|
+
style <<-STYLE
|
2
|
+
body { background: #c93; padding: 20px; font-family: verdana, sans-serif; }
|
3
|
+
h1 { font-size: 60px; font-weight: bold; margin: 0px; }
|
4
|
+
p { font-size: 24px; margin: 0px; }
|
5
|
+
STYLE
|
1
6
|
h1 '500'
|
2
7
|
p %q( Internal server error. Sorry, but your request could not be processed. )
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waves
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Yoder
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-07 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -18,9 +18,19 @@ dependencies:
|
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0.6"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: choice
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
22
32
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
33
|
+
version: "0.1"
|
24
34
|
version:
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: autocode
|
@@ -38,9 +48,9 @@ dependencies:
|
|
38
48
|
version_requirement:
|
39
49
|
version_requirements: !ruby/object:Gem::Requirement
|
40
50
|
requirements:
|
41
|
-
- -
|
51
|
+
- - ~>
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.2
|
53
|
+
version: "0.2"
|
44
54
|
version:
|
45
55
|
- !ruby/object:Gem::Dependency
|
46
56
|
name: rack
|
@@ -48,9 +58,9 @@ dependencies:
|
|
48
58
|
version_requirement:
|
49
59
|
version_requirements: !ruby/object:Gem::Requirement
|
50
60
|
requirements:
|
51
|
-
- -
|
61
|
+
- - ~>
|
52
62
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.4
|
63
|
+
version: "0.4"
|
54
64
|
version:
|
55
65
|
- !ruby/object:Gem::Dependency
|
56
66
|
name: filebase
|
@@ -68,9 +78,9 @@ dependencies:
|
|
68
78
|
version_requirement:
|
69
79
|
version_requirements: !ruby/object:Gem::Requirement
|
70
80
|
requirements:
|
71
|
-
- -
|
81
|
+
- - ~>
|
72
82
|
- !ruby/object:Gem::Version
|
73
|
-
version: 0.3
|
83
|
+
version: "0.3"
|
74
84
|
version:
|
75
85
|
- !ruby/object:Gem::Dependency
|
76
86
|
name: extensions
|
@@ -78,9 +88,9 @@ dependencies:
|
|
78
88
|
version_requirement:
|
79
89
|
version_requirements: !ruby/object:Gem::Requirement
|
80
90
|
requirements:
|
81
|
-
- -
|
91
|
+
- - ~>
|
82
92
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.6
|
93
|
+
version: "0.6"
|
84
94
|
version:
|
85
95
|
- !ruby/object:Gem::Dependency
|
86
96
|
name: RedCloth
|
@@ -88,9 +98,9 @@ dependencies:
|
|
88
98
|
version_requirement:
|
89
99
|
version_requirements: !ruby/object:Gem::Requirement
|
90
100
|
requirements:
|
91
|
-
- -
|
101
|
+
- - ~>
|
92
102
|
- !ruby/object:Gem::Version
|
93
|
-
version: 4.0
|
103
|
+
version: "4.0"
|
94
104
|
version:
|
95
105
|
- !ruby/object:Gem::Dependency
|
96
106
|
name: live_console
|
@@ -98,9 +108,9 @@ dependencies:
|
|
98
108
|
version_requirement:
|
99
109
|
version_requirements: !ruby/object:Gem::Requirement
|
100
110
|
requirements:
|
101
|
-
- -
|
111
|
+
- - ~>
|
102
112
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.2
|
113
|
+
version: "0.2"
|
104
114
|
version:
|
105
115
|
- !ruby/object:Gem::Dependency
|
106
116
|
name: functor
|
@@ -121,6 +131,50 @@ extensions: []
|
|
121
131
|
extra_rdoc_files: []
|
122
132
|
|
123
133
|
files:
|
134
|
+
- templates/classic
|
135
|
+
- templates/classic/configurations
|
136
|
+
- templates/classic/configurations/default.rb.erb
|
137
|
+
- templates/classic/configurations/development.rb.erb
|
138
|
+
- templates/classic/configurations/production.rb.erb
|
139
|
+
- templates/classic/controllers
|
140
|
+
- templates/classic/helpers
|
141
|
+
- templates/classic/lib
|
142
|
+
- templates/classic/lib/tasks
|
143
|
+
- templates/classic/models
|
144
|
+
- templates/classic/public
|
145
|
+
- templates/classic/public/css
|
146
|
+
- templates/classic/public/flash
|
147
|
+
- templates/classic/public/images
|
148
|
+
- templates/classic/public/javascript
|
149
|
+
- templates/classic/Rakefile
|
150
|
+
- templates/classic/resources
|
151
|
+
- templates/classic/resources/map.rb.erb
|
152
|
+
- templates/classic/schema
|
153
|
+
- templates/classic/schema/migrations
|
154
|
+
- templates/classic/startup.rb.erb
|
155
|
+
- templates/classic/templates
|
156
|
+
- templates/classic/templates/errors
|
157
|
+
- templates/classic/templates/errors/not_found_404.mab
|
158
|
+
- templates/classic/templates/errors/server_error_500.mab
|
159
|
+
- templates/classic/templates/layouts
|
160
|
+
- templates/classic/templates/layouts/default.mab
|
161
|
+
- templates/classic/tmp
|
162
|
+
- templates/classic/tmp/sessions
|
163
|
+
- templates/classic/views
|
164
|
+
- templates/compact
|
165
|
+
- templates/compact/startup.rb.erb
|
166
|
+
- templates/classic/controllers/.gitignore
|
167
|
+
- templates/classic/helpers/.gitignore
|
168
|
+
- templates/classic/lib/tasks/.gitignore
|
169
|
+
- templates/classic/models/.gitignore
|
170
|
+
- templates/classic/public/css/.gitignore
|
171
|
+
- templates/classic/public/flash/.gitignore
|
172
|
+
- templates/classic/public/images/.gitignore
|
173
|
+
- templates/classic/public/javascript/.gitignore
|
174
|
+
- templates/classic/resources/.gitignore
|
175
|
+
- templates/classic/schema/migrations/.gitignore
|
176
|
+
- templates/classic/tmp/sessions/.gitignore
|
177
|
+
- templates/classic/views/.gitignore
|
124
178
|
- lib/caches/file.rb
|
125
179
|
- lib/caches/memcached.rb
|
126
180
|
- lib/caches/simple.rb
|
@@ -251,38 +305,6 @@ files:
|
|
251
305
|
- samples/blog/templates/waves/status.mab
|
252
306
|
- samples/blog/tmp
|
253
307
|
- samples/blog/tmp/sessions
|
254
|
-
- templates/classic
|
255
|
-
- templates/classic/configurations
|
256
|
-
- templates/classic/configurations/default.rb.erb
|
257
|
-
- templates/classic/configurations/development.rb.erb
|
258
|
-
- templates/classic/configurations/production.rb.erb
|
259
|
-
- templates/classic/controllers
|
260
|
-
- templates/classic/helpers
|
261
|
-
- templates/classic/lib
|
262
|
-
- templates/classic/lib/tasks
|
263
|
-
- templates/classic/models
|
264
|
-
- templates/classic/public
|
265
|
-
- templates/classic/public/css
|
266
|
-
- templates/classic/public/flash
|
267
|
-
- templates/classic/public/images
|
268
|
-
- templates/classic/public/javascript
|
269
|
-
- templates/classic/Rakefile
|
270
|
-
- templates/classic/resources
|
271
|
-
- templates/classic/resources/map.rb.erb
|
272
|
-
- templates/classic/schema
|
273
|
-
- templates/classic/schema/migrations
|
274
|
-
- templates/classic/startup.rb.erb
|
275
|
-
- templates/classic/templates
|
276
|
-
- templates/classic/templates/errors
|
277
|
-
- templates/classic/templates/errors/not_found_404.mab
|
278
|
-
- templates/classic/templates/errors/server_error_500.mab
|
279
|
-
- templates/classic/templates/layouts
|
280
|
-
- templates/classic/templates/layouts/default.mab
|
281
|
-
- templates/classic/tmp
|
282
|
-
- templates/classic/tmp/sessions
|
283
|
-
- templates/classic/views
|
284
|
-
- templates/compact
|
285
|
-
- templates/compact/startup.rb.erb
|
286
308
|
has_rdoc: true
|
287
309
|
homepage: http://rubywaves.com
|
288
310
|
post_install_message:
|