0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
A convenient gem for retrieving a link from a hierarchical lookup table from a raw Polyrex document format
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Runtime

~> 1.3, >= 1.3.2
 Project Readme

#Introducing the Polyrex links gem 0.1.2

The polyrex-links gem was intended to run as a back-end web service to handle clean URL requests and return the associated longer URL. I've been experimenting with QR codes, and I've reached the conclusion it's better to change the associated URL behind a clean URL, than it is to regenerate and print out QR codes each time.

require 'polyrex-links'

lines =<<LINES
food http://kitchen.com/food
  fruit http://kitchen.com/fruit
    apples http://kitchen.com/fruit?q=apples
    pears http://kitchen.com/fruit?q=pears
spoons http://kitchen.com/spoons
LINES

links = PolyrexLinks.new
links.parse lines
puts links.to_xml pretty: true

links.locate "food/fruit/"

However say for example it refers to a physical directory which is:

/home/james/dws2/images

the clean URL stored in polyrex-links may look like this:

/images

and the actual URL requested may be:

/images/sunshine.jpg

and the target URL is

/do/file/read?name=images

after locating the polyrex-link the target URL would be:

/do/file/read?name=images/sunshine.jpg