doozer 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
data/doozer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{doozer}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["grippy"]
12
- s.date = %q{2010-02-01}
12
+ s.date = %q{2010-02-07}
13
13
  s.default_executable = %q{doozer}
14
14
  s.description = %q{This GEM provides a small, barebones framework for creating MVC Rack applications.}
15
15
  s.email = %q{gmelton@whorde.com}
data/lib/doozer/mailer.rb CHANGED
@@ -213,21 +213,43 @@ module Doozer
213
213
  include Object.const_get(Doozer::Lib.classify("#{helper}"))
214
214
  end
215
215
 
216
- # Call this method to deliver a Mailer#action
216
+ # Call this method to generate a Mailer#action instance
217
217
  #
218
218
  # Arguments
219
219
  # - action: The action of the mailer to call passed as a symbol.
220
220
  # - args: The mail arguments to initialize the email with.
221
221
  # All remaining arguments are turned into instance variables and bound to the view.
222
-
223
- # Note: The send mechanism is empty and must be overriden in the calling application.
224
- def self.deliver(action, args={})
225
- # puts "deliver.."
222
+ def self.generate(action, args={})
223
+ # puts "process.."
226
224
  mailer = self.new(action, args)
227
225
  mailer.method(action).call()
228
226
  mailer.finished! #close the db connections
229
227
  mailer.package
230
- send(mailer)
228
+ mailer
229
+ end
230
+
231
+ # Call this method to deliver a Mailer#action instance
232
+ #
233
+ # Arguments
234
+ # - action: The action of the mailer to call passed as a symbol.
235
+ # - args: The mail arguments to initialize the email with.
236
+ # All remaining arguments are turned into instance variables and bound to the view.
237
+
238
+ # Note: The send mechanism is empty and must be overriden in the calling application.
239
+ def self.deliver(action, args={})
240
+ # puts "deliver.."
241
+ send(generate(action, args))
242
+ end
243
+
244
+ # Call this method to queue a Mailer#action instance for defered sending
245
+ #
246
+ # Arguments
247
+ # - action: The action of the mailer to call passed as a symbol.
248
+ # - args: The mail arguments to initialize the email with.
249
+ # All remaining arguments are turned into instance variables and bound to the view.
250
+ def self.queue(action, args={})
251
+ # puts "save.."
252
+ save(generate(action, args))
231
253
  end
232
254
 
233
255
  # The send method must be overriden by the calling class.
@@ -236,6 +258,13 @@ module Doozer
236
258
  # => You can access the mailer.envelope.encoded (tmail) object which handles all the encoding.
237
259
  def self.send(mailer); end
238
260
 
261
+ # The save method must be overriden by the calling class.
262
+ #
263
+ # => Implement this method to serialize a mailer and store it in the db.
264
+ # => The mailer object passed to this mehod of the instance of the mailer.
265
+ # => You can access the mailer.envelope.encoded (tmail) object which handles all the encoding.
266
+ def self.save(mailer); end
267
+
239
268
  private
240
269
  def change_layout(sym)
241
270
  if sym == :none
data/lib/doozer/task.rb CHANGED
@@ -4,6 +4,11 @@ module Doozer
4
4
  def initialize(args=nil)
5
5
  @args = args
6
6
  end
7
+ def models(list=[])
8
+ for m in list
9
+ require "app/models/#{m.to_s}"
10
+ end
11
+ end
7
12
  def name; return self.class.to_s end
8
13
  def help; end
9
14
  def run; end
@@ -3,7 +3,7 @@ module Doozer
3
3
  module Version
4
4
  MAJOR=0
5
5
  MINOR=4
6
- PATCH=2
6
+ PATCH=3
7
7
  STRING=[MAJOR, MINOR, PATCH].join('.')
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doozer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - grippy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-01 00:00:00 -08:00
12
+ date: 2010-02-07 00:00:00 -08:00
13
13
  default_executable: doozer
14
14
  dependencies: []
15
15