harukizaemon-restful_transactions 2.0.0

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/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ module RedHillConsulting::RestfulTransactions::ActionController
2
+ module Base
3
+ def self.included(base)
4
+ base.prepend_around_filter(TransactionFilter)
5
+ end
6
+ end
7
+
8
+ class TransactionFilter
9
+ def self.filter(controller)
10
+ case controller.request.method
11
+ when :post, :put, :delete then
12
+ ActiveRecord::Base.transaction { |*block_args| yield(*block_args) if block_given? }
13
+ else
14
+ yield if block_given?
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ ActionController::Base.send(:include, RedHillConsulting::RestfulTransactions::ActionController::Base)
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "restful_transactions"
3
+ s.version = "2.0.0"
4
+ s.date = "2009-01-07"
5
+ s.summary = "Ensure that any Ruby on Rails controller action executed within a POST, PUT or DELETE request is wrapped in a transaction."
6
+ s.email = "simon.harris@redhillconsulting.com.au"
7
+ s.homepage = "http://github.com/harukizaemon/restful_transactions"
8
+ s.description = "Restful Transactions is a Ruby on Rails plugin that wraps any controller action executed within a POST, PUT or DELETE request in a transaction."
9
+ s.has_rdoc = true
10
+ s.authors = ["Simon Harris"]
11
+ s.files = ["CHANGELOG.rdoc",
12
+ "MIT-LICENSE",
13
+ "README.rdoc",
14
+ "restful_transactions.gemspec",
15
+ "lib/restful_transactions.rb",
16
+ "lib/red_hill_consulting/restful_transactions/action_controller/base.rb"]
17
+ s.rdoc_options = ["--main", "README.rdoc"]
18
+ s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc"]
19
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: harukizaemon-restful_transactions
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Simon Harris
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-07 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Restful Transactions is a Ruby on Rails plugin that wraps any controller action executed within a POST, PUT or DELETE request in a transaction.
17
+ email: simon.harris@redhillconsulting.com.au
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - CHANGELOG.rdoc
24
+ - README.rdoc
25
+ files:
26
+ - CHANGELOG.rdoc
27
+ - MIT-LICENSE
28
+ - README.rdoc
29
+ - restful_transactions.gemspec
30
+ - lib/restful_transactions.rb
31
+ - lib/red_hill_consulting/restful_transactions/action_controller/base.rb
32
+ has_rdoc: true
33
+ homepage: http://github.com/harukizaemon/restful_transactions
34
+ post_install_message:
35
+ rdoc_options:
36
+ - --main
37
+ - README.rdoc
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ requirements: []
53
+
54
+ rubyforge_project:
55
+ rubygems_version: 1.2.0
56
+ signing_key:
57
+ specification_version: 2
58
+ summary: Ensure that any Ruby on Rails controller action executed within a POST, PUT or DELETE request is wrapped in a transaction.
59
+ test_files: []
60
+