Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The code-snippets gem renders HTML, and RSS for a Dynarex-usersblog.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
MIT-LICENSE
README.md
code-snippets.gemspec
gem-public_cert.pem

README.md

Introducing the Code-snippets gem

require 'code-snippets'

h = {
  filepath: '/home/james/snippets', 
  default_user: 'jrobertson',
  xsl: {
    outer: 'http://rscript.rorbuilder.info/s/open/snippets/index.xsl', 
    page: 'http://rscript.rorbuilder.info/s/open/snippets/snippets.xsl', 
    entry: 'http://rscript.rorbuilder.info/s/open/snippets/snippets_entry.xsl', 
    rss: 'http://rscript.rorbuilder.info/s/open/snippets/rss.xsl'
  }
}

snippets = CodeSnippets.new({config: h})

# return the front page
pg = snippets.page '1'

# return the front page for tag 'json'
tag_pg = snippets.tag('json', '1')

# return the front page for user 'jrobertson'
user_pg = snippets.user('jrobertson', '1')

# return the front page for user 'jrobertson' with tag 'json'
user_tag_pg = snippets.user('jrobertson', 'json','1')

# return the rss feed for the front page
rss_pg = snippets.rss</pre>

installation sudo gem install code-snippets

This gem renders the HTML, and RSS for a dynarex-usersblog system, and it also powers snippets.rorbuilder.info

Something went wrong with that request. Please try again.