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.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

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,4 +1,4 @@
1
- class Thor
1
+ class Bundler::Thor
2
2
  class Arguments #:nodoc: # rubocop:disable ClassLength
3
3
  NUMERIC = /(\d*\.\d+|\d+)/
4
4
 
@@ -21,7 +21,7 @@ class Thor
21
21
  new(*args).parse(to_parse)
22
22
  end
23
23
 
24
- # Takes an array of Thor::Argument objects.
24
+ # Takes an array of Bundler::Thor::Argument objects.
25
25
  #
26
26
  def initialize(arguments = [])
27
27
  @assigns, @non_assigned_required = {}, []
@@ -97,8 +97,8 @@ class Thor
97
97
  return shift if peek.is_a?(Hash)
98
98
  hash = {}
99
99
 
100
- while current_is_value? && peek.include?(':')
101
- key, value = shift.split(':', 2)
100
+ while current_is_value? && peek.include?(":")
101
+ key, value = shift.split(":", 2)
102
102
  hash[key] = value
103
103
  end
104
104
  hash
@@ -131,12 +131,12 @@ class Thor
131
131
  fail MalformattedArgumentError, "Expected numeric value for '#{name}'; got #{peek.inspect}"
132
132
  end
133
133
 
134
- value = $&.index('.') ? shift.to_f : shift.to_i
135
- if @switches.is_a?(Hash) && switch = @switches[name]
136
- if switch.enum && !switch.enum.include?(value)
137
- raise MalformattedArgumentError, "Expected '#{name}' to be one of #{switch.enum.join(', ')}; got #{value}"
138
- end
134
+ value = $&.index(".") ? shift.to_f : shift.to_i
135
+ if @switches.is_a?(Hash) && switch = @switches[name]
136
+ if switch.enum && !switch.enum.include?(value)
137
+ fail MalformattedArgumentError, "Expected '#{name}' to be one of #{switch.enum.join(', ')}; got #{value}"
139
138
  end
139
+ end
140
140
  value
141
141
  end
142
142
 
@@ -167,7 +167,7 @@ class Thor
167
167
  o.respond_to?(:switch_name) ? o.switch_name : o.human_name
168
168
  end.join("', '")
169
169
 
170
- class_name = self.class.name.split('::').last.downcase
170
+ class_name = self.class.name.split("::").last.downcase
171
171
  fail RequiredArgumentMissingError, "No value provided for required #{class_name} '#{names}'"
172
172
  end
173
173
  end
@@ -1,4 +1,4 @@
1
- class Thor
1
+ class Bundler::Thor
2
2
  class Option < Argument #:nodoc:
3
3
  attr_reader :aliases, :group, :lazy_default, :hide
4
4
 
@@ -78,15 +78,19 @@ class Thor
78
78
 
79
79
  def usage(padding = 0)
80
80
  sample = if banner && !banner.to_s.empty?
81
- "#{switch_name}=#{banner}"
82
- else
83
- switch_name
84
- end
81
+ "#{switch_name}=#{banner}"
82
+ else
83
+ switch_name
84
+ end
85
85
 
86
86
  sample = "[#{sample}]" unless required?
87
87
 
88
+ if boolean?
89
+ sample << ", [#{dasherize("no-" + human_name)}]" unless name == "force"
90
+ end
91
+
88
92
  if aliases.empty?
89
- (' ' * padding) << sample
93
+ (" " * padding) << sample
90
94
  else
91
95
  "#{aliases.join(', ')}, #{sample}"
92
96
  end
@@ -103,19 +107,19 @@ class Thor
103
107
  protected
104
108
 
105
109
  def validate!
106
- fail ArgumentError, 'An option cannot be boolean and required.' if boolean? && required?
110
+ fail ArgumentError, "An option cannot be boolean and required." if boolean? && required?
107
111
  end
108
112
 
109
113
  def dasherized?
110
- name.index('-') == 0
114
+ name.index("-") == 0
111
115
  end
112
116
 
113
117
  def undasherize(str)
114
- str.sub(/^-{1,2}/, '')
118
+ str.sub(/^-{1,2}/, "")
115
119
  end
116
120
 
117
121
  def dasherize(str)
118
- (str.length > 1 ? '--' : '-') + str.gsub('_', '-')
122
+ (str.length > 1 ? "--" : "-") + str.gsub("_", "-")
119
123
  end
120
124
  end
121
125
  end
@@ -1,11 +1,11 @@
1
- class Thor
1
+ class Bundler::Thor
2
2
  class Options < Arguments #:nodoc: # rubocop:disable ClassLength
3
3
  LONG_RE = /^(--\w+(?:-\w+)*)$/
4
4
  SHORT_RE = /^(-[a-z])$/i
5
5
  EQ_RE = /^(--\w+(?:-\w+)*|-[a-z])=(.*)$/i
6
6
  SHORT_SQ_RE = /^-([a-z]{2,})$/i # Allow either -x -v or -xv style for single char args
7
7
  SHORT_NUM = /^(-[a-z])#{NUMERIC}$/i
8
- OPTS_END = '--'.freeze
8
+ OPTS_END = "--".freeze
9
9
 
10
10
  # Receives a hash and makes it switches.
11
11
  def self.to_switches(options)
@@ -18,14 +18,14 @@ class Thor
18
18
  when Hash
19
19
  "--#{key} #{value.map { |k, v| "#{k}:#{v}" }.join(' ')}"
20
20
  when nil, false
21
- ''
21
+ ""
22
22
  else
23
23
  "--#{key} #{value.inspect}"
24
24
  end
25
- end.join(' ')
25
+ end.join(" ")
26
26
  end
27
27
 
28
- # Takes a hash of Thor::Option and a hash with defaults.
28
+ # Takes a hash of Bundler::Thor::Option and a hash with defaults.
29
29
  #
30
30
  # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
31
31
  # an unknown option or a regular argument.
@@ -46,7 +46,7 @@ class Thor
46
46
  @switches[option.switch_name] = option
47
47
 
48
48
  option.aliases.each do |short|
49
- name = short.to_s.sub(/^(?!\-)/, '-')
49
+ name = short.to_s.sub(/^(?!\-)/, "-")
50
50
  @shorts[name] ||= option.switch_name
51
51
  end
52
52
  end
@@ -81,7 +81,7 @@ class Thor
81
81
  if is_switch
82
82
  case shifted
83
83
  when SHORT_SQ_RE
84
- unshift($1.split('').map { |f| "-#{f}" })
84
+ unshift($1.split("").map { |f| "-#{f}" })
85
85
  next
86
86
  when EQ_RE, SHORT_NUM
87
87
  unshift($2)
@@ -111,7 +111,7 @@ class Thor
111
111
 
112
112
  check_requirement!
113
113
 
114
- assigns = Thor::CoreExt::HashWithIndifferentAccess.new(@assigns)
114
+ assigns = Bundler::Thor::CoreExt::HashWithIndifferentAccess.new(@assigns)
115
115
  assigns.freeze
116
116
  assigns
117
117
  end
@@ -133,7 +133,7 @@ class Thor
133
133
  when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
134
134
  [true, switch?($1)]
135
135
  when SHORT_SQ_RE
136
- [true, $1.split('').any? { |f| switch?("-#{f}") }]
136
+ [true, $1.split("").any? { |f| switch?("-#{f}") }]
137
137
  else
138
138
  [false, false]
139
139
  end
@@ -167,7 +167,7 @@ class Thor
167
167
  # Check if the given argument is actually a shortcut.
168
168
  #
169
169
  def normalize_switch(arg)
170
- (@shorts[arg] || arg).tr('_', '-')
170
+ (@shorts[arg] || arg).tr("_", "-")
171
171
  end
172
172
 
173
173
  def parsing_options?
@@ -179,10 +179,10 @@ class Thor
179
179
  #
180
180
  def parse_boolean(switch)
181
181
  if current_is_value?
182
- if ['true', 'TRUE', 't', 'T', true].include?(peek)
182
+ if ["true", "TRUE", "t", "T", true].include?(peek)
183
183
  shift
184
184
  true
185
- elsif ['false', 'FALSE', 'f', 'F', false].include?(peek)
185
+ elsif ["false", "FALSE", "f", "F", false].include?(peek)
186
186
  shift
187
187
  false
188
188
  else
@@ -1,15 +1,15 @@
1
- require 'rake'
2
- require 'rake/dsl_definition'
1
+ require "rake"
2
+ require "rake/dsl_definition"
3
3
 
4
- class Thor
5
- # Adds a compatibility layer to your Thor classes which allows you to use
4
+ class Bundler::Thor
5
+ # Adds a compatibility layer to your Bundler::Thor classes which allows you to use
6
6
  # rake package tasks. For example, to use rspec rake tasks, one can do:
7
7
  #
8
8
  # require 'thor/rake_compat'
9
9
  # require 'rspec/core/rake_task'
10
10
  #
11
- # class Default < Thor
12
- # include Thor::RakeCompat
11
+ # class Default < Bundler::Thor
12
+ # include Bundler::Thor::RakeCompat
13
13
  #
14
14
  # RSpec::Core::RakeTask.new(:spec) do |t|
15
15
  # t.spec_opts = ['--options', './.rspec']
@@ -40,11 +40,11 @@ instance_eval do
40
40
  def task(*)
41
41
  task = super
42
42
 
43
- if klass = Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
44
- non_namespaced_name = task.name.split(':').last
43
+ if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
44
+ non_namespaced_name = task.name.split(":").last
45
45
 
46
46
  description = non_namespaced_name
47
- description << task.arg_names.map { |n| n.to_s.upcase }.join(' ')
47
+ description << task.arg_names.map { |n| n.to_s.upcase }.join(" ")
48
48
  description.strip!
49
49
 
50
50
  klass.desc description, Rake.application.last_description || non_namespaced_name
@@ -58,14 +58,14 @@ instance_eval do
58
58
  end
59
59
 
60
60
  def namespace(name)
61
- if klass = Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
62
- const_name = Thor::Util.camel_case(name.to_s).to_sym
63
- klass.const_set(const_name, Class.new(Thor))
61
+ if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
62
+ const_name = Bundler::Thor::Util.camel_case(name.to_s).to_sym
63
+ klass.const_set(const_name, Class.new(Bundler::Thor))
64
64
  new_klass = klass.const_get(const_name)
65
- Thor::RakeCompat.rake_classes << new_klass
65
+ Bundler::Thor::RakeCompat.rake_classes << new_klass
66
66
  end
67
67
 
68
68
  super
69
- Thor::RakeCompat.rake_classes.pop
69
+ Bundler::Thor::RakeCompat.rake_classes.pop
70
70
  end
71
71
  end
@@ -1,42 +1,42 @@
1
- require 'thor'
2
- require 'thor/group'
3
- require 'thor/core_ext/io_binary_read'
1
+ require "thor"
2
+ require "thor/group"
3
+ require "thor/core_ext/io_binary_read"
4
4
 
5
- require 'fileutils'
6
- require 'open-uri'
7
- require 'yaml'
8
- require 'digest/md5'
9
- require 'pathname'
5
+ require "fileutils"
6
+ require "open-uri"
7
+ require "yaml"
8
+ require "digest/md5"
9
+ require "pathname"
10
10
 
11
- class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
12
- map '-T' => :list, '-i' => :install, '-u' => :update, '-v' => :version
11
+ class Bundler::Thor::Runner < Bundler::Thor #:nodoc: # rubocop:disable ClassLength
12
+ map "-T" => :list, "-i" => :install, "-u" => :update, "-v" => :version
13
13
 
14
- # Override Thor#help so it can give information about any class and any method.
14
+ # Override Bundler::Thor#help so it can give information about any class and any method.
15
15
  #
16
16
  def help(meth = nil)
17
17
  if meth && !self.respond_to?(meth)
18
18
  initialize_thorfiles(meth)
19
- klass, command = Thor::Util.find_class_and_command_by_namespace(meth)
19
+ klass, command = Bundler::Thor::Util.find_class_and_command_by_namespace(meth)
20
20
  self.class.handle_no_command_error(command, false) if klass.nil?
21
- klass.start(['-h', command].compact, :shell => shell)
21
+ klass.start(["-h", command].compact, :shell => shell)
22
22
  else
23
23
  super
24
24
  end
25
25
  end
26
26
 
27
- # If a command is not found on Thor::Runner, method missing is invoked and
28
- # Thor::Runner is then responsible for finding the command in all classes.
27
+ # If a command is not found on Bundler::Thor::Runner, method missing is invoked and
28
+ # Bundler::Thor::Runner is then responsible for finding the command in all classes.
29
29
  #
30
30
  def method_missing(meth, *args)
31
31
  meth = meth.to_s
32
32
  initialize_thorfiles(meth)
33
- klass, command = Thor::Util.find_class_and_command_by_namespace(meth)
33
+ klass, command = Bundler::Thor::Util.find_class_and_command_by_namespace(meth)
34
34
  self.class.handle_no_command_error(command, false) if klass.nil?
35
35
  args.unshift(command) if command
36
36
  klass.start(args, :shell => shell)
37
37
  end
38
38
 
39
- desc 'install NAME', 'Install an optionally named Thor file into your system commands'
39
+ desc "install NAME", "Install an optionally named Bundler::Thor file into your system commands"
40
40
  method_options :as => :string, :relative => :boolean, :force => :boolean
41
41
  def install(name) # rubocop:disable MethodLength
42
42
  initialize_thorfiles
@@ -45,7 +45,7 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
45
45
  # command in said directory.
46
46
  begin
47
47
  if File.directory?(File.expand_path(name))
48
- base, package = File.join(name, 'main.thor'), :directory
48
+ base, package = File.join(name, "main.thor"), :directory
49
49
  contents = open(base) { |input| input.read }
50
50
  else
51
51
  base, package = name, :file
@@ -57,14 +57,14 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
57
57
  fail Error, "Error opening file '#{name}'"
58
58
  end
59
59
 
60
- say 'Your Thorfile contains:'
60
+ say "Your Bundler::Thorfile contains:"
61
61
  say contents
62
62
 
63
- unless options['force']
64
- return false if no?('Do you wish to continue [y/N]?')
63
+ unless options["force"]
64
+ return false if no?("Do you wish to continue [y/N]?")
65
65
  end
66
66
 
67
- as = options['as'] || begin
67
+ as = options["as"] || begin
68
68
  first_line = contents.split("\n")[0]
69
69
  (match = first_line.match(/\s*#\s*module:\s*([^\n]*)/)) ? match[1].strip : nil
70
70
  end
@@ -76,23 +76,23 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
76
76
  end
77
77
 
78
78
  location = if options[:relative] || name =~ %r{^https?://}
79
- name
80
- else
81
- File.expand_path(name)
82
- end
79
+ name
80
+ else
81
+ File.expand_path(name)
82
+ end
83
83
 
84
84
  thor_yaml[as] = {
85
85
  :filename => Digest::MD5.hexdigest(name + as),
86
86
  :location => location,
87
- :namespaces => Thor::Util.namespaces_in_content(contents, base)
87
+ :namespaces => Bundler::Thor::Util.namespaces_in_content(contents, base)
88
88
  }
89
89
 
90
90
  save_yaml(thor_yaml)
91
- say 'Storing thor file in your system repository'
91
+ say "Storing thor file in your system repository"
92
92
  destination = File.join(thor_root, thor_yaml[as][:filename])
93
93
 
94
94
  if package == :file
95
- File.open(destination, 'w') { |f| f.puts contents }
95
+ File.open(destination, "w") { |f| f.puts contents }
96
96
  else
97
97
  FileUtils.cp_r(name, destination)
98
98
  end
@@ -100,13 +100,13 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
100
100
  thor_yaml[as][:filename] # Indicate success
101
101
  end
102
102
 
103
- desc 'version', 'Show Thor version'
103
+ desc "version", "Show Bundler::Thor version"
104
104
  def version
105
- require 'thor/version'
106
- say "Thor #{Thor::VERSION}"
105
+ require "thor/version"
106
+ say "Bundler::Thor #{Bundler::Thor::VERSION}"
107
107
  end
108
108
 
109
- desc 'uninstall NAME', 'Uninstall a named Thor module'
109
+ desc "uninstall NAME", "Uninstall a named Bundler::Thor module"
110
110
  def uninstall(name)
111
111
  fail Error, "Can't find module '#{name}'" unless thor_yaml[name]
112
112
  say "Uninstalling #{name}."
@@ -115,17 +115,17 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
115
115
  thor_yaml.delete(name)
116
116
  save_yaml(thor_yaml)
117
117
 
118
- puts 'Done.'
118
+ puts "Done."
119
119
  end
120
120
 
121
- desc 'update NAME', 'Update a Thor file from its original location'
121
+ desc "update NAME", "Update a Bundler::Thor file from its original location"
122
122
  def update(name)
123
123
  fail Error, "Can't find module '#{name}'" if !thor_yaml[name] || !thor_yaml[name][:location]
124
124
 
125
125
  say "Updating '#{name}' from #{thor_yaml[name][:location]}"
126
126
 
127
127
  old_filename = thor_yaml[name][:filename]
128
- self.options = options.merge('as' => name)
128
+ self.options = options.merge("as" => name)
129
129
 
130
130
  if File.directory? File.expand_path(name)
131
131
  FileUtils.rm_rf(File.join(thor_root, old_filename))
@@ -143,23 +143,23 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
143
143
  end
144
144
  end
145
145
 
146
- desc 'installed', 'List the installed Thor modules and commands'
146
+ desc "installed", "List the installed Bundler::Thor modules and commands"
147
147
  method_options :internal => :boolean
148
148
  def installed
149
149
  initialize_thorfiles(nil, true)
150
- display_klasses(true, options['internal'])
150
+ display_klasses(true, options["internal"])
151
151
  end
152
152
 
153
- desc 'list [SEARCH]', 'List the available thor commands (--substring means .*SEARCH)'
153
+ desc "list [SEARCH]", "List the available thor commands (--substring means .*SEARCH)"
154
154
  method_options :substring => :boolean, :group => :string, :all => :boolean, :debug => :boolean
155
- def list(search = '')
155
+ def list(search = "")
156
156
  initialize_thorfiles
157
157
 
158
- search = ".*#{search}" if options['substring']
158
+ search = ".*#{search}" if options["substring"]
159
159
  search = /^#{search}.*/i
160
- group = options[:group] || 'standard'
160
+ group = options[:group] || "standard"
161
161
 
162
- klasses = Thor::Base.subclasses.select do |k|
162
+ klasses = Bundler::Thor::Base.subclasses.select do |k|
163
163
  (options[:all] || k.group == group) && k.namespace =~ search
164
164
  end
165
165
 
@@ -169,16 +169,16 @@ class Thor::Runner < Thor #:nodoc: # rubocop:disable ClassLength
169
169
  private
170
170
 
171
171
  def self.banner(command, all = false, subcommand = false)
172
- 'thor ' + command.formatted_usage(self, all, subcommand)
172
+ "thor " + command.formatted_usage(self, all, subcommand)
173
173
  end
174
174
 
175
175
  def thor_root
176
- Thor::Util.thor_root
176
+ Bundler::Thor::Util.thor_root
177
177
  end
178
178
 
179
179
  def thor_yaml
180
180
  @thor_yaml ||= begin
181
- yaml_file = File.join(thor_root, 'thor.yml')
181
+ yaml_file = File.join(thor_root, "thor.yml")
182
182
  yaml = YAML.load_file(yaml_file) if File.exist?(yaml_file)
183
183
  yaml || {}
184
184
  end
@@ -187,39 +187,39 @@ private
187
187
  # Save the yaml file. If none exists in thor root, creates one.
188
188
  #
189
189
  def save_yaml(yaml)
190
- yaml_file = File.join(thor_root, 'thor.yml')
190
+ yaml_file = File.join(thor_root, "thor.yml")
191
191
 
192
192
  unless File.exist?(yaml_file)
193
193
  FileUtils.mkdir_p(thor_root)
194
- yaml_file = File.join(thor_root, 'thor.yml')
194
+ yaml_file = File.join(thor_root, "thor.yml")
195
195
  FileUtils.touch(yaml_file)
196
196
  end
197
197
 
198
- File.open(yaml_file, 'w') { |f| f.puts yaml.to_yaml }
198
+ File.open(yaml_file, "w") { |f| f.puts yaml.to_yaml }
199
199
  end
200
200
 
201
201
  def self.exit_on_failure?
202
202
  true
203
203
  end
204
204
 
205
- # Load the Thorfiles. If relevant_to is supplied, looks for specific files
205
+ # Load the Bundler::Thorfiles. If relevant_to is supplied, looks for specific files
206
206
  # in the thor_root instead of loading them all.
207
207
  #
208
- # By default, it also traverses the current path until find Thor files, as
208
+ # By default, it also traverses the current path until find Bundler::Thor files, as
209
209
  # described in thorfiles. This look up can be skipped by supplying
210
210
  # skip_lookup true.
211
211
  #
212
212
  def initialize_thorfiles(relevant_to = nil, skip_lookup = false)
213
213
  thorfiles(relevant_to, skip_lookup).each do |f|
214
- Thor::Util.load_thorfile(f, nil, options[:debug]) unless Thor::Base.subclass_files.keys.include?(File.expand_path(f))
214
+ Bundler::Thor::Util.load_thorfile(f, nil, options[:debug]) unless Bundler::Thor::Base.subclass_files.keys.include?(File.expand_path(f))
215
215
  end
216
216
  end
217
217
 
218
- # Finds Thorfiles by traversing from your current directory down to the root
219
- # directory of your system. If at any time we find a Thor file, we stop.
218
+ # Finds Bundler::Thorfiles by traversing from your current directory down to the root
219
+ # directory of your system. If at any time we find a Bundler::Thor file, we stop.
220
220
  #
221
- # We also ensure that system-wide Thorfiles are loaded first, so local
222
- # Thorfiles can override them.
221
+ # We also ensure that system-wide Bundler::Thorfiles are loaded first, so local
222
+ # Bundler::Thorfiles can override them.
223
223
  #
224
224
  # ==== Example
225
225
  #
@@ -227,7 +227,7 @@ private
227
227
  #
228
228
  # 1. /Users/wycats/dev/thor
229
229
  # 2. /Users/wycats/dev
230
- # 3. /Users/wycats <-- we find a Thorfile here, so we stop
230
+ # 3. /Users/wycats <-- we find a Bundler::Thorfile here, so we stop
231
231
  #
232
232
  # Suppose we start at c:\Documents and Settings\james\dev\thor ...
233
233
  #
@@ -235,33 +235,33 @@ private
235
235
  # 2. c:\Documents and Settings\james\dev
236
236
  # 3. c:\Documents and Settings\james
237
237
  # 4. c:\Documents and Settings
238
- # 5. c:\ <-- no Thorfiles found!
238
+ # 5. c:\ <-- no Bundler::Thorfiles found!
239
239
  #
240
240
  def thorfiles(relevant_to = nil, skip_lookup = false)
241
241
  thorfiles = []
242
242
 
243
243
  unless skip_lookup
244
244
  Pathname.pwd.ascend do |path|
245
- thorfiles = Thor::Util.globs_for(path).map { |g| Dir[g] }.flatten
245
+ thorfiles = Bundler::Thor::Util.globs_for(path).map { |g| Dir[g] }.flatten
246
246
  break unless thorfiles.empty?
247
247
  end
248
248
  end
249
249
 
250
- files = (relevant_to ? thorfiles_relevant_to(relevant_to) : Thor::Util.thor_root_glob)
250
+ files = (relevant_to ? thorfiles_relevant_to(relevant_to) : Bundler::Thor::Util.thor_root_glob)
251
251
  files += thorfiles
252
252
  files -= ["#{thor_root}/thor.yml"]
253
253
 
254
254
  files.map! do |file|
255
- File.directory?(file) ? File.join(file, 'main.thor') : file
255
+ File.directory?(file) ? File.join(file, "main.thor") : file
256
256
  end
257
257
  end
258
258
 
259
- # Load Thorfiles relevant to the given method. If you provide "foo:bar" it
259
+ # Load Bundler::Thorfiles relevant to the given method. If you provide "foo:bar" it
260
260
  # will load all thor files in the thor.yaml that has "foo" e "foo:bar"
261
261
  # namespaces registered.
262
262
  #
263
263
  def thorfiles_relevant_to(meth)
264
- lookup = [meth, meth.split(':')[0...-1].join(':')]
264
+ lookup = [meth, meth.split(":")[0...-1].join(":")]
265
265
 
266
266
  files = thor_yaml.select do |k, v|
267
267
  v[:namespaces] && !(v[:namespaces] & lookup).empty?
@@ -273,24 +273,24 @@ private
273
273
  # Display information about the given klasses. If with_module is given,
274
274
  # it shows a table with information extracted from the yaml file.
275
275
  #
276
- def display_klasses(with_modules = false, show_internal = false, klasses = Thor::Base.subclasses)
277
- klasses -= [Thor, Thor::Runner, Thor::Group] unless show_internal
276
+ def display_klasses(with_modules = false, show_internal = false, klasses = Bundler::Thor::Base.subclasses)
277
+ klasses -= [Bundler::Thor, Bundler::Thor::Runner, Bundler::Thor::Group] unless show_internal
278
278
 
279
- fail Error, 'No Thor commands available' if klasses.empty?
279
+ fail Error, "No Bundler::Thor commands available" if klasses.empty?
280
280
  show_modules if with_modules && !thor_yaml.empty?
281
281
 
282
282
  list = Hash.new { |h, k| h[k] = [] }
283
- groups = klasses.select { |k| k.ancestors.include?(Thor::Group) }
283
+ groups = klasses.select { |k| k.ancestors.include?(Bundler::Thor::Group) }
284
284
 
285
- # Get classes which inherit from Thor
286
- (klasses - groups).each { |k| list[k.namespace.split(':').first] += k.printable_commands(false) }
285
+ # Get classes which inherit from Bundler::Thor
286
+ (klasses - groups).each { |k| list[k.namespace.split(":").first] += k.printable_commands(false) }
287
287
 
288
- # Get classes which inherit from Thor::Base
288
+ # Get classes which inherit from Bundler::Thor::Base
289
289
  groups.map! { |k| k.printable_commands(false).first }
290
- list['root'] = groups
290
+ list["root"] = groups
291
291
 
292
292
  # Order namespaces with default coming first
293
- list = list.sort { |a, b| a[0].sub(/^default/, '') <=> b[0].sub(/^default/, '') }
293
+ list = list.sort { |a, b| a[0].sub(/^default/, "") <=> b[0].sub(/^default/, "") }
294
294
  list.each { |n, commands| display_commands(n, commands) unless commands.empty? }
295
295
  end
296
296
 
@@ -298,7 +298,7 @@ private
298
298
  list.sort! { |a, b| a[0] <=> b[0] }
299
299
 
300
300
  say shell.set_color(namespace, :blue, true)
301
- say '-' * namespace.size
301
+ say "-" * namespace.size
302
302
 
303
303
  print_table(list, :truncate => true)
304
304
  say
@@ -310,13 +310,13 @@ private
310
310
  labels = %w[Modules Namespaces]
311
311
 
312
312
  info << labels
313
- info << ['-' * labels[0].size, '-' * labels[1].size]
313
+ info << ["-" * labels[0].size, "-" * labels[1].size]
314
314
 
315
315
  thor_yaml.each do |name, hash|
316
- info << [name, hash[:namespaces].join(', ')]
316
+ info << [name, hash[:namespaces].join(", ")]
317
317
  end
318
318
 
319
319
  print_table info
320
- say ''
320
+ say ""
321
321
  end
322
322
  end