sr-sinatra-ditties 0.0.2

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.
Files changed (2) hide show
  1. data/README.markdown +74 -0
  2. metadata +82 -0
data/README.markdown ADDED
@@ -0,0 +1,74 @@
1
+ Sinatra Ditties
2
+ ===============
3
+
4
+ All those handy tunes in one elegant package.
5
+
6
+ Sinatra::Mailer
7
+ ===============
8
+
9
+ Adds an `email` method to your email handlers, that receives a hash of values
10
+ to create your email.
11
+
12
+ For example:
13
+
14
+ post "/signup" do
15
+ # sign up the user, and then:
16
+ email :to => @user.email,
17
+ :from => "awesomeness@example.com",
18
+ :subject => "Welcome to Awesomeness!",
19
+ :body => haml(:some_template)
20
+ end
21
+
22
+ Configuration
23
+ =============
24
+
25
+ This plugin is very dirty yet :) Since it's just a port to Sinatra of
26
+ [Merb::Mailer][merb-mailer]. So the configuration is not Sinatra-y, yet.
27
+ But we'll get to that.
28
+
29
+ Using SMTP
30
+ ----------
31
+
32
+ Sinatra::Mailer.config = {
33
+ :host => 'smtp.yourserver.com',
34
+ :port => '25',
35
+ :user => 'user',
36
+ :pass => 'pass',
37
+ :auth => :plain # :plain, :login, :cram_md5, the default is no auth
38
+ :domain => "localhost.localdomain" # the HELO domain provided by the client to the server
39
+ }
40
+
41
+ Using Gmail SMTP
42
+ ----------------
43
+
44
+ You need [smtp-tls][], a gem that improves `net/smtp` to add support for secure
45
+ servers such as Gmail.
46
+
47
+ require "smtp-tls"
48
+
49
+ Sinatra::Mailer.config = {
50
+ :host => 'smtp.gmail.com',
51
+ :port => '587',
52
+ :user => 'user@gmail.com',
53
+ :pass => 'pass',
54
+ :auth => :plain
55
+ }
56
+
57
+ Make sure that when you call your `email` method you pass the `:text` option
58
+ and not `:body`.
59
+
60
+ Using sendmail
61
+ --------------
62
+
63
+ Sinatra::Mailer.config = {:sendmail_path => '/somewhere/odd'}
64
+ Sinatra::Mailer.delivery_method = :sendmail
65
+
66
+ Credits
67
+ =======
68
+
69
+ This has been blatantly adapted from [Merb::Mailer][merb-mailer], so all credit
70
+ is theirs, I just ported it to [Sinatra][].
71
+
72
+ [merb-mailer]: http://github.com/wycats/merb-more/tree/master/merb-mailer
73
+ [smtp-tls]: http://github.com/ambethia/smtp-tls/tree/master
74
+ [Sinatra]: http://sinatrarb.com
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sr-sinatra-ditties
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - "Nicol\xC3\xA1s Sanguinetti"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-10 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sinatra
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.3.2
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: mailfactory
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.4.0
32
+ version:
33
+ - !ruby/object:Gem::Dependency
34
+ name: tlsmail
35
+ version_requirement:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: "0"
41
+ version:
42
+ description: A series of plugins and useful helpers for the Sinatra web framework
43
+ email: contacto@nicolassanguinetti.info
44
+ executables: []
45
+
46
+ extensions: []
47
+
48
+ extra_rdoc_files: []
49
+
50
+ files:
51
+ - README.markdown
52
+ - lib/ditties.rb
53
+ - lib/ditties/authorization.rb
54
+ - lib/ditties/mailer.rb
55
+ has_rdoc: false
56
+ homepage: http://github.com/foca/sinatra-ditties
57
+ post_install_message:
58
+ rdoc_options: []
59
+
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.2.0
78
+ signing_key:
79
+ specification_version: 2
80
+ summary: A series of plugins and useful helpers for the Sinatra web framework
81
+ test_files: []
82
+