mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-26 05:45:43 +08:00
[command] Make the changelog command work again.
This commit is contained in:
@@ -40,6 +40,17 @@ module Motion; module Project
|
||||
help! message
|
||||
end
|
||||
|
||||
# This is lifted straight from CLAide, but adjusted slightly because the
|
||||
# Class#name method is overriden in the old (deprecated) API below.
|
||||
def self.command
|
||||
@command ||= __name__.split('::').last.gsub(/[A-Z]+[a-z]*/) do |part|
|
||||
part.downcase << '-'
|
||||
end[0..-2]
|
||||
end
|
||||
class << self
|
||||
alias_method :__name__, :name
|
||||
end
|
||||
|
||||
def self.name
|
||||
warn "The usage of `Motion::Project::Command.name` is deprecated use the " \
|
||||
"`Motion::Project::Command.command` method instead. " \
|
||||
@@ -54,7 +65,6 @@ module Motion; module Project
|
||||
self.command = name
|
||||
end
|
||||
|
||||
|
||||
def self.help
|
||||
warn "The usage of `Motion::Project::Command.help` is deprecated use the " \
|
||||
"`Motion::Project::Command.summary` method instead. " \
|
||||
|
||||
@@ -22,15 +22,12 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
module Motion; module Project
|
||||
class ChangelogCommand < Command
|
||||
self.name = 'changelog'
|
||||
self.help = 'View the changelog'
|
||||
|
||||
def run(args)
|
||||
unless args.empty?
|
||||
die "Usage: motion changelog"
|
||||
end
|
||||
class Changelog < Command
|
||||
self.summary = 'View the changelog.'
|
||||
self.description = 'View the changes that have been made in all ' \
|
||||
'RubyMotion versions.'
|
||||
|
||||
def run
|
||||
pager = (ENV['PAGER'] or '/usr/bin/less')
|
||||
system("#{pager} /Library/RubyMotion/NEWS")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user