bundler 1.2.5 → 1.3.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 (124) hide show
  1. data/.gitignore +10 -7
  2. data/.travis.yml +12 -3
  3. data/CHANGELOG.md +26 -19
  4. data/CONTRIBUTE.md +97 -0
  5. data/README.md +4 -2
  6. data/Rakefile +17 -59
  7. data/bundler.gemspec +2 -1
  8. data/lib/bundler.rb +23 -20
  9. data/lib/bundler/cli.rb +68 -22
  10. data/lib/bundler/definition.rb +3 -2
  11. data/lib/bundler/deprecate.rb +15 -0
  12. data/lib/bundler/dsl.rb +14 -16
  13. data/lib/bundler/environment.rb +0 -5
  14. data/lib/bundler/fetcher.rb +23 -78
  15. data/lib/bundler/friendly_errors.rb +4 -5
  16. data/lib/bundler/gem_helper.rb +14 -16
  17. data/lib/bundler/injector.rb +64 -0
  18. data/lib/bundler/installer.rb +1 -7
  19. data/lib/bundler/lazy_specification.rb +6 -3
  20. data/lib/bundler/lockfile_parser.rb +25 -13
  21. data/lib/bundler/resolver.rb +0 -1
  22. data/lib/bundler/rubygems_integration.rb +83 -17
  23. data/lib/bundler/settings.rb +4 -2
  24. data/lib/bundler/similarity_detector.rb +63 -0
  25. data/lib/bundler/source.rb +3 -886
  26. data/lib/bundler/source/git.rb +267 -0
  27. data/lib/bundler/source/git/git_proxy.rb +142 -0
  28. data/lib/bundler/source/path.rb +209 -0
  29. data/lib/bundler/source/path/installer.rb +33 -0
  30. data/lib/bundler/source/rubygems.rb +261 -0
  31. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
  32. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  33. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
  34. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  35. data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
  36. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
  37. data/lib/bundler/ui.rb +20 -5
  38. data/lib/bundler/vendor/.document +0 -0
  39. data/lib/bundler/vendor/thor.rb +74 -5
  40. data/lib/bundler/vendor/thor/actions.rb +5 -5
  41. data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
  42. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
  43. data/lib/bundler/vendor/thor/base.rb +44 -11
  44. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
  45. data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
  46. data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
  47. data/lib/bundler/vendor/thor/parser/option.rb +8 -8
  48. data/lib/bundler/vendor/thor/parser/options.rb +62 -24
  49. data/lib/bundler/vendor/thor/runner.rb +1 -1
  50. data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
  51. data/lib/bundler/vendor/thor/task.rb +2 -2
  52. data/lib/bundler/vendor/thor/version.rb +1 -1
  53. data/lib/bundler/vendored_persistent.rb +3 -15
  54. data/lib/bundler/version.rb +1 -1
  55. data/man/bundle-exec.ronn +1 -1
  56. data/man/bundle-update.ronn +1 -1
  57. data/man/bundle.ronn +4 -1
  58. data/spec/bundler/bundler_spec.rb +2 -28
  59. data/spec/bundler/cli_rspec.rb +9 -0
  60. data/spec/bundler/definition_spec.rb +1 -1
  61. data/spec/bundler/dsl_spec.rb +15 -8
  62. data/spec/bundler/gem_helper_spec.rb +38 -21
  63. data/spec/bundler/psyched_yaml_spec.rb +1 -0
  64. data/spec/bundler/source_spec.rb +3 -3
  65. data/spec/cache/gems_spec.rb +24 -24
  66. data/spec/cache/git_spec.rb +21 -23
  67. data/spec/cache/path_spec.rb +11 -11
  68. data/spec/cache/platform_spec.rb +6 -6
  69. data/spec/install/deploy_spec.rb +38 -38
  70. data/spec/install/gems/c_ext_spec.rb +2 -2
  71. data/spec/install/gems/dependency_api_spec.rb +23 -116
  72. data/spec/install/gems/env_spec.rb +1 -1
  73. data/spec/install/gems/flex_spec.rb +7 -8
  74. data/spec/install/gems/groups_spec.rb +10 -10
  75. data/spec/install/gems/packed_spec.rb +4 -4
  76. data/spec/install/gems/platform_spec.rb +3 -3
  77. data/spec/install/gems/post_install_spec.rb +9 -9
  78. data/spec/install/gems/resolving_spec.rb +2 -2
  79. data/spec/install/gems/simple_case_spec.rb +50 -53
  80. data/spec/install/gems/standalone_spec.rb +19 -19
  81. data/spec/install/gems/sudo_spec.rb +31 -16
  82. data/spec/install/gems/win32_spec.rb +1 -1
  83. data/spec/install/gemspec_spec.rb +6 -6
  84. data/spec/install/git_spec.rb +34 -34
  85. data/spec/install/invalid_spec.rb +3 -3
  86. data/spec/install/path_spec.rb +71 -8
  87. data/spec/install/upgrade_spec.rb +2 -2
  88. data/spec/integration/inject.rb +78 -0
  89. data/spec/lock/git_spec.rb +2 -2
  90. data/spec/lock/lockfile_spec.rb +14 -14
  91. data/spec/other/check_spec.rb +29 -29
  92. data/spec/other/clean_spec.rb +47 -48
  93. data/spec/other/config_spec.rb +20 -20
  94. data/spec/other/console_spec.rb +5 -5
  95. data/spec/other/exec_spec.rb +48 -28
  96. data/spec/other/ext_spec.rb +3 -3
  97. data/spec/other/help_spec.rb +6 -6
  98. data/spec/other/init_spec.rb +8 -8
  99. data/spec/other/newgem_spec.rb +95 -15
  100. data/spec/other/open_spec.rb +10 -5
  101. data/spec/other/outdated_spec.rb +8 -8
  102. data/spec/other/platform_spec.rb +45 -45
  103. data/spec/other/show_spec.rb +10 -10
  104. data/spec/quality_spec.rb +2 -2
  105. data/spec/realworld/dependency_api_spec.rb +61 -0
  106. data/spec/realworld/edgecases_spec.rb +8 -8
  107. data/spec/runtime/executable_spec.rb +13 -13
  108. data/spec/runtime/load_spec.rb +12 -12
  109. data/spec/runtime/platform_spec.rb +1 -1
  110. data/spec/runtime/require_spec.rb +24 -24
  111. data/spec/runtime/setup_spec.rb +113 -56
  112. data/spec/runtime/with_clean_env_spec.rb +11 -13
  113. data/spec/spec_helper.rb +6 -0
  114. data/spec/support/artifice/endpoint.rb +28 -13
  115. data/spec/support/artifice/endpoint_extra.rb +4 -0
  116. data/spec/support/builders.rb +1 -1
  117. data/spec/support/helpers.rb +2 -7
  118. data/spec/support/indexes.rb +3 -3
  119. data/spec/support/matchers.rb +6 -6
  120. data/spec/update/gems_spec.rb +19 -8
  121. data/spec/update/git_spec.rb +10 -10
  122. data/spec/update/source_spec.rb +1 -1
  123. metadata +86 -55
  124. data/.rspec +0 -2
@@ -114,12 +114,12 @@ class Thor
114
114
  # the script started).
115
115
  #
116
116
  def relative_to_original_destination_root(path, remove_dot=true)
117
- if path =~ /^#{@destination_stack[0]}/
118
- path = path.gsub(@destination_stack[0], '.')
119
- path = remove_dot ? (path[2..-1] || '') : path
117
+ path = path.dup
118
+ if path.gsub!(@destination_stack[0], '.')
119
+ remove_dot ? (path[2..-1] || '') : path
120
+ else
121
+ path
120
122
  end
121
-
122
- path
123
123
  end
124
124
 
125
125
  # Holds source paths in instance so they can be manipulated.
@@ -38,6 +38,7 @@ class Thor
38
38
  # destination<String>:: the relative path to the destination root.
39
39
  # config<Hash>:: give :verbose => false to not log the status.
40
40
  # If :recursive => false, does not look for paths recursively.
41
+ # If :mode => :preserve, preserve the file mode from the source.
41
42
  #
42
43
  # ==== Examples
43
44
  #
@@ -10,7 +10,9 @@ class Thor
10
10
  # ==== Parameters
11
11
  # source<String>:: the relative path to the source root.
12
12
  # destination<String>:: the relative path to the destination root.
13
- # config<Hash>:: give :verbose => false to not log the status.
13
+ # config<Hash>:: give :verbose => false to not log the status, and
14
+ # :mode => :preserve, to preserve the file mode from the source.
15
+
14
16
  #
15
17
  # ==== Examples
16
18
  #
@@ -28,6 +30,10 @@ class Thor
28
30
  content = block.call(content) if block
29
31
  content
30
32
  end
33
+ if config[:mode] == :preserve
34
+ mode = File.stat(source).mode
35
+ chmod(destination, mode, config)
36
+ end
31
37
  end
32
38
 
33
39
  # Links the file from the relative source to the relative destination. If
@@ -10,6 +10,7 @@ require 'thor/util'
10
10
  class Thor
11
11
  autoload :Actions, 'thor/actions'
12
12
  autoload :RakeCompat, 'thor/rake_compat'
13
+ autoload :Group, 'thor/group'
13
14
 
14
15
  # Shortcuts for help.
15
16
  HELP_MAPPINGS = %w(-h -? --help -D)
@@ -58,7 +59,8 @@ class Thor
58
59
  # Let Thor::Options parse the options first, so it can remove
59
60
  # declared options from the array. This will leave us with
60
61
  # a list of arguments that weren't declared.
61
- opts = Thor::Options.new(parse_options, hash_options)
62
+ stop_on_unknown = self.class.stop_on_unknown_option? config[:current_task]
63
+ opts = Thor::Options.new(parse_options, hash_options, stop_on_unknown)
62
64
  self.options = opts.parse(array_options)
63
65
 
64
66
  # If unknown options are disallowed, make sure that none of the
@@ -70,11 +72,12 @@ class Thor
70
72
  # arguments declared using #argument (this is primarily used
71
73
  # by Thor::Group). Tis will leave us with the remaining
72
74
  # positional arguments.
73
- thor_args = Thor::Arguments.new(self.class.arguments)
74
- thor_args.parse(args + opts.remaining).each { |k,v| send("#{k}=", v) }
75
- args = thor_args.remaining
75
+ to_parse = args
76
+ to_parse += opts.remaining unless self.class.strict_args_position?(config)
76
77
 
77
- @args = args
78
+ thor_args = Thor::Arguments.new(self.class.arguments)
79
+ thor_args.parse(to_parse).each { |k,v| __send__("#{k}=", v) }
80
+ @args = thor_args.remaining
78
81
  end
79
82
 
80
83
  class << self
@@ -141,6 +144,28 @@ class Thor
141
144
  !!check_unknown_options
142
145
  end
143
146
 
147
+ # If true, option parsing is suspended as soon as an unknown option or a
148
+ # regular argument is encountered. All remaining arguments are passed to
149
+ # the task as regular arguments.
150
+ def stop_on_unknown_option?(task_name) #:nodoc:
151
+ false
152
+ end
153
+
154
+ # If you want only strict string args (useful when cascading thor classes),
155
+ # call strict_args_position! This is disabled by default to allow dynamic
156
+ # invocations.
157
+ def strict_args_position!
158
+ @strict_args_position = true
159
+ end
160
+
161
+ def strict_args_position #:nodoc:
162
+ @strict_args_position ||= from_superclass(:strict_args_position, false)
163
+ end
164
+
165
+ def strict_args_position?(config) #:nodoc:
166
+ !!strict_args_position
167
+ end
168
+
144
169
  # Adds an argument to the class and creates an attr_accessor for it.
145
170
  #
146
171
  # Arguments are different from options in several aspects. The first one
@@ -196,8 +221,9 @@ class Thor
196
221
  "the non-required argument #{argument.human_name.inspect}."
197
222
  end if required
198
223
 
199
- arguments << Thor::Argument.new(name, options[:desc], required, options[:type],
200
- options[:default], options[:banner])
224
+ options[:required] = required
225
+
226
+ arguments << Thor::Argument.new(name, options)
201
227
  end
202
228
 
203
229
  # Returns this class arguments, looking up in the ancestors chain.
@@ -491,6 +517,7 @@ class Thor
491
517
 
492
518
  list << item
493
519
  list << [ "", "# Default: #{option.default}" ] if option.show_default?
520
+ list << [ "", "# Possible values: #{option.enum.join(', ')}" ] if option.enum
494
521
  end
495
522
  end
496
523
 
@@ -510,10 +537,9 @@ class Thor
510
537
  # ==== Parameters
511
538
  # name<Symbol>:: The name of the argument.
512
539
  # options<Hash>:: Described in both class_option and method_option.
540
+ # scope<Hash>:: Options hash that is being built up
513
541
  def build_option(name, options, scope) #:nodoc:
514
- scope[name] = Thor::Option.new(name, options[:desc], options[:required],
515
- options[:type], options[:default], options[:banner],
516
- options[:lazy_default], options[:group], options[:aliases], options[:hide])
542
+ scope[name] = Thor::Option.new(name, options)
517
543
  end
518
544
 
519
545
  # Receives a hash of options, parse them and add to the scope. This is a
@@ -576,7 +602,14 @@ class Thor
576
602
  default
577
603
  else
578
604
  value = superclass.send(method)
579
- value.dup if value
605
+
606
+ if value
607
+ if value.is_a?(TrueClass) || value.is_a?(Symbol)
608
+ value
609
+ else
610
+ value.dup
611
+ end
612
+ end
580
613
  end
581
614
  end
582
615
 
@@ -45,6 +45,11 @@ class Thor
45
45
  self
46
46
  end
47
47
 
48
+ # Convert to a Hash with String keys.
49
+ def to_hash
50
+ Hash.new(default).merge!(self)
51
+ end
52
+
48
53
  protected
49
54
 
50
55
  def convert_key(key)
@@ -2,21 +2,24 @@ class Thor
2
2
  class Argument #:nodoc:
3
3
  VALID_TYPES = [ :numeric, :hash, :array, :string ]
4
4
 
5
- attr_reader :name, :description, :required, :type, :default, :banner
5
+ attr_reader :name, :description, :enum, :required, :type, :default, :banner
6
6
  alias :human_name :name
7
7
 
8
- def initialize(name, description=nil, required=true, type=:string, default=nil, banner=nil)
8
+ def initialize(name, options={})
9
9
  class_name = self.class.name.split("::").last
10
10
 
11
+ type = options[:type]
12
+
11
13
  raise ArgumentError, "#{class_name} name can't be nil." if name.nil?
12
14
  raise ArgumentError, "Type :#{type} is not valid for #{class_name.downcase}s." if type && !valid_type?(type)
13
15
 
14
16
  @name = name.to_s
15
- @description = description
16
- @required = required || false
17
+ @description = options[:desc]
18
+ @required = options.key?(:required) ? options[:required] : true
17
19
  @type = (type || :string).to_sym
18
- @default = default
19
- @banner = banner || default_banner
20
+ @default = options[:default]
21
+ @banner = options[:banner] || default_banner
22
+ @enum = options[:enum]
20
23
 
21
24
  validate! # Trigger specific validations
22
25
  end
@@ -41,7 +44,11 @@ class Thor
41
44
  protected
42
45
 
43
46
  def validate!
44
- raise ArgumentError, "An argument cannot be required and have default value." if required? && !default.nil?
47
+ if required? && !default.nil?
48
+ raise ArgumentError, "An argument cannot be required and have default value."
49
+ elsif @enum && !@enum.is_a?(Array)
50
+ raise ArgumentError, "An argument cannot have an enum other than an array."
51
+ end
45
52
  end
46
53
 
47
54
  def valid_type?(type)
@@ -144,7 +144,13 @@ class Thor
144
144
  if no_or_skip?(name)
145
145
  nil
146
146
  else
147
- shift
147
+ value = shift
148
+ if @switches.is_a?(Hash) && switch = @switches[name]
149
+ if switch.enum && !switch.enum.include?(value)
150
+ raise MalformattedArgumentError, "Expected '#{name}' to be one of #{switch.enum.join(', ')}; got #{value}"
151
+ end
152
+ end
153
+ value
148
154
  end
149
155
  end
150
156
 
@@ -4,12 +4,13 @@ class Thor
4
4
 
5
5
  VALID_TYPES = [:boolean, :numeric, :hash, :array, :string]
6
6
 
7
- def initialize(name, description=nil, required=nil, type=nil, default=nil, banner=nil, lazy_default=nil, group=nil, aliases=nil, hide=nil)
8
- super(name, description, required, type, default, banner)
9
- @lazy_default = lazy_default
10
- @group = group.to_s.capitalize if group
11
- @aliases = [*aliases].compact
12
- @hide = hide
7
+ def initialize(name, options={})
8
+ options[:required] = false unless options.key?(:required)
9
+ super
10
+ @lazy_default = options[:lazy_default]
11
+ @group = options[:group].to_s.capitalize if options[:group]
12
+ @aliases = Array(options[:aliases])
13
+ @hide = options[:hide]
13
14
  end
14
15
 
15
16
  # This parse quick options given as method_options. It makes several
@@ -64,8 +65,7 @@ class Thor
64
65
  when Hash, Array, String
65
66
  value.class.name.downcase.to_sym
66
67
  end
67
-
68
- self.new(name.to_s, nil, required, type, default, nil, nil, nil, aliases)
68
+ self.new(name.to_s, :required => required, :type => type, :default => default, :aliases => aliases)
69
69
  end
70
70
 
71
71
  def switch_name
@@ -5,6 +5,7 @@ class Thor
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
9
 
9
10
  # Receives a hash and makes it switches.
10
11
  def self.to_switches(options)
@@ -25,7 +26,11 @@ class Thor
25
26
  end
26
27
 
27
28
  # Takes a hash of Thor::Option and a hash with defaults.
28
- def initialize(hash_options={}, defaults={})
29
+ #
30
+ # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
31
+ # an unknown option or a regular argument.
32
+ def initialize(hash_options={}, defaults={}, stop_on_unknown=false)
33
+ @stop_on_unknown = stop_on_unknown
29
34
  options = hash_options.values
30
35
  super(options)
31
36
 
@@ -50,33 +55,55 @@ class Thor
50
55
  @extra
51
56
  end
52
57
 
58
+ def peek
59
+ return super unless @parsing_options
60
+
61
+ result = super
62
+ if result == OPTS_END
63
+ shift
64
+ @parsing_options = false
65
+ super
66
+ else
67
+ result
68
+ end
69
+ end
70
+
53
71
  def parse(args)
54
72
  @pile = args.dup
73
+ @parsing_options = true
55
74
 
56
75
  while peek
57
- match, is_switch = current_is_switch?
58
- shifted = shift
59
-
60
- if is_switch
61
- case shifted
62
- when SHORT_SQ_RE
63
- unshift($1.split('').map { |f| "-#{f}" })
64
- next
65
- when EQ_RE, SHORT_NUM
66
- unshift($2)
67
- switch = $1
68
- when LONG_RE, SHORT_RE
69
- switch = $1
76
+ if parsing_options?
77
+ match, is_switch = current_is_switch?
78
+ shifted = shift
79
+
80
+ if is_switch
81
+ case shifted
82
+ when SHORT_SQ_RE
83
+ unshift($1.split('').map { |f| "-#{f}" })
84
+ next
85
+ when EQ_RE, SHORT_NUM
86
+ unshift($2)
87
+ switch = $1
88
+ when LONG_RE, SHORT_RE
89
+ switch = $1
90
+ end
91
+
92
+ switch = normalize_switch(switch)
93
+ option = switch_option(switch)
94
+ @assigns[option.human_name] = parse_peek(switch, option)
95
+ elsif @stop_on_unknown
96
+ @extra << shifted
97
+ @extra << shift while peek
98
+ break
99
+ elsif match
100
+ @extra << shifted
101
+ @extra << shift while peek && peek !~ /^-/
102
+ else
103
+ @extra << shifted
70
104
  end
71
-
72
- switch = normalize_switch(switch)
73
- option = switch_option(switch)
74
- @assigns[option.human_name] = parse_peek(switch, option)
75
- elsif match
76
- @extra << shifted
77
- @extra << shift while peek && peek !~ /^-/
78
105
  else
79
- @extra << shifted
106
+ @extra << shift
80
107
  end
81
108
  end
82
109
 
@@ -95,8 +122,10 @@ class Thor
95
122
 
96
123
  protected
97
124
 
98
- # Returns true if the current value in peek is a registered switch.
125
+ # Check if the current value in peek is a registered switch.
99
126
  #
127
+ # Two booleans are returned. The first is true if the current value
128
+ # starts with a hyphen; the second is true if it is a registered switch.
100
129
  def current_is_switch?
101
130
  case peek
102
131
  when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
@@ -117,6 +146,10 @@ class Thor
117
146
  end
118
147
  end
119
148
 
149
+ def current_is_value?
150
+ peek && (!parsing_options? || super)
151
+ end
152
+
120
153
  def switch?(arg)
121
154
  switch_option(normalize_switch(arg))
122
155
  end
@@ -135,6 +168,11 @@ class Thor
135
168
  (@shorts[arg] || arg).tr('_', '-')
136
169
  end
137
170
 
171
+ def parsing_options?
172
+ peek
173
+ @parsing_options
174
+ end
175
+
138
176
  # Parse boolean values which can be given as --foo=true, --foo or --no-foo.
139
177
  #
140
178
  def parse_boolean(switch)
@@ -156,7 +194,7 @@ class Thor
156
194
  # Parse the value at the peek analyzing if it requires an input or not.
157
195
  #
158
196
  def parse_peek(switch, option)
159
- if current_is_switch_formatted? || last?
197
+ if parsing_options? && (current_is_switch_formatted? || last?)
160
198
  if option.boolean?
161
199
  # No problem for boolean types
162
200
  elsif no_or_skip?(switch)
@@ -25,7 +25,7 @@ class Thor::Runner < Thor #:nodoc:
25
25
  end
26
26
 
27
27
  # If a task is not found on Thor::Runner, method missing is invoked and
28
- # Thor::Runner is then responsable for finding the task in all classes.
28
+ # Thor::Runner is then responsible for finding the task in all classes.
29
29
  #
30
30
  def method_missing(meth, *args)
31
31
  meth = meth.to_s
@@ -58,7 +58,7 @@ class Thor
58
58
  # ==== Example
59
59
  # say("I know you knew that.")
60
60
  #
61
- def say(message="", color=nil, force_new_line=(message.to_s !~ /( |\t)$/))
61
+ def say(message="", color=nil, force_new_line=(message.to_s !~ /( |\t)\Z/))
62
62
  message = message.to_s
63
63
 
64
64
  message = set_color(message, *color) if color
@@ -370,7 +370,7 @@ HELP
370
370
 
371
371
  def ask_simply(statement, color=nil)
372
372
  say("#{statement} ", color)
373
- stdin.gets.strip
373
+ stdin.gets.tap{|text| text.strip! if text}
374
374
  end
375
375
 
376
376
  def ask_filtered(statement, answer_set, *args)
@@ -24,9 +24,9 @@ class Thor
24
24
  instance.class.handle_no_task_error(name)
25
25
  elsif public_method?(instance)
26
26
  arity = instance.method(name).arity
27
- instance.send(name, *args)
27
+ instance.__send__(name, *args)
28
28
  elsif local_method?(instance, :method_missing)
29
- instance.send(:method_missing, name.to_sym, *args)
29
+ instance.__send__(:method_missing, name.to_sym, *args)
30
30
  else
31
31
  instance.class.handle_no_task_error(name)
32
32
  end
@@ -1,3 +1,3 @@
1
1
  class Thor
2
- VERSION = "0.15.2"
2
+ VERSION = "0.16.0"
3
3
  end
@@ -1,15 +1,3 @@
1
- begin
2
- require 'openssl'
3
- OpenSSL # ensure OpenSSL is loaded
4
-
5
- vendor = File.expand_path('../vendor', __FILE__)
6
- $:.unshift(vendor) unless $:.include?(vendor)
7
- require 'net/http/persistent'
8
-
9
- USE_PERSISTENT = true
10
-
11
- rescue LoadError, NameError => e
12
- require 'net/http'
13
- USE_PERSISTENT = false
14
-
15
- end
1
+ vendor = File.expand_path('../vendor', __FILE__)
2
+ $:.unshift(vendor) unless $:.include?(vendor)
3
+ require 'net/http/persistent'