[command] Make the account command work again.

This commit is contained in:
Eloy Durán
2014-01-16 18:24:51 +01:00
committed by Watson
parent ea24ea74a5
commit 8be728d90c
2 changed files with 8 additions and 11 deletions

View File

@@ -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

View File

@@ -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