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 +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +3 -4
- data/cosgrove.gemspec +1 -1
- data/lib/cosgrove/config.rb +16 -2
- data/lib/cosgrove/utils.rb +35 -12
- data/lib/cosgrove/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0cf31a43e03d935fa8f7181b3a0579555b09dab
|
4
|
+
data.tar.gz: 79890eac80e09015ac09e639d564d41e4f4deec0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bd2e6b8149491f186b88e88081aaf81001fffadd6bfc47e96ecd9cee11c09e2845cad9f13f4c103b78fbec29bdf1f76096faabe10abf5221d0d49cfd997b09d
|
7
|
+
data.tar.gz: 2cf2c9a1d6c55a20db6fe4c1b58dba0758035e08f53ba6aefefb67096604f44b058e0a4e16e88bb3f2bfcbcb652857abb627d96f495436c5c04edbd305da624c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -17,14 +17,14 @@ GIT
|
|
17
17
|
PATH
|
18
18
|
remote: .
|
19
19
|
specs:
|
20
|
-
cosgrove (0.0.
|
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.
|
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.
|
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!
|
data/cosgrove.gemspec
CHANGED
@@ -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.
|
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'
|
data/lib/cosgrove/config.rb
CHANGED
@@ -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
|
36
|
-
chain[:
|
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 %'
|
data/lib/cosgrove/utils.rb
CHANGED
@@ -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
|
29
|
-
when :golos then @golos_api ||= Radiator::Api.new(chain
|
30
|
-
when :test then @test_api ||= Radiator::Api.new(chain
|
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
|
41
|
-
when :golos then @golos_follow_api ||= Radiator::FollowApi.new(chain
|
42
|
-
when :test then @test_follow_api ||= Radiator::FollowApi.new(chain
|
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(
|
59
|
-
when :golos then @golos_stream ||= Radiator::Stream.new(
|
60
|
-
when :test then @test_stream ||= Radiator::Stream.new(
|
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
|
104
|
-
when :golos then Radiator::Transaction.new(chain
|
105
|
-
when :test then Radiator::Transaction.new(chain
|
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
|
|
data/lib/cosgrove/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
300
|
+
version: 0.3.0dev5
|
301
301
|
- !ruby/object:Gem::Dependency
|
302
302
|
name: steemdata-rb
|
303
303
|
requirement: !ruby/object:Gem::Requirement
|