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

Sync was extracted from std lib in ruby 2.7 #19682

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jan 3, 2020

Add the gem for forward compatibility.

Found in #19678

Add the gem for forward compatibility.

Found in ManageIQ#19678
@jrafanie jrafanie mentioned this pull request Jan 3, 2020
18 tasks
@miq-bot
Copy link
Member

miq-bot commented Jan 3, 2020

Checked commit jrafanie@84be676 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@Fryguy
Copy link
Member

Fryguy commented Jan 3, 2020

My only concern, that I can't tell from this PR, is whether or not sync 0.5.0 is what is being used in Ruby 2.5 / 2.6. If we are supporting multiple Rubies, should this line be postfixed with if RUBY_VERSION >= "2.7" or something to that effect?

@jrafanie
Copy link
Member Author

jrafanie commented Jan 3, 2020

My only concern, that I can't tell from this PR, is whether or not sync 0.5.0 is what is being used in Ruby 2.5 / 2.6. If we are supporting multiple Rubies, should this line be postfixed with if RUBY_VERSION >= "2.7" or something to that effect?

Great question. I forgot to mention that sync hasn't been changed in years. It looks like they just bumped the version to 0.5.0 and extracted it to a gem at that version:

02:43:59 ~/Code/ruby ((650c45dcd7...)) (2.5.7) + git diff upstream/ruby_2_5 upstream/ruby_2_6 lib/sync.rb
diff --git a/lib/sync.rb b/lib/sync.rb
index 40a48ac985..998e2b7b92 100644
--- a/lib/sync.rb
+++ b/lib/sync.rb
@@ -38,10 +38,6 @@
 #
 #

-unless defined? Thread
-  raise "Thread not available for this ruby interpreter"
-end
-
 ##
 # A module that provides a two-phase lock with a counter.

@@ -320,6 +316,9 @@ def sync_try_lock_sub(m)
 # details.

 class Sync
+
+  VERSION = "0.5.0"
+
   include Sync_m
 end

@djberg96
Copy link
Contributor

djberg96 commented Jan 6, 2020

👍

@Fryguy Fryguy merged commit 8d5e3fe into ManageIQ:master Jan 6, 2020
@Fryguy Fryguy self-assigned this Jan 6, 2020
@Fryguy Fryguy added this to the Sprint 127 Ending Jan 6, 2020 milestone Jan 6, 2020
@jrafanie jrafanie deleted the ruby_2_7_add_sync_gem branch January 6, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants