lib/thor/base.rb in thor-0.18.0 vs lib/thor/base.rb in thor-0.18.1

- old
+ new

@@ -117,10 +117,22 @@ file_subclasses << klass unless file_subclasses.include?(klass) end end module ClassMethods + def attr_reader(*) #:nodoc: + no_commands { super } + end + + def attr_writer(*) #:nodoc: + no_commands { super } + end + + def attr_accessor(*) #:nodoc: + no_commands { super } + end + # If you want to raise an error for unknown options, call check_unknown_options! # This is disabled by default to allow dynamic invocations. def check_unknown_options! @check_unknown_options = true end @@ -575,12 +587,9 @@ return end # Return if it's not a public instance method return unless public_method_defined?(meth.to_sym) - - # Return if attr_* added the method - return if caller.first.to_s[/`attr_(reader|writer|accessor)'/] return if @no_commands || !create_command(meth) is_thor_reserved_word?(meth, :command) Thor::Base.register_klass_file(self)