Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Workaround rake 0.9.1 deprecations

  • Loading branch information...
commit 5d2b9e8089d05af50ee11221b9b25a39b9fefcaf 1 parent 01046f5
@luislavena luislavena authored
View
8 rake/contrib/uri_ext.rb
@@ -234,7 +234,7 @@ class HTTP #:nodoc:
def read(options = nil, &block)
options ||= {}
connect do |http|
- puts "Requesting #{self}" if verbose
+ puts "Requesting #{self}" if Rake.application.options.verbose
headers = { 'If-Modified-Since' => CGI.rfc1123_date(options[:modified].utc) } if options[:modified]
request = Net::HTTP::Get.new(request_uri.empty? ? '/' : request_uri, headers)
request.basic_auth self.user, self.password if self.user
@@ -242,14 +242,14 @@ def read(options = nil, &block)
case response
when Net::HTTPNotModified
# No modification, nothing to do.
- puts 'Not modified since last download' if verbose
+ puts 'Not modified since last download' if Rake.application.options.verbose
return nil
when Net::HTTPRedirection
# Try to download from the new URI, handle relative redirects.
- puts "Redirected to #{response['Location']}" if verbose
+ puts "Redirected to #{response['Location']}" if Rake.application.options.verbose
return (self + URI.parse(response['location'])).read(options, &block)
when Net::HTTPOK
- puts "Downloading #{self}" if verbose
+ puts "Downloading #{self}" if Rake.application.options.verbose
result = nil
with_progress_bar options[:progress], path.split('/').last, response.content_length do |progress|
if block
View
19 recipes/packager/inno.rake
@@ -135,7 +135,7 @@ end
# if SIGNED was specified, chain signtool verification to innosetup check
if ENV['SIGNED'] then
- task :innosetup, :needs => [:signtool]
+ task :innosetup => [:signtool]
end
directory 'pkg'
@@ -160,8 +160,7 @@ directory 'pkg'
"resources/installer/config-#{version_xyz}.iss"
]
- file "resources/installer/config-#{version_xyz}.iss",
- :needs => ['resources/installer/config.iss.erb'] do |t|
+ file "resources/installer/config-#{version_xyz}.iss" => ['resources/installer/config.iss.erb'] do |t|
guid = pkg.installer_guid
contents = ERB.new(File.read(t.prerequisites.first)).result(binding)
@@ -170,9 +169,7 @@ directory 'pkg'
end
end
- file 'resources/installer/changes.txt',
- :needs => ['pkg', 'History.txt'] do |t|
-
+ file 'resources/installer/changes.txt' => ['pkg', 'History.txt'] do |t|
contents = File.read('History.txt')
latest = contents.split(/^(===+ .*)/)[1..2].join.strip
@@ -182,9 +179,7 @@ directory 'pkg'
end
# installer
- file "pkg/#{installer_pkg}.exe",
- :needs => ['pkg', "ruby#{namespace_ver}:docs", :book, *files] do
-
+ file "pkg/#{installer_pkg}.exe" => ['pkg', "ruby#{namespace_ver}:docs", :book, *files] do
options = {
:ruby_version => info[:version],
:ruby_lib_version => info[:lib_version],
@@ -202,10 +197,10 @@ directory 'pkg'
# define the packaging task for the version
namespace "ruby#{namespace_ver}" do
desc "generate #{installer_pkg}.exe"
- task :package, :needs => [:innosetup, "pkg/#{installer_pkg}.exe"]
+ task :package => [:innosetup, "pkg/#{installer_pkg}.exe"]
desc "install #{installer_pkg}.exe"
- task :install, :needs => [:package] do
+ task :install => [:package] do
sh "pkg/#{installer_pkg}.exe /LOG=pkg/#{installer_pkg}.log"
end
@@ -215,7 +210,7 @@ directory 'pkg'
end
desc "rebuild #{installer_pkg}.exe"
- task :repackage, :needs => [:clobber, :package]
+ task :repackage => [:clobber, :package]
end
end
end
View
8 recipes/tools/docs.rake
@@ -91,7 +91,7 @@ interpreters.each do |package|
end
# meta package depends on individual chm files
- file meta_chm.file, :needs => [chm_file]
+ file meta_chm.file => [chm_file]
end
# generate index
@@ -119,7 +119,7 @@ interpreters.each do |package|
end
# add index to the metapackge dependency
- file meta_chm.file, :needs => [index]
+ file meta_chm.file => [index]
# generate meta package
file meta_chm.file do
@@ -148,9 +148,9 @@ interpreters.each do |package|
end
desc "build docs for #{version}"
- task :docs, :needs => ['docs:htmlhelp', meta_chm.file]
+ task :docs => ['docs:htmlhelp', meta_chm.file]
desc "rebuild docs for #{version}"
- task :redocs, :needs => [:clobber_docs, :docs]
+ task :redocs => [:clobber_docs, :docs]
end
end

4 comments on commit 5d2b9e8

@jonforums
Owner

this commit appears to have introduced trailing whitespace problems

C:\projects\rubyinstaller-git>git diff HEAD..HEAD~1 --check
recipes/packager/inno.rake:173: trailing whitespace.
+    file 'resources/installer/changes.txt',
recipes/tools/docs.rake:94: trailing whitespace.
+    file meta_chm.file, :needs => [chm_file]^M
recipes/tools/docs.rake:122: trailing whitespace.
+  file meta_chm.file, :needs => [index]^M
recipes/tools/docs.rake:151: trailing whitespace.
+    task :docs, :needs => ['docs:htmlhelp', meta_chm.file]^M
recipes/tools/docs.rake:154: trailing whitespace.
+    task :redocs, :needs => [:clobber_docs, :docs]^M
@luislavena
Owner

The problem is that docs.rake was CRLF. git doesn't like that for diff.

@jonforums
Owner

yes, and there are 2 types of whitespace problems with this commit...the CRLF mode of docs.rake and the trailing space in inno.rake which isn't CRLF. I thought we'd changed all the files to LF mode but it looks like docs.rake snuck through.

@luislavena
Owner

Yeah, a bummer.

Please introduce independent commits that change line endings and we can live with it :-)

Please sign in to comment.
Something went wrong with that request. Please try again.