cryptocoin_payable 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 69a13a8a0c2157e87c41dde92831b8ad336aab77a9d58314adfddedf4808509d
4
- data.tar.gz: 216d48f0578f487fd0420469d7d0a6214b7dc205aae65aab92d21f837fafe723
2
+ SHA1:
3
+ metadata.gz: ad069cdb3d17b910ae90f4ccfc893547df52af40
4
+ data.tar.gz: d1af2f689d9ebfeb3cfcbf20efd8ef24e9d2705b
5
5
  SHA512:
6
- metadata.gz: f3ceadd2dd62f11a419119583a0fbeeaee72418c9d7c318caba1542809a91dbc06f671f6eed7afc1136cc3556ddc5c535df475b501fa741cd03d2270c493ad81
7
- data.tar.gz: 0b340f0086b3411eef2df4f434bc46b12166969ddea73741227382c64d78cc8e88fbaeee9843a26eed3cbf64f07821cd3b658bb4cc628a7262616c7ede99e122
6
+ metadata.gz: 024b1be86b34a5a5949529ac22d99dfea3ea453f45ff0883e84fa38f079a5db16c6cfbd15cab727c0d78eb55fe29f8e5850bea11277e381fb4cc56ef2d501bcf
7
+ data.tar.gz: 95f2f5a66d64c781e3dd94e56631b5fe104dd94b750e64a9293c1d6a70c619c08f8f179aee832ba6fccc0afeb8407c92689de8605af182c8cf58310811491163
data/.gitignore CHANGED
@@ -2,4 +2,3 @@ spec/dummy/log/*
2
2
  *.gem
3
3
  /Gemfile.lock
4
4
  /spec/dummy/log/development.log
5
- /spec/dummy/db/test.sqlite3
data/.travis.yml CHANGED
@@ -6,6 +6,24 @@ rvm:
6
6
  - 2.4
7
7
  - 2.5
8
8
 
9
+ gemfile:
10
+ - gemfiles/rails_4_0.gemfile
11
+ - gemfiles/rails_4_1.gemfile
12
+ - gemfiles/rails_4_2.gemfile
13
+ - gemfiles/rails_5_0.gemfile
14
+ - gemfiles/rails_5_1.gemfile
15
+ - gemfiles/rails_5_2.gemfile
16
+ - gemfiles/rails_master.gemfile
17
+
18
+ sudo: false
19
+
20
+ before_install:
21
+ - gem install bundler
22
+
23
+ before_script:
24
+ - psql -c 'create database cryptocoin_payable_test;' -U postgres
25
+ - bundle exec rake -f spec/dummy/Rakefile db:schema:load RAILS_ENV=test
26
+
9
27
  notifications:
10
28
  email: false
11
29
 
@@ -13,3 +31,20 @@ script:
13
31
  - bundle exec cucumber features
14
32
  - bundle exec rspec
15
33
  - bundle exec rubocop
34
+
35
+ matrix:
36
+ exclude:
37
+ - rvm: 2.4
38
+ gemfile: gemfiles/rails_4_0.gemfile
39
+ - rvm: 2.4
40
+ gemfile: gemfiles/rails_4_1.gemfile
41
+ - rvm: 2.5
42
+ gemfile: gemfiles/rails_4_0.gemfile
43
+ - rvm: 2.5
44
+ gemfile: gemfiles/rails_4_1.gemfile
45
+ allow_failures:
46
+ - gemfile: gemfiles/rails_4_0.gemfile
47
+ - gemfile: gemfiles/rails_master.gemfile
48
+
49
+ addons:
50
+ postgresql: '9.5'
data/Gemfile CHANGED
@@ -2,7 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in cryptocoin_payable.gemspec
4
4
  gemspec
5
-
6
- group :test do
7
- gem 'cucumber-rails', require: false
8
- end
data/README.md CHANGED
@@ -38,28 +38,33 @@ No private keys needed, No bitcoind blockchain indexing on new servers, just add
38
38
 
39
39
  Add this line to your application's Gemfile:
40
40
 
41
- gem 'cryptocoin_payable'
41
+ ```rb
42
+ gem 'cryptocoin_payable'
43
+ ```
42
44
 
43
45
  And then execute:
44
46
 
45
- $ bundle
46
-
47
- $ rails g cryptocoin_payable:install
48
-
49
- $ bundle exec rake db:migrate
50
-
51
- $ populate cryptocoin_payable.rb (see below)
52
-
53
- $ bundle exec rake cryptocoin_payable:process_prices (see below)
47
+ ```sh
48
+ bundle
49
+ rails g cryptocoin_payable:install
50
+ bundle exec rake db:migrate
51
+ populate cryptocoin_payable.rb (see below)
52
+ bundle exec rake cryptocoin_payable:process_prices (see below)
53
+ ```
54
54
 
55
55
  ## Uninstall
56
56
 
57
- $ rails d cryptocoin_payable:install
57
+ ```sh
58
+ rails d cryptocoin_payable:install
59
+ ```
58
60
 
59
61
  ## Run Tests
60
62
 
61
- cucumber features
62
- rspec
63
+ ```sh
64
+ cucumber features
65
+ rspec
66
+ rubocop
67
+ ```
63
68
 
64
69
  ## Usage
65
70
 
@@ -67,42 +72,48 @@ And then execute:
67
72
 
68
73
  config/initializers/cryptocoin_payable.rb
69
74
 
70
- CryptocoinPayable.configure do |config|
71
- # config.currency = :usd
72
- # config.testnet = true
75
+ ```rb
76
+ CryptocoinPayable.configure do |config|
77
+ # config.currency = :usd
78
+ # config.testnet = true
73
79
 
74
- config.request_delay = 0.5
75
- config.expire_payments_after = 15.minutes
80
+ config.request_delay = 0.5
81
+ config.expire_payments_after = 15.minutes
76
82
 
77
- config.configure_btc do |btc_config|
78
- # btc_config.confirmations = 3
79
- # btc_config.node_path = ''
83
+ config.configure_btc do |btc_config|
84
+ # btc_config.confirmations = 3
85
+ # btc_config.node_path = ''
80
86
 
81
- btc_config.master_public_key = 'tpub...'
82
- end
87
+ btc_config.master_public_key = 'tpub...'
88
+ end
83
89
 
84
- config.configure_bch do |bch_config|
85
- # bch_config.confirmations = 3
86
- # btc_config.node_path = ''
90
+ config.configure_bch do |bch_config|
91
+ # bch_config.confirmations = 3
92
+ # btc_config.node_path = ''
87
93
 
88
- bch_config.master_public_key = 'tpub...'
89
- end
94
+ bch_config.master_public_key = 'tpub...'
95
+ end
90
96
 
91
- config.configure_eth do |eth_config|
92
- # eth_config.confirmations = 12
93
- # eth_config.node_path = ''
97
+ config.configure_eth do |eth_config|
98
+ # eth_config.confirmations = 12
99
+ # eth_config.node_path = ''
94
100
 
95
- eth_config.master_public_key = 'tpub...'
96
- end
97
- end
101
+ eth_config.master_public_key = 'tpub...'
102
+ end
103
+ end
104
+ ```
98
105
 
99
- In order to use the bitcoin network and issue real addresses, CryptocoinPayable.config.testnet must be set to false:
106
+ In order to use the bitcoin network and issue real addresses, `CryptocoinPayable.config.testnet` must be set to false:
100
107
 
101
- CryptocoinPayable.config.testnet = false
108
+ ```rb
109
+ CryptocoinPayable.config.testnet = false
110
+ ```
102
111
 
103
112
  Consider adding a request delay (in seconds) to prevent API rate limit errors:
104
113
 
105
- CryptocoinPayable.config.request_delay = 0.5
114
+ ```rb
115
+ CryptocoinPayable.config.request_delay = 0.5
116
+ ```
106
117
 
107
118
  #### Node Path
108
119
 
@@ -119,25 +130,31 @@ Testnet starts with: tpub
119
130
 
120
131
  ### Adding it to your model
121
132
 
122
- class Product < ActiveRecord::Base
123
- has_coin_payments
124
- end
133
+ ```rb
134
+ class Product < ActiveRecord::Base
135
+ has_coin_payments
136
+ end
137
+ ```
125
138
 
126
139
  ### Creating a payment from your application
127
140
 
128
- def create_payment(amount_in_cents)
129
- self.coin_payments.create!(reason: 'sale', price: amount_in_cents, coin_type: :btc)
130
- end
141
+ ```rb
142
+ def create_payment(amount_in_cents)
143
+ self.coin_payments.create!(reason: 'sale', price: amount_in_cents, coin_type: :btc)
144
+ end
145
+ ```
131
146
 
132
147
  ### Update payments with the current price of BTC based on your currency
133
148
 
134
149
  CryptocoinPayable also supports local currency conversions and BTC exchange rates.
135
150
 
136
- The `process_prices` rake task connects to api.bitcoinaverage.com to get the 24 hour weighted average of BTC for your specified currency.
151
+ The `process_prices` rake task connects to api.coinbase.com to get the latest BTC price for your specified currency. As a fallback, it will connect to api.gemini.com to get the latest price.
137
152
  It then updates all payments that havent received an update in the last 30 minutes with the new value owing in BTC.
138
153
  This *honors* the price of a payment for 30 minutes at a time.
139
154
 
140
- `rake cryptocoin_payable:process_prices`
155
+ ```sh
156
+ rake cryptocoin_payable:process_prices
157
+ ```
141
158
 
142
159
  ### Processing payments
143
160
 
@@ -154,29 +171,33 @@ Payments are not recalculated based on the current value of BTC, but in dollars.
154
171
 
155
172
  To run the payment processor:
156
173
 
157
- `rake cryptocoin_payable:process_payments`
174
+ ```sh
175
+ rake cryptocoin_payable:process_payments
176
+ ```
158
177
 
159
178
  ### Notify your application when a payment is made
160
179
 
161
180
  Use the `coin_payment_paid` and `coin_payment_confirmed` methods
162
181
 
163
- def Product < ActiveRecord::Base
164
- has_coin_payments
182
+ ```rb
183
+ def Product < ActiveRecord::Base
184
+ has_coin_payments
165
185
 
166
- def create_payment(amount_in_cents)
167
- self.coin_payments.create!(reason: 'sale', price: amount_in_cents, type: :btc)
168
- end
186
+ def create_payment(amount_in_cents)
187
+ self.coin_payments.create!(reason: 'sale', price: amount_in_cents, type: :btc)
188
+ end
169
189
 
170
- # Runs when the payment is first detected on the network.
171
- def coin_payment_paid(payment)
172
- self.notify!
173
- end
190
+ # Runs when the payment is first detected on the network.
191
+ def coin_payment_paid(payment)
192
+ self.notify!
193
+ end
174
194
 
175
- # Runs when enough confirmations have occurred.
176
- def coin_payment_confirmed(payment)
177
- self.ship!
178
- end
179
- end
195
+ # Runs when enough confirmations have occurred.
196
+ def coin_payment_confirmed(payment)
197
+ self.ship!
198
+ end
199
+ end
200
+ ```
180
201
 
181
202
  ### Delete old CurrencyConversion data
182
203
 
@@ -185,14 +206,14 @@ database to record the value of the coin at a given instance in time. Over time,
185
206
  your application will accumulate historical currency conversion data and you may
186
207
  want to clear it out:
187
208
 
188
- ```
209
+ ```sh
189
210
  rake cryptocoin_payable:delete_currency_conversions
190
211
  ```
191
212
 
192
213
  By default, it will delete any data older than 1 month. You can configure this
193
214
  using an env variable:
194
215
 
195
- ```
216
+ ```sh
196
217
  DELETE_BEFORE=2017-12-15 rake cryptocoin_payable:delete_currency_conversions
197
218
  ```
198
219
 
@@ -200,11 +221,15 @@ DELETE_BEFORE=2017-12-15 rake cryptocoin_payable:delete_currency_conversions
200
221
 
201
222
  This will bypass the payment, set the state to comped and call back to your app that the payment has been processed.
202
223
 
203
- `@coin_payment.comp`
224
+ ```rb
225
+ @coin_payment.comp
226
+ ```
204
227
 
205
228
  ### Expire a payment
206
229
 
207
- `@coin_payment.expire`
230
+ ```rb
231
+ @coin_payment.expire
232
+ ```
208
233
 
209
234
  Payments will auto-expire if you set the `expire_payments_after` option. The
210
235
  exact timing is not precise because payment expiry is evaluated whenever
@@ -212,20 +237,12 @@ payment_processor runs.
212
237
 
213
238
  ### View all the transactions in the payment
214
239
 
215
- coin_payment = @product.coin_payments.first
216
- coin_payment.transactions.find_each do |transaction|
217
- puts transaction.block_hash
218
- puts transaction.block_time
219
-
220
- puts transaction.transaction_hash
221
-
222
- puts transaction.estimated_value
223
- puts transaction.estimated_time
224
-
225
- puts transaction.coin_conversion
226
-
227
- puts transaction.confirmations
228
- end
240
+ ```rb
241
+ coin_payment = @product.coin_payments.first
242
+ coin_payment.transactions.find_each do |transaction|
243
+ puts transaction.attributes
244
+ end
245
+ ```
229
246
 
230
247
  ## Contributing
231
248
 
@@ -20,17 +20,17 @@ Gem::Specification.new do |spec|
20
20
  spec.required_rubygems_version = '>= 1.3.6'
21
21
  spec.required_ruby_version = '>= 2.2.0'
22
22
 
23
- spec.add_development_dependency 'activerecord', '~> 5.1'
24
23
  spec.add_development_dependency 'bundler', '~> 1.15'
25
- spec.add_development_dependency 'cucumber', '~> 3.1'
24
+ spec.add_development_dependency 'cucumber'
25
+ spec.add_development_dependency 'cucumber-rails'
26
26
  spec.add_development_dependency 'database_cleaner', '~> 1.7'
27
+ spec.add_development_dependency 'pg', '~> 0.21.0'
27
28
  spec.add_development_dependency 'rails', '>= 4.0.0'
28
29
  spec.add_development_dependency 'rake', '~> 12.3'
29
30
  spec.add_development_dependency 'rspec-benchmark', '~> 0.4'
30
31
  spec.add_development_dependency 'rspec-rails', '~> 3.7'
31
32
  spec.add_development_dependency 'rspec-retry', '~> 0.6'
32
33
  spec.add_development_dependency 'rubocop', '~> 0.59'
33
- spec.add_development_dependency 'sqlite3', '~> 1.3'
34
34
  spec.add_development_dependency 'vcr', '~> 4.0'
35
35
  spec.add_development_dependency 'webmock', '~> 3.4'
36
36
 
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'cash-addr', '~> 0.2'
39
39
  spec.add_dependency 'eth', '0.4.8'
40
40
  spec.add_dependency 'money-tree', '0.10.0'
41
- spec.add_dependency 'state_machine', '~> 1.2'
41
+ spec.add_dependency 'state_machines-activerecord', '~> 0.5'
42
42
  end
43
43
  # rubocop:enable Metrics/BlockLength
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.0.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.1.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.2.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 5.0.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 5.1.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 5.2.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', github: 'rails/rails', branch: 'master'
4
+
5
+ gemspec path: '../'
@@ -1,5 +1,5 @@
1
1
  require 'money-tree'
2
- require 'state_machine'
2
+ require 'state_machines-activerecord'
3
3
 
4
4
  module CryptocoinPayable
5
5
  class CoinPayment < ActiveRecord::Base
@@ -23,7 +23,7 @@ module CryptocoinPayable
23
23
  eth
24
24
  ]
25
25
 
26
- state_machine :state do
26
+ state_machine :state, initial: :pending do
27
27
  state :pending
28
28
  state :partial_payment
29
29
  state :paid_in_full
@@ -39,7 +39,7 @@ module CryptocoinPayable
39
39
  transactions = Adapters.for(payment.coin_type).fetch_transactions(payment.address)
40
40
 
41
41
  payment.transaction do
42
- if ActiveRecord::Base.connection.supports_on_duplicate_key_update?
42
+ if supports_bulk_insert?
43
43
  update_via_bulk_insert(payment, transactions)
44
44
  else
45
45
  update_via_many_insert(payment, transactions)
@@ -51,6 +51,13 @@ module CryptocoinPayable
51
51
 
52
52
  private
53
53
 
54
+ def supports_bulk_insert?
55
+ # TODO: Remove this once this is fixed: https://github.com/zdennis/activerecord-import/issues/559
56
+ return false if Gem.loaded_specs['rails'].version < Gem::Version.create('4.2')
57
+
58
+ ActiveRecord::Base.connection.supports_on_duplicate_key_update?
59
+ end
60
+
54
61
  def update_via_bulk_insert(payment, transactions)
55
62
  transactions.each do |t|
56
63
  t[:coin_conversion] = payment.coin_conversion
@@ -1,3 +1,3 @@
1
1
  module CryptocoinPayable
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -1,13 +1,13 @@
1
+ require 'digest'
1
2
  require 'active_record'
2
- require 'database_cleaner'
3
3
  require 'cryptocoin_payable/orm/activerecord'
4
4
 
5
5
  describe CryptocoinPayable::PaymentProcessor do
6
6
  def build_fake_transactions_data
7
7
  transactions = []
8
- 300.times do
8
+ 300.times do |i|
9
9
  transactions << {
10
- transaction_hash: '5bdeaf7829148d7e0e1e7b5233512a2c5ae54ef7ccbc8e68b2f85b7e49c917a0',
10
+ transaction_hash: Digest::SHA2.new(256).hexdigest(i.to_s),
11
11
  block_hash: '0000000000000000048e8ea3fdd2c3a59ddcbcf7575f82cb96ce9fd17da9f2f4',
12
12
  block_time: DateTime.iso8601('2016-09-13T15:41:00.000000000+00:00'),
13
13
  estimated_time: DateTime.iso8601('2016-09-13T15:41:00.000000000+00:00'),
@@ -18,33 +18,48 @@ describe CryptocoinPayable::PaymentProcessor do
18
18
  transactions
19
19
  end
20
20
 
21
+ def create_tables
22
+ ENV['RAILS_ENV'] = 'test'
23
+ load 'spec/dummy/db/schema.rb'
24
+ end
25
+
26
+ def drop_tables
27
+ %i[
28
+ coin_payment_transactions
29
+ coin_payments
30
+ currency_conversions
31
+ widgets
32
+ ].each do |table_name|
33
+ ActiveRecord::Base.connection.drop_table(table_name)
34
+ end
35
+ end
36
+
21
37
  context 'when testing performance of database interaction' do
22
38
  before(:all) do
23
- ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: 'spec/dummy/db/test.sqlite3')
24
- DatabaseCleaner.strategy = :truncation
39
+ ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: 'cryptocoin_payable_test')
40
+ create_tables
25
41
  GC.disable
26
42
  end
27
43
 
28
44
  after(:all) do
29
45
  GC.enable
46
+ drop_tables
30
47
  end
31
48
 
32
49
  before do
33
- DatabaseCleaner.clean
34
50
  CryptocoinPayable::CurrencyConversion.create!(coin_type: :btc, currency: 1, price: 1)
35
51
  adapter = CryptocoinPayable::Adapters.bitcoin_adapter
36
52
  allow(adapter).to receive(:fetch_transactions) { build_fake_transactions_data }
37
53
  end
38
54
 
39
- after do
40
- DatabaseCleaner.clean
41
- end
55
+ it 'should insert 300 transactions in under 400ms', retry: 3 do
56
+ # TODO: Remove this once this is fixed: https://github.com/zdennis/activerecord-import/issues/559
57
+ skip if Gem.loaded_specs['rails'].version < Gem::Version.create('4.2')
42
58
 
43
- it 'should insert 300 transactions in under 300ms', retry: 3 do
44
59
  payment = CryptocoinPayable::CoinPayment.create!(reason: 'test', price: 1, coin_type: :btc)
45
60
  payment.update(address: '3HR9xYD7MybbE7JLVTjwijYse48BtfEKni')
46
61
 
47
- expect { subject.update_transactions_for(payment) }.to perform_under(300).ms
62
+ expect { subject.update_transactions_for(payment) }.to perform_under(400).ms
48
63
  end
49
64
  end
50
65
  end
@@ -1,25 +1,5 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
1
  test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
2
+ adapter: postgresql
3
+ encoding: unicode
24
4
  pool: 5
25
- timeout: 5000
5
+ database: cryptocoin_payable_test
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptocoin_payable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Salis
@@ -9,50 +9,50 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-16 00:00:00.000000000 Z
12
+ date: 2018-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: activerecord
15
+ name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '5.1'
20
+ version: '1.15'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '5.1'
27
+ version: '1.15'
28
28
  - !ruby/object:Gem::Dependency
29
- name: bundler
29
+ name: cucumber
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '1.15'
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '1.15'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: cucumber
43
+ name: cucumber-rails
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '3.1'
48
+ version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '3.1'
55
+ version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: database_cleaner
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.7'
70
+ - !ruby/object:Gem::Dependency
71
+ name: pg
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.21.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.21.0
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: rails
72
86
  requirement: !ruby/object:Gem::Requirement
@@ -151,20 +165,6 @@ dependencies:
151
165
  - - "~>"
152
166
  - !ruby/object:Gem::Version
153
167
  version: '0.59'
154
- - !ruby/object:Gem::Dependency
155
- name: sqlite3
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - "~>"
159
- - !ruby/object:Gem::Version
160
- version: '1.3'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - "~>"
166
- - !ruby/object:Gem::Version
167
- version: '1.3'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: vcr
170
170
  requirement: !ruby/object:Gem::Requirement
@@ -250,19 +250,19 @@ dependencies:
250
250
  - !ruby/object:Gem::Version
251
251
  version: 0.10.0
252
252
  - !ruby/object:Gem::Dependency
253
- name: state_machine
253
+ name: state_machines-activerecord
254
254
  requirement: !ruby/object:Gem::Requirement
255
255
  requirements:
256
256
  - - "~>"
257
257
  - !ruby/object:Gem::Version
258
- version: '1.2'
258
+ version: '0.5'
259
259
  type: :runtime
260
260
  prerelease: false
261
261
  version_requirements: !ruby/object:Gem::Requirement
262
262
  requirements:
263
263
  - - "~>"
264
264
  - !ruby/object:Gem::Version
265
- version: '1.2'
265
+ version: '0.5'
266
266
  description: Cryptocurrency payment processor
267
267
  email:
268
268
  - jsalis@bitcoinsultants.ca
@@ -293,6 +293,13 @@ files:
293
293
  - features/step_definitions/processor_steps.rb
294
294
  - features/step_definitions/widget_steps.rb
295
295
  - features/support/env.rb
296
+ - gemfiles/rails_4_0.gemfile
297
+ - gemfiles/rails_4_1.gemfile
298
+ - gemfiles/rails_4_2.gemfile
299
+ - gemfiles/rails_5_0.gemfile
300
+ - gemfiles/rails_5_1.gemfile
301
+ - gemfiles/rails_5_2.gemfile
302
+ - gemfiles/rails_master.gemfile
296
303
  - lib/cryptocoin_payable.rb
297
304
  - lib/cryptocoin_payable/adapters.rb
298
305
  - lib/cryptocoin_payable/adapters/base.rb
@@ -350,11 +357,9 @@ files:
350
357
  - spec/dummy/config/initializers/mime_types.rb
351
358
  - spec/dummy/config/initializers/secret_token.rb
352
359
  - spec/dummy/config/initializers/session_store.rb
353
- - spec/dummy/config/initializers/state_machine.rb
354
360
  - spec/dummy/config/initializers/wrap_parameters.rb
355
361
  - spec/dummy/config/locales/en.yml
356
362
  - spec/dummy/config/routes.rb
357
- - spec/dummy/db/development.sqlite3
358
363
  - spec/dummy/db/migrate/20140510023211_create_widgets.rb
359
364
  - spec/dummy/db/migrate/20171227225132_create_coin_payments.rb
360
365
  - spec/dummy/db/migrate/20171227225134_create_currency_conversions.rb
@@ -398,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
398
403
  version: 1.3.6
399
404
  requirements: []
400
405
  rubyforge_project:
401
- rubygems_version: 2.7.7
406
+ rubygems_version: 2.6.12
402
407
  signing_key:
403
408
  specification_version: 4
404
409
  summary: Cryptocurrency payment processor
@@ -447,11 +452,9 @@ test_files:
447
452
  - spec/dummy/config/initializers/mime_types.rb
448
453
  - spec/dummy/config/initializers/secret_token.rb
449
454
  - spec/dummy/config/initializers/session_store.rb
450
- - spec/dummy/config/initializers/state_machine.rb
451
455
  - spec/dummy/config/initializers/wrap_parameters.rb
452
456
  - spec/dummy/config/locales/en.yml
453
457
  - spec/dummy/config/routes.rb
454
- - spec/dummy/db/development.sqlite3
455
458
  - spec/dummy/db/migrate/20140510023211_create_widgets.rb
456
459
  - spec/dummy/db/migrate/20171227225132_create_coin_payments.rb
457
460
  - spec/dummy/db/migrate/20171227225134_create_currency_conversions.rb
@@ -1,12 +0,0 @@
1
- require 'state_machine'
2
-
3
- module StateMachine
4
- module Integrations
5
- module ActiveModel
6
- alias around_validation_protected around_validation
7
- def around_validation(*args, &block)
8
- around_validation_protected(*args, &block)
9
- end
10
- end
11
- end
12
- end
Binary file