Skip to content

Commit

Permalink
post merge cleaning, use one gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Apr 3, 2012
1 parent 2d9289b commit 4b81ae7
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 94 deletions.
6 changes: 6 additions & 0 deletions 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

Expand Down
3 changes: 0 additions & 3 deletions Gemfile
@@ -1,6 +1,3 @@
source "http://rubygems.org"

# Specify your gem's dependencies in noexec.gemspec
gemspec

gem 'rake'
28 changes: 16 additions & 12 deletions README.md
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bin/noexec
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby

print File.expand_path(File.expand_path("../../lib/noexec/auto.rb", __FILE__))
print File.expand_path(File.expand_path("../../lib/rubygems-bundler/noexec.rb", __FILE__))
3 changes: 2 additions & 1 deletion bin/ruby_noexec_wrapper
Expand Up @@ -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
3 changes: 0 additions & 3 deletions lib/noexec/version.rb

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/rubygems-bundler/version.rb
@@ -0,0 +1,3 @@
module RubygemsBundler
VERSION = "0.9.0"
end
7 changes: 4 additions & 3 deletions 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
20 changes: 0 additions & 20 deletions noexec.gemspec

This file was deleted.

72 changes: 21 additions & 51 deletions 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

0 comments on commit 4b81ae7

Please sign in to comment.