bond-railtie 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +26 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +16 -0
- data/README.md +39 -0
- data/bond-railtie.gemspec +18 -0
- data/lib/bond-railtie.rb +19 -0
- data/lib/bond/railtie.rb +5 -0
- data/lib/bond/version.rb +3 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f666bfe5a68345802a7f8c245a695e1b85c68ed8
|
4
|
+
data.tar.gz: 3e8cf573400f2c48660536fcfd03550089926fd3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6eec14a4744f1bafeed331215209ece1dd116284e74c243c65c39c47861f93e3d3d7a43e1386ae65ebd72a498c9403acde8987dbafe11fc2c72c8fed8a926dce
|
7
|
+
data.tar.gz: b63c8b5efce964382c8747efc674ada56ac640a627358c43609f439b37c634fca4fc36fc805a2ff0acfb647418d3528f65cf2a800f9d8ba15d1f5e1f66fb8c68
|
data/.gitignore
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
pecific to RubyMotion:
|
2
|
+
.dat*
|
3
|
+
.repl_history
|
4
|
+
build/
|
5
|
+
|
6
|
+
## Documentation cache and generated files:
|
7
|
+
/.yardoc/
|
8
|
+
/_yardoc/
|
9
|
+
/doc/
|
10
|
+
/rdoc/
|
11
|
+
|
12
|
+
## Environment normalisation:
|
13
|
+
/.bundle/
|
14
|
+
/vendor/bundle
|
15
|
+
/lib/bundler/man/
|
16
|
+
|
17
|
+
# for a library or gem, you might want to ignore these files since the code is
|
18
|
+
# intended to run in multiple environments; otherwise, check them in:
|
19
|
+
# Gemfile.lock
|
20
|
+
# .ruby-version
|
21
|
+
o .ruby-gemset
|
22
|
+
|
23
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
24
|
+
.rvmrc
|
25
|
+
|
26
|
+
*.gem
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Bond #
|
2
|
+
|
3
|
+
Bond is a Railtie that conveniently wires up
|
4
|
+
[Rack::Transaction](https://github.com/p60/rack-transaction). It will handle
|
5
|
+
configuring `Rack::Transaction` to work with `ActiveRecord` if available.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'bond-railtie'
|
13
|
+
```
|
14
|
+
|
15
|
+
and bundle up.
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
Bond *should* just work as soon as you install it using the defaults provided
|
20
|
+
by `Rack::Transaction`. If you need to do additional configuration, you can add
|
21
|
+
a Rails initializer and call `Bond.setup`. The method takes in a block and
|
22
|
+
provides a `Rack::Transaction::Configuration`. For example:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
Bond.setup do |config|
|
26
|
+
config.exclude { |request| request.path =~ %r{/search}i }
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
Please refer to `Rack::Transaction` documentation to see additional
|
31
|
+
configuration options.
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create new Pull Request
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/bond/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.author = 'vyrak.bunleang@gmail.com'
|
6
|
+
gem.homepage = 'https://github.com/p60/bond-railtie'
|
7
|
+
gem.description = 'A convenient drop in Railtie for enabling Rack::Transaction'
|
8
|
+
gem.summary = 'A convenient drop in Railtie for enabling Rack::Transaction'
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split("\n")
|
11
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
|
+
gem.name = 'bond-railtie'
|
13
|
+
gem.require_paths = ["lib"]
|
14
|
+
gem.version = Bond::VERSION
|
15
|
+
|
16
|
+
gem.add_dependency 'rails'
|
17
|
+
gem.add_dependency 'rack-transaction'
|
18
|
+
end
|
data/lib/bond-railtie.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'rack/transaction'
|
3
|
+
|
4
|
+
module Bond
|
5
|
+
def self.setup
|
6
|
+
yield config
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.config
|
10
|
+
@config ||= Rack::Transaction::Configuration.new do
|
11
|
+
if defined?(ActiveRecord)
|
12
|
+
provided_by ActiveRecord::Base
|
13
|
+
rollback_with ActiveRecord::Rollback
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'bond/railtie'
|
data/lib/bond/railtie.rb
ADDED
data/lib/bond/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bond-railtie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- vyrak.bunleang@gmail.com
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack-transaction
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A convenient drop in Railtie for enabling Rack::Transaction
|
42
|
+
email:
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- ".gitignore"
|
48
|
+
- Gemfile
|
49
|
+
- Gemfile.lock
|
50
|
+
- README.md
|
51
|
+
- bond-railtie.gemspec
|
52
|
+
- lib/bond-railtie.rb
|
53
|
+
- lib/bond/railtie.rb
|
54
|
+
- lib/bond/version.rb
|
55
|
+
homepage: https://github.com/p60/bond-railtie
|
56
|
+
licenses: []
|
57
|
+
metadata: {}
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
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
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 2.2.2
|
75
|
+
signing_key:
|
76
|
+
specification_version: 4
|
77
|
+
summary: A convenient drop in Railtie for enabling Rack::Transaction
|
78
|
+
test_files: []
|