bundler 1.8.9 → 1.9.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -7
  3. data/CHANGELOG.md +8 -33
  4. data/Rakefile +51 -8
  5. data/lib/bundler/cli/gem.rb +20 -1
  6. data/lib/bundler/cli/install.rb +1 -1
  7. data/lib/bundler/definition.rb +8 -12
  8. data/lib/bundler/dep_proxy.rb +2 -2
  9. data/lib/bundler/installer.rb +12 -18
  10. data/lib/bundler/resolver.rb +168 -383
  11. data/lib/bundler/rubygems_ext.rb +1 -1
  12. data/lib/bundler/rubygems_integration.rb +6 -14
  13. data/lib/bundler/runtime.rb +3 -0
  14. data/lib/bundler/shared_helpers.rb +12 -7
  15. data/lib/bundler/source.rb +0 -5
  16. data/lib/bundler/source/path.rb +2 -1
  17. data/lib/bundler/source/path/installer.rb +0 -2
  18. data/lib/bundler/source/rubygems.rb +9 -11
  19. data/lib/bundler/templates/newgem/Rakefile.tt +0 -1
  20. data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  21. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo.rb +5 -0
  22. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/dependency_graph.rb +266 -0
  23. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/errors.rb +69 -0
  24. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/gem_metadata.rb +3 -0
  25. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/modules/specification_provider.rb +90 -0
  26. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/modules/ui.rb +63 -0
  27. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/resolution.rb +412 -0
  28. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/resolver.rb +43 -0
  29. data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/state.rb +43 -0
  30. data/lib/bundler/vendor/{thor.rb → thor-0.19.1/lib/thor.rb} +57 -53
  31. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions.rb +34 -34
  32. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/create_file.rb +7 -7
  33. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/create_link.rb +2 -2
  34. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/directory.rb +11 -11
  35. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/empty_directory.rb +2 -2
  36. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/file_manipulation.rb +14 -14
  37. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/actions/inject_into_file.rb +24 -24
  38. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/base.rb +71 -71
  39. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/command.rb +8 -8
  40. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/core_ext/hash_with_indifferent_access.rb +2 -2
  41. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/core_ext/io_binary_read.rb +1 -1
  42. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/core_ext/ordered_hash.rb +2 -2
  43. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/error.rb +3 -3
  44. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/group.rb +27 -27
  45. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/invocation.rb +16 -11
  46. data/lib/bundler/vendor/thor-0.19.1/lib/thor/line_editor.rb +17 -0
  47. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/line_editor/basic.rb +2 -2
  48. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/line_editor/readline.rb +7 -7
  49. data/lib/bundler/vendor/thor-0.19.1/lib/thor/parser.rb +4 -0
  50. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/parser/argument.rb +7 -7
  51. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/parser/arguments.rb +10 -10
  52. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/parser/option.rb +14 -10
  53. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/parser/options.rb +12 -12
  54. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/rake_compat.rb +14 -14
  55. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/runner.rb +76 -76
  56. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/shell.rb +18 -18
  57. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/shell/basic.rb +31 -30
  58. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/shell/color.rb +10 -10
  59. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/shell/html.rb +28 -28
  60. data/lib/bundler/vendor/{thor → thor-0.19.1/lib/thor}/util.rb +61 -61
  61. data/lib/bundler/vendor/thor-0.19.1/lib/thor/version.rb +3 -0
  62. data/lib/bundler/vendored_molinillo.rb +5 -0
  63. data/lib/bundler/vendored_thor.rb +3 -6
  64. data/lib/bundler/version.rb +1 -1
  65. metadata +44 -35
  66. data/lib/bundler/vendor/.document +0 -0
  67. data/lib/bundler/vendor/thor/line_editor.rb +0 -17
  68. data/lib/bundler/vendor/thor/parser.rb +0 -4
  69. data/lib/bundler/vendor/thor/version.rb +0 -3
@@ -1,6 +1,6 @@
1
- require 'thor/actions/empty_directory'
1
+ require "thor/actions/empty_directory"
2
2
 
3
- class Thor
3
+ class Bundler::Thor
4
4
  module Actions
5
5
  # Create a new file relative to the destination root with the given data,
6
6
  # which is the return value of a block or a data string.
@@ -50,16 +50,16 @@ class Thor
50
50
  #
51
51
  def render
52
52
  @render ||= if data.is_a?(Proc)
53
- data.call
54
- else
55
- data
56
- end
53
+ data.call
54
+ else
55
+ data
56
+ end
57
57
  end
58
58
 
59
59
  def invoke!
60
60
  invoke_with_conflict_check do
61
61
  FileUtils.mkdir_p(File.dirname(destination))
62
- File.open(destination, 'wb') { |f| f.write render }
62
+ File.open(destination, "wb") { |f| f.write render }
63
63
  end
64
64
  given_destination
65
65
  end
@@ -1,6 +1,6 @@
1
- require 'thor/actions/create_file'
1
+ require "thor/actions/create_file"
2
2
 
3
- class Thor
3
+ class Bundler::Thor
4
4
  module Actions
5
5
  # Create a new file relative to the destination root from the given source.
6
6
  #
@@ -1,6 +1,6 @@
1
- require 'thor/actions/empty_directory'
1
+ require "thor/actions/empty_directory"
2
2
 
3
- class Thor
3
+ class Bundler::Thor
4
4
  module Actions
5
5
  # Copies recursively the files from source directory to root directory.
6
6
  # If any of the files finishes with .tt, it's considered to be a template
@@ -29,9 +29,9 @@ class Thor
29
29
  # rdoc.rb
30
30
  # blog.rb
31
31
  #
32
- # <b>Encoded path note:</b> Since Thor internals use Object#respond_to? to check if it can
32
+ # <b>Encoded path note:</b> Since Bundler::Thor internals use Object#respond_to? to check if it can
33
33
  # expand %something%, this `something` should be a public method in the class calling
34
- # #directory. If a method is private, Thor stack raises PrivateMethodEncodedError.
34
+ # #directory. If a method is private, Bundler::Thor stack raises PrivateMethodEncodedError.
35
35
  #
36
36
  # ==== Parameters
37
37
  # source<String>:: the relative path to the source root.
@@ -74,18 +74,18 @@ class Thor
74
74
 
75
75
  def execute! # rubocop:disable MethodLength
76
76
  lookup = Util.escape_globs(source)
77
- lookup = config[:recursive] ? File.join(lookup, '**') : lookup
77
+ lookup = config[:recursive] ? File.join(lookup, "**") : lookup
78
78
  lookup = file_level_lookup(lookup)
79
79
 
80
80
  files(lookup).sort.each do |file_source|
81
81
  next if File.directory?(file_source)
82
82
  next if config[:exclude_pattern] && file_source.match(config[:exclude_pattern])
83
- file_destination = File.join(given_destination, file_source.gsub(source, '.'))
84
- file_destination.gsub!('/./', '/')
83
+ file_destination = File.join(given_destination, file_source.gsub(source, "."))
84
+ file_destination.gsub!("/./", "/")
85
85
 
86
86
  case file_source
87
87
  when /\.empty_directory$/
88
- dirname = File.dirname(file_destination).gsub(/\/\.$/, '')
88
+ dirname = File.dirname(file_destination).gsub(/\/\.$/, "")
89
89
  next if dirname == given_destination
90
90
  base.empty_directory(dirname, config)
91
91
  when /#{TEMPLATE_EXTNAME}$/
@@ -96,9 +96,9 @@ class Thor
96
96
  end
97
97
  end
98
98
 
99
- if RUBY_VERSION < '2.0'
99
+ if RUBY_VERSION < "2.0"
100
100
  def file_level_lookup(previous_lookup)
101
- File.join(previous_lookup, '{*,.[a-z]*}')
101
+ File.join(previous_lookup, "{*,.[a-z]*}")
102
102
  end
103
103
 
104
104
  def files(lookup)
@@ -106,7 +106,7 @@ class Thor
106
106
  end
107
107
  else
108
108
  def file_level_lookup(previous_lookup)
109
- File.join(previous_lookup, '*')
109
+ File.join(previous_lookup, "*")
110
110
  end
111
111
 
112
112
  def files(lookup)
@@ -1,4 +1,4 @@
1
- class Thor
1
+ class Bundler::Thor
2
2
  module Actions
3
3
  # Creates an empty directory.
4
4
  #
@@ -26,7 +26,7 @@ class Thor
26
26
  # Initializes given the source and destination.
27
27
  #
28
28
  # ==== Parameters
29
- # base<Thor::Base>:: A Thor::Base instance
29
+ # base<Bundler::Thor::Base>:: A Bundler::Thor::Base instance
30
30
  # source<String>:: Relative path to the source of this file
31
31
  # destination<String>:: Relative path to the destination of this file
32
32
  # config<Hash>:: give :verbose => false to not log the status.
@@ -1,7 +1,7 @@
1
- require 'erb'
2
- require 'open-uri'
1
+ require "erb"
2
+ require "open-uri"
3
3
 
4
- class Thor
4
+ class Bundler::Thor
5
5
  module Actions
6
6
  # Copies the file from the relative source to the relative destination. If
7
7
  # the destination is not given it's assumed to be equal to the source.
@@ -82,10 +82,10 @@ class Thor
82
82
  render = open(source) { |input| input.binmode.read }
83
83
 
84
84
  destination ||= if block_given?
85
- block.arity == 1 ? block.call(render) : block.call
86
- else
87
- File.basename(source)
88
- end
85
+ block.arity == 1 ? block.call(render) : block.call
86
+ else
87
+ File.basename(source)
88
+ end
89
89
 
90
90
  create_file destination, render, config
91
91
  end
@@ -107,13 +107,13 @@ class Thor
107
107
  #
108
108
  def template(source, *args, &block)
109
109
  config = args.last.is_a?(Hash) ? args.pop : {}
110
- destination = args.first || source.sub(/#{TEMPLATE_EXTNAME}$/, '')
110
+ destination = args.first || source.sub(/#{TEMPLATE_EXTNAME}$/, "")
111
111
 
112
112
  source = File.expand_path(find_in_source_paths(source.to_s))
113
- context = instance_eval('binding')
113
+ context = instance_eval("binding")
114
114
 
115
115
  create_file destination, nil, config do
116
- content = ERB.new(::File.binread(source), nil, '-', '@output_buffer').result(context)
116
+ content = ERB.new(::File.binread(source), nil, "-", "@output_buffer").result(context)
117
117
  content = block.call(content) if block
118
118
  content
119
119
  end
@@ -230,7 +230,7 @@ class Thor
230
230
  unless options[:pretend]
231
231
  content = File.binread(path)
232
232
  content.gsub!(flag, *args, &block)
233
- File.open(path, 'wb') { |file| file.write(content) }
233
+ File.open(path, "wb") { |file| file.write(content) }
234
234
  end
235
235
  end
236
236
 
@@ -292,8 +292,8 @@ class Thor
292
292
  end
293
293
  alias_method :remove_dir, :remove_file
294
294
 
295
- attr_accessor :output_buffer
296
- private :output_buffer, :output_buffer=
295
+ attr_accessor :output_buffer
296
+ private :output_buffer, :output_buffer=
297
297
 
298
298
  private
299
299
 
@@ -305,7 +305,7 @@ class Thor
305
305
  with_output_buffer { block.call(*args) }
306
306
  end
307
307
 
308
- def with_output_buffer(buf = '') #:nodoc:
308
+ def with_output_buffer(buf = "") #:nodoc:
309
309
  self.output_buffer, old_buffer = buf, output_buffer
310
310
  yield
311
311
  output_buffer
@@ -1,6 +1,6 @@
1
- require 'thor/actions/empty_directory'
1
+ require "thor/actions/empty_directory"
2
2
 
3
- class Thor
3
+ class Bundler::Thor
4
4
  module Actions
5
5
  # Injects the given content into a file. Different from gsub_file, this
6
6
  # method is reversible.
@@ -38,7 +38,7 @@ class Thor
38
38
  super(base, destination, {:verbose => true}.merge(config))
39
39
 
40
40
  @behavior, @flag = if @config.key?(:after)
41
- [:after, @config.delete(:after)]
41
+ [:after, @config.delete(:after)]
42
42
  else
43
43
  [:before, @config.delete(:before)]
44
44
  end
@@ -51,10 +51,10 @@ class Thor
51
51
  say_status :invoke
52
52
 
53
53
  content = if @behavior == :after
54
- '\0' + replacement
55
- else
56
- replacement + '\0'
57
- end
54
+ '\0' + replacement
55
+ else
56
+ replacement + '\0'
57
+ end
58
58
 
59
59
  replace!(/#{flag}/, content, config[:force])
60
60
  end
@@ -63,12 +63,12 @@ class Thor
63
63
  say_status :revoke
64
64
 
65
65
  regexp = if @behavior == :after
66
- content = '\1\2'
67
- /(#{flag})(.*)(#{Regexp.escape(replacement)})/m
68
- else
69
- content = '\2\3'
70
- /(#{Regexp.escape(replacement)})(.*)(#{flag})/m
71
- end
66
+ content = '\1\2'
67
+ /(#{flag})(.*)(#{Regexp.escape(replacement)})/m
68
+ else
69
+ content = '\2\3'
70
+ /(#{Regexp.escape(replacement)})(.*)(#{flag})/m
71
+ end
72
72
 
73
73
  replace!(regexp, content, true)
74
74
  end
@@ -77,16 +77,16 @@ class Thor
77
77
 
78
78
  def say_status(behavior)
79
79
  status = if behavior == :invoke
80
- if flag == /\A/
81
- :prepend
82
- elsif flag == /\z/
83
- :append
84
- else
85
- :insert
86
- end
87
- else
88
- :subtract
89
- end
80
+ if flag == /\A/
81
+ :prepend
82
+ elsif flag == /\z/
83
+ :append
84
+ else
85
+ :insert
86
+ end
87
+ else
88
+ :subtract
89
+ end
90
90
 
91
91
  super(status, config[:verbose])
92
92
  end
@@ -98,7 +98,7 @@ class Thor
98
98
  content = File.binread(destination)
99
99
  if force || !content.include?(replacement)
100
100
  content.gsub!(regexp, string)
101
- File.open(destination, 'wb') { |file| file.write(content) }
101
+ File.open(destination, "wb") { |file| file.write(content) }
102
102
  end
103
103
  end
104
104
  end
@@ -1,26 +1,26 @@
1
- require 'thor/command'
2
- require 'thor/core_ext/hash_with_indifferent_access'
3
- require 'thor/core_ext/ordered_hash'
4
- require 'thor/error'
5
- require 'thor/invocation'
6
- require 'thor/parser'
7
- require 'thor/shell'
8
- require 'thor/line_editor'
9
- require 'thor/util'
10
-
11
- class Thor
12
- autoload :Actions, 'thor/actions'
13
- autoload :RakeCompat, 'thor/rake_compat'
14
- autoload :Group, 'thor/group'
1
+ require "thor/command"
2
+ require "thor/core_ext/hash_with_indifferent_access"
3
+ require "thor/core_ext/ordered_hash"
4
+ require "thor/error"
5
+ require "thor/invocation"
6
+ require "thor/parser"
7
+ require "thor/shell"
8
+ require "thor/line_editor"
9
+ require "thor/util"
10
+
11
+ class Bundler::Thor
12
+ autoload :Actions, "thor/actions"
13
+ autoload :RakeCompat, "thor/rake_compat"
14
+ autoload :Group, "thor/group"
15
15
 
16
16
  # Shortcuts for help.
17
- HELP_MAPPINGS = %w(-h -? --help -D)
17
+ HELP_MAPPINGS = %w[-h -? --help -D]
18
18
 
19
- # Thor methods that should not be overwritten by the user.
20
- THOR_RESERVED_WORDS = %w(invoke shell options behavior root destination_root relative_root
21
- action add_file create_file in_root inside run run_ruby_script)
19
+ # Bundler::Thor methods that should not be overwritten by the user.
20
+ THOR_RESERVED_WORDS = %w[invoke shell options behavior root destination_root relative_root
21
+ action add_file create_file in_root inside run run_ruby_script]
22
22
 
23
- TEMPLATE_EXTNAME = '.tt'
23
+ TEMPLATE_EXTNAME = ".tt"
24
24
 
25
25
  module Base
26
26
  attr_accessor :options, :parent_options, :args
@@ -39,7 +39,7 @@ class Thor
39
39
  # The hash given is converted to a hash with indifferent
40
40
  # access, magic predicates (options.skip?) and then frozen.
41
41
  #
42
- # config<Hash>:: Configuration for this Thor class.
42
+ # config<Hash>:: Configuration for this Bundler::Thor class.
43
43
  #
44
44
  def initialize(args = [], local_options = {}, config = {}) # rubocop:disable MethodLength
45
45
  parse_options = self.class.class_options
@@ -59,11 +59,11 @@ class Thor
59
59
  array_options, hash_options = [], local_options
60
60
  end
61
61
 
62
- # Let Thor::Options parse the options first, so it can remove
62
+ # Let Bundler::Thor::Options parse the options first, so it can remove
63
63
  # declared options from the array. This will leave us with
64
64
  # a list of arguments that weren't declared.
65
65
  stop_on_unknown = self.class.stop_on_unknown_option? config[:current_command]
66
- opts = Thor::Options.new(parse_options, hash_options, stop_on_unknown)
66
+ opts = Bundler::Thor::Options.new(parse_options, hash_options, stop_on_unknown)
67
67
  self.options = opts.parse(array_options)
68
68
  self.options = config[:class_options].merge(options) if config[:class_options]
69
69
 
@@ -74,12 +74,12 @@ class Thor
74
74
  # Add the remaining arguments from the options parser to the
75
75
  # arguments passed in to initialize. Then remove any positional
76
76
  # arguments declared using #argument (this is primarily used
77
- # by Thor::Group). Tis will leave us with the remaining
77
+ # by Bundler::Thor::Group). Tis will leave us with the remaining
78
78
  # positional arguments.
79
79
  to_parse = args
80
80
  to_parse += opts.remaining unless self.class.strict_args_position?(config)
81
81
 
82
- thor_args = Thor::Arguments.new(self.class.arguments)
82
+ thor_args = Bundler::Thor::Arguments.new(self.class.arguments)
83
83
  thor_args.parse(to_parse).each { |k, v| __send__("#{k}=", v) }
84
84
  @args = thor_args.remaining
85
85
  end
@@ -91,7 +91,7 @@ class Thor
91
91
  base.send :include, Shell
92
92
  end
93
93
 
94
- # Returns the classes that inherits from Thor or Thor::Group.
94
+ # Returns the classes that inherits from Bundler::Thor or Bundler::Thor::Group.
95
95
  #
96
96
  # ==== Returns
97
97
  # Array[Class]
@@ -109,14 +109,14 @@ class Thor
109
109
  @subclass_files ||= Hash.new { |h, k| h[k] = [] }
110
110
  end
111
111
 
112
- # Whenever a class inherits from Thor or Thor::Group, we should track the
113
- # class and the file on Thor::Base. This is the method responsible for it.
112
+ # Whenever a class inherits from Bundler::Thor or Bundler::Thor::Group, we should track the
113
+ # class and the file on Bundler::Thor::Base. This is the method responsable for it.
114
114
  #
115
115
  def register_klass_file(klass) #:nodoc:
116
116
  file = caller[1].match(/(.*):\d+/)[1]
117
- Thor::Base.subclasses << klass unless Thor::Base.subclasses.include?(klass)
117
+ Bundler::Thor::Base.subclasses << klass unless Bundler::Thor::Base.subclasses.include?(klass)
118
118
 
119
- file_subclasses = Thor::Base.subclass_files[File.expand_path(file)]
119
+ file_subclasses = Bundler::Thor::Base.subclass_files[File.expand_path(file)]
120
120
  file_subclasses << klass unless file_subclasses.include?(klass)
121
121
  end
122
122
  end
@@ -210,12 +210,12 @@ class Thor
210
210
  no_commands { attr_accessor name }
211
211
 
212
212
  required = if options.key?(:optional)
213
- !options[:optional]
214
- elsif options.key?(:required)
215
- options[:required]
216
- else
217
- options[:default].nil?
218
- end
213
+ !options[:optional]
214
+ elsif options.key?(:required)
215
+ options[:required]
216
+ else
217
+ options[:default].nil?
218
+ end
219
219
 
220
220
  remove_argument name
221
221
 
@@ -227,13 +227,13 @@ class Thor
227
227
 
228
228
  options[:required] = required
229
229
 
230
- arguments << Thor::Argument.new(name, options)
230
+ arguments << Bundler::Thor::Argument.new(name, options)
231
231
  end
232
232
 
233
233
  # Returns this class arguments, looking up in the ancestors chain.
234
234
  #
235
235
  # ==== Returns
236
- # Array[Thor::Argument]
236
+ # Array[Bundler::Thor::Argument]
237
237
  #
238
238
  def arguments
239
239
  @arguments ||= from_superclass(:arguments, [])
@@ -265,7 +265,7 @@ class Thor
265
265
  # :required:: -- If the argument is required or not.
266
266
  # :default:: -- Default value for this argument.
267
267
  # :group:: -- The group for this options. Use by class options to output options in different levels.
268
- # :aliases:: -- Aliases for this option. <b>Note:</b> Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
268
+ # :aliases:: -- Aliases for this option. <b>Note:</b> Bundler::Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
269
269
  # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
270
270
  # :banner:: -- String to show on usage notes.
271
271
  # :hide:: -- If you want to hide this option from the help.
@@ -320,34 +320,34 @@ class Thor
320
320
  if name
321
321
  @group = name.to_s
322
322
  else
323
- @group ||= from_superclass(:group, 'standard')
323
+ @group ||= from_superclass(:group, "standard")
324
324
  end
325
325
  end
326
326
 
327
- # Returns the commands for this Thor class.
327
+ # Returns the commands for this Bundler::Thor class.
328
328
  #
329
329
  # ==== Returns
330
- # OrderedHash:: An ordered hash with commands names as keys and Thor::Command
330
+ # OrderedHash:: An ordered hash with commands names as keys and Bundler::Thor::Command
331
331
  # objects as values.
332
332
  #
333
333
  def commands
334
- @commands ||= Thor::CoreExt::OrderedHash.new
334
+ @commands ||= Bundler::Thor::CoreExt::OrderedHash.new
335
335
  end
336
336
  alias_method :tasks, :commands
337
337
 
338
- # Returns the commands for this Thor class and all subclasses.
338
+ # Returns the commands for this Bundler::Thor class and all subclasses.
339
339
  #
340
340
  # ==== Returns
341
- # OrderedHash:: An ordered hash with commands names as keys and Thor::Command
341
+ # OrderedHash:: An ordered hash with commands names as keys and Bundler::Thor::Command
342
342
  # objects as values.
343
343
  #
344
344
  def all_commands
345
- @all_commands ||= from_superclass(:all_commands, Thor::CoreExt::OrderedHash.new)
345
+ @all_commands ||= from_superclass(:all_commands, Bundler::Thor::CoreExt::OrderedHash.new)
346
346
  @all_commands.merge(commands)
347
347
  end
348
348
  alias_method :all_tasks, :all_commands
349
349
 
350
- # Removes a given command from this Thor class. This is usually done if you
350
+ # Removes a given command from this Bundler::Thor class. This is usually done if you
351
351
  # are inheriting from another class and don't want it to be available
352
352
  # anymore.
353
353
  #
@@ -374,7 +374,7 @@ class Thor
374
374
  #
375
375
  # So you can do:
376
376
  #
377
- # class MyScript < Thor
377
+ # class MyScript < Bundler::Thor
378
378
  # no_commands do
379
379
  # def this_is_not_a_command
380
380
  # end
@@ -383,7 +383,7 @@ class Thor
383
383
  #
384
384
  # You can also add the method and remove it from the command list:
385
385
  #
386
- # class MyScript < Thor
386
+ # class MyScript < Bundler::Thor
387
387
  # def this_is_not_a_command
388
388
  # end
389
389
  # remove_command :this_is_not_a_command
@@ -397,8 +397,8 @@ class Thor
397
397
  end
398
398
  alias_method :no_tasks, :no_commands
399
399
 
400
- # Sets the namespace for the Thor or Thor::Group class. By default the
401
- # namespace is retrieved from the class name. If your Thor class is named
400
+ # Sets the namespace for the Bundler::Thor or Bundler::Thor::Group class. By default the
401
+ # namespace is retrieved from the class name. If your Bundler::Thor class is named
402
402
  # Scripts::MyScript, the help method, for example, will be called as:
403
403
  #
404
404
  # thor scripts:my_script -h
@@ -423,23 +423,23 @@ class Thor
423
423
  if name
424
424
  @namespace = name.to_s
425
425
  else
426
- @namespace ||= Thor::Util.namespace_from_thor_class(self)
426
+ @namespace ||= Bundler::Thor::Util.namespace_from_thor_class(self)
427
427
  end
428
428
  end
429
429
 
430
430
  # Parses the command and options from the given args, instantiate the class
431
431
  # and invoke the command. This method is used when the arguments must be parsed
432
- # from an array. If you are inside Ruby and want to use a Thor class, you
432
+ # from an array. If you are inside Ruby and want to use a Bundler::Thor class, you
433
433
  # can simply initialize it:
434
434
  #
435
435
  # script = MyScript.new(args, options, config)
436
436
  # script.invoke(:command, first_arg, second_arg, third_arg)
437
437
  #
438
438
  def start(given_args = ARGV, config = {})
439
- config[:shell] ||= Thor::Base.shell.new
439
+ config[:shell] ||= Bundler::Thor::Base.shell.new
440
440
  dispatch(nil, given_args.dup, nil, config)
441
- rescue Thor::Error => e
442
- config[:debug] || ENV['THOR_DEBUG'] == '1' ? (raise e) : config[:shell].error(e.message)
441
+ rescue Bundler::Thor::Error => e
442
+ config[:debug] || ENV["THOR_DEBUG"] == "1" ? (raise e) : config[:shell].error(e.message)
443
443
  exit(1) if exit_on_failure?
444
444
  rescue Errno::EPIPE
445
445
  # This happens if a thor command is piped to something like `head`,
@@ -477,8 +477,8 @@ class Thor
477
477
 
478
478
  def handle_argument_error(command, error, args, arity) #:nodoc:
479
479
  msg = "ERROR: \"#{basename} #{command.name}\" was called with "
480
- msg << 'no arguments' if args.empty?
481
- msg << 'arguments ' << args.inspect unless args.empty?
480
+ msg << "no arguments" if args.empty?
481
+ msg << "arguments " << args.inspect unless args.empty?
482
482
  msg << "\nUsage: #{banner(command).inspect}"
483
483
  fail InvocationError, msg
484
484
  end
@@ -515,23 +515,23 @@ class Thor
515
515
  options.each do |option|
516
516
  unless option.hide
517
517
  item = [option.usage(padding)]
518
- item.push(option.description ? "# #{option.description}" : '')
518
+ item.push(option.description ? "# #{option.description}" : "")
519
519
 
520
520
  list << item
521
- list << ['', "# Default: #{option.default}"] if option.show_default?
522
- list << ['', "# Possible values: #{option.enum.join(', ')}"] if option.enum
521
+ list << ["", "# Default: #{option.default}"] if option.show_default?
522
+ list << ["", "# Possible values: #{option.enum.join(', ')}"] if option.enum
523
523
  end
524
524
  end
525
525
 
526
- shell.say(group_name ? "#{group_name} options:" : 'Options:')
526
+ shell.say(group_name ? "#{group_name} options:" : "Options:")
527
527
  shell.print_table(list, :indent => 2)
528
- shell.say ''
528
+ shell.say ""
529
529
  end
530
530
 
531
- # Raises an error if the word given is a Thor reserved word.
531
+ # Raises an error if the word given is a Bundler::Thor reserved word.
532
532
  def is_thor_reserved_word?(word, type) #:nodoc:
533
533
  return false unless THOR_RESERVED_WORDS.include?(word.to_s)
534
- fail "#{word.inspect} is a Thor reserved word and cannot be defined as #{type}"
534
+ fail "#{word.inspect} is a Bundler::Thor reserved word and cannot be defined as #{type}"
535
535
  end
536
536
 
537
537
  # Build an option and adds it to the given scope.
@@ -541,7 +541,7 @@ class Thor
541
541
  # options<Hash>:: Described in both class_option and method_option.
542
542
  # scope<Hash>:: Options hash that is being built up
543
543
  def build_option(name, options, scope) #:nodoc:
544
- scope[name] = Thor::Option.new(name, options)
544
+ scope[name] = Bundler::Thor::Option.new(name, options)
545
545
  end
546
546
 
547
547
  # Receives a hash of options, parse them and add to the scope. This is a
@@ -553,7 +553,7 @@ class Thor
553
553
  # Hash[Symbol => Object]
554
554
  def build_options(options, scope) #:nodoc:
555
555
  options.each do |key, value|
556
- scope[key] = Thor::Option.parse(key, value)
556
+ scope[key] = Bundler::Thor::Option.parse(key, value)
557
557
  end
558
558
  end
559
559
 
@@ -571,10 +571,10 @@ class Thor
571
571
  end
572
572
  alias_method :find_and_refresh_task, :find_and_refresh_command
573
573
 
574
- # Everytime someone inherits from a Thor class, register the klass
574
+ # Everytime someone inherits from a Bundler::Thor class, register the klass
575
575
  # and file into baseclass.
576
576
  def inherited(klass)
577
- Thor::Base.register_klass_file(klass)
577
+ Bundler::Thor::Base.register_klass_file(klass)
578
578
  klass.instance_variable_set(:@no_commands, false)
579
579
  end
580
580
 
@@ -583,7 +583,7 @@ class Thor
583
583
  def method_added(meth)
584
584
  meth = meth.to_s
585
585
 
586
- if meth == 'initialize'
586
+ if meth == "initialize"
587
587
  initialize_added
588
588
  return
589
589
  end
@@ -595,7 +595,7 @@ class Thor
595
595
  return if @no_commands || !create_command(meth)
596
596
 
597
597
  is_thor_reserved_word?(meth, :command)
598
- Thor::Base.register_klass_file(self)
598
+ Bundler::Thor::Base.register_klass_file(self)
599
599
  end
600
600
 
601
601
  # Retrieves a value from superclass. If it reaches the baseclass,
@@ -628,7 +628,7 @@ class Thor
628
628
  # The basename of the program invoking the thor class.
629
629
  #
630
630
  def basename
631
- File.basename($PROGRAM_NAME).split(' ').first
631
+ File.basename($PROGRAM_NAME).split(" ").first
632
632
  end
633
633
 
634
634
  # SIGNATURE: Sets the baseclass. This is where the superclass lookup