-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use default editor to write comments and descriptions if specified #43
Use default editor to write comments and descriptions if specified #43
Conversation
c628238
to
2cd1d8c
Compare
2cd1d8c
to
110eab4
Compare
Thanks for PR! First of all, Opening editor(it's what we need) is good for writing and editing long text. But I think, the default should be inline or prompt. Opening editor should be optional (pass option arg or global configuration). |
82a39c3
to
61c7dc1
Compare
That is a good idea. I have updated the pr to accept |
Thanks :) , There are 2 problem I found. Please fix 2 issues before I merge your nice code. :) |
d30c951
to
ca4d249
Compare
Thank you for the feedback. I didn't understand what I have cleaned up the code a bit, fixed so that it raises an error if you try to edit with an editor without having $EDITOR set to something or if the editor returns a non-zero status code. I also changed the alternative argument for using an editor to |
ca4d249
to
43127de
Compare
43127de
to
08bccbb
Compare
Good, but you should fix one more thing. So, you should handle For example,
And please check, your code does not work :) |
I apologize for breaking the code. I was manually testing the Regarding not passing it in resources. The reason for passing it as a resource was because it was a nice way to have it accessable in How would you propose passing the value forward through terjira/lib/terjira/option_supportable.rb Line 66 in 08bccbb
selector_method to take arguments?
I am apologize if this a stupid question, it's been a very long time since I did Ruby development 🙃 |
How about pass suggest_options(required: [:project, :summary, :issuetype], editor: options.editor) def suggest_options(opts = {})
with_editor = opts[:editor]
...
end module Terjira
module OptionSelector
def self.with_editor=(with_editor)
@with_editor = with_editor
end
def self.with_editor?
@with_editor || false
end
...
end
end I'm not sure my code works. It's just concept. Please feel free to suggest any idea 😄 |
76bf794
to
50cf1f4
Compare
lib/terjira/option_supportable.rb
Outdated
origin = options.dup | ||
origin.delete(:editor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing the issues earlier. Other logic that parses the options in the client couldn't handle the that the editor option was in the hash.
I have addressed your comments and the issues should be fixed now. I think travis are having issues right now which is why one of the jobs is failing 😞 |
50cf1f4
to
2d0a04e
Compare
Retriggering travis does not seem to help |
I just merged your code, fixed travis issue and release 0.3.7. Thanks! ❤️ |
Descriptions and comments can be quite long and cumbersome to input in the default input prompt so therefore it's better to use the system default $EDITOR for composing the content.
This feature was requested in #40.
Feel free to comment on code style, it has been a while since I developed with Ruby