brainblocks-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/brainblocks-rails.gemspec +3 -3
- data/lib/brainblocks-rails.rb +4 -4
- data/lib/brainblocks-rails/brainblocks_rails_helper.rb +24 -0
- data/lib/brainblocks-rails/version.rb +2 -4
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37d5106c1a7882291d5adfd72fc8e0596c8d2712
|
4
|
+
data.tar.gz: d7bbca14709491d93b1d258de78a33d9d28311e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1787d46dedf129599d8279fe1d8d436189dd4f9664bd4479b697af2102fd2db19b113e6807e784e7574a6ffad33cee83027a823ba54068fabf1a22658153d8c5
|
7
|
+
data.tar.gz: 2061b63e703726a08d9116eaa833c609b4392fe46acce83bd9ec1367ea1198eb62c601616e5872f0b40afb7a4a24697d1cbe1d1d17990ffdf6454f230f2cabde
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# brainblocks-rails
|
2
2
|
|
3
3
|
Integrate Brainblocks (Current version v1.0.3) into Rails Asset Pipeline.
|
4
4
|
|
@@ -26,4 +26,15 @@ Include it in your application.js as:
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
+
```
|
30
|
+
brainblocks(wallet, amount, currency, on_success)
|
31
|
+
```
|
32
|
+
|
33
|
+
`on_success` Takes javascript. In the future I hope to support Rails actions.
|
34
|
+
|
35
|
+
Example:
|
36
|
+
```
|
37
|
+
brainblocks(xrb_1rube3u6iyshxpe5g737zkqnmk7jq4whoi76dw1zip5wcy4y4rm84jw3bs79, 2.5, "rai", "console.log('Payment successful!', data.token);")
|
38
|
+
```
|
39
|
+
|
29
40
|
https://brainblocks.io/
|
data/brainblocks-rails.gemspec
CHANGED
@@ -5,12 +5,12 @@ require "brainblocks-rails/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "brainblocks-rails"
|
8
|
-
spec.version =
|
8
|
+
spec.version = BrainblocksRails::VERSION
|
9
9
|
spec.authors = ["Mitchel"]
|
10
10
|
spec.email = ["mitchel_jager@hotmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Brainblocks
|
13
|
-
spec.description = %q{Brainblocks
|
12
|
+
spec.summary = %q{Simplified use of Brainblocks (Raiblocks [RBX] payment) in Rails}
|
13
|
+
spec.description = %q{Simplified use of Brainblocks (Raiblocks [RBX] payment) in Rails}
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/brainblocks-rails.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
+
require "brainblocks-rails/brainblocks_rails_helper"
|
1
2
|
require "brainblocks-rails/version"
|
2
3
|
|
3
|
-
module
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
module BrainblocksRails
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
ActionView::Base.send :include, BrainblocksHelper
|
7
7
|
end
|
8
8
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module BrainblocksHelper
|
2
|
+
def brainblocks(wallet = "xrb_1xau1obw9u14ung8okbstmh4wmc63iw9y5cq3way3pbkj4krh9j15f4j7dnz", amount = 1000, currency = "rai", on_success = "console.log('Payment successful!', data.token);")
|
3
|
+
@brainblocks_id ||= -1
|
4
|
+
|
5
|
+
element = "brainblocks-#{@brainblocks_id += 1}"
|
6
|
+
button = tag.div id: element
|
7
|
+
|
8
|
+
script = javascript_tag do
|
9
|
+
<<-END.squish.html_safe
|
10
|
+
brainblocks.Button.render({
|
11
|
+
payment: {
|
12
|
+
destination: '#{wallet}',
|
13
|
+
currency: '#{currency}',
|
14
|
+
amount: #{amount}
|
15
|
+
}, onPayment: function(data) {
|
16
|
+
#{on_success}
|
17
|
+
}
|
18
|
+
}, '##{element}');
|
19
|
+
END
|
20
|
+
end
|
21
|
+
|
22
|
+
button + script
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brainblocks-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description: Brainblocks
|
41
|
+
description: Simplified use of Brainblocks (Raiblocks [RBX] payment) in Rails
|
42
42
|
email:
|
43
43
|
- mitchel_jager@hotmail.com
|
44
44
|
executables: []
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- bin/setup
|
55
55
|
- brainblocks-rails.gemspec
|
56
56
|
- lib/brainblocks-rails.rb
|
57
|
+
- lib/brainblocks-rails/brainblocks_rails_helper.rb
|
57
58
|
- lib/brainblocks-rails/version.rb
|
58
59
|
- vendor/assets/javascripts/brainblocks.js
|
59
60
|
homepage: ''
|
@@ -79,5 +80,5 @@ rubyforge_project:
|
|
79
80
|
rubygems_version: 2.5.2
|
80
81
|
signing_key:
|
81
82
|
specification_version: 4
|
82
|
-
summary: Brainblocks
|
83
|
+
summary: Simplified use of Brainblocks (Raiblocks [RBX] payment) in Rails
|
83
84
|
test_files: []
|