mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-12 00:35:25 +08:00
[command] Make the account command work again.
This commit is contained in:
@@ -83,7 +83,7 @@ module Motion; module Project
|
||||
# Base command class of RubyMotion
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
#require 'motion/project/command/account'
|
||||
require 'motion/project/command/account'
|
||||
#require 'motion/project/command/archive'
|
||||
#require 'motion/project/command/activate'
|
||||
require 'motion/project/command/changelog'
|
||||
@@ -144,6 +144,7 @@ module Motion; module Project
|
||||
end
|
||||
|
||||
def guess_email_address
|
||||
require 'uri'
|
||||
# Guess the default email address from git.
|
||||
URI.escape(`git config --get user.email`.strip)
|
||||
end
|
||||
|
||||
@@ -22,18 +22,14 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
module Motion; module Project
|
||||
class AccountCommand < Command
|
||||
self.name = 'account'
|
||||
self.help = 'Access the software license account'
|
||||
|
||||
def run(args)
|
||||
unless args.empty?
|
||||
die "Usage: motion account"
|
||||
end
|
||||
|
||||
class Account < Command
|
||||
self.summary = 'Access account details.'
|
||||
self.description = 'Access the details of your software license account.'
|
||||
|
||||
def run
|
||||
license_key = read_license_key
|
||||
email = guess_email_address
|
||||
|
||||
|
||||
system("open \"https://secure.rubymotion.com/account?license_key=#{license_key}&email=#{email}\"")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user