cosgrove 0.0.1rc14 → 0.0.1rc15

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: 3d935e0198f1e37f2bab80435479036d5c78c4cb
4
- data.tar.gz: bbc9cf7a720361fed74ab9bd744466cd51556fd4
3
+ metadata.gz: c0cf31a43e03d935fa8f7181b3a0579555b09dab
4
+ data.tar.gz: 79890eac80e09015ac09e639d564d41e4f4deec0
5
5
  SHA512:
6
- metadata.gz: b2cd5265122c6be0ba37ca1a9e68f4f983d45672ff6402249f6879d5668e7d9055b68c8d727d27b45cbb966bfa461d521bef2f1a6e3efabe87232bbc3bf63057
7
- data.tar.gz: 230bddb62fbdc43997e8bfa0c49d760076f2c880f3bf5156f111e6f5cc0d6958cdebcec7331990ac71fcbe887a28378af236e450f1a6922055621b8ca0b59287
6
+ metadata.gz: 0bd2e6b8149491f186b88e88081aaf81001fffadd6bfc47e96ecd9cee11c09e2845cad9f13f4c103b78fbec29bdf1f76096faabe10abf5221d0d49cfd997b09d
7
+ data.tar.gz: 2cf2c9a1d6c55a20db6fe4c1b58dba0758035e08f53ba6aefefb67096604f44b058e0a4e16e88bb3f2bfcbcb652857abb627d96f495436c5c04edbd305da624c
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'radiator', '0.3.0dev4'
4
3
  gem 'steemdata-rb', require: 'steemdata', git: 'git@github.com:steem-third-party/steemdata-rb.git'
5
4
  gem 'cleverbot_rb', git: 'git@github.com:Reaver01/cleverbot_rb.git', branch: 'master'
6
5
 
@@ -17,14 +17,14 @@ GIT
17
17
  PATH
18
18
  remote: .
19
19
  specs:
20
- cosgrove (0.0.1rc14)
20
+ cosgrove (0.0.1rc15)
21
21
  activesupport (~> 5.1, >= 5.1.1)
22
22
  ai4r (~> 1.13, >= 1.13)
23
23
  discordrb (~> 3.2, >= 3.2.1)
24
24
  mechanize (~> 2.7, >= 2.7.5)
25
25
  mongoid (~> 6.1, >= 6.1.0)
26
26
  phantomjs (~> 2.1, >= 2.1.1.0)
27
- radiator (= 0.3.0dev4)
27
+ radiator (= 0.3.0dev5)
28
28
  railties (~> 5.1, >= 5.1.1)
29
29
  rdiscount (~> 2.2, >= 2.2.0.1)
30
30
  rmagick (~> 2.16, >= 2.16.0)
@@ -151,7 +151,7 @@ GEM
151
151
  rack (2.0.3)
152
152
  rack-test (0.7.0)
153
153
  rack (>= 1.0, < 3)
154
- radiator (0.3.0dev4)
154
+ radiator (0.3.0dev5)
155
155
  bitcoin-ruby (= 0.0.11)
156
156
  ffi (= 1.9.18)
157
157
  hashie (~> 3.5, >= 3.5.5)
@@ -231,7 +231,6 @@ DEPENDENCIES
231
231
  minitest-line (~> 0.6, >= 0.6.3)
232
232
  minitest-proveit (~> 1.0, >= 1.0.0)
233
233
  pry (~> 0.10, >= 0.10.3)
234
- radiator (= 0.3.0dev4)
235
234
  rake (~> 11.2, >= 11.2.2)
236
235
  simplecov (~> 0.11, >= 0.11.2)
237
236
  steemdata-rb!
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'pry', '~> 0.10', '>= 0.10.3'
34
34
  spec.add_development_dependency 'awesome_print', '~> 1.7', '>= 1.7.0'
35
35
 
36
- spec.add_dependency 'radiator', '0.3.0dev4'
36
+ spec.add_dependency 'radiator', '0.3.0dev5'
37
37
  spec.add_dependency 'steemdata-rb', '~> 0.0', '>= 0.0.1f'
38
38
  spec.add_dependency 'steem_api', '~> 1.1', '>= 1.1.0'
39
39
  spec.add_dependency 'discordrb', '~> 3.2', '>= 3.2.1'
@@ -28,12 +28,20 @@ module Cosgrove
28
28
  chain[:steem_api_url]
29
29
  end
30
30
 
31
+ def steem_api_failover_urls
32
+ chain[:steem_api_failover_urls]
33
+ end
34
+
31
35
  def golos_api_url
32
36
  chain[:golos_api_url]
33
37
  end
34
38
 
35
- def test_api_url
36
- chain[:test_api_url]
39
+ def golos_api_failover_urls
40
+ chain[:golos_api_failover_urls]
41
+ end
42
+
43
+ def test_api_failover_urls
44
+ chain[:test_api_failover_urls]
37
45
  end
38
46
 
39
47
  def steem_account
@@ -69,6 +77,12 @@ module Cosgrove
69
77
  yml[:discord][:log_mode].to_sym
70
78
  end
71
79
 
80
+ def discord_fancy_log
81
+ return false if !!ENV['HELL_ENABLED']
82
+
83
+ yml[:discord][:fancy_log].to_s == 'true'
84
+ end
85
+
72
86
  def channel_upvote_weight(channel_id)
73
87
  rules = yml[:cosgrove][:upvote_rules][:channels]
74
88
  default_weight = rules[:default][:upvote_weight] rescue '0.00 %'
@@ -19,15 +19,38 @@ module Cosgrove
19
19
  true
20
20
  end
21
21
 
22
+ def chain_options(chain)
23
+ case chain
24
+ when :steem
25
+ {
26
+ chain: :steem,
27
+ url: steem_api_url,
28
+ failover_urls: steem_api_failover_urls
29
+ }
30
+ when :golos
31
+ {
32
+ chain: :golos,
33
+ url: golos_api_url,
34
+ failover_urls: golos_api_failover_urls
35
+ }
36
+ when :test
37
+ {
38
+ chain: :test,
39
+ url: test_api_url,
40
+ failover_urls: test_api_failover_urls
41
+ }
42
+ end
43
+ end
44
+
22
45
  def api(chain)
23
46
  reset_api if @cycle_api_at.nil? || @cycle_api_at < 15.minutes.ago
24
47
 
25
48
  @cycle_api_at ||= Time.now
26
49
 
27
50
  case chain
28
- when :steem then @steem_api ||= Radiator::Api.new(chain: :steem, url: steem_api_url)
29
- when :golos then @golos_api ||= Radiator::Api.new(chain: :golos, url: golos_api_url)
30
- when :test then @test_api ||= Radiator::Api.new(chain: :test, url: test_api_url)
51
+ when :steem then @steem_api ||= Radiator::Api.new(chain_options(chain))
52
+ when :golos then @golos_api ||= Radiator::Api.new(chain_options(chain))
53
+ when :test then @test_api ||= Radiator::Api.new(chain_options(chain))
31
54
  end
32
55
  end
33
56
 
@@ -37,9 +60,9 @@ module Cosgrove
37
60
  @cycle_api_at ||= Time.now
38
61
 
39
62
  case chain
40
- when :steem then @steem_follow_api ||= Radiator::FollowApi.new(chain: :steem, url: steem_api_url)
41
- when :golos then @golos_follow_api ||= Radiator::FollowApi.new(chain: :golos, url: golos_api_url)
42
- when :test then @test_follow_api ||= Radiator::FollowApi.new(chain: :test, url: test_api_url)
63
+ when :steem then @steem_follow_api ||= Radiator::FollowApi.new(chain_options(chain))
64
+ when :golos then @golos_follow_api ||= Radiator::FollowApi.new(chain_options(chain))
65
+ when :test then @test_follow_api ||= Radiator::FollowApi.new(chain_options(chain))
43
66
  end
44
67
  end
45
68
 
@@ -55,9 +78,9 @@ module Cosgrove
55
78
  @cycle_stream_at ||= Time.now
56
79
 
57
80
  case chain
58
- when :steem then @steem_stream ||= Radiator::Stream.new(url: steem_api_url)
59
- when :golos then @golos_stream ||= Radiator::Stream.new(url: golos_api_url)
60
- when :test then @test_stream ||= Radiator::Stream.new(url: test_api_url)
81
+ when :steem then @steem_stream ||= Radiator::Stream.new(chain_options(chain))
82
+ when :golos then @golos_stream ||= Radiator::Stream.new(chain_options(chain))
83
+ when :test then @test_stream ||= Radiator::Stream.new(chain_options(chain))
61
84
  end
62
85
  end
63
86
 
@@ -100,9 +123,9 @@ module Cosgrove
100
123
 
101
124
  def new_tx(chain)
102
125
  case chain
103
- when :steem then Radiator::Transaction.new(chain: :steem, wif: steem_posting_wif, url: steem_api_url)
104
- when :golos then Radiator::Transaction.new(chain: :golos, wif: golos_posting_wif, url: golos_api_url)
105
- when :test then Radiator::Transaction.new(chain: :test, wif: test_posting_wif, url: test_api_url)
126
+ when :steem then Radiator::Transaction.new(chain_options(chain).merge(wif: steem_posting_wif))
127
+ when :golos then Radiator::Transaction.new(chain_options(chain).merge(wif: golos_posting_wif))
128
+ when :test then Radiator::Transaction.new(chain_options(chain).merge(wif: test_posting_wif))
106
129
  end
107
130
  end
108
131
 
@@ -1,4 +1,4 @@
1
1
  module Cosgrove
2
- VERSION = '0.0.1rc14'
2
+ VERSION = '0.0.1rc15'
3
3
  AGENT_ID = "cosgrove/#{VERSION}"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosgrove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1rc14
4
+ version: 0.0.1rc15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -290,14 +290,14 @@ dependencies:
290
290
  requirements:
291
291
  - - '='
292
292
  - !ruby/object:Gem::Version
293
- version: 0.3.0dev4
293
+ version: 0.3.0dev5
294
294
  type: :runtime
295
295
  prerelease: false
296
296
  version_requirements: !ruby/object:Gem::Requirement
297
297
  requirements:
298
298
  - - '='
299
299
  - !ruby/object:Gem::Version
300
- version: 0.3.0dev4
300
+ version: 0.3.0dev5
301
301
  - !ruby/object:Gem::Dependency
302
302
  name: steemdata-rb
303
303
  requirement: !ruby/object:Gem::Requirement