-
Notifications
You must be signed in to change notification settings - Fork 158
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
Add support for Rakefile #15
base: master
Are you sure you want to change the base?
Conversation
Created Rakefile and added support for post creation through Rake command "task". closes kronik3r#7
Hi man, sorry for the late reply, looks nice, thanks man for your time. I have a question: Does this will require the users to run some kinds of PS: if the answer is no would you please update the README file too, thanks again for your time. |
This feature is just for making the process of posting something to the blog easier. So instead of:
The use would just have to go to the root of their project and issue the following command in the terminal
which automates this workflow. They need to install Rake to use this feature however, which is as simple as
|
Yeah, yeah I know :), sorry my bad, I wasn't clear when I asked the question. I feared that when the user wants to One last thing, is it possible that you update the README file to reflect your changes also document what are the supported params. Again thanks a lot for your time 👍 |
valid_options = [ 'y', 'n' ] | ||
answer = get_stdin("#{message} ").downcase[0] | ||
|
||
if answer == 'y' |
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 could be replaced with
- if answer == 'y'
- true
- else
- false
- end
+ answer == 'y'
|
||
filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}") | ||
if File.exists?(filename) | ||
abort('Rake task aborted.') if agree?("#{filename} already exists. Do you want to override it?") == false |
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.
It may be worth using unless
to tidy up the statement:
- abort('Rake task aborted.') if agree?("#{filename} already exists. Do you want to override it?") == false
+ abort('Rake task aborted.') unless agree?("#{filename} already exists. Do you want to override it?")
Created Rakefile and added support for post creation through Rake command "task".
closes #7