Skip to content

Provide rake tasks to make it easier to manage the blog#42

Merged
ScottIsAFool merged 1 commit intoOpenLiveWriter:masterfrom
hashhar:rake-tasks
Mar 12, 2017
Merged

Provide rake tasks to make it easier to manage the blog#42
ScottIsAFool merged 1 commit intoOpenLiveWriter:masterfrom
hashhar:rake-tasks

Conversation

@hashhar
Copy link
Copy Markdown
Contributor

@hashhar hashhar commented Feb 5, 2016

This pull is a WIP. It will allow people to run commands like:

rake new_blog_post title
rake new_news title
rake preview
rake generate

@kathweaver
Copy link
Copy Markdown
Contributor

So how do you run that?

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 5, 2016

I haven't finished it yet. Will let everyone know when its ready.

@kathweaver
Copy link
Copy Markdown
Contributor

If this isn't finished, why is it a pull request?

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 6, 2016

I have implemented 4 tasks now. Test them out.

rake new_blog_post
rake new_news_item
rake generate
rake preview

The new_blog_post and new_news_item can take arguments too:

rake new_blog_post[post-name,author-name]
rake new_news_item[post-name,author-name]

Test them out.

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 6, 2016

You can also request any new tasks if you want @kathweaver.

NOTE: Before testing, make a copy of the repository somewhere since it deals with writing files onto the filesystem so there is a possibility of it overwriting something. (Highly unlikely but still)

@hashhar hashhar changed the title [WIP] Provide rake tasks to make it easier to manage the blog Provide rake tasks to make it easier to manage the blog Feb 8, 2016
@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 10, 2016

Has anybody tested this out so far?

@RobStand
Copy link
Copy Markdown
Member

@hashhar If you can write up a short tutorial in a comment on this PR, @kathweaver will be able to test the rakefile.

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 20, 2016

There are the following tasks available.

  1. rake generate:

    This will generate the website using Jekyll but not run the webserver.

  2. rake preview:

    Preview the generated website in a browser and keep watching for changes.

  3. rake new_blog_post[title,author,file-extension]:

    Begin a new blog post in /_posts. Use as rake new_news_item[title,author,file-extension]. In absence of any of those, the values will be asked for interactively.

  4. rake new_news_item[title,author,file-extension]:

    Begin a new news post in /_posts. Use as rake new_news_item[title,author,file-extension]. In absence of any of those, the values will be asked for interactively.

  5. rake new_release[version,author,file-extension]:

    Begin a new release post in /_posts. Use as rake new_release[version-number,author,file-extension]. In absence of any of those, the values will be asked for interactively. The fully formed title becomes 'Open Live Writer version-number is now available!'.

@kathweaver
Copy link
Copy Markdown
Contributor

So I still understand when and how the rake is done?

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 21, 2016

You can simply type rake name-of-task when you want to do that task from the command line.
It saves you the additional work of typing out the headers of the files and naming and placing them where they need to be.

@kathweaver
Copy link
Copy Markdown
Contributor

I've downloaded your branch, put it on my computer, went to the directory that the branch is in and typed in

rake generate
and got LoadError: cannot load such file -- stringe

rake preview
and got the same.

What am I missing?

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 21, 2016

@kathweaver My bad. You have to run bundle install first.

@kathweaver
Copy link
Copy Markdown
Contributor

bundle install gives me not recognized error

@kathweaver
Copy link
Copy Markdown
Contributor

Okay, I've done
gem install bundler
bundle install

and still get the same error

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 22, 2016

Hmmm. I'll look into that. In the meantime try installing http://rubyinstaller.org/downloads/

Run ruby --version and install the correct one from the 3 links on the left side.

@kathweaver
Copy link
Copy Markdown
Contributor

I have Ruby on my machine --still getting the same thing.

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 22, 2016

No, that's the dev kit I pasted the link to. Bundle needs the dev kit to work.

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 22, 2016

screenshot from 2016-02-22 07-52-10

See the 3 links on the left.

@kathweaver
Copy link
Copy Markdown
Contributor

I already have that installed. Everything runs but the rake -- it's expected stringex

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 22, 2016

Hmm. Oh, I get it now. Run gem install stringex from a command prompt as an admin. Then try again.

@kathweaver
Copy link
Copy Markdown
Contributor

That did the trick. Thanks! Now I have to remember how to pull the branch :-)

@kathweaver
Copy link
Copy Markdown
Contributor

Testing now!

@kathweaver
Copy link
Copy Markdown
Contributor

Everything looks good but:

rake new_release[0.7,kathweaver,html]

I get a title Open Live Writer #version is now available! and an address of http://127.0.0.1:4000/news/release/2016/02/21/open-live-writer-number-version-is-now-available.html

@kathweaver
Copy link
Copy Markdown
Contributor

Better, but I ran:

rake new_release[0.70.kathweaver,html]

and got:

Version 0.6 Now Available

13 Feb 2016 hashhar

@hashhar
Copy link
Copy Markdown
Contributor Author

hashhar commented Feb 22, 2016

@kathweaver Try again. You might be seeing that 0.6 because it was already there. Try again and run git status. That will show you the newly created file in red.

snip_20160222222123

@kathweaver
Copy link
Copy Markdown
Contributor

It's working as expected now. Not sure what was going on this morning.

- Add new blog post.
- Add new news post.
- Add new release notes post.

Completely configurable.
@ScottIsAFool ScottIsAFool merged commit 8d6195b into OpenLiveWriter:master Mar 12, 2017
@hashhar hashhar deleted the rake-tasks branch March 12, 2017 12:41
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.

5 participants