cosgrove 0.0.3.1 → 0.0.3.2

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: 98ba86984f44b954735318c62f777b6f866317aa
4
- data.tar.gz: 63e2cfebd97a768ef26bd15998fdaac58561d6cd
3
+ metadata.gz: c14eb423f8c640e3c91e8a3c6208f674686e52fd
4
+ data.tar.gz: 475c9bd350356ffa2655b4d72644336780678e64
5
5
  SHA512:
6
- metadata.gz: f9f2941326f6ef68dac80bf31ca860e032c003976553510b9f96fab8ccbe685992b6cad3c6084cd6cdb4c2004b4efc4d3ddc4073c88129e7cbc1c935f550bc8b
7
- data.tar.gz: 503b1dfec30ff481c10db6c6f9dfe5813ee17828ef36bc5fc900d2368af12f19c7a70a3d2469d43fecb44e65e8178846c1ad10a221ac05813c2c4acfd9c8eef2
6
+ metadata.gz: 25f73224d202592f54396403e410e3dd73c2d0c1820417570b1ef78fdfebcf45a4cbcf60e79957ba4d29f89b82b1c707bba2f61c8aaa493dfe3824f026324c08
7
+ data.tar.gz: a775c5663d071d5cf97215d1e006accb5324888b2617fe50a0c64b34fc0b2cb495efc5da0b713698bcb17fbd61719cf7b13a264c764b54c7f50d8880e5010754
data/Gemfile.lock CHANGED
@@ -16,7 +16,7 @@ GIT
16
16
  PATH
17
17
  remote: .
18
18
  specs:
19
- cosgrove (0.0.3.1)
19
+ cosgrove (0.0.3.2)
20
20
  activesupport (~> 5.1, >= 5.1.1)
21
21
  ai4r (~> 1.13, >= 1.13)
22
22
  awesome_print (~> 1.7, >= 1.7.0)
@@ -47,6 +47,12 @@ module Cosgrove
47
47
  cashout_time = Time.parse(cashout_time + 'Z')
48
48
  end
49
49
 
50
+ active_votes = if post.active_votes.class == String
51
+ active_votes = JSON[post.active_votes]
52
+ else
53
+ post.active_votes
54
+ end
55
+
50
56
  nope = if created > 1.minute.ago
51
57
  "Give it a second! It's going to SPACE! Can you give it a second to come back from space?"
52
58
  elsif created > 20.minutes.ago
@@ -59,7 +65,7 @@ module Cosgrove
59
65
  elsif post.json_metadata.include?('nsfw')
60
66
  puts "Won't vote because json_metadata includes: nsfw"
61
67
  'Unable to vote on that.'
62
- elsif post.active_votes.map{ |v| v['voter'] }.include?('blacklist-a')
68
+ elsif active_votes.map{ |v| v['voter'] }.include?('blacklist-a')
63
69
  puts "Won't vote blacklist-a voted."
64
70
  'Unable to vote on that.'
65
71
  elsif (rep = to_rep(post.author_reputation).to_f) < 25.0
@@ -77,7 +83,7 @@ module Cosgrove
77
83
  'Unable to vote. Your account has been resticted.'
78
84
  elsif today_count > 10 && vote_ratio > 0.1
79
85
  "Maybe later. It seems like I've been voting for #{author_name} quite a bit lately."
80
- elsif post.active_votes.map{ |v| v['voter'] }.include?(steem_account)
86
+ elsif active_votes.map{ |v| v['voter'] }.include?(steem_account)
81
87
  title = post.title
82
88
  title = post.permlink if title.empty?
83
89
  "I already voted on #{title} by #{post.author}."
@@ -1,4 +1,4 @@
1
1
  module Cosgrove
2
- VERSION = '0.0.3.1'
2
+ VERSION = '0.0.3.2'
3
3
  AGENT_ID = "cosgrove/#{VERSION}"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosgrove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.1
4
+ version: 0.0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Martin