formprocessor 0.0.4 → 0.0.5

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 (4) hide show
  1. data/LICENSE +13 -0
  2. data/README +41 -0
  3. data/formprocessor.gemspec +13 -0
  4. metadata +7 -16
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (2012) Kenton Small
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
4
+ files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
5
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
6
+ is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
11
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
12
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
13
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,41 @@
1
+ Author: Kenton Small
2
+
3
+ Website: http://www.kentonsmall.com
4
+
5
+ This gem processes web forms and emails the results to a specified user.
6
+
7
+ Provided under the MIT license (in the LICENSE file).
8
+
9
+ = Example Usage
10
+ == script.rb
11
+ #!/usr/bin/ruby
12
+ require 'cgi'
13
+ require 'formprocessor'
14
+ cgi = CGI.new
15
+ puts cgi.header
16
+ puts FormProcessor::Main(cgi.params).result
17
+
18
+ == form.html
19
+ <form action="script.rb" method="post">
20
+ <input type="hidden" name="mailto" value="email@me.com" />
21
+ <input type="hidden" name="subject" value="A Test Form" />
22
+ <input type="hidden" name="required" value="email" />
23
+ <input type="hidden" name="redirect" value="http://www.kentonsmall.com" />
24
+ Email: <input type="text" name="email" />
25
+ <input type="submit" value="Submit" />
26
+ </form>
27
+
28
+ = Keywords
29
+ === required
30
+ A CSV string. Check for the existence of these form fields.
31
+ === mailto
32
+ If successful submission, mail results to this address. A valid SMTP server running on localhost is required.
33
+ === redirect
34
+ Redirect to this URL upon successful submission.
35
+ === subject
36
+ The subject of the email/form.
37
+
38
+ = Return Values & Templating
39
+ It is possible to template the results of the form submission by omitting the redirection key/value pair in the values Hash.
40
+
41
+ If there are no errors, @result will return nil. If there are errors, @result will return a String containing those errors.
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "formprocessor"
3
+ s.summary = "Process web forms and have the results emailed to you."
4
+ s.requirements = ["An SMTP server running on localhost"]
5
+ s.version = "0.0.5"
6
+ s.author = "Kenton Small"
7
+ s.homepage = "http://www.kentonsmall.com"
8
+ s.platform = Gem::Platform::RUBY
9
+ s.required_ruby_version = '>=1.9'
10
+ s.files = Dir['**/**']
11
+ s.license = "MIT"
12
+ s.post_install_message = "Thanks for installing! If you have any questions please feel free to contact me. http://www.kentonsmall.com"
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formprocessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-28 00:00:00.000000000 Z
12
+ date: 2012-10-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: ! 'Author: Kenton Small
15
-
16
-
17
- Website: http://www.kentonsmall.com
18
-
19
-
20
- This gem processes web forms and emails the results to a specified user.
21
-
22
-
23
- See the USAGE file for an example.
24
-
25
-
26
- Provided under the MIT license (in the LICENSE file).'
27
- email: kentonthegreat@gmail.com
14
+ description:
15
+ email:
28
16
  executables: []
29
17
  extensions: []
30
18
  extra_rdoc_files: []
@@ -32,6 +20,9 @@ files:
32
20
  - lib/formprocessor.rb
33
21
  - lib/required.rb
34
22
  - lib/mailer.rb
23
+ - formprocessor.gemspec
24
+ - README
25
+ - LICENSE
35
26
  homepage: http://www.kentonsmall.com
36
27
  licenses:
37
28
  - MIT