diff options
author | Stefan Lance <stefan@lances.net> | 2015-07-17 15:06:18 -0500 |
---|---|---|
committer | Stefan Lance <stefan@lances.net> | 2015-07-17 15:09:16 -0500 |
commit | 7e4a4f85e552ddfd66fed46629b8d19e476f70f1 (patch) | |
tree | 31f89160be0a63519d12e99dfc57da5f66a331ff | |
parent | 680e91cdb167a5400dc6157d4913f90a96269ecd (diff) | |
download | bundler-7e4a4f85e552ddfd66fed46629b8d19e476f70f1.tar.gz |
Fix conflict resolution mistakes
-rw-r--r-- | .travis.yml | 3 | ||||
-rwxr-xr-x | bin/bundle | 11 | ||||
-rwxr-xr-x | bin/bundler | 11 | ||||
-rwxr-xr-x | exe/bundle_ruby | 58 | ||||
-rw-r--r-- | lib/bundler/deployment.rb | 66 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 3 | ||||
-rw-r--r-- | man/bundle-install.ronn | 1 |
7 files changed, 62 insertions, 91 deletions
diff --git a/.travis.yml b/.travis.yml index 8bd1cfec76..bbcdb2d791 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ before_script: travis_retry rake spec:travis:deps branches: only: - master - - 2-0-dev + - /.+-dev$/ + - /.+-stable$/ notifications: email: diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index 43da771776..0000000000 --- a/bin/bundle +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env ruby - -# Exit cleanly from an early interrupt -Signal.trap("INT") { exit 1 } - -require 'bundler/friendly_errors' -Bundler.with_friendly_errors do - require 'bundler' - require 'bundler/cli' - Bundler::CLI.start(ARGV, :debug => true) -end diff --git a/bin/bundler b/bin/bundler deleted file mode 100755 index 43da771776..0000000000 --- a/bin/bundler +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env ruby - -# Exit cleanly from an early interrupt -Signal.trap("INT") { exit 1 } - -require 'bundler/friendly_errors' -Bundler.with_friendly_errors do - require 'bundler' - require 'bundler/cli' - Bundler::CLI.start(ARGV, :debug => true) -end diff --git a/exe/bundle_ruby b/exe/bundle_ruby new file mode 100755 index 0000000000..734e5a7874 --- /dev/null +++ b/exe/bundle_ruby @@ -0,0 +1,58 @@ +#!/usr/bin/env ruby + +Signal.trap("INT") { exit 1 } + +require "bundler/ruby_version" +require "bundler/ruby_dsl" +require "bundler/shared_helpers" + +module Bundler + class GemfileError < RuntimeError; end + class Dsl + include RubyDsl + + attr_accessor :ruby_version + + def initialize + @ruby_version = nil + end + + def eval_gemfile(gemfile, contents = nil) + contents ||= File.open(gemfile, "rb") { |f| f.read } + instance_eval(contents, gemfile.to_s, 1) + rescue SyntaxError => e + bt = e.message.split("\n")[1..-1] + raise GemfileError, ["Gemfile syntax error:", *bt].join("\n") + rescue ScriptError, RegexpError, NameError, ArgumentError => e + e.backtrace[0] = "#{e.backtrace[0]}: #{e.message} (#{e.class})" + STDERR.puts e.backtrace.join("\n ") + raise GemfileError, "There was an error in your Gemfile," \ + " and Bundler cannot continue." + end + + def source(source, options = {}) + end + + def gem(name, *args) + end + + def group(*args, &blk) + end + end +end + +STDERR.puts "Warning: bundle_ruby will be deprecated in Bundler 2.0.0." + +dsl = Bundler::Dsl.new +begin + dsl.eval_gemfile(Bundler::SharedHelpers.default_gemfile) + ruby_version = dsl.ruby_version + if ruby_version + puts ruby_version + else + puts "No ruby version specified" + end +rescue Bundler::GemfileError => e + puts e.message + exit(-1) +end diff --git a/lib/bundler/deployment.rb b/lib/bundler/deployment.rb deleted file mode 100644 index 2a76ccc859..0000000000 --- a/lib/bundler/deployment.rb +++ /dev/null @@ -1,66 +0,0 @@ -$stderr.puts "DEPRECATION: Bundler no longer integrates with " \ - "Capistrano, but Capistrano provides its own integration with " \ - "Bundler via the capistrano-bundler gem. Use it instead." - -module Bundler - class Deployment - def self.define_task(context, task_method = :task, opts = {}) - if defined?(Capistrano) && context.is_a?(Capistrano::Configuration) - context_name = "capistrano" - role_default = "{:except => {:no_release => true}}" - error_type = ::Capistrano::CommandError - else - context_name = "vlad" - role_default = "[:app]" - error_type = ::Rake::CommandFailedError - end - - roles = context.fetch(:bundle_roles, false) - opts[:roles] = roles if roles - - context.send :namespace, :bundle do - send :desc, <<-DESC - Install the current Bundler environment. By default, gems will be \ - installed to the shared/bundle path. Gems in the development and \ - test group will not be installed. The install command is executed \ - with the --deployment and --quiet flags. If the bundle cmd cannot \ - be found then you can override the bundle_cmd variable to specify \ - which one it should use. The base path to the app is fetched from \ - the :latest_release variable. Set it for custom deploy layouts. - - You can override any of these defaults by setting the variables shown below. - - N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \ - in your deploy.rb file. - - set :bundle_gemfile, "Gemfile" - set :bundle_dir, File.join(fetch(:shared_path), 'bundle') - set :bundle_flags, "--deployment --quiet" - set :bundle_without, [:development, :test] - set :bundle_with, [:mysql] - set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle" - set :bundle_roles, #{role_default} # e.g. [:app, :batch] - DESC - send task_method, :install, opts do - bundle_cmd = context.fetch(:bundle_cmd, "bundle") - bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet") - bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), 'bundle')) - bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile") - bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact - bundle_with = [*context.fetch(:bundle_with, [])].compact - app_path = context.fetch(:latest_release) - if app_path.to_s.empty? - raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.") - end - args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"] - args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty? - args << bundle_flags.to_s - args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty? - args << "--with #{bundle_with.join(" ")}" unless bundle_with.empty? - - run "cd #{app_path} && #{bundle_cmd} install #{args.join(' ')}" - end - end - end - end -end diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index a87a0f825a..8b356f8932 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -224,8 +224,7 @@ module Bundler # TODO 2.0 remove this deprecated git source git_source(:bitbucket) do |repo_name| - # Double quotes here make some dsl_spec.rb specs fail - warn_deprecated_git_source(:bitbucket, 'https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git') + warn_deprecated_git_source(:bitbucket, "https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git") user_name, repo_name = repo_name.split "/" repo_name ||= user_name "https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git" diff --git a/man/bundle-install.ronn b/man/bundle-install.ronn index e8103ed8c1..00636f5d2e 100644 --- a/man/bundle-install.ronn +++ b/man/bundle-install.ronn @@ -9,6 +9,7 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile [--jobs=NUMBER] [--local] [--deployment] + [--force] [--cache] [--no-prune] [--path PATH] |