Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a new command for renaming yourself on trunk #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

orta
Copy link
Member

@orta orta commented Apr 28, 2017

fixes CocoaPods/trunk.cocoapods.org#155

Overall the idea of re-registering with a new name to overwrite doesn't really make sense. As discussed in CocoaPods/trunk.cocoapods.org#155 I paired with @ashfurrow on adding a new command that allows you to just rename yourself.

Also, thanks @paynerc

Copy link
Member

@segiddins segiddins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@@ -18,6 +18,7 @@ class Trunk < Command
require 'pod/command/trunk/deprecate'
require 'pod/command/trunk/info'
require 'pod/command/trunk/me'
require 'pod/command/trunk/me_rename'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pod/command/trunk/me/rename

class Trunk
# @CocoaPods 1.2.1+
#
class Rename < Me
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace under Me

def run
email = netrc['trunk.cocoapods.org'] && netrc['trunk.cocoapods.org'].login
body = { 'name' => @name, 'email' => email }.to_json
json(request_path(:post, 'sessions', body, auth_headers))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will this output on success?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing, good point 👍

@paynerc
Copy link

paynerc commented Apr 28, 2017

Will it be confusing that the result of this rename operation is a new session that you need to verify? If there is a new command to do the renaming client side, should there also be a sessions/rename (or something similar) server side that just does a rename on an authenticated session? Or maybe a PUT on the session?

describe Command::Trunk::Register do
describe 'CLAide' do
it 'registers it self' do
Command.parse(%w[trunk me rename]).should.be.instance_of Command::Trunk::Rename
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use %() to delimited the arrays

@orta
Copy link
Member Author

orta commented Apr 28, 2017

Him, yep, that is indeed totally illogical

screen shot 2017-04-28 at 15 44 21

Sigh, it will indeed need a new server route

@lyc2345
Copy link

lyc2345 commented May 11, 2017

Is any workaround to rename trunk name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating name doesn't work
4 participants