cryptocoin_fanboi 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 347752be962e97bf3e8a9c1f6558b24810d4f2fe
4
+ data.tar.gz: 270035196f146b30538d6df4d6bf06c01b632599
5
+ SHA512:
6
+ metadata.gz: 5bf16fcdf1eee6d5fc2223e9c9502c8514eefe2d2fabab90c7ba79be43630997c625d8936361cfe495205cdcf54c636ac493ad19bd2c6109852fbd1b3040e495
7
+ data.tar.gz: 74ea125d94994c89c5702baae9ed6e74e2361455a8d9aa68cec87c1f27dc885b09433f99e06c18d01ee1edb072dad454093cae960cf43abb4094aa83d899ac7b
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: cryptocoin_fanboi
4
+
5
+
6
+ require 'coinmarketcap'
7
+ require 'table-formatter'
8
+
9
+
10
+ class CryptocoinFanboi
11
+
12
+ def initialize()
13
+
14
+ @tfo = TableFormatter.new
15
+ @tfo.labels = %w(Name USD BTC) + ['% 24hr:', '% 1 week:']
16
+
17
+ end
18
+
19
+ def to_s(limit: 5, markdown: false)
20
+
21
+ @tfo.source = fetch_coinlist limit: limit
22
+ @tfo.display markdown: markdown
23
+
24
+ end
25
+
26
+ private
27
+
28
+ def fetch_coinlist(limit: 5)
29
+
30
+ coins = JSON.parse(Coinmarketcap.coins.body).take(limit).map do |coin|
31
+
32
+ %w(name price_usd price_btc percent_change_24h percent_change_7d)\
33
+ .map {|x| coin[x] }
34
+
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+
41
+
42
+ if __FILE__ == $0 then
43
+
44
+ ccf = CryptocoinFanboi.new
45
+ puts ccf.to_s
46
+
47
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cryptocoin_fanboi
3
+ version: !ruby/object:Gem::Version
4
+ version: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mo80mNV
27
+ G+5aUDLavpo3MR6yrcfzY0jkR2c5gH818JNIGsq/aQMkm36WV9fjIkroRYIAFeh6
28
+ qr6d7tVVC5iZO7Kis/rHVnl+2YbRRKRGeKpRy5xc0QLf6+Vd/+12o9XRWGuokYUF
29
+ 7LC3NfVXVGoVb+BtcEDRmXje7XRl4P6YXJXmXXjRffOejiQAAYAy4RepBCerTM7X
30
+ NgmsFfw10oaD3PWQ7UPxWJP14au2LUL+NGHkLrGHOMPphsZhYeXKugGO8NfcKukq
31
+ fps=
32
+ -----END CERTIFICATE-----
33
+ date: 2018-01-01 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: coinmarketcap
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.2'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 0.2.4
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '0.2'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.2.4
55
+ - !ruby/object:Gem::Dependency
56
+ name: table-formatter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.4'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.4.2
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0.4'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.4.2
75
+ description:
76
+ email: james@jamesrobertson.eu
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files: []
80
+ files:
81
+ - lib/cryptocoin_fanboi.rb
82
+ homepage: https://github.com/jrobertson/cryptocoin_fanboi
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.6.13
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: A coinmarketcap wrapper which makes it convenient to display the top 5 crypto
106
+ currencies as listed on https://coinmarketcap.com.
107
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+
2
+ bA�O-V��W�|�<����T-��2uTl|Y妉<`K�dhb���@��"�r&���