watchcow 0.0.1 → 0.0.3

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
  SHA256:
3
- metadata.gz: 190013ace8f0a7d0ef2025cb766d42a9fdb60594d530e4cd977bf828c0f0af29
4
- data.tar.gz: 71ca5b0d7f88bd1ef3062e7025ecff773ef52c6bf235016ebf00e1c169bec70a
3
+ metadata.gz: cda7d68cc1cb1ba53871ca1e4b2f1cdb3884daff8abfa148363395b44a18213d
4
+ data.tar.gz: 975be9a7765e07031eb6ca6d6acb7a287c53bbf22793c7b41fae0f1ed3c0e5a0
5
5
  SHA512:
6
- metadata.gz: df69250920b9ac2858655cc00778881b711bd768faf9ac32cee5a7aa0286b1351e38faf499064525f08ab97615ca36b62f5f0cf2c724a05c8376b213b0258239
7
- data.tar.gz: 13c323b3124bc39e6151c7062862c1a34fbd29413b109df07d3865646352f85d091f8a0d9f60b10a9f763e1e3b3307afb5a98935b6729ff8d0971b0e2271de20
6
+ metadata.gz: 920372c2c7e02c94e15018a7b71baf1a607b81c249ad4ae79bd4fd77f9e470d4262ec0861f701922cf2d1ba62fd00e220503323e508ef62b6f867be43dbb3416
7
+ data.tar.gz: 3a9b4a02242835cd1afc3e9cf0c216c28bde4ba066a3434e32d352d69937a0b04815ef7cc4ee5bd8b601bb6fb39b88bbd399e87a3ec5f3215575dbc241107d5d
data/Gemfile CHANGED
@@ -8,3 +8,9 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
+
12
+ gem "httparty", '0.14.0'
13
+ gem 'redis', '~> 3.3.5'
14
+ gem 'sidekiq', '5.2.9'
15
+ gem 'pry-rails'
16
+ gem 'activesupport', '~> 6.1', '>= 6.1.3.2'
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ watchcow (0.0.1)
5
+ httparty (~> 0.14, >= 0.14.0)
6
+ pry-rails (~> 0.3.9)
7
+ redis (~> 3.3, >= 3.3.5)
8
+ sidekiq (~> 5.2, >= 5.2.9)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ coderay (1.1.3)
14
+ connection_pool (2.2.5)
15
+ diff-lcs (1.4.4)
16
+ httparty (0.18.1)
17
+ mime-types (~> 3.0)
18
+ multi_xml (>= 0.5.2)
19
+ method_source (1.0.0)
20
+ mime-types (3.3.1)
21
+ mime-types-data (~> 3.2015)
22
+ mime-types-data (3.2021.0225)
23
+ multi_xml (0.6.0)
24
+ pry (0.14.1)
25
+ coderay (~> 1.1)
26
+ method_source (~> 1.0)
27
+ pry-rails (0.3.9)
28
+ pry (>= 0.10.4)
29
+ rack (2.2.3)
30
+ rack-protection (2.0.4)
31
+ rack
32
+ rake (13.0.3)
33
+ redis (3.3.5)
34
+ rspec (3.10.0)
35
+ rspec-core (~> 3.10.0)
36
+ rspec-expectations (~> 3.10.0)
37
+ rspec-mocks (~> 3.10.0)
38
+ rspec-core (3.10.1)
39
+ rspec-support (~> 3.10.0)
40
+ rspec-expectations (3.10.1)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.10.0)
43
+ rspec-mocks (3.10.2)
44
+ diff-lcs (>= 1.2.0, < 2.0)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-support (3.10.2)
47
+ sidekiq (5.2.9)
48
+ connection_pool (~> 2.2, >= 2.2.2)
49
+ rack (~> 2.0)
50
+ rack-protection (>= 1.5.0)
51
+ redis (>= 3.3.5, < 4.2)
52
+
53
+ PLATFORMS
54
+ x86_64-darwin-17
55
+
56
+ DEPENDENCIES
57
+ rake (~> 13.0)
58
+ rspec (~> 3.0)
59
+ watchcow!
60
+
61
+ BUNDLED WITH
62
+ 2.2.6
@@ -3,6 +3,7 @@ require 'watchcow/contract_info'
3
3
  require 'watchcow/market_depth'
4
4
  require 'active_support'
5
5
  require 'watchcow/rate'
6
+ require 'watchcow/output'
6
7
 
7
8
  $redis = Redis.new(url: ENV["REDIS_URL"] || "redis://localhost:6379/0")
8
9
 
@@ -22,17 +23,20 @@ module Watchcow
22
23
  expected_margin = "expected margin: #{best_cq.dig(:expected_margin)}%"
23
24
  real_margin = "landed margin: #{best_cq.dig(:real_margin_expected)}%"
24
25
  puts "---"
25
- puts "Best current quarter"
26
- puts "#{coin}, #{best_margin}, #{days_remained}, #{expected_margin}, #{real_margin}"
26
+ puts "CQ"
27
+ cq_string = "#{coin}, #{best_margin}, #{days_remained}, #{expected_margin}, #{real_margin}"
28
+ puts cq_string
27
29
  # NQ
28
30
  coin = best_nq.dig(:coin)
29
31
  best_margin = "annual margin: #{best_nq.dig(:margin)}%"
30
32
  days_remained = "days remained: #{best_nq.dig(:days)}"
31
33
  expected_margin = "expected margin: #{best_nq.dig(:expected_margin)}%"
32
34
  real_margin = "landed margin: #{best_nq.dig(:real_margin_expected)}%"
33
- puts "Best next quarter"
34
- puts "#{coin}, #{best_margin}, #{days_remained}, #{expected_margin}, #{real_margin}"
35
+ puts "NQ"
36
+ nq_string = "#{coin}, #{best_margin}, #{days_remained}, #{expected_margin}, #{real_margin}"
37
+ puts nq_string
35
38
  puts "---"
39
+ Watchcow::Output.call("<p>#{cq_string}</p><p>#{nq_string}</p>")
36
40
  sleep(30)
37
41
  end
38
42
  end
@@ -0,0 +1,10 @@
1
+ module Watchcow
2
+ class Output
3
+ class << self
4
+ def call text
5
+ path = File.expand_path('~/', __FILE__)
6
+ File.open("#{path}/info.html", 'w+'){|f| f.write(text)}
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchcow
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.3"
5
5
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchcow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - DrinE Liu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date:
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -96,6 +96,7 @@ files:
96
96
  - ".rspec"
97
97
  - CODE_OF_CONDUCT.md
98
98
  - Gemfile
99
+ - Gemfile.lock
99
100
  - LICENSE.txt
100
101
  - README.md
101
102
  - Rakefile
@@ -107,9 +108,10 @@ files:
107
108
  - lib/watchcow/client.rb
108
109
  - lib/watchcow/contract_info.rb
109
110
  - lib/watchcow/market_depth.rb
111
+ - lib/watchcow/output.rb
110
112
  - lib/watchcow/rate.rb
111
113
  - lib/watchcow/version.rb
112
- - watchcow-0.0.1.gem
114
+ - watchcow-0.0.2.gem
113
115
  - watchcow.gemspec
114
116
  homepage: https://rubygems.org/gems
115
117
  licenses:
data/watchcow-0.0.1.gem DELETED
Binary file