lib/dryrun/dryrun_utils.rb in dryrun-0.7.2 vs lib/dryrun/dryrun_utils.rb in dryrun-0.7.3

- old
+ new

@@ -17,12 +17,19 @@ def self.get_latest_version url = 'https://raw.githubusercontent.com/cesarferreira/dryrun/master/lib/dryrun/version.rb' page_string = nil - open(url) do |f| - page_string = f.read - end + if Gem.win_platform? + open(url, {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}) do |f| + page_string = f.read + end + else + open(url) do |f| + page_string = f.read + end + end + page_string[/#{Regexp.escape('\'')}(.*?)#{Regexp.escape('\'')}/m, 1] end def self.is_up_to_date