ambito 0.2.1 → 0.3.0

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: d23be2cb4c6df3b9b39b52bca2a3f61f97d3ea0da79bee423df5e85e4387324e
4
- data.tar.gz: d0b1156222d75af14749b9bfff6cc80550fcc0c20004337cfb7e0d478ac2d715
3
+ metadata.gz: 626b627c3f3718bde249aa3d225720dcf255d7533409f0b5fa099a1f5152edb5
4
+ data.tar.gz: cd38318ce750b2c7e594e79cad1aba342dc8dac0b89519a2bf1464d8ac464fd1
5
5
  SHA512:
6
- metadata.gz: bdc8d2f6b7cb93b1af53f83d2f2c64a78f1198d260ec1e11a7ac8ef5b6e8b93affd564de405001f52e116264defd2253a60cb304e417a50caf7a4840a3460405
7
- data.tar.gz: 4526159a7ac8282191e9f884e45efd713cde0e91857168eca569be72d24f4ba553d8dfdda67175cdba425be9c1c1597185f312ccb29b7ca887a49993a860685f
6
+ metadata.gz: 2860ca43c23793ca8b82463dd326e7ff4a1bdbdd40ae67c085b843635d4cc40a4ffc25616e1279abde3ec34bbe5edf03e262aa7e3e27508bb5d4828b96517e13
7
+ data.tar.gz: abcbe303761efed98fc3924fb0865eee13a58c819c51a350698a345c3e0d025678a5a92f4f2e169c30ebd96ee05f68ba7e43816cb5443e02b944cf5c636dc912
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0] - 2023-11-27
4
+
5
+ ### Added
6
+
7
+ - Multi-threaded requests
8
+
3
9
  ## [0.2.1] - 2023-11-27
4
10
 
5
11
  ### Fixed
data/config/dollars.yml CHANGED
@@ -1,7 +1,11 @@
1
1
  - !ruby/object:Ambito::Dollar
2
- name: oficial
3
- display: Oficial
4
- endpoint: /dolar/oficial/variacion
2
+ name: ccl
3
+ display: CCL
4
+ endpoint: /dolarrava/cl/variacion
5
+ - !ruby/object:Ambito::Dollar
6
+ name: cripto
7
+ display: Cripto
8
+ endpoint: /dolarcripto/variacion
5
9
  - !ruby/object:Ambito::Dollar
6
10
  name: informal
7
11
  display: Informal
@@ -11,6 +15,10 @@
11
15
  display: MEP
12
16
  endpoint: /dolarrava/mep/variacion
13
17
  - !ruby/object:Ambito::Dollar
14
- name: cripto
15
- display: Cripto
16
- endpoint: /dolarcripto/variacion
18
+ name: oficial
19
+ display: Oficial
20
+ endpoint: /dolar/oficial/variacion
21
+ - !ruby/object:Ambito::Dollar
22
+ name: turista
23
+ display: Turista
24
+ endpoint: /dolarturista/variacion
data/lib/ambito/cli.rb CHANGED
@@ -7,8 +7,11 @@ module Ambito
7
7
  end
8
8
 
9
9
  def run
10
- if options.any?
11
- puts Ambito.rate(*options)
10
+ case options
11
+ in {dollar:}
12
+ puts Ambito.rate(dollar)
13
+ in {version: true}
14
+ puts Ambito::VERSION
12
15
  else
13
16
  puts Ambito.rates
14
17
  end
@@ -17,10 +20,13 @@ module Ambito
17
20
  private
18
21
 
19
22
  def options
20
- [].tap do |parsed_options|
23
+ {}.tap do |parsed_options|
21
24
  OptionParser.new do |options|
22
25
  options.on("-d", "--dollar DOLLAR", "Select the rate") do |dollar|
23
- parsed_options << dollar
26
+ parsed_options[:dollar] = dollar
27
+ end
28
+ options.on("-v", "--version", "Show version") do
29
+ parsed_options[:version] = true
24
30
  end
25
31
  end.parse(@argv)
26
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ambito
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/ambito.rb CHANGED
@@ -11,7 +11,11 @@ require_relative "ambito/version"
11
11
  module Ambito
12
12
  class << self
13
13
  def rates
14
- Dollar.all.map(&:rate)
14
+ Dollar.all.map do |dollar|
15
+ Thread.new do
16
+ dollar.rate
17
+ end
18
+ end.map(&:value)
15
19
  end
16
20
 
17
21
  def rate(dollar)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ambito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Rzezak