yahoo_finanza 0.4.5 → 0.4.6

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: 5ddd901458a0858736099dd65681308951857fd7
4
- data.tar.gz: 86e420d4b0a24cc17d9fc5bc50fddfbc56438c16
3
+ metadata.gz: e3893047d95805f00d8c58e8918ac9c50a6e6380
4
+ data.tar.gz: 6fea6aaeca86549b9a0d6ce3d4f9845569192893
5
5
  SHA512:
6
- metadata.gz: 121491ca37a4d877ec7756a214fba459da7d00b90a3209cdeaabe2f5811a8155e549f865f1e9d33026eec6c70b3426d9b83b5f1db93625c46189dd12d014e2b6
7
- data.tar.gz: f09535c35e1c357d9c3392e0b00b199ec2886f0123604010ba48c8af8e09dd96f4ad79c1bd418d5550e63f768f49a23b3678c66e069f8bd662052d5dffe39d1d
6
+ metadata.gz: 3e633ffe84de6f9c970433ebcda6000a5e307a973162bda15625b3c6af37b2d86ac9fe1498a575dbcee8012b143db417f61171ac7f1bf0ef764e9f3ece3ee6d1
7
+ data.tar.gz: c328bb4541a334da2fbbe508de05562fa08d79627f7edc6e9113949701b9b409b7fb6862e220018ab77ec01a2a95eeaf9a6543b997e9ce54057012e1730f57be
data/lib/yahoo_finanza.rb CHANGED
@@ -4,4 +4,11 @@ require 'yahoo_finanza/workers'
4
4
  require 'yahoo_finanza/client'
5
5
 
6
6
  module YahooFinanza
7
+ def self.root
8
+ File.expand_path '../..', __FILE__
9
+ end
10
+
11
+ def self.config_path
12
+ File.join(root, 'config')
13
+ end
7
14
  end
@@ -4,32 +4,16 @@ module YahooFinanza
4
4
  module Constants
5
5
  extend self
6
6
 
7
- def nyse
8
- YAML.load(File.read(File.join(Dir.pwd, "config/nyse.yml")))["nyse_symbols"]
7
+ %w(nyse amex nasdaq sp_500).each do |market|
8
+ define_method(market) do
9
+ YAML.load(File.read(File.join(YahooFinanza.config_path, "#{market}.yml")))["#{market}_symbols"]
10
+ end
9
11
  end
10
12
 
11
- def amex
12
- YAML.load(File.read(File.join(Dir.pwd, "config/amex.yml")))["amex_symbols"]
13
- end
14
-
15
- def nasdaq
16
- YAML.load(File.read(File.join(Dir.pwd, "config/nasdaq.yml")))["nasdaq_symbols"]
17
- end
18
-
19
- def sp_500
20
- YAML.load(File.read(File.join(Dir.pwd, "config/sp_500.yml")))["sp_500_symbols"]
21
- end
22
-
23
- def active_nyse_url
24
- YAML.load(File.read(File.join(Dir.pwd, "config/config.yml")))["active_nyse_url"]
25
- end
26
-
27
- def active_nnm_url
28
- YAML.load(File.read(File.join(Dir.pwd, "config/config.yml")))["active_nnm_url"]
29
- end
30
-
31
- def search_url
32
- YAML.load(File.read(File.join(Dir.pwd, "config/config.yml")))["search_url"]
13
+ %w(active_nyse_url active_nnm_url search_url).each do |url|
14
+ define_method(url) do
15
+ YAML.load(File.read(File.join(YahooFinanza.config_path, "config.yml")))["#{url}"]
16
+ end
33
17
  end
34
18
  end
35
19
  end
@@ -1,4 +1,4 @@
1
1
  # Yahoo Finanza Version
2
2
  module YahooFinanza
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.6'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_finanza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric D. Santos