Skip to content

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!

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

5 participants