Skip to content

Commit

Permalink
Fix rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed Apr 8, 2024
1 parent 61447c4 commit cee9253
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cloudinary.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.required_ruby_version = '~> 3'

s.add_dependency "faraday", ">= 2.0.1", "< 3.0.0"
s.add_dependency "faraday-multipart", "~> 1.0", ">= 1.0.4"

s.add_development_dependency 'faraday-follow_redirects', '~> 0.3.0'
s.add_development_dependency "rails", ">= 6.1.7", "< 8.0.0"
s.add_development_dependency "rexml", ">= 3.2.5", "< 4.0.0"
s.add_development_dependency "actionpack", ">= 6.1.7", "< 8.0.0"
Expand Down
8 changes: 7 additions & 1 deletion lib/tasks/cloudinary/fetch_assets.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'tmpdir'
require 'faraday'
require 'faraday/follow_redirects'
require 'json'
require 'rubygems/package'
require 'stringio'

unless Rake::Task.task_defined?('cloudinary:fetch_assets') # prevent double-loading/execution
namespace :cloudinary do
Expand All @@ -20,7 +22,11 @@ unless Rake::Task.task_defined?('cloudinary:fetch_assets') # prevent double-load
FileUtils.mkdir_p js_folder

puts "Fetching cloudinary_js version #{release["tag_name"]}\n\n"
sio = StringIO.new(Faraday.get(release["tarball_url"]).body)
conn = Faraday.new do |faraday|
faraday.response :follow_redirects
faraday.adapter Faraday.default_adapter
end
sio = StringIO.new(conn.get(release["tarball_url"]).body)
file = Zlib::GzipReader.new(sio)
tar = Gem::Package::TarReader.new(file)
tar.each_entry do |entry|
Expand Down

0 comments on commit cee9253

Please sign in to comment.