hodlmoon 0.1.2 → 0.1.3

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
2
  SHA1:
3
- metadata.gz: f9886e4441e2e074d35bc5960f99434f07e23596
4
- data.tar.gz: 61f4e3302d777517e778e5084052f8227111ebf0
3
+ metadata.gz: bcf8dff893d3eff1c2b478326214628ce6b8c6cd
4
+ data.tar.gz: 4867a8e1bad506769de00f75affb416b3985962d
5
5
  SHA512:
6
- metadata.gz: 972431b7518cb668d77f263cf7d35e614ad5603201cd5f489cf9fa4587630e5de414e7e502d14d7226eb2df6831c3fc49752b2c1fd79774b243142de89cc326c
7
- data.tar.gz: b9ef6a8ace986315ac00bea106a65294d6561b9104f798d50fc44e4d51c689ec5b095125fe6238fcc7e4ba457dc0c81082983878a75f70aa6114dd04c21124e6
6
+ metadata.gz: 4c32aaf6a6e20ea16e3ee157fe2cf01a5752fc0d39708d7bea0c0e614f6e765f1679513eff641e512195e491178d971017f8fc816f15999d1218abe0642b87d7
7
+ data.tar.gz: '08831f1833705d26a29b10c8649fba87b61a511476524d698bebfedb2b83068a6b1a62c1c4576eb4b320ad8fcbc3f31182847a6049ad7626519ad2a95fed5646'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hodlmoon (0.1.2)
4
+ hodlmoon (0.1.3)
5
5
  httparty (~> 0.15.7)
6
6
  terminal-table (~> 1.8.0)
7
7
  thor (~> 0.20.0)
@@ -12,20 +12,41 @@ GEM
12
12
  addressable (2.5.2)
13
13
  public_suffix (>= 2.0.2, < 4.0)
14
14
  ast (2.4.0)
15
+ coveralls (0.7.1)
16
+ multi_json (~> 1.3)
17
+ rest-client
18
+ simplecov (>= 0.7)
19
+ term-ansicolor
20
+ thor
15
21
  crack (0.4.3)
16
22
  safe_yaml (~> 1.0.0)
17
23
  diff-lcs (1.3)
24
+ docile (1.1.5)
25
+ domain_name (0.5.20170404)
26
+ unf (>= 0.0.5, < 1.0.0)
18
27
  hashdiff (0.3.7)
28
+ http-cookie (1.0.3)
29
+ domain_name (~> 0.5)
19
30
  httparty (0.15.7)
20
31
  multi_xml (>= 0.5.2)
32
+ json (2.1.0)
33
+ mime-types (3.1)
34
+ mime-types-data (~> 3.2015)
35
+ mime-types-data (3.2016.0521)
36
+ multi_json (1.13.1)
21
37
  multi_xml (0.6.0)
38
+ netrc (0.11.0)
22
39
  parallel (1.12.0)
23
40
  parser (2.4.0.2)
24
41
  ast (~> 2.3)
25
42
  powerpack (0.1.1)
26
- public_suffix (3.0.1)
43
+ public_suffix (3.0.2)
27
44
  rainbow (3.0.0)
28
45
  rake (10.5.0)
46
+ rest-client (2.0.2)
47
+ http-cookie (>= 1.0.2, < 2.0)
48
+ mime-types (>= 1.16, < 4.0)
49
+ netrc (~> 0.8)
29
50
  rspec (3.7.0)
30
51
  rspec-core (~> 3.7.0)
31
52
  rspec-expectations (~> 3.7.0)
@@ -48,9 +69,20 @@ GEM
48
69
  unicode-display_width (~> 1.0, >= 1.0.1)
49
70
  ruby-progressbar (1.9.0)
50
71
  safe_yaml (1.0.4)
72
+ simplecov (0.15.1)
73
+ docile (~> 1.1.0)
74
+ json (>= 1.8, < 3)
75
+ simplecov-html (~> 0.10.0)
76
+ simplecov-html (0.10.2)
77
+ term-ansicolor (1.6.0)
78
+ tins (~> 1.0)
51
79
  terminal-table (1.8.0)
52
80
  unicode-display_width (~> 1.1, >= 1.1.1)
53
81
  thor (0.20.0)
82
+ tins (1.16.3)
83
+ unf (0.1.4)
84
+ unf_ext
85
+ unf_ext (0.0.7.5)
54
86
  unicode-display_width (1.3.0)
55
87
  vcr (3.0.3)
56
88
  webmock (3.2.1)
@@ -63,6 +95,7 @@ PLATFORMS
63
95
 
64
96
  DEPENDENCIES
65
97
  bundler (~> 1.16)
98
+ coveralls (~> 0.7.1)
66
99
  hodlmoon!
67
100
  rake (~> 10.0)
68
101
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Hodlmoon
2
2
 
3
+ [![Donate with Ethereum](https://en.cryptobadges.io/badge/small/0x5aa9a264fF5516E615eB60b43d524F04c13a331e)](https://en.cryptobadges.io/donate/0x5aa9a264fF5516E615eB60b43d524F04c13a331e)
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/hodlmoon.svg)](https://badge.fury.io/rb/hodlmoon)
6
+ [![CircleCI](https://circleci.com/gh/richo225/hodlmoon/tree/master.svg?style=shield)](https://circleci.com/gh/richo225/hodlmoon/tree/master)
7
+ [![Dependency Status](https://gemnasium.com/badges/github.com/richo225/hodlmoon.svg)](https://gemnasium.com/github.com/richo225/hodlmoon)
8
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c328ff2b6d581e5121fc/maintainability)](https://codeclimate.com/github/richo225/hodlmoon/maintainability)
9
+ [![Coverage Status](https://coveralls.io/repos/github/richo225/hodlmoon/badge.svg?branch=circle)](https://coveralls.io/github/richo225/hodlmoon?branch=circle)
10
+
3
11
  Quickly find the price of your crypto portfolio from the comfort of your command line.
4
12
 
5
13
  When moon?
@@ -18,65 +26,21 @@ The gem comes with two methods that can be run : `price` and `list`.
18
26
 
19
27
  ### List
20
28
 
21
- Lists market data for the top coins in a specific currency. If no limit is given, the top 5 will be shown. If no currency is given, the CLI will default to `gbp`:
22
-
23
- ```ruby
24
- hodlmoon list
25
- #
26
- O==============O========O===============O================O===================O====================O===================O
27
- | ☾ ☾ ☾ Hodlmoon ☽ ☽ ☽ |
28
- O==============O========O===============O================O===================O====================O===================O
29
- | name | symbol | price_gbp | market_cap_gbp | percent_change_1h | percent_change_24h | percent_change_7d |
30
- O==============O========O===============O================O===================O====================O===================O
31
- | Bitcoin | BTC | 6194.31180144 | 104438958744 | -1.69 | +2.13 | +14.56 |
32
- O==============O========O===============O================O===================O====================O===================O
33
- | Ethereum | ETH | 611.451838746 | 59659761394.0 | -1.66 | +0.14 | +13.49 |
34
- O==============O========O===============O================O===================O====================O===================O
35
- | Ripple | XRP | 0.7614421057 | 29703259449.0 | -1.33 | +0.51 | +42.23 |
36
- O==============O========O===============O================O===================O====================O===================O
37
- | Bitcoin Cash | BCH | 905.989224 | 15368940724.0 | -1.75 | -0.82 | +28.42 |
38
- O==============O========O===============O================O===================O====================O===================O
39
- | Cardano | ADA | 0.2704738498 | 7012594583.0 | -1.64 | -2.15 | +10.23 |
40
- O==============O========O===============O================O===================O====================O===================O
41
-
42
- hodlmoon list 2 eur
43
- #
44
- O==========O========O===============O================O===================O====================O===================O
45
- | ☾ ☾ ☾ Hodlmoon ☽ ☽ ☽ |
46
- O==========O========O===============O================O===================O====================O===================O
47
- | name | symbol | price_eur | market_cap_eur | percent_change_1h | percent_change_24h | percent_change_7d |
48
- O==========O========O===============O================O===================O====================O===================O
49
- | Bitcoin | BTC | 6999.59148544 | 118016346256 | -1.69 | +2.13 | +14.56 |
50
- O==========O========O===============O================O===================O====================O===================O
51
- | Ethereum | ETH | 690.942468096 | 67415714814.0 | -1.66 | +0.14 | +13.49 |
52
- O==========O========O===============O================O===================O====================O===================O
53
- ```
29
+ Lists market data for the top default 8 coins.
30
+
31
+ <img width="956" alt="screen shot 2018-02-13 at 23 34 15" src="https://user-images.githubusercontent.com/18379191/36180073-d0fbd150-1116-11e8-8355-24af83efb03d.png">
32
+
33
+
34
+ A specific limit and a specific currency can also be supplied. If no currency is given, the CLI will default to `gbp`.
35
+
36
+
37
+ <img width="927" alt="screen shot 2018-02-13 at 23 34 44" src="https://user-images.githubusercontent.com/18379191/36180125-114bc8dc-1117-11e8-910e-d2bee9df72df.png">
54
38
 
55
39
  ### Price
56
40
 
57
41
  Gets the current price of a coin in a specific currency. If no currency is given, the CLI will default to `gbp`:
58
42
 
59
- ```ruby
60
- hodlmoon price ethereum
61
- #
62
- O==========O========O===============O================O===================O====================O===================O
63
- | ☾ ☾ ☾ Hodlmoon ☽ ☽ ☽ |
64
- O==========O========O===============O================O===================O====================O===================O
65
- | name | symbol | price_gbp | market_cap_gbp | percent_change_1h | percent_change_24h | percent_change_7d |
66
- O==========O========O===============O================O===================O====================O===================O
67
- | Ethereum | ETH | 608.540996151 | 59387446060.0 | +0.54 | -1.76 | +26.1 |
68
- O==========O========O===============O================O===================O====================O===================O
69
-
70
- hodlmoon price neo usd
71
- #
72
- O======O========O===========O================O===================O====================O===================O
73
- | ☾ ☾ ☾ Hodlmoon ☽ ☽ ☽ |
74
- O======O========O===========O================O===================O====================O===================O
75
- | name | symbol | price_usd | market_cap_usd | percent_change_1h | percent_change_24h | percent_change_7d |
76
- O======O========O===========O================O===================O====================O===================O
77
- | NEO | NEO | 111.91 | 7274150000.0 | +0.17 | -0.72 | +35.47 |
78
- O======O========O===========O================O===================O====================O===================O
79
- ```
43
+ <img width="895" alt="screen shot 2018-02-13 at 23 41 24" src="https://user-images.githubusercontent.com/18379191/36180237-7accffd8-1117-11e8-9e7d-b1c6d8d9f295.png">
80
44
 
81
45
  ## Contributing
82
46
 
@@ -91,3 +55,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
91
55
  ## Code of Conduct
92
56
 
93
57
  Everyone interacting in the Hodlmoon project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/richo225/hodlmoon/blob/master/CODE_OF_CONDUCT.md).
58
+
59
+ [![forthebadge](https://forthebadge.com/images/badges/fuck-it-ship-it.svg)](https://forthebadge.com)
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'thor', '~> 0.20.0'
26
26
 
27
27
  spec.add_development_dependency 'bundler', '~> 1.16'
28
+ spec.add_development_dependency 'coveralls', '~> 0.7.1'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
29
30
  spec.add_development_dependency 'rspec', '~> 3.0'
30
31
  spec.add_development_dependency 'rubocop', '~> 0.52.1'
@@ -5,6 +5,8 @@ require 'hodlmoon/table'
5
5
 
6
6
  module Hodlmoon
7
7
  class Cli < Thor
8
+ DEFAULT_LIMIT = 8
9
+
8
10
  CURRENCY = {
9
11
  gbp: '£',
10
12
  usd: '$',
@@ -23,7 +25,7 @@ module Hodlmoon
23
25
  end
24
26
 
25
27
  desc 'list LIMIT CURRENCY', 'get LIMIT of top coins in CURRENCY(optional)'
26
- def list(limit = 8, currency = 'gbp')
28
+ def list(limit = DEFAULT_LIMIT, currency = 'gbp')
27
29
  info = Hodlmoon::Client::RetrieveList.call(limit, currency)
28
30
  puts Hodlmoon::Table.build(info, currency)
29
31
  end
@@ -14,7 +14,7 @@ module Hodlmoon
14
14
  def build
15
15
  Terminal::Table.new do |t|
16
16
  t.title = '☾ ☾ ☾ Hodlmoon ☽ ☽ ☽'
17
- t.headings = headers
17
+ t.headings = humanised_headings
18
18
  t.rows = rows
19
19
  t.style = { all_separators: true, border_x: '=', border_i: 'O', alignment: :center }
20
20
  end
@@ -22,8 +22,9 @@ module Hodlmoon
22
22
 
23
23
  private
24
24
 
25
- def headers
26
- ['name',
25
+ def headings
26
+ ['rank',
27
+ 'name',
27
28
  'symbol',
28
29
  "price_#{@currency}",
29
30
  "market_cap_#{@currency}",
@@ -32,6 +33,12 @@ module Hodlmoon
32
33
  'percent_change_7d']
33
34
  end
34
35
 
36
+ def humanised_headings
37
+ headings.map do |heading|
38
+ heading.tr('_', ' ').capitalize
39
+ end
40
+ end
41
+
35
42
  def rows
36
43
  colorised_info.map(&:values)
37
44
  end
@@ -42,6 +49,12 @@ module Hodlmoon
42
49
  end
43
50
  end
44
51
 
52
+ def filtered_info
53
+ @info.map do |coin|
54
+ headings.each_with_object({}) { |k, h| h[k] = coin[k]; }
55
+ end
56
+ end
57
+
45
58
  def colorise(key, value)
46
59
  return unless value
47
60
 
@@ -51,12 +64,6 @@ module Hodlmoon
51
64
  end
52
65
  end
53
66
 
54
- def filtered_info
55
- @info.map do |coin|
56
- headers.each_with_object({}) { |k, h| h[k] = coin[k]; }
57
- end
58
- end
59
-
60
67
  def colorise_yellow(string)
61
68
  string.prepend("\e[33m").concat("\e[0m")
62
69
  end
@@ -1,3 +1,3 @@
1
1
  module Hodlmoon
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hodlmoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Bates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-13 00:00:00.000000000 Z
11
+ date: 2018-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.16'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.7.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement