Skip to content

Adds a new command for renaming yourself on trunk - #92

Open
orta wants to merge 1 commit into
masterfrom
rename
Open

Adds a new command for renaming yourself on trunk#92
orta wants to merge 1 commit into
masterfrom
rename

Conversation

@orta

@orta orta commented Apr 28, 2017

Copy link
Copy Markdown
Member

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

@segiddins segiddins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome!

Comment thread lib/pod/command/trunk.rb
require 'pod/command/trunk/deprecate'
require 'pod/command/trunk/info'
require 'pod/command/trunk/me'
require 'pod/command/trunk/me_rename'

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

paynerc commented Apr 28, 2017

Copy link
Copy Markdown

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
Copy Markdown
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

orta commented Apr 28, 2017

Copy link
Copy Markdown
Member Author

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

lyc2345 commented May 11, 2017

Copy link
Copy Markdown

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