bundle-gem-install 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/bundle +32 -0
  2. data/lib/bundle-gem-install/cli.rb +32 -0
  3. metadata +71 -0
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler'
3
+ begin
4
+ # Check if an older version of bundler is installed
5
+ $:.each do |path|
6
+ if path =~ %r'/bundler-0.(\d+)' && $1.to_i < 9
7
+ err = "Please remove Bundler 0.8 versions."
8
+ err << "This can be done by running `gem cleanup bundler`."
9
+ abort(err)
10
+ end
11
+ end
12
+ require 'bundler/cli'
13
+ require 'bundle-gem-install/cli'
14
+ Bundler::CLI.start
15
+ rescue Bundler::BundlerError => e
16
+ Bundler.ui.error e.message
17
+ Bundler.ui.debug e.backtrace.join("\n")
18
+ exit e.status_code
19
+ rescue Interrupt => e
20
+ Bundler.ui.error "\nQuitting..."
21
+ Bundler.ui.debug e.backtrace.join("\n")
22
+ exit 1
23
+ rescue SystemExit => e
24
+ exit e.status
25
+ rescue Exception => e
26
+ Bundler.ui.error "Unfortunately, a fatal error has occurred. " +
27
+ "Please report this error to the Bundler issue tracker at " +
28
+ "https://github.com/carlhuda/bundler/issues so that we can fix it. " +
29
+ "Please include the full output of the command, your Gemfile and Gemfile.lock. " +
30
+ "Thanks!"
31
+ raise e
32
+ end
@@ -0,0 +1,32 @@
1
+ module Bundler
2
+
3
+ class CLI
4
+
5
+ desc "gem-install", "Gem install the current environment to the system"
6
+ def gem_install
7
+ begin
8
+ not_installed = Bundler.definition.missing_specs
9
+ rescue GemNotFound, VersionConflict
10
+ Bundler.ui.error "Your Gemfile's dependencies could not be satisfied"
11
+ Bundler.ui.warn "Install missing gems with `bundle install`"
12
+ exit 1
13
+ end
14
+
15
+ if not_installed.any?
16
+ Bundler.ui.error "The following gems are missing"
17
+ not_installed.each { |s| Bundler.ui.error " * #{s.name} (#{s.version})" }
18
+ Bundler.ui.warn "Installing missing gems with `gem install`"
19
+ not_installed.each do |gem|
20
+ puts "gem installing #{gem.name} --version=#{gem.version} ..."
21
+ `gem install #{gem.name} --version=#{gem.version}`
22
+ end
23
+ exit 1
24
+ else
25
+ Bundler.load.lock
26
+ Bundler.ui.info "The Gemfile's dependencies are satisfied"
27
+ end
28
+ end
29
+
30
+ end
31
+
32
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundle-gem-install
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Feng Zhichao
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-12-27 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: dfghjkl
22
+ email:
23
+ - flankerfc@gmail.com
24
+ executables:
25
+ - bundle
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - ./lib/bundle-gem-install/cli.rb
32
+ - bin/bundle
33
+ homepage: http://www.chaojiwudi.com
34
+ licenses:
35
+ - MIT
36
+ post_install_message:
37
+ rdoc_options: []
38
+
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ hash: 57
47
+ segments:
48
+ - 1
49
+ - 8
50
+ - 7
51
+ version: 1.8.7
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 23
58
+ segments:
59
+ - 1
60
+ - 3
61
+ - 6
62
+ version: 1.3.6
63
+ requirements: []
64
+
65
+ rubyforge_project:
66
+ rubygems_version: 1.8.23
67
+ signing_key:
68
+ specification_version: 3
69
+ summary: dfghjkl
70
+ test_files: []
71
+