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

Change temporary file name extension while editing encrypted file. #32268

Merged
merged 1 commit into from Apr 1, 2018

Conversation

morgoth
Copy link
Member

@morgoth morgoth commented Mar 16, 2018

To have syntax higlihting in an editor try to preserve original extension of edited file

@rails-bot
Copy link

r? @rafaelfranca

(@rails-bot has picked a reviewer for you, use r? to override)

@@ -57,7 +57,7 @@ def change(&block)

private
def writing(contents)
tmp_file = "#{content_path.basename}.#{Process.pid}"
tmp_file = "#{Process.pid}.#{content_path.basename.sub(/\.enc$/, '')}"
Copy link
Contributor

Choose a reason for hiding this comment

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

chomp(".enc") seems pertinent 😊

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Had to add to_s as we're dealing here with Pathname object, which has sub method, but no chomp

To have syntax highlighting in an editor try to preserve original extension of edited file.
@morgoth
Copy link
Member Author

morgoth commented Mar 21, 2018

r? @kaspth

@rails-bot rails-bot assigned kaspth and unassigned rafaelfranca Mar 21, 2018
@morgoth
Copy link
Member Author

morgoth commented Apr 1, 2018

@kaspth can it be merged? I think it would be a nice improvement in 5.2 release

@kaspth kaspth merged commit 2c56d63 into rails:master Apr 1, 2018
@kaspth
Copy link
Contributor

kaspth commented Apr 1, 2018

Yep, I was just working through my list now! Thanks!

kaspth added a commit that referenced this pull request Apr 1, 2018
Change temporary file name extension while editing encrypted file.
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.

None yet

4 participants