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

feat: split bin and lib #45

Merged
merged 10 commits into from
Jul 2, 2015
Merged

feat: split bin and lib #45

merged 10 commits into from
Jul 2, 2015

Conversation

kbknapp
Copy link
Member

@kbknapp kbknapp commented Jul 1, 2015

DO NOT MERGE

The bin and lib are now split, but none of the docs have been written yet.

  • Split bin and lib
  • Add non-cli configuration options
  • redo the readme
  • add documentation

Relates to #44

@cburgdorf
Copy link
Contributor

This looks like a good start. We should probably add an API similar to from_matches but with the focus on easy non-CLI usage. Should we just merge this in first and then iterate on the library use case?

@kbknapp
Copy link
Member Author

kbknapp commented Jul 1, 2015

There are a few ways to easily configure it without a CLI; one using the builder pattern, and a second being accessing the fields directly (an unintentional bi-product of not having crate only visibility specifier).

i.e.

let mut clog = Clog::with_dir("/myproject").unwrap_or_else(|e| { println!("{}",e); std::process::exit(1); });
clog.repository("https://github.com/thoughtram/clog")
        .subtitle("Crazy Dog")
        .from("6d8183f")
        .version("0.1.0");

I also want to add a few more automatic methods which sort of do the work for you. Meaning, you can use clog just src/bin/clog.rs does where you access the sections and write them individually, or just call a single method or two and it does all the default work for you.

The commit I just pushed does a lot of the configuration help work, but it's not quite working yet - I need to troubleshoot a few things. I'll update once it's good to go.

@kbknapp
Copy link
Member Author

kbknapp commented Jul 1, 2015

Alright, it's working like normal now.

Docs still need to be written though, so don't merge yet.

@kbknapp
Copy link
Member Author

kbknapp commented Jul 1, 2015

Those automatic changelog writing methods are done. For example, to write the clog changelog to an arbitrary location it's as simple as:

let mut clog = Clog::with_dir("/home/kevin/Projects/clog").unwrap_or_else(|e| { 
    println!("{}",e); 
    std::process::exit(1); 
});
clog.repository("https://github.com/thoughtram/clog")
    .subtitle("Crazy Dog")
    .from("6d8183f")
    .version("0.1.0");
clog.write_changelog_to("/home/kevin/clog_changelog.md")

Alternatively if I'd wanted to just use the current working dir and all the defaults just change Clog::with_dir("/myproject") -> Clog::new() and clog.write_changelog_to("location") -> clog.write_changelog()

I'll start on the docs later tonight, but it'll probably take a few days to finish.

@kbknapp
Copy link
Member Author

kbknapp commented Jul 2, 2015

Now it should be OK to merge (or test first, then merge :) ).

If you setup a github pages site, and just use this repo as the contents browsing to http://thoughtram.github.io/clog/ will re-direct to http://thoughtram/clog/docs/clog/index.html where the docs front page is located.

Clone the repo and use your browser to view clog/docs/clog/index.html to preview the docs.

Also, I put a makefile in there so you can do make doc which will auto-include the README.md as the doc front page but not clutter up src/lib.rs

@kbknapp kbknapp changed the title wip: split bin and lib feat: split bin and lib Jul 2, 2015
@cburgdorf cburgdorf merged commit 24b2dc5 into master Jul 2, 2015
@cburgdorf
Copy link
Contributor

Thanks Kevin! That's awesome work. I'm about to release it as 0.8.0. Regarding the documentation. I'm in the process of setting up a site for clog where you can use clog right from the browser. It's a joint venture of nickel and clog working together :)

I'll probably finish it sometime next week and pick up the documentation task then to link to the docs from that site then. Btw, if you are into stickers and other swag I'd love to package some stuff up and send it over to you :) Just send me your address and t-shirt size via mail :)

@kbknapp
Copy link
Member Author

kbknapp commented Jul 2, 2015

That's an awesome idea, I'm looking forward to seeing this site! And yeah, I'll take you up on that offer thanks! :)

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.

2 participants