ruby - Difficult code packaging design -


this long story, let me apologize in advance....

i've built tool write college curricula using static site generator nanoc. nanoc nice ruby based package , distributed gem.

i installed gem, , used "nanoc new" command create basic directory structure. within directory structure wrote custom ruby code, large number of markdown files define first course. here's course built.

the code showed above, in git, corresponds result of work, nanoc + customizations. there's bundler file has run bring in additional gems well.

let's call individual course "cosi235a.course" , let's call tool "nanoc-course". call author of cosi235a.course "an author" , call maintainer of "nanoc-course" "me".

what seeking nice design decouple nanoc-course cosi235a.course. in other words, want separate customized nanoc based tool content of 1 course.

that way if want design curriculum second course can create , still pull in updates common code. more that, author create new course on site, , use nanoc-course themselves, , benefit updates make tool.

i've been turning design question on in mind , not finding idea like. here ideas, half baked, far:

  1. make nanoc-courss on git contain except markdown, html, , other content files. happen live in subdirectory called ./content according nanoc. directory empty on git. add rake tasks create symlinks separate directory containing cosi235a.course files. way author can work on content files , @ time git pull updates nanoc-course. clean separation clunky.

  2. make nanoc course gem used nanoc. in other words, author installs nanoc, gem install (or bundler install) of nanoc-course , add line or 2 nanoc's libs incorporate logic. separation less complete , requires author (who not ruby programmer) modify code. it's fragile respect nanoc changes.

i know it's long story. have ideas?

have same problem. option 1 seems obvious, requires author understand intricacies of git - , can see going wrong easily.

i'd tend towards modification of 2, have custom gem based on nanoc locking specific version within gemspec. "course" have contain few basic elements, e.g.

/content

/output

gemfile <== contains "nanoc-course" gem

gemfile.lock

supply template project course authors , you'd have teach authors how use bundler.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -