piko_transaction 2.0.0 → 2.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/piko_transaction.rb +2 -0
- data/lib/piko_transaction/transaction_holder.rb +48 -0
- data/lib/piko_transaction/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2a5c353c83ff13ddda8d02da3472d26817097f3
|
4
|
+
data.tar.gz: bd2b2647b33ac8b31909d2362bc41c821280b8e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74bb0c9fd14f7feaf3cee6f36725a7e6ceb47a300ab822153c834c4bf994d4375775c9db875b26bb33c5022880ef78ef1ba8890b5ebfe816bac9fdcd05036518
|
7
|
+
data.tar.gz: 54f72334b93ebe20e88f6ffe72ada7328f6f4c12f1923eae165aa7c4f33c667ea96c1b9ffbb910748d6b791bb9d2922d73dbd6e9974812a19ed76508fe817abc
|
data/CHANGELOG.md
CHANGED
data/lib/piko_transaction.rb
CHANGED
@@ -18,5 +18,7 @@
|
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
20
|
require "piko_transaction/transaction"
|
21
|
+
require "piko_transaction/transaction_holder"
|
21
22
|
require "piko_transaction/insert_command"
|
22
23
|
require "piko_transaction/delete_command"
|
24
|
+
require "piko_transaction/custom_command"
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (C) 2017 Szymon Kopciewski
|
4
|
+
#
|
5
|
+
# This file is part of PikoTransaction.
|
6
|
+
#
|
7
|
+
# This program is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
require "piko_transaction/logger"
|
21
|
+
require "piko_transaction/transaction"
|
22
|
+
|
23
|
+
module PikoTransaction
|
24
|
+
class TransactionHolder
|
25
|
+
include Logger
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
@transactions = {}
|
29
|
+
end
|
30
|
+
|
31
|
+
def method_missing(method_name, *args, &block)
|
32
|
+
logger.debug { format "Looking for transaction '%s'", method_name }
|
33
|
+
return super unless valid_method_name?(method_name)
|
34
|
+
@transactions[method_name] ||= Transaction.new
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def respond_to_missing?(method_name, include_private = false)
|
40
|
+
return true if valid_method_name?(method_name)
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
44
|
+
def valid_method_name?(name)
|
45
|
+
/^\w+$/.match? name
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piko_transaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Szymon Kopciewski
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- lib/piko_transaction/insert_command.rb
|
126
126
|
- lib/piko_transaction/logger.rb
|
127
127
|
- lib/piko_transaction/transaction.rb
|
128
|
+
- lib/piko_transaction/transaction_holder.rb
|
128
129
|
- lib/piko_transaction/version.rb
|
129
130
|
homepage: https://github.com/skopciewski/piko_transaction
|
130
131
|
licenses:
|