brainblocks-rails 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11f4a560e42d12a95dc38ebadecd305ef4690fee
4
- data.tar.gz: de57be71f20c4a3c583ccc4460c11558c4d5a603
3
+ metadata.gz: 37d5106c1a7882291d5adfd72fc8e0596c8d2712
4
+ data.tar.gz: d7bbca14709491d93b1d258de78a33d9d28311e8
5
5
  SHA512:
6
- metadata.gz: 1362185723cd4f035dfc9b691213674f5115c54c66f2612fdb7fac136403e389efe48fe618fb432dc0283377117e5a43b03e7ea9233e24b68942523e0683f4c9
7
- data.tar.gz: a024fb7f80b9dc2cf75a7aa5d22671dbd8c0170f2248e3ba8cdbc10c046c4ee99f71d0ee792c2f7a89ea7cca5568c1b74ccc05c76258b1ab0cde22c2cd74e149
6
+ metadata.gz: 1787d46dedf129599d8279fe1d8d436189dd4f9664bd4479b697af2102fd2db19b113e6807e784e7574a6ffad33cee83027a823ba54068fabf1a22658153d8c5
7
+ data.tar.gz: 2061b63e703726a08d9116eaa833c609b4392fe46acce83bd9ec1367ea1198eb62c601616e5872f0b40afb7a4a24697d1cbe1d1d17990ffdf6454f230f2cabde
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Brainblocks::Rails
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/
@@ -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 = Brainblocks::Rails::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 for use in Rails asset pipeline}
13
- spec.description = %q{Brainblocks for use in Rails asset pipeline}
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
 
@@ -1,8 +1,8 @@
1
+ require "brainblocks-rails/brainblocks_rails_helper"
1
2
  require "brainblocks-rails/version"
2
3
 
3
- module Brainblocks
4
- module Rails
5
- class Engine < ::Rails::Engine
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
@@ -1,5 +1,3 @@
1
- module Brainblocks
2
- module Rails
3
- VERSION = "1.0.0"
4
- end
1
+ module BrainblocksRails
2
+ VERSION = "1.0.1"
5
3
  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.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-20 00:00:00.000000000 Z
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 for use in Rails asset pipeline
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 for use in Rails asset pipeline
83
+ summary: Simplified use of Brainblocks (Raiblocks [RBX] payment) in Rails
83
84
  test_files: []