waves 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/app/Rakefile CHANGED
@@ -1,4 +1,22 @@
1
- require 'waves'
2
- Waves::Console.load
3
- %w( schema cluster generate ).each { |task| require "lib/tasks/#{task}.rb" }
1
+ #!/usr/bin/env ruby
2
+ if File.exist?(waves_src = File.join(File.dirname(__FILE__), 'waves'))
3
+ $:.unshift(File.join(waves_src, 'lib'))
4
+ end
4
5
 
6
+ begin
7
+ require 'waves'
8
+ Waves::Console.load
9
+ %w( schema cluster generate ).each { |task| require "lib/tasks/#{task}.rb" }
10
+ rescue LoadError
11
+ puts "Can't find waves gem or ./waves/lib directory. try rake symlink waves=/path/to/waves/"
12
+ end
13
+
14
+ desc "Create lib and bin symlinks using waves=<path>"
15
+ task :symlink do
16
+ waves = ENV['waves']
17
+ system "mkdir waves"
18
+ libdir = File.join(waves, 'lib')
19
+ bindir = File.join(waves, 'bin')
20
+ system(cmd = "ln -s #{libdir} waves/") && puts(cmd)
21
+ system(cmd = "ln -s #{bindir} waves/") && puts(cmd)
22
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ if File.exist?(waves_src = File.join(File.dirname(__FILE__), '..', 'waves'))
3
+ $:.unshift(File.join(waves_src, 'lib'))
4
+ end
5
+
6
+ load File.join(waves_src, 'bin', 'waves-console')
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ if File.exist?(waves_src = File.join(File.dirname(__FILE__), '..', 'waves'))
3
+ $:.unshift(File.join(waves_src, 'lib'))
4
+ end
5
+
6
+ load File.join(waves_src, 'bin', 'waves-server')
@@ -16,8 +16,8 @@ module <%= name %>
16
16
 
17
17
  def update( name )
18
18
  instance = find( name )
19
- instance.set( attributes )
20
- instance.save_changes
19
+ instance.update_with_params( attributes )
20
+ instance
21
21
  end
22
22
 
23
23
  def delete( name ); find( name ).destroy; end
@@ -41,7 +41,7 @@ module <%= name %>
41
41
  # accessor methods for modules and other key application objects ...
42
42
  class << self
43
43
  def config ; Waves::Server.config rescue nil || Waves::Console.config ; end
44
- def database ; @database ||= Sequel.mysql( config.database ) ; end
44
+ def database ; @database ||= Sequel.open( config.database ) ; end
45
45
  def configurations ; <%= name %>::Configurations ; end
46
46
  def controllers ; <%= name %>::Controllers ; end
47
47
  def models ; <%= name %>::Models ; end
@@ -1,2 +1,3 @@
1
1
  require 'lib/<%= name.downcase %>'
2
- Waves << <%= name %>
2
+ Waves << <%= name %>
3
+ Application = <%= name %>
@@ -5,7 +5,7 @@ namespace :schema do
5
5
  task :migration do |task|
6
6
 
7
7
  version = ( ENV['version'].nil? ?
8
- Sequel::Migrator.get_current_migration_version( Blog.database ) :
8
+ Sequel::Migrator.get_current_migration_version( Application.database ) :
9
9
  ENV['version'].to_i ) + 1
10
10
 
11
11
  name = ENV['name'] || 'migration'
data/bin/waves CHANGED
@@ -6,19 +6,22 @@ unless ARGV.length == 1
6
6
  end
7
7
 
8
8
  require 'rubygems'
9
- require 'waves'
9
+ require 'erubis'
10
+ require 'extensions/all'
11
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'utilities', 'string')
10
12
 
11
13
  puts "** Creating new Waves application ..."
12
- app_name = ARGV[0]
14
+ app_path = ARGV[0]
15
+ app_name = File.basename(app_path)
13
16
  template = File.join( File.dirname(__FILE__),'..','app')
14
- system "cp -R #{template} #{app_name}"
17
+ system "cp -R #{template} #{app_path}"
15
18
 
16
19
  # get rid of placeholder files left over from gem install
17
- Dir["#{app_name}/**/EMPTY"].each { |path| system "rm #{path}" }
20
+ Dir["#{app_path}/**/EMPTY"].each { |path| system "rm #{path}" }
18
21
 
19
22
  # next, process all template files ...
20
- Dir["#{app_name}/**/*.erb"].each do |path|
21
- unless path =~ %r{^#{app_name}/(schema/migrations/templates|templates)}
23
+ Dir["#{app_path}/**/*.erb"].each do |path|
24
+ unless path =~ %r{^#{app_path}/(schema/migrations/templates|templates)}
22
25
  name = app_name.camel_case
23
26
  File.write( path.gsub(/\.erb$/,''),
24
27
  Erubis::Eruby.new( File.read( path ) ).result( binding ) )
@@ -26,7 +29,10 @@ Dir["#{app_name}/**/*.erb"].each do |path|
26
29
  end
27
30
  end
28
31
 
32
+ # make the scripts executable
33
+ system "chmod ug+x #{app_path}/bin/waves-*"
34
+
29
35
  # finally, change the lib/application.rb file
30
- system "mv #{app_name}/lib/application.rb #{app_name}/lib/#{app_name}.rb"
36
+ system "mv #{app_path}/lib/application.rb #{app_path}/lib/#{app_name}.rb"
31
37
 
32
38
  puts "** Application created!"
data/bin/waves-console CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'waves'
2
3
  require 'choice'
3
4
 
data/lib/waves.rb CHANGED
@@ -4,6 +4,7 @@ require 'rubygems'
4
4
  # the underlying web server
5
5
  require 'mongrel'
6
6
  require 'rack'
7
+ require 'daemons'
7
8
  require 'live_console'
8
9
  require 'autocode'
9
10
 
metadata CHANGED
@@ -1,33 +1,135 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
3
- specification_version: 1
4
2
  name: waves
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.7.2
7
- date: 2008-02-05 00:00:00 -08:00
8
- summary: Open-source framework for building Ruby-based Web applications.
9
- require_paths:
10
- - lib
11
- email: dan@zeraweb.com
12
- homepage: http://dev.zeraweb.com/waves
13
- rubyforge_project:
14
- description:
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.8.6
24
- version:
4
+ version: 0.7.3
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Dan Yoder
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-06-09 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mongrel
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: rack
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: "0"
32
+ version:
33
+ - !ruby/object:Gem::Dependency
34
+ name: markaby
35
+ version_requirement:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: "0"
41
+ version:
42
+ - !ruby/object:Gem::Dependency
43
+ name: erubis
44
+ version_requirement:
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ - !ruby/object:Gem::Dependency
52
+ name: RedCloth
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ version:
60
+ - !ruby/object:Gem::Dependency
61
+ name: sequel
62
+ version_requirement:
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ - !ruby/object:Gem::Dependency
70
+ name: extensions
71
+ version_requirement:
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ version:
78
+ - !ruby/object:Gem::Dependency
79
+ name: live_console
80
+ version_requirement:
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
87
+ - !ruby/object:Gem::Dependency
88
+ name: choice
89
+ version_requirement:
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: "0"
95
+ version:
96
+ - !ruby/object:Gem::Dependency
97
+ name: daemons
98
+ version_requirement:
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: "0"
104
+ version:
105
+ - !ruby/object:Gem::Dependency
106
+ name: sequel
107
+ version_requirement:
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 2.0.0
113
+ version:
114
+ - !ruby/object:Gem::Dependency
115
+ name: autocode
116
+ version_requirement:
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "="
120
+ - !ruby/object:Gem::Version
121
+ version: 0.9.2
122
+ version:
123
+ description:
124
+ email: dan@zeraweb.com
125
+ executables:
126
+ - waves
127
+ - waves-server
128
+ - waves-console
129
+ extensions: []
130
+
131
+ extra_rdoc_files: []
132
+
31
133
  files:
32
134
  - lib/controllers/mixin.rb
33
135
  - lib/dispatchers/base.rb
@@ -61,6 +163,9 @@ files:
61
163
  - lib/utilities/symbol.rb
62
164
  - lib/views/mixin.rb
63
165
  - lib/waves.rb
166
+ - app/bin
167
+ - app/bin/waves-console
168
+ - app/bin/waves-server
64
169
  - app/configurations
65
170
  - app/configurations/default.rb.erb
66
171
  - app/configurations/development.rb.erb
@@ -79,7 +184,6 @@ files:
79
184
  - app/lib/tasks/cluster.rb
80
185
  - app/lib/tasks/generate.rb
81
186
  - app/lib/tasks/schema.rb
82
- - app/log
83
187
  - app/models
84
188
  - app/models/default.rb.erb
85
189
  - app/public
@@ -107,117 +211,31 @@ files:
107
211
  - app/tmp/sessions/EMPTY
108
212
  - app/views
109
213
  - app/views/default.rb.erb
110
- test_files: []
111
-
214
+ has_rdoc: true
215
+ homepage: http://dev.zeraweb.com/waves
216
+ post_install_message:
112
217
  rdoc_options: []
113
218
 
114
- extra_rdoc_files: []
115
-
116
- executables:
117
- - waves
118
- - waves-server
119
- - waves-console
120
- extensions: []
121
-
219
+ require_paths:
220
+ - lib
221
+ required_ruby_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: 1.8.6
226
+ version:
227
+ required_rubygems_version: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - ">="
230
+ - !ruby/object:Gem::Version
231
+ version: "0"
232
+ version:
122
233
  requirements: []
123
234
 
124
- dependencies:
125
- - !ruby/object:Gem::Dependency
126
- name: mongrel
127
- version_requirement:
128
- version_requirements: !ruby/object:Gem::Version::Requirement
129
- requirements:
130
- - - ">"
131
- - !ruby/object:Gem::Version
132
- version: 0.0.0
133
- version:
134
- - !ruby/object:Gem::Dependency
135
- name: rack
136
- version_requirement:
137
- version_requirements: !ruby/object:Gem::Version::Requirement
138
- requirements:
139
- - - ">"
140
- - !ruby/object:Gem::Version
141
- version: 0.0.0
142
- version:
143
- - !ruby/object:Gem::Dependency
144
- name: markaby
145
- version_requirement:
146
- version_requirements: !ruby/object:Gem::Version::Requirement
147
- requirements:
148
- - - ">"
149
- - !ruby/object:Gem::Version
150
- version: 0.0.0
151
- version:
152
- - !ruby/object:Gem::Dependency
153
- name: erubis
154
- version_requirement:
155
- version_requirements: !ruby/object:Gem::Version::Requirement
156
- requirements:
157
- - - ">"
158
- - !ruby/object:Gem::Version
159
- version: 0.0.0
160
- version:
161
- - !ruby/object:Gem::Dependency
162
- name: RedCloth
163
- version_requirement:
164
- version_requirements: !ruby/object:Gem::Version::Requirement
165
- requirements:
166
- - - ">"
167
- - !ruby/object:Gem::Version
168
- version: 0.0.0
169
- version:
170
- - !ruby/object:Gem::Dependency
171
- name: autocode
172
- version_requirement:
173
- version_requirements: !ruby/object:Gem::Version::Requirement
174
- requirements:
175
- - - ">"
176
- - !ruby/object:Gem::Version
177
- version: 0.0.0
178
- version:
179
- - !ruby/object:Gem::Dependency
180
- name: sequel
181
- version_requirement:
182
- version_requirements: !ruby/object:Gem::Version::Requirement
183
- requirements:
184
- - - ">"
185
- - !ruby/object:Gem::Version
186
- version: 0.0.0
187
- version:
188
- - !ruby/object:Gem::Dependency
189
- name: extensions
190
- version_requirement:
191
- version_requirements: !ruby/object:Gem::Version::Requirement
192
- requirements:
193
- - - ">"
194
- - !ruby/object:Gem::Version
195
- version: 0.0.0
196
- version:
197
- - !ruby/object:Gem::Dependency
198
- name: live_console
199
- version_requirement:
200
- version_requirements: !ruby/object:Gem::Version::Requirement
201
- requirements:
202
- - - ">"
203
- - !ruby/object:Gem::Version
204
- version: 0.0.0
205
- version:
206
- - !ruby/object:Gem::Dependency
207
- name: choice
208
- version_requirement:
209
- version_requirements: !ruby/object:Gem::Version::Requirement
210
- requirements:
211
- - - ">"
212
- - !ruby/object:Gem::Version
213
- version: 0.0.0
214
- version:
215
- - !ruby/object:Gem::Dependency
216
- name: daemons
217
- version_requirement:
218
- version_requirements: !ruby/object:Gem::Version::Requirement
219
- requirements:
220
- - - ">"
221
- - !ruby/object:Gem::Version
222
- version: 0.0.0
223
- version:
235
+ rubyforge_project:
236
+ rubygems_version: 1.0.1
237
+ signing_key:
238
+ specification_version: 2
239
+ summary: Open-source framework for building Ruby-based Web applications.
240
+ test_files: []
241
+