Skip to content

Commit 69abe62

Browse files
committed
URI.open, rather than Kernel#open
1 parent cfda118 commit 69abe62

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs-source/dataflow_top_stock_calc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require 'open-uri'
2222
def get_year_end_closing(symbol, year, api_key)
2323
uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv"
2424
data = []
25-
open(uri) do |f|
25+
URI.open(uri) do |f|
2626
CSV.parse(f, headers: true) do |row|
2727
data << row['close'] if row['timestamp'].include?(year.to_s)
2828
end

docs-source/future.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ A fulfilled example:
2222
```ruby
2323
require 'concurrent'
2424
require 'thread' # for Queue
25-
require 'open-uri' # for open(uri)
25+
require 'open-uri' # for URI.open(uri)
2626

2727
class Ticker
2828
def get_year_end_closing(symbol, year)
2929
uri = "http://ichart.finance.yahoo.com/table.csv?s=#{symbol}&a=11&b=01&c=#{year}&d=11&e=31&f=#{year}&g=m"
30-
data = open(uri) {|f| f.collect{|line| line.strip } }
30+
data = URI.open(uri) {|f| f.collect{|line| line.strip } }
3131
data[1].split(',')[4].to_f
3232
end
3333
end

docs-source/top-stock-scala/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require 'open-uri'
3535
def get_year_end_closing(symbol, year, api_key)
3636
uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv"
3737
data = []
38-
open(uri) do |f|
38+
URI.open(uri) do |f|
3939
CSV.parse(f, headers: true) do |row|
4040
data << row['close'] if row['timestamp'].include?(year.to_s)
4141
end

docs-source/top-stock-scala/top-stock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def get_year_end_closing(symbol, year, api_key)
66
uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv"
77
data = []
8-
open(uri) do |f|
8+
URI.open(uri) do |f|
99
CSV.parse(f, headers: true) do |row|
1010
data << row['close'] if row['timestamp'].include?(year.to_s)
1111
end

lib/concurrent-ruby/concurrent/scheduled_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ module Concurrent
5959
#
6060
# require 'concurrent'
6161
# require 'thread' # for Queue
62-
# require 'open-uri' # for open(uri)
62+
# require 'open-uri' # for URI.open(uri)
6363
#
6464
# class Ticker
6565
# def get_year_end_closing(symbol, year)
6666
# uri = "http://ichart.finance.yahoo.com/table.csv?s=#{symbol}&a=11&b=01&c=#{year}&d=11&e=31&f=#{year}&g=m"
67-
# data = open(uri) {|f| f.collect{|line| line.strip } }
67+
# data = URI.open(uri) {|f| f.collect{|line| line.strip } }
6868
# data[1].split(',')[4].to_f
6969
# end
7070
# end

0 commit comments

Comments
 (0)