thor 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49e18474eddb5dbf02c13be5b42104385928e460511272e7293cc66110d1c3d7
4
- data.tar.gz: ffea33d8f08051882551af3a444fe68a77ffe0ecfe16404f2ead662364d36b5e
3
+ metadata.gz: e94d00b16790c1908982c0fc76113f047ef1d190cba38b28269bff4be8d29191
4
+ data.tar.gz: 73c43412813c252302cc88b3aa3b5deee87ba9d1db20e2d6661714a7a4e88843
5
5
  SHA512:
6
- metadata.gz: bc1a58088c4c7b48166152c1f7cfc0c4dc91e9c3199e583e6085b74a2982f65c0eaa8d8b7595f8f5781c08b0f60818e4a014bb23adbdfb07fd2ded558ceef67e
7
- data.tar.gz: f9a3c7f81a55d75298e3655569a86f04aa2055088058eb0a30ce5b80e05c6be7ed9c0f1840031dd266c453a4ac1454d8749849b47659d2f53f8b1221b9db2b7b
6
+ metadata.gz: 5071358360989a17de4daa7f141b4d4f411d5914cf2d25e2856c4f95815f6ad6ecbaaec52a5a385a96d5277005cd61fec34c9401918b62de8c767cdae36a924d
7
+ data.tar.gz: 49a99cc7a21d9f9f90aef59325c543c8d82e9f22cff26fecfdfd3071d82c3ead068b82818b1cbe67ba7e3235edf29b0db0f74334723cbad5cd00808997bc1147
data/README.md CHANGED
@@ -2,14 +2,8 @@ Thor
2
2
  ====
3
3
 
4
4
  [![Gem Version](http://img.shields.io/gem/v/thor.svg)][gem]
5
- [![Build Status](http://img.shields.io/travis/erikhuda/thor.svg)][travis]
6
- [![Code Climate](http://img.shields.io/codeclimate/github/erikhuda/thor.svg)][codeclimate]
7
- [![Coverage Status](http://img.shields.io/coveralls/erikhuda/thor.svg)][coveralls]
8
5
 
9
6
  [gem]: https://rubygems.org/gems/thor
10
- [travis]: http://travis-ci.org/erikhuda/thor
11
- [codeclimate]: https://codeclimate.com/github/erikhuda/thor
12
- [coveralls]: https://coveralls.io/r/erikhuda/thor
13
7
 
14
8
  Description
15
9
  -----------
@@ -35,7 +29,7 @@ Usage and documentation
35
29
  -----------------------
36
30
  Please see the [wiki][] for basic usage and other documentation on using Thor. You can also checkout the [official homepage][homepage].
37
31
 
38
- [wiki]: https://github.com/erikhuda/thor/wiki
32
+ [wiki]: https://github.com/rails/thor/wiki
39
33
  [homepage]: http://whatisthor.com/
40
34
 
41
35
  Contributing
@@ -210,9 +210,9 @@ class Thor
210
210
  #
211
211
  # ==== Examples
212
212
  #
213
- # inject_into_class "app/controllers/application_controller.rb", ApplicationController, " filter_parameter :password\n"
213
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n"
214
214
  #
215
- # inject_into_class "app/controllers/application_controller.rb", ApplicationController do
215
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
216
216
  # " filter_parameter :password\n"
217
217
  # end
218
218
  #
@@ -233,9 +233,9 @@ class Thor
233
233
  #
234
234
  # ==== Examples
235
235
  #
236
- # inject_into_module "app/helpers/application_helper.rb", ApplicationHelper, " def help; 'help'; end\n"
236
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n"
237
237
  #
238
- # inject_into_module "app/helpers/application_helper.rb", ApplicationHelper do
238
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do
239
239
  # " def help; 'help'; end\n"
240
240
  # end
241
241
  #
@@ -331,7 +331,7 @@ class Thor
331
331
  path = File.expand_path(path, destination_root)
332
332
 
333
333
  say_status :remove, relative_to_original_destination_root(path), config.fetch(:verbose, true)
334
- if !options[:pretend] && File.exist?(path)
334
+ if !options[:pretend] && (File.exist?(path) || File.symlink?(path))
335
335
  require "fileutils"
336
336
  ::FileUtils.rm_rf(path)
337
337
  end
@@ -106,12 +106,14 @@ class Thor
106
106
  # Adds the content to the file.
107
107
  #
108
108
  def replace!(regexp, string, force)
109
- return if pretend?
110
109
  content = File.read(destination)
111
- if force || !content.include?(replacement)
110
+ before, after = content.split(regexp, 2)
111
+ snippet = (behavior == :after ? after : before).to_s
112
+
113
+ if force || !snippet.include?(replacement)
112
114
  success = content.gsub!(regexp, string)
113
115
 
114
- File.open(destination, "wb") { |file| file.write(content) }
116
+ File.open(destination, "wb") { |file| file.write(content) } unless pretend?
115
117
  success
116
118
  end
117
119
  end
data/lib/thor/actions.rb CHANGED
@@ -161,6 +161,8 @@ class Thor
161
161
  # to the block you provide. The path is set back to the previous path when
162
162
  # the method exits.
163
163
  #
164
+ # Returns the value yielded by the block.
165
+ #
164
166
  # ==== Parameters
165
167
  # dir<String>:: the directory to move to.
166
168
  # config<Hash>:: give :verbose => true to log and use padding.
@@ -179,16 +181,18 @@ class Thor
179
181
  FileUtils.mkdir_p(destination_root)
180
182
  end
181
183
 
184
+ result = nil
182
185
  if pretend
183
186
  # In pretend mode, just yield down to the block
184
- block.arity == 1 ? yield(destination_root) : yield
187
+ result = block.arity == 1 ? yield(destination_root) : yield
185
188
  else
186
189
  require "fileutils"
187
- FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield }
190
+ FileUtils.cd(destination_root) { result = block.arity == 1 ? yield(destination_root) : yield }
188
191
  end
189
192
 
190
193
  @destination_stack.pop
191
194
  shell.padding -= 1 if verbose
195
+ result
192
196
  end
193
197
 
194
198
  # Goes to the root and execute the given block.
@@ -28,6 +28,12 @@ class Thor
28
28
  super(convert_key(key))
29
29
  end
30
30
 
31
+ def except(*keys)
32
+ dup.tap do |hash|
33
+ keys.each { |key| hash.delete(convert_key(key)) }
34
+ end
35
+ end
36
+
31
37
  def fetch(key, *args)
32
38
  super(convert_key(key), *args)
33
39
  end
data/lib/thor/error.rb CHANGED
@@ -102,9 +102,14 @@ class Thor
102
102
  end
103
103
 
104
104
  if Correctable
105
- DidYouMean::SPELL_CHECKERS.merge!(
106
- 'Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
107
- 'Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
108
- )
105
+ if DidYouMean.respond_to?(:correct_error)
106
+ DidYouMean.correct_error(Thor::UndefinedCommandError, UndefinedCommandError::SpellChecker)
107
+ DidYouMean.correct_error(Thor::UnknownArgumentError, UnknownArgumentError::SpellChecker)
108
+ else
109
+ DidYouMean::SPELL_CHECKERS.merge!(
110
+ 'Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
111
+ 'Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
112
+ )
113
+ end
109
114
  end
110
115
  end
@@ -45,6 +45,7 @@ class Thor
45
45
  @switches = {}
46
46
  @extra = []
47
47
  @stopped_parsing_after_extra_index = nil
48
+ @is_treated_as_value = false
48
49
 
49
50
  options.each do |option|
50
51
  @switches[option.switch_name] = option
@@ -74,8 +75,19 @@ class Thor
74
75
  end
75
76
  end
76
77
 
78
+ def shift
79
+ @is_treated_as_value = false
80
+ super
81
+ end
82
+
83
+ def unshift(arg, is_value: false)
84
+ @is_treated_as_value = is_value
85
+ super(arg)
86
+ end
87
+
77
88
  def parse(args) # rubocop:disable MethodLength
78
89
  @pile = args.dup
90
+ @is_treated_as_value = false
79
91
  @parsing_options = true
80
92
 
81
93
  while peek
@@ -88,7 +100,10 @@ class Thor
88
100
  when SHORT_SQ_RE
89
101
  unshift($1.split("").map { |f| "-#{f}" })
90
102
  next
91
- when EQ_RE, SHORT_NUM
103
+ when EQ_RE
104
+ unshift($2, is_value: true)
105
+ switch = $1
106
+ when SHORT_NUM
92
107
  unshift($2)
93
108
  switch = $1
94
109
  when LONG_RE, SHORT_RE
@@ -148,6 +163,7 @@ class Thor
148
163
  # Two booleans are returned. The first is true if the current value
149
164
  # starts with a hyphen; the second is true if it is a registered switch.
150
165
  def current_is_switch?
166
+ return [false, false] if @is_treated_as_value
151
167
  case peek
152
168
  when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
153
169
  [true, switch?($1)]
@@ -159,6 +175,7 @@ class Thor
159
175
  end
160
176
 
161
177
  def current_is_switch_formatted?
178
+ return false if @is_treated_as_value
162
179
  case peek
163
180
  when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM, SHORT_SQ_RE
164
181
  true
@@ -168,6 +185,7 @@ class Thor
168
185
  end
169
186
 
170
187
  def current_is_value?
188
+ return true if @is_treated_as_value
171
189
  peek && (!parsing_options? || super)
172
190
  end
173
191
 
@@ -103,6 +103,23 @@ class Thor
103
103
  stdout.flush
104
104
  end
105
105
 
106
+ # Say (print) an error to the user. If the sentence ends with a whitespace
107
+ # or tab character, a new line is not appended (print + flush). Otherwise
108
+ # are passed straight to puts (behavior got from Highline).
109
+ #
110
+ # ==== Example
111
+ # say_error("error: something went wrong")
112
+ #
113
+ def say_error(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
114
+ return if quiet?
115
+
116
+ buffer = prepare_message(message, *color)
117
+ buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
118
+
119
+ stderr.print(buffer)
120
+ stderr.flush
121
+ end
122
+
106
123
  # Say a status with the given color and appends the message. Since this
107
124
  # method is used frequently by actions, it allows nil or false to be given
108
125
  # in log_status, avoiding the message from being shown. If a Symbol is
@@ -111,13 +128,14 @@ class Thor
111
128
  def say_status(status, message, log_status = true)
112
129
  return if quiet? || log_status == false
113
130
  spaces = " " * (padding + 1)
114
- color = log_status.is_a?(Symbol) ? log_status : :green
115
-
116
131
  status = status.to_s.rjust(12)
132
+ margin = " " * status.length + spaces
133
+
134
+ color = log_status.is_a?(Symbol) ? log_status : :green
117
135
  status = set_color status, color, true if color
118
136
 
119
- buffer = "#{status}#{spaces}#{message}"
120
- buffer = "#{buffer}\n" unless buffer.end_with?("\n")
137
+ message = message.to_s.chomp.gsub(/(?<!\A)^/, margin)
138
+ buffer = "#{status}#{spaces}#{message}\n"
121
139
 
122
140
  stdout.print(buffer)
123
141
  stdout.flush
data/lib/thor/shell.rb CHANGED
@@ -21,7 +21,7 @@ class Thor
21
21
  end
22
22
 
23
23
  module Shell
24
- SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
24
+ SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_error, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
25
25
  attr_writer :shell
26
26
 
27
27
  autoload :Basic, File.expand_path("shell/basic", __dir__)
data/lib/thor/util.rb CHANGED
@@ -211,7 +211,7 @@ class Thor
211
211
  #
212
212
  def globs_for(path)
213
213
  path = escape_globs(path)
214
- ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor"]
214
+ ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"]
215
215
  end
216
216
 
217
217
  # Return the path to the ruby interpreter taking into account multiple
data/lib/thor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Thor
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/thor.gemspec CHANGED
@@ -14,11 +14,11 @@ Gem::Specification.new do |spec|
14
14
  spec.licenses = %w(MIT)
15
15
  spec.name = "thor"
16
16
  spec.metadata = {
17
- "bug_tracker_uri" => "https://github.com/erikhuda/thor/issues",
18
- "changelog_uri" => "https://github.com/erikhuda/thor/blob/master/CHANGELOG.md",
17
+ "bug_tracker_uri" => "https://github.com/rails/thor/issues",
18
+ "changelog_uri" => "https://github.com/rails/thor/releases/tag/v#{Thor::VERSION}",
19
19
  "documentation_uri" => "http://whatisthor.com/",
20
- "source_code_uri" => "https://github.com/erikhuda/thor/tree/v#{Thor::VERSION}",
21
- "wiki_uri" => "https://github.com/erikhuda/thor/wiki"
20
+ "source_code_uri" => "https://github.com/rails/thor/tree/v#{Thor::VERSION}",
21
+ "wiki_uri" => "https://github.com/rails/thor/wiki"
22
22
  }
23
23
  spec.require_paths = %w(lib)
24
24
  spec.required_ruby_version = ">= 2.0.0"
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yehuda Katz
8
8
  - José Valim
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-20 00:00:00.000000000 Z
12
+ date: 2022-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -39,7 +39,6 @@ extensions: []
39
39
  extra_rdoc_files: []
40
40
  files:
41
41
  - ".document"
42
- - CHANGELOG.md
43
42
  - CONTRIBUTING.md
44
43
  - LICENSE.md
45
44
  - README.md
@@ -80,12 +79,12 @@ homepage: http://whatisthor.com/
80
79
  licenses:
81
80
  - MIT
82
81
  metadata:
83
- bug_tracker_uri: https://github.com/erikhuda/thor/issues
84
- changelog_uri: https://github.com/erikhuda/thor/blob/master/CHANGELOG.md
82
+ bug_tracker_uri: https://github.com/rails/thor/issues
83
+ changelog_uri: https://github.com/rails/thor/releases/tag/v1.2.0
85
84
  documentation_uri: http://whatisthor.com/
86
- source_code_uri: https://github.com/erikhuda/thor/tree/v1.1.0
87
- wiki_uri: https://github.com/erikhuda/thor/wiki
88
- post_install_message:
85
+ source_code_uri: https://github.com/rails/thor/tree/v1.2.0
86
+ wiki_uri: https://github.com/rails/thor/wiki
87
+ post_install_message:
89
88
  rdoc_options: []
90
89
  require_paths:
91
90
  - lib
@@ -100,8 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
99
  - !ruby/object:Gem::Version
101
100
  version: 1.3.5
102
101
  requirements: []
103
- rubygems_version: 3.2.3
104
- signing_key:
102
+ rubygems_version: 3.2.32
103
+ signing_key:
105
104
  specification_version: 4
106
105
  summary: Thor is a toolkit for building powerful command-line interfaces.
107
106
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,228 +0,0 @@
1
- # 1.1.0
2
- * Don't use ANSI colors when terminal is dumb.
3
- * Ensure default option/argument is not erroneously aliased.
4
- * Fixes a bug in the calculation of the print_wrapped method.
5
- * Obey `:mute` and `options[:quiet]` in `Shell#say`.
6
- * Support Ruby 3.0.
7
- * Add force option to the `gsub_file` action.
8
-
9
- # 1.0.1
10
- * Fix thor when `thor/base` and `thor/group` are required without `thor.rb`.
11
- * Handle relative source path in `create_link`.
12
-
13
- # 1.0.0
14
- * Drop support to Ruby 1.8 and 1.9.
15
- * Deprecate relying on default `exit_on_failure?`.
16
- In preparation to make Thor commands exit when there is a failure we are deprecating
17
- defining a command without defining what behavior is expected when there is a failure.
18
-
19
- To fix the deprecation you need to define a class method called `exit_on_failure?` returning
20
-
21
- `false` if you want the current behavior or `true` if you want the new behavior.
22
- * Deprecate defining an option with the default value using a different type as defined in the option.
23
- * Allow options to be repeatable. See #674.
24
-
25
- # 0.20.3
26
- * Support old versions of `did_you_mean`.
27
-
28
- # 0.20.2
29
- * Fix `did_you_mean` support.
30
-
31
- # 0.20.1
32
- * Support new versions of ERB.
33
- * Fix `check_unknown_options!` to not check the content that was not parsed, i.e. after a `--` or after the first unknown with `stop_on_unknown_option!`
34
- * Add `did_you_mean` support.
35
-
36
- ## 0.20.0
37
- * Add `check_default_type!` to check if the default value of an option matches the defined type.
38
- It removes the warning on usage and gives the command authors the possibility to check for programming errors.
39
-
40
- * Add `disable_required_check!` to disable check for required options in some commands.
41
- It is a substitute of `disable_class_options` that was not working as intended.
42
-
43
- * Add `inject_into_module`.
44
-
45
- ## 0.19.4, release 2016-11-28
46
- * Rename `Thor::Base#thor_reserved_word?` to `#is_thor_reserved_word?`
47
-
48
- ## 0.19.3, release 2016-11-27
49
- * Output a warning instead of raising an exception when a default option value doesn't match its specified type
50
-
51
- ## 0.19.2, release 2016-11-26
52
- * Fix bug with handling of colors passed to `ask` (and methods like `yes?` and `no?` which it underpins)
53
- * Allow numeric arguments to be negative
54
- * Ensure that default option values are of the specified type (e.g. you can't specify `"foo"` as the default for a numeric option), but make symbols and strings interchangeable
55
- * Add `Thor::Shell::Basic#indent` method for intending output
56
- * Fix `remove_command` for an inherited command (see #451)
57
- * Allow hash arguments to only have each key provided once (see #455)
58
- * Allow commands to disable class options, for instance for "help" commands (see #363)
59
- * Do not generate a negative option (`--no-no-foo`) for already negative boolean options (`--no-foo`)
60
- * Improve compatibility of `Thor::CoreExt::HashWithIndifferentAccess` with Ruby standard library `Hash`
61
- * Allow specifying a custom binding for template evaluation (e.g. `#key?` and `#fetch`)
62
- * Fix support for subcommand-specific "help"s
63
- * Use a string buffer when handling ERB for Ruby 2.3 compatibility
64
- * Update dependencies
65
-
66
- ## 0.19.1, release 2014-03-24
67
- * Fix `say` non-String break regression
68
-
69
- ## 0.19.0, release 2014-03-22
70
- * Add support for a default to #ask
71
- * Avoid @namespace not initialized warning
72
- * Avoid private attribute? warning
73
- * Fix initializing with unknown options
74
- * Loosen required_rubygems_version for compatibility with Ubuntu 10.04
75
- * Shell#ask: support a noecho option for stdin
76
- * Shell#ask: change API to be :echo => false
77
- * Display a message without a stack trace for ambiguous commands
78
- * Make say and say_status thread safe
79
- * Dependency for console io version check
80
- * Alias --help to help on subcommands
81
- * Use mime-types 1.x for Ruby 1.8.7 compatibility for Ruby 1.8 only
82
- * Accept .tt files as templates
83
- * Check if numeric value is in enum
84
- * Use Readline for user input
85
- * Fix dispatching of subcommands (concerning :help and *args)
86
- * Fix warnings when running specs with `$VERBOSE = true`
87
- * Make subcommand help more consistent
88
- * Make the current command chain accessible in command
89
-
90
- ## 0.18.1, release 2013-03-30
91
- * Revert regressions found in 0.18.0
92
-
93
- ## 0.18.0, release 2013-03-26
94
- * Remove rake2thor
95
- * Only display colors if output medium supports colors
96
- * Pass parent_options to subcommands
97
- * Fix non-dash-prefixed aliases
98
- * Make error messages more helpful
99
- * Rename "task" to "command"
100
- * Add the method to allow for custom package name
101
-
102
- ## 0.17.0, release 2013-01-24
103
- * Add better support for tasks that accept arbitrary additional arguments (e.g. things like `bundle exec`)
104
- * Add #stop_on_unknown_option!
105
- * Only strip from stdin.gets if it wasn't ended with EOF
106
- * Allow "send" as a task name
107
- * Allow passing options as arguments after "--"
108
- * Autoload Thor::Group
109
-
110
- ## 0.16.0, release 2012-08-14
111
- * Add enum to string arguments
112
-
113
- ## 0.15.4, release 2012-06-29
114
- * Fix regression when destination root contains reserved regexp characters
115
-
116
- ## 0.15.3, release 2012-06-18
117
- * Support strict_args_position! for backwards compatibility
118
- * Escape Dir glob characters in paths
119
-
120
- ## 0.15.2, released 2012-05-07
121
- * Added print_in_columns
122
- * Exposed terminal_width as a public API
123
-
124
- ## 0.15.1, release 2012-05-06
125
- * Fix Ruby 1.8 truncation bug with unicode chars
126
- * Fix shell delegate methods to pass their block
127
- * Don't output trailing spaces when printing the last column in a table
128
-
129
- ## 0.15, released 2012-04-29
130
- * Alias method_options to options
131
- * Refactor say to allow multiple colors
132
- * Exposed error as a public API
133
- * Exposed file_collision as a public API
134
- * Exposed print_wrapped as a public API
135
- * Exposed set_color as a public API
136
- * Fix number-formatting bugs in print_table
137
- * Fix "indent" typo in print_table
138
- * Fix Errno::EPIPE when piping tasks to `head`
139
- * More friendly error messages
140
-
141
- ## 0.14, released 2010-07-25
142
- * Added CreateLink class and #link_file method
143
- * Made Thor::Actions#run use system as default method for system calls
144
- * Allow use of private methods from superclass as tasks
145
- * Added mute(&block) method which allows to run block without any output
146
- * Removed config[:pretend]
147
- * Enabled underscores for command line switches
148
- * Added Thor::Base.basename which is used by both Thor.banner and Thor::Group.banner
149
- * Deprecated invoke() without arguments
150
- * Added :only and :except to check_unknown_options
151
-
152
- ## 0.13, released 2010-02-03
153
- * Added :lazy_default which is only triggered if a switch is given
154
- * Added Thor::Shell::HTML
155
- * Added subcommands
156
- * Decoupled Thor::Group and Thor, so it's easier to vendor
157
- * Added check_unknown_options! in case you want error messages to be raised in valid switches
158
- * run(command) should return the results of command
159
-
160
- ## 0.12, released 2010-01-02
161
- * Methods generated by attr_* are automatically not marked as tasks
162
- * inject_into_file does not add the same content twice, unless :force is set
163
- * Removed rr in favor to rspec mock framework
164
- * Improved output for thor -T
165
- * [#7] Do not force white color on status
166
- * [#8] Yield a block with the filename on directory
167
-
168
- ## 0.11, released 2009-07-01
169
- * Added a rake compatibility layer. It allows you to use spec and rdoc tasks on
170
- Thor classes.
171
- * BACKWARDS INCOMPATIBLE: aliases are not generated automatically anymore
172
- since it may cause wrong behavior in the invocation system.
173
- * thor help now show information about any class/task. All those calls are
174
- possible:
175
-
176
- thor help describe
177
- thor help describe:amazing
178
- Or even with default namespaces:
179
-
180
- thor help :spec
181
- * Thor::Runner now invokes the default task if none is supplied:
182
-
183
- thor describe # invokes the default task, usually help
184
- * Thor::Runner now works with mappings:
185
-
186
- thor describe -h
187
- * Added some documentation and code refactoring.
188
-
189
- ## 0.9.8, released 2008-10-20
190
- * Fixed some tiny issues that were introduced lately.
191
-
192
- ## 0.9.7, released 2008-10-13
193
- * Setting global method options on the initialize method works as expected:
194
- All other tasks will accept these global options in addition to their own.
195
- * Added 'group' notion to Thor task sets (class Thor); by default all tasks
196
- are in the 'standard' group. Running 'thor -T' will only show the standard
197
- tasks - adding --all will show all tasks. You can also filter on a specific
198
- group using the --group option: thor -T --group advanced
199
-
200
- ## 0.9.6, released 2008-09-13
201
- * Generic improvements
202
-
203
- ## 0.9.5, released 2008-08-27
204
- * Improve Windows compatibility
205
- * Update (incorrect) README and task.thor sample file
206
- * Options hash is now frozen (once returned)
207
- * Allow magic predicates on options object. For instance: `options.force?`
208
- * Add support for :numeric type
209
- * BACKWARDS INCOMPATIBLE: Refactor Thor::Options. You cannot access shorthand forms in options hash anymore (for instance, options[:f])
210
- * Allow specifying optional args with default values: method_options(:user => "mislav")
211
- * Don't write options for nil or false values. This allows, for example, turning color off when running specs.
212
- * Exit with the status of the spec command to help CI stuff out some.
213
-
214
- ## 0.9.4, released 2008-08-13
215
- * Try to add Windows compatibility.
216
- * BACKWARDS INCOMPATIBLE: options hash is now accessed as a property in your class and is not passed as last argument anymore
217
- * Allow options at the beginning of the argument list as well as the end.
218
- * Make options available with symbol keys in addition to string keys.
219
- * Allow true to be passed to Thor#method_options to denote a boolean option.
220
- * If loading a thor file fails, don't give up, just print a warning and keep going.
221
- * Make sure that we re-raise errors if they happened further down the pipe than we care about.
222
- * Only delete the old file on updating when the installation of the new one is a success
223
- * Make it Ruby 1.8.5 compatible.
224
- * Don't raise an error if a boolean switch is defined multiple times.
225
- * Thor::Options now doesn't parse through things that look like options but aren't.
226
- * Add URI detection to install task, and make sure we don't append ".thor" to URIs
227
- * Add rake2thor to the gem binfiles.
228
- * Make sure local Thorfiles override system-wide ones.