[DRE-commits] [rails-3.2] 05/11: add patches from ruby-railties-3.2 source package
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat Dec 14 19:13:25 UTC 2013
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository rails-3.2.
commit 9aa2bf13fd9528bd7c3413e781039d97e04ddec1
Author: Antonio Terceiro <terceiro at debian.org>
Date: Sat Dec 14 14:15:17 2013 -0300
add patches from ruby-railties-3.2 source package
---
debian/patches/be-carefull-with-that-bundler.patch | 41 +++++++++++++++++++
debian/patches/fix-rake-tmp-tasks.patch | 46 ++++++++++++++++++++++
debian/patches/series | 2 +
3 files changed, 89 insertions(+)
diff --git a/debian/patches/be-carefull-with-that-bundler.patch b/debian/patches/be-carefull-with-that-bundler.patch
new file mode 100644
index 0000000..a3dad8e
--- /dev/null
+++ b/debian/patches/be-carefull-with-that-bundler.patch
@@ -0,0 +1,41 @@
+Description: Be careful with that bundler
+ on Debian, Rails must preferably use Debian packages, while not stopping the
+ users to get stuff from Rubygems if they want.
+ .
+ This way, when creating a new application, we run `bundle install --local`
+ instead of `bundle install`, to make sure bundler does not download anything
+ from Rubygems. That's not because I don't like Rubygems, but because
+ everything the user will need to run this new app (sqlite3, sass-rails,
+ coffee-rails) is already installed by means of Debian packages. If the user
+ does want to use Rubygems packages after that, she will just edit the Gemfile,
+ run `bundle install`, and bundler will to its thing as usual.
+ .
+ This is patch is most probably Debian-specific.
+Author: Antonio Terceiro <terceiro at debian.org>
+
+--- ruby-railties-3.2-3.2.6.orig/railties/lib/rails/generators/app_base.rb
++++ ruby-railties-3.2-3.2.6/railties/lib/rails/generators/app_base.rb
+@@ -241,21 +241,11 @@ module Rails
+ def bundle_command(command)
+ say_status :run, "bundle #{command}"
+
+- # We are going to shell out rather than invoking Bundler::CLI.new(command)
+- # because `rails new` loads the Thor gem and on the other hand bundler uses
+- # its own vendored Thor, which could be a different version. Running both
+- # things in the same process is a recipe for a night with paracetamol.
+- #
+- # We use backticks and #print here instead of vanilla #system because it
+- # is easier to silence stdout in the existing test suite this way. The
+- # end-user gets the bundler commands called anyway, so no big deal.
+- #
+- # Thanks to James Tucker for the Gem tricks involved in this call.
+- print `"#{Gem.ruby}" -rubygems "#{Gem.bin_path('bundler', 'bundle')}" #{command}`
++ print `"#{Gem.ruby}" -rubygems /usr/bin/bundle #{command}`
+ end
+
+ def run_bundle
+- bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle]
++ bundle_command('install --local') unless options[:skip_gemfile] || options[:skip_bundle]
+ end
+
+ def empty_directory_with_gitkeep(destination, config = {})
diff --git a/debian/patches/fix-rake-tmp-tasks.patch b/debian/patches/fix-rake-tmp-tasks.patch
new file mode 100644
index 0000000..a21b1fa
--- /dev/null
+++ b/debian/patches/fix-rake-tmp-tasks.patch
@@ -0,0 +1,46 @@
+--- a/railties/lib/rails/tasks/tmp.rake
++++ b/railties/lib/rails/tasks/tmp.rake
+@@ -4,34 +4,38 @@ namespace :tmp do
+
+ desc "Creates tmp directories for sessions, cache, sockets, and pids"
+ task :create do
+- FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets tmp/pids tmp/cache/assets ))
++ FileUtils.mkdir_p(File.join(Rails.configuration.paths["tmp"],"sessions"))
++ FileUtils.mkdir_p(File.join(Rails.configuration.paths["tmp"],"cache"))
++ FileUtils.mkdir_p(File.join(Rails.configuration.paths["tmp"],"sockets"))
++ FileUtils.mkdir_p(File.join(Rails.configuration.paths["tmp"],"pids"))
++ FileUtils.mkdir_p(File.join(Rails.configuration.paths["tmp"],"cache/assets"))
+ end
+
+ namespace :sessions do
+ # desc "Clears all files in tmp/sessions"
+ task :clear do
+- FileUtils.rm(Dir['tmp/sessions/[^.]*'])
++ FileUtils.rm(Dir[File.join(Rails.configuration.paths["tmp"],'sessions/[^.]*')])
+ end
+ end
+
+ namespace :cache do
+ # desc "Clears all files and directories in tmp/cache"
+ task :clear do
+- FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
++ FileUtils.rm_rf(Dir[File.join(Rails.configuration.paths["tmp"],'cache/[^.]*')])
+ end
+ end
+
+ namespace :sockets do
+ # desc "Clears all files in tmp/sockets"
+ task :clear do
+- FileUtils.rm(Dir['tmp/sockets/[^.]*'])
++ FileUtils.rm(Dir[File.join(Rails.configuration.paths["tmp"],'sockets/[^.]*')])
+ end
+ end
+
+ namespace :pids do
+ # desc "Clears all files in tmp/pids"
+ task :clear do
+- FileUtils.rm(Dir['tmp/pids/[^.]*'])
++ FileUtils.rm(Dir[File.join(Rails.configuration.paths["tmp"],'pids/[^.]*')])
+ end
+ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index d3b3b4e..d9a2ce7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
port-to-minitest.patch
Remove_rubygems_dependency.patch
+be-carefull-with-that-bundler.patch
+fix-rake-tmp-tasks.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rails-3.2.git
More information about the Pkg-ruby-extras-commits
mailing list