Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File.exists? method was removed in ruby 3.2 #188

Closed
rassas opened this issue Jan 13, 2023 · 0 comments
Closed

File.exists? method was removed in ruby 3.2 #188

rassas opened this issue Jan 13, 2023 · 0 comments

Comments

@rassas
Copy link
Contributor

rassas commented Jan 13, 2023

Which SDK version are you using?

v0.15.0.0

What's the issue?

Compatibility with ruby 3.2

Method File.exists? was removed from ruby 3.2

@rassas rassas changed the title File.exists? method is removed in ruby version 3.2 File.exists? method was removed in ruby version 3.2 Jan 13, 2023
@rassas rassas changed the title File.exists? method was removed in ruby version 3.2 File.exists? method was removed in ruby 3.2 Jan 13, 2023
facebook-github-bot pushed a commit that referenced this issue Jan 26, 2023
Summary:
Fix #188
Method [File.exists?](https://github.com/facebook/facebook-ruby-business-sdk/blob/v0.15.0.0/lib/facebook_ads/field_types/upload_file.rb#L117) was removed from [ruby 3.2](https://bugs.ruby-lang.org/issues/17391)

Pull Request resolved: #189

Reviewed By: stcheng

Differential Revision: D42627295

Pulled By: alanho

fbshipit-source-id: c3498e7aae081cfd991514291ae9f8261353a787
ssankim added a commit to shakrmedia/facebookbusiness-shakr that referenced this issue Jul 31, 2023
* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: jingping2015

Differential Revision: D37562917

fbshipit-source-id: 03e474b82028ea50d36dcd10953220f9b01950f0

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: jawwad

Differential Revision: D40691138

fbshipit-source-id: 36c1249d96eb345c66c58dc3f621c90999055dff

* Bump rexml from 3.2.4 to 3.2.5 (facebook#140)

Summary:
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.4 to 3.2.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/ruby/rexml/blob/master/NEWS.md">rexml's changelog</a>.</em></p>
<blockquote>
<h2>3.2.5 - 2021-04-05 {#version-3-2-5}</h2>
<h3>Improvements</h3>
<ul>
<li>
<p>Add more validations to XPath parser.</p>
</li>
<li>
<p><code>require &quot;rexml/document&quot;</code> by default.
[GitHub#36][Patch by Koichi ITO]</p>
</li>
<li>
<p>Don't add <code>#dcloe</code> method to core classes globally.
[GitHub#37][Patch by Akira Matsuda]</p>
</li>
<li>
<p>Add more documentations.
[Patch by Burdette Lamar]</p>
</li>
<li>
<p>Added <code>REXML::Elements#parent</code>.
[GitHub#52][Patch by Burdette Lamar]</p>
</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>
<p>Fixed a bug that <code>REXML::DocType#clone</code> doesn't copy external ID
information.</p>
</li>
<li>
<p>Fixed round-trip vulnerability bugs.
See also: <a href="https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965/">https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965/</a>
[HackerOne#1104077][CVE-2021-28965][Reported by Juho Nurminen]</p>
</li>
</ul>
<h3>Thanks</h3>
<ul>
<li>
<p>Koichi ITO</p>
</li>
<li>
<p>Akira Matsuda</p>
</li>
<li>
<p>Burdette Lamar</p>
</li>
<li>
<p>Juho Nurminen</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/ruby/rexml/commit/a622645e980ea5b91ad7b4d6fec32d113f15df88"><code>a622645</code></a> Add 3.2.5 entry</li>
<li><a href="https://github.com/ruby/rexml/commit/3c137eb119550874b2b3e27d12b733ca67033377"><code>3c137eb</code></a> Fix a parser bug that some data may be ignored before DOCTYPE</li>
<li><a href="https://github.com/ruby/rexml/commit/9b311e59ae05749e082eb6bbefa1cb620d1a786e"><code>9b311e5</code></a> Fix a bug that invalid document declaration may be accepted</li>
<li><a href="https://github.com/ruby/rexml/commit/f9d88e4948b4a43294c25dc0edb16815bd9d8618"><code>f9d88e4</code></a> Fix a bug that invalid document declaration may be generated</li>
<li><a href="https://github.com/ruby/rexml/commit/f7bab8937513b1403cea5aff874cbf32fd5e8551"><code>f7bab89</code></a> Fix a bug that invalid element end may be accepted</li>
<li><a href="https://github.com/ruby/rexml/commit/6a250d2cd1194c2be72becbdd9c3e770aa16e752"><code>6a250d2</code></a> Fix a bug that invalid element start may be accepted</li>
<li><a href="https://github.com/ruby/rexml/commit/2fe62e29094d95921d7e19abbd2e26b23d78dc5b"><code>2fe62e2</code></a> Fix a bug that invalid notation declaration may be accepted</li>
<li><a href="https://github.com/ruby/rexml/commit/a659c63e37414506dfb0d4655e031bb7a2e73fc8"><code>a659c63</code></a> Fix a bug that invalid notation declaration may be generated</li>
<li><a href="https://github.com/ruby/rexml/commit/790dd113ce693ce831cbbc53f2f990a317643f75"><code>790dd11</code></a> Use ruby/setup-ruby (<a href="https://github-redirect.dependabot.com/ruby/rexml/issues/66">https://github.com/facebook/facebook-ruby-business-sdk/issues/66</a>)</li>
<li><a href="https://github.com/ruby/rexml/commit/eda1b2007dd8751f381bf741f16c9e33c5d3e52a"><code>eda1b20</code></a> Clean up and enhance high-level RDoc (<a href="https://github-redirect.dependabot.com/ruby/rexml/issues/65">https://github.com/facebook/facebook-ruby-business-sdk/issues/65</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/ruby/rexml/compare/v3.2.4...v3.2.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rexml&package-manager=bundler&previous-version=3.2.4&new-version=3.2.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/facebook-ruby-business-sdk/network/alerts).

</details>

Pull Request resolved: facebook#140

Differential Revision: D41279979

Pulled By: stcheng

fbshipit-source-id: 139e202266a6c4495cbc731d2b3f89f85532c942

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: mengxuanzhangz

Differential Revision: D42508095

fbshipit-source-id: 8ba38b48e64f5dc026287e3d0309f9ba04ea9e21

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: mengxuanzhangz

Differential Revision: D42560829

fbshipit-source-id: a1cb970c0ed1f797a8538194ec7d97bd31100fcd

* Ruby 3.2 compatibility (facebook#189)

Summary:
Fix facebook#188
Method [File.exists?](https://github.com/facebook/facebook-ruby-business-sdk/blob/v0.15.0.0/lib/facebook_ads/field_types/upload_file.rb#L117) was removed from [ruby 3.2](https://bugs.ruby-lang.org/issues/17391)

Pull Request resolved: facebook#189

Reviewed By: stcheng

Differential Revision: D42627295

Pulled By: alanho

fbshipit-source-id: c3498e7aae081cfd991514291ae9f8261353a787

* Update build environment to Ruby 3.0.5

Summary: Ruby 2.4 has reach EOL and 2.7 is EOL in a month or so. So updating our build enviroment to 3.0.5

Reviewed By: stcheng

Differential Revision: D42626793

fbshipit-source-id: 583101e289e284bc1960a205690b4101c5022045

* modernize gem dependencies

Summary:
update few gem to more updated versions.

fixed missing require issue after using more updated faraday gem

Reviewed By: stcheng

Differential Revision: D42781435

fbshipit-source-id: 86d8059e23558d10227b434c3b38c70f1eb669d1

* Support version 5 of the countries gem (facebook#180)

Summary:
It drops support for Ruby <2.7, as those are EOL: https://github.com/countries/countries/blob/9046bc79298986554f01ce6363c9310b1081a8f4/CHANGELOG.md#500-20220403-1744-0000

Otherwise this library only uses ISO3166::Country.search, which still works in a compatible way:

https://github.com/facebook/facebook-ruby-business-sdk/blob/f2e6f54084ee50c16acbb31410acd60aa5c44fda/lib/facebook_ads/ad_objects/server_side/util.rb#L137

Removed from add_development_dependency because I don't see it being used in dev, and AFAIK if it's in the regular dependencies, we don't need to repeat it in the development dependencies anyway.

Did not update Gemfile.lock since it doesn't appear to be kept up to date.

Pull Request resolved: facebook#180

Reviewed By: stcheng

Differential Revision: D42571235

Pulled By: alanho

fbshipit-source-id: 45c5141aed9ff2b5dfb700e6acf972f56a882135

* Allow overriding of access_token for EventRequest (facebook#181)

Summary:
This allows conversion events to be sent with a different access token (e.g. the one generated via the the Events Manager following the instructions [here](https://www.facebook.com/business/help/232481544843294?id=818859032317965)) than the one used for other API interactions (i.e. the OAuth access token).

Pull Request resolved: facebook#181

Reviewed By: stcheng

Differential Revision: D42838217

Pulled By: alanho

fbshipit-source-id: 9e81c3aff329803ce520b99282aece9eb978f68c

* Properly determine if edge has a next page based off `next` key (facebook#146)

Summary:
Currently, with regards to pagination, the library assumes that if there are fewer results than `limit`, there will not be a next page of results. This is not always true, as explained in the docs (quoted below). The proper way to determine whether there is a next page of results is by keying off the presence of the `next` key.

From [the docs](https://developers.facebook.com/docs/graph-api/using-graph-api/#cursors):

> **limit:** This is the maximum number of objects that may be returned. A query may return fewer than the value of limit due to filtering. Do not depend on the number of results being fewer than the limit value to indicate that your query reached the end of the list of data, use the absence of next instead as described below. For example, if you set limit to 10 and 9 results are returned, there may be more data available, but one item was removed due to privacy filtering. Some edges may also have a maximum on the limit value for performance reasons. In all cases, the API returns the correct pagination links.

> **next:** The Graph API endpoint that will return the next page of data. If not included, this is the last page of data. Due to how pagination works with visibility and privacy, it is possible that a page may be empty but contain a next paging link. Stop paging when the next link no longer appears.

Pull Request resolved: facebook#146

Reviewed By: stcheng

Differential Revision: D42838342

Pulled By: alanho

fbshipit-source-id: 98bc40007db10b1c51f012ba985021f1c72f2630

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: mengxuanzhangz

Differential Revision: D42982388

fbshipit-source-id: 3cbf0cc44e14c81a7ed63cf538230f0455b92e7e

* Add Ruby 3.2 to CI (facebook#193)

Summary: Pull Request resolved: facebook#193

Test Plan: n/a

Reviewed By: alanho

Differential Revision: D43473331

Pulled By: stcheng

fbshipit-source-id: bc123bc9a802adbab602ac967cad987350df38d7

* Support App CAPI

Summary:
Update Business SDK (serverside) to support App CAPI.
The current Business SDK only support web CAPI. This diff is to support App CAPI for Ruby.

Reviewed By: stcheng

Differential Revision: D43864089

fbshipit-source-id: 169dead2a506a5cc3fba2a570593e19f1e79f2e7

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: enamshah09

Differential Revision: D44061979

fbshipit-source-id: fdcb9d94419cc99538d9ba3df7a50515e090974d

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Differential Revision: D44467974

fbshipit-source-id: d5a679857a6d372a3da9d6f68c48a340535b4dda

* Update All README.md badges

Summary:
[BizSDK] Update All README.md badges

Fix all badges for all repositories;
Fix certain typos

Differential Revision: D44524913

fbshipit-source-id: c9f594b8a4f8063d0c9fcc42702313f92c872ed1

* Align Ruby Gem Version with Other SDK Versions

Summary:
[BizSDK][Ruby] Align Ruby Gem Version with Other SDK Versions

Make Ruby version format the same as the other languages.
Update version bumping script to remove ruby specific logic.
Remove unused functions.

Reviewed By: alanho

Differential Revision: D44552539

fbshipit-source-id: a27681494d624733c6b68ad1a6bcb21db1a3017b

* add 'advanced_measurement_table' arg

Summary: Argument added to CAPI Graph endpoint in D28614990, reflecting the changes in the SDK as well

Reviewed By: stcheng

Differential Revision: D44366726

fbshipit-source-id: e7b6aedfe34afb61c9366d607b5b22fa61694cc7

* fixed wrong var name in shortcut

Summary:
Calling FacebookAds::ad_account(123) is returning error

```
irb(main):004:0> FacebookAds::ad_account(123)
/Users/alanho/fbsource/business-sdk/sdk/servers/ruby/release/lib/facebook_ads/helpers/shortcuts.rb:26:in `ad_account': undefined local variable or method `id' for FacebookAds:Module (NameError)
        from (irb):4:in `<main>'
        from /Users/alanho/.rubies/ruby-3.0.5/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
        from /Users/alanho/.rubies/ruby-3.0.5/bin/irb:23:in `load'
        from /Users/alanho/.rubies/ruby-3.0.5/bin/irb:23:in `<main>'
```

Reviewed By: stcheng

Differential Revision: D42953149

fbshipit-source-id: 97cb3298bd493e5ef880c768e120598f742ea215

* fixed namespace for DateTime

Summary: to avoid namespace collision, force to use ::DateTime

Reviewed By: stcheng

Differential Revision: D42959136

fbshipit-source-id: 83bf411943f71bbc878fcc72320a99d64c13d941

* Auto-generated ruby SDK code update

Summary: ignore-conflict-markers

Reviewed By: stcheng

Differential Revision: D46256524

fbshipit-source-id: bc7b8cde2eff2ea9c44e2b3bd1737318c1958559

* Remove Single Quote Marks Completely to Avoid Bugs

Summary:
[BizSDK] Remove Single Quote Marks Completely to Avoid Bugs

The introduction of single quote marks breaks languages, e.g. Python, Ruby, and PHP. Remove this entirely to mitigate this issue immediately and unblock the release of v18.

Reviewed By: mengxuanzhangz

Differential Revision: D46813106

fbshipit-source-id: d39d417b61d59c38a35d8674c7a7679defc1e31d

* Bump Version to 17.0.1 to Address Single Quote Issue

Summary:
[BizSDK] Bump Version to 17.0.1 to Address Single Quote Issue

Bump the version to release a new minor version to address the issue

Reviewed By: mengxuanzhangz

Differential Revision: D46815647

fbshipit-source-id: 7c2be171a10452aa7d3870592f0861a5399111e0

* Update README on Ruby Version Requirement

Summary:
[BizSDK][Ruby] Update README on Ruby Version Requirement

ref: facebook@00e7668

Reviewed By: alanho

Differential Revision: D47648279

fbshipit-source-id: f60dad0374630c6c137df94d8c66af99cd4dc6cf

* Update faraday dependency to 1.0

* Fix

* Restove creative_folders edge

---------

Co-authored-by: Shuotian Cheng <shuotian@fb.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: generatedunixname89002005295453 <generatedunixname89002005295453@fb.com>
Co-authored-by: Achref <rassasachref@gmail.com>
Co-authored-by: Alan Ho <alanho@fb.com>
Co-authored-by: Henrik Nyh <henrik@nyh.se>
Co-authored-by: Ian Cole <imcole@pm.me>
Co-authored-by: Colby Aley <colby@clearbit.com>
Co-authored-by: Thomas Dippel <dipth@users.noreply.github.com>
Co-authored-by: Yifan Liu <yifan0726@fb.com>
Co-authored-by: Abdulrahman Alsaudi <aalsaudi@meta.com>
Co-authored-by: Alan Ho <alanho@meta.com>
Co-authored-by: Shuotian Cheng <shuotian@meta.com>
Co-authored-by: San Kim <uisan@me.com>
afn pushed a commit to cygnuseducation/facebook-ruby-business-sdk that referenced this issue Nov 1, 2023
Summary:
Fix facebook#188
Method [File.exists?](https://github.com/facebook/facebook-ruby-business-sdk/blob/v0.15.0.0/lib/facebook_ads/field_types/upload_file.rb#L117) was removed from [ruby 3.2](https://bugs.ruby-lang.org/issues/17391)

Pull Request resolved: facebook#189

Reviewed By: stcheng

Differential Revision: D42627295

Pulled By: alanho

fbshipit-source-id: c3498e7aae081cfd991514291ae9f8261353a787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant