Skip to content

Commit f15627c

Browse files
Tom OsowskimargstanPimentoso
authored
Ruby 3.0.0 Compatibility (#259)
* Ruby 3.0.0 Compatibility: Change &Proc.new to &block (#253) * Fix TwitterAds::Analytics.fetch_async_job_data for Ruby 3 (#256) * add back Account entity in Analytics class * add back Account entity in Analytics class * fix Kernel.open to URI.open * Add Ruby 3.0 to build matrix * Add support for latest Ruby version to readme Co-authored-by: margstan <79088430+margstan@users.noreply.github.com> Co-authored-by: Michele Ferri <ferrimiche@gmail.com>
1 parent 8a77180 commit f15627c

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
ruby_version: [2.7, 2.6.4, 2.5.6, 2.4.7]
24+
ruby_version: [3.0, 2.7, 2.6.4, 2.5.6, 2.4.7]
2525
os: [ubuntu, macos]
2626

2727
steps:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This project is designed to work with Ruby 2.4.0 or greater. While it may work o
5252

5353
Platform | Versions
5454
-------- | --------
55-
MRI | 2.4.x, 2.5.x, 2.6.x
55+
MRI | 2.4.x, 2.5.x, 2.6.x, 2.7, 3.0
5656
Rubinius | 2.4.x, 2.5.x
5757

5858
All releases adhere to strict [semantic versioning](http://semver.org). For Example, major.minor.patch-pre (aka. stick.carrot.oops-peek).
@@ -89,7 +89,7 @@ Like the [Response](https://github.com/twitterdev/twitter-ruby-ads-sdk/blob/mast
8989

9090
The MIT License (MIT)
9191

92-
Copyright (C) 2019 Twitter, Inc.
92+
Copyright (C) 2021 Twitter, Inc.
9393

9494
Permission is hereby granted, free of charge, to any person obtaining a copy
9595
of this software and associated documentation files (the "Software"), to deal

lib/twitter-ads/cursor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ def next
5656
# @return [Cursor] The current Cursor instance.
5757
#
5858
# @since 0.1.0
59-
def each(offset = 0)
59+
def each(offset = 0, &block)
6060
return to_enum(:each, offset) unless block_given?
6161
@collection[offset..-1].each { |element| yield(element) }
6262
unless exhausted?
6363
offset = [@collection.size, offset].max
6464
fetch_next
65-
each(offset, &Proc.new)
65+
each(offset, &block)
6666
end
6767
self
6868
end

lib/twitter-ads/resources/analytics.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def fetch_async_job_data(data_url)
211211
tries = 0
212212
begin
213213
tries += 1
214-
raw_file = open(data_url)
214+
raw_file = URI.open(data_url)
215215
unzipped_file = Zlib::GzipReader.new(raw_file)
216216
response_data = unzipped_file.read
217217
response = JSON.parse(response_data)

0 commit comments

Comments
 (0)