diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dec468..9cafd04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.9.0 +date: 2012-04-03 + + - joining forces with noexec from + [Joshua Hull - @joshbuddy](https://github.com/joshbuddy) + ## 0.3.0 date: 2012-04-02 diff --git a/Gemfile b/Gemfile index b977f30..c80ee36 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ source "http://rubygems.org" -# Specify your gem's dependencies in noexec.gemspec gemspec - -gem 'rake' \ No newline at end of file diff --git a/README.md b/README.md index 19579dc..e856661 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,19 @@ Let's stop using bundle exec, kthx. gem install rubygems-bundler -Then, in your .profile (or somewhere you can set env variables) +Add / Change a line in ~/.gemrc to: - RUBYOPT="-r`noexec`" - -And you're done! + custom_shebang: $env ruby_noexec_wrapper -Alternatively you can use rubygems-bundler to generate wrappers aware of noexec, install: +Next run (once): - gem install rubygems-bundler - -change a line in ~/.gemrc to: + gem regenerate_binstubs - custom_shebang: $env ruby_noexec_wrapper +And you're done! -and run (once): +Alternatively, in your .bashrc (or somewhere you can set env variables): - gem regenerate_binstubs + export RUBYOPT="-r`noexec`" ## Configuration @@ -90,7 +86,15 @@ and run `gem regenerate_binstubs` this will set all gems to `/usr/bin/env ruby` which is one of the safest choices (especially when using rvm). -# Controlling the wrapper - the old way +# Controlling the wrapper - the old way, the old wrapper + +Add / Change a line in ~/.gemrc to: + + custom_shebang: $env ruby_bundler_wrapper + +Next run (once): + + gem regenerate_binstubs Wrappers generated by this gem will replace original rubygems wrapper, but it will not change wrapper behavior unless explicitly asked for. diff --git a/bin/noexec b/bin/noexec index ca6e5eb..41fe557 100755 --- a/bin/noexec +++ b/bin/noexec @@ -1,3 +1,3 @@ #!/usr/bin/env ruby -print File.expand_path(File.expand_path("../../lib/noexec/auto.rb", __FILE__)) \ No newline at end of file +print File.expand_path(File.expand_path("../../lib/rubygems-bundler/noexec.rb", __FILE__)) diff --git a/bin/ruby_noexec_wrapper b/bin/ruby_noexec_wrapper index 1f0055e..a35be70 100644 --- a/bin/ruby_noexec_wrapper +++ b/bin/ruby_noexec_wrapper @@ -6,8 +6,9 @@ $PROGRAM_NAME=original_file require 'rubygems' begin - require 'noexec/auto' + require 'rubygems-bundler/noexec' rescue LoadError + warn "unable to load rubygems-bundler/noexec" if ENV.key?('NOEXEC_DEBUG') end eval File.read(original_file), binding, original_file diff --git a/lib/noexec/version.rb b/lib/noexec/version.rb deleted file mode 100644 index 825aa84..0000000 --- a/lib/noexec/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Noexec - VERSION = "0.1.0" -end diff --git a/lib/rubygems_bundler/fix_wrapper.rb b/lib/rubygems-bundler/fix_wrapper.rb similarity index 100% rename from lib/rubygems_bundler/fix_wrapper.rb rename to lib/rubygems-bundler/fix_wrapper.rb diff --git a/lib/noexec/auto.rb b/lib/rubygems-bundler/noexec.rb similarity index 100% rename from lib/noexec/auto.rb rename to lib/rubygems-bundler/noexec.rb diff --git a/lib/rubygems_bundler/regenerate_binstubs_command.rb b/lib/rubygems-bundler/regenerate_binstubs_command.rb similarity index 100% rename from lib/rubygems_bundler/regenerate_binstubs_command.rb rename to lib/rubygems-bundler/regenerate_binstubs_command.rb diff --git a/lib/rubygems_bundler/rubygems_bundler_installer.rb b/lib/rubygems-bundler/rubygems_bundler_installer.rb similarity index 100% rename from lib/rubygems_bundler/rubygems_bundler_installer.rb rename to lib/rubygems-bundler/rubygems_bundler_installer.rb diff --git a/lib/rubygems-bundler/version.rb b/lib/rubygems-bundler/version.rb new file mode 100644 index 0000000..e9a26ce --- /dev/null +++ b/lib/rubygems-bundler/version.rb @@ -0,0 +1,3 @@ +module RubygemsBundler + VERSION = "0.9.0" +end diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb index 1102b70..5e499e5 100644 --- a/lib/rubygems_plugin.rb +++ b/lib/rubygems_plugin.rb @@ -1,8 +1,9 @@ require 'rubygems/command_manager' -require 'rubygems_bundler/rubygems_bundler_installer' -require 'rubygems_bundler/regenerate_binstubs_command' +require 'rubygems-bundler/rubygems_bundler_installer' +require 'rubygems-bundler/regenerate_binstubs_command' + if Gem::VERSION < '1.9' then - require 'rubygems_bundler/fix_wrapper' + require 'rubygems-bundler/fix_wrapper' end Gem::CommandManager.instance.register_command :regenerate_binstubs diff --git a/noexec.gemspec b/noexec.gemspec deleted file mode 100644 index 0fdc1dd..0000000 --- a/noexec.gemspec +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -$:.push File.expand_path("../lib", __FILE__) -require "noexec/version" - -Gem::Specification.new do |s| - s.name = "noexec" - s.version = Noexec::VERSION - s.authors = ["Josh Hull"] - s.email = ["joshbuddy@gmail.com"] - s.homepage = "https://github.com/joshbuddy/noexec" - s.summary = %q{Stop using bundle exec} - s.description = %q{Stop using bundle exec.} - - s.rubyforge_project = "noexec" - - s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - s.require_paths = ["lib"] -end diff --git a/rubygems-bundler.gemspec b/rubygems-bundler.gemspec index 5c2b5b3..7e82488 100644 --- a/rubygems-bundler.gemspec +++ b/rubygems-bundler.gemspec @@ -1,53 +1,23 @@ -Gem::Specification.new do |s| - s.name = "rubygems-bundler" - s.version = "0.3.0" - s.date = "2012-04-02" - s.summary = "Make rubygems generate bundler aware executable wrappers" - s.email = "mpapis@gmail.com" - s.homepage = "http://mpapis.github.com/rubygems-bundler" - s.description = "Integrate Rubygems and Bundler" - s.has_rdoc = false - s.authors = ["Michal Papis"] - s.files = [ - "bin/ruby_bundler_wrapper", - "bin/ruby_noexec_wrapper", - "ext/wrapper_installer/extconf.rb", - "lib/rubygems_bundler/regenerate_binstubs_command.rb", - "lib/rubygems_bundler/rubygems_bundler_installer.rb", - "lib/rubygems_bundler/fix_wrapper.rb", - "lib/rubygems_plugin.rb", - "LICENSE", - "README.md", - "rubygems-bundler.gemspec", - ] - s.extensions = ["ext/wrapper_installer/extconf.rb"] - s.post_install_message = <<-TEXT -================================================================================== - -rubygems-bundler allows running gem executables in Gemfile specified versions! - -Note: from 0.2.8 the wrapper name changes, you need to repeat instructions bellow. - -First step is to add following line to ~/.gemrc - - custom_shebang: $env ruby_bundler_wrapper - -To make all the executables bundler compatible run: - - gem regenerate_binstubs # only once +#!/usr/bin/env ruby +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "rubygems-bundler/version" -To always use bundler add the following line to ~/.rvmrc or ~/.bashrc - - export USE_BUNDLER=force - -Relogin or call in every open shell: - - export USE_BUNDLER=force - -For more information read: - - https://github.com/mpapis/rubygems-bundler - -================================================================================== -TEXT +Gem::Specification.new do |s| + s.name = "rubygems-bundler" + s.version = RubygemsBundler::VERSION + s.authors = ["Josh Hull", "Michal Papis"] + s.email = ["joshbuddy@gmail.com", "mpapis@gmail.conf"] + s.homepage = "http://mpapis.github.com/rubygems-bundler" + s.summary = %q{Stop using bundle exec} + s.description = %q{Stop using bundle exec. Integrate Rubygems and Bundler. Make rubygems generate bundler aware executable wrappers.} + + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = ["noexec"] + s.extensions = ["ext/wrapper_installer/extconf.rb"] + + # Can do we have to depend on those two ? Can we have two simple tasks doing the same ? + s.add_development_dependency "rake" + s.add_development_dependency "bundler" end