This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
module ONIX | |
class DateType < ROXML::XMLRef # ::nodoc:: | |
attr_reader :cdata, :content | |
def initialize(accessor, args, &block) | |
super(accessor, args, &block) | |
@content = args.content? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jh@gaz rba_staff_site (master)]$ rake ts:index --trace | |
(in /home/jh/git/rba_staff_site) | |
** Invoke ts:index (first_time) | |
** Invoke thinking_sphinx:index (first_time) | |
** Invoke thinking_sphinx:app_env (first_time) | |
** Execute thinking_sphinx:app_env | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute thinking_sphinx:index | |
Generating Configuration to /home/jh/git/rba_staff_site/config/development.sphinx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ************************************* | |
# A handy initiliser that logs when the loaded version of | |
# Rails or a gem dependency is out of date. The notice is | |
# non-fatal (often we want it to be out of date). I often | |
# forget which version of a gem my apps are using, and | |
# don't notice when there is a newer version available. | |
# | |
# Only really makes sense on Rails >= 2.1, where initialisers | |
# and gem dependencies first appeared. Drop this file in | |
# config/initializers/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE ONIXMessage SYSTEM "http://www.editeur.org/onix/2.1/02/reference/onix-international.dtd"> | |
<ONIXMessage> | |
<Header> | |
<FromCompany>HarperCollins Publishers</FromCompany> | |
<ToCompany>Australian Booksellers Association</ToCompany> | |
<SentDate>20081106</SentDate> | |
</Header> | |
<Product> | |
<RecordReference>9780732287573</RecordReference> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
gem "libxml-ruby", "1.1.2" | |
require "libxml" | |
file = File.join(File.dirname(__FILE__),"..","data","entities.xml") | |
reader = LibXML::XML::Reader.file(file) | |
def read_next(reader) | |
while reader.read | |
if (reader.name == "Header" || reader.name == "Product") && reader.node_type == LibXML::XML::Reader::TYPE_ELEMENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'prawn' | |
NAME_TREE_CHILDREN_LIMIT = 20 | |
Prawn::Document.generate "autoprint.pdf" do |pdf| | |
# Build the script we want to execute when the document opens | |
script = <<-EOF | |
var pp = this.getPrintParams(); | |
pp.interactive = pp.constants.interactionLevel.silent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> ed = Edition.find(1) | |
=> #<Edition id: 1, work_id: 469942, ean: "9781857230765", name: "Eye of the World(1) :Wheel Of Time Series"> | |
>> Edition.search("9781857230765") | |
=> [#<Edition id: 1, work_id: 469942, ean: "9781857230765", name: "Eye of the World(1) :Wheel Of Time Series">] | |
>> Edition.search("9781857230764") | |
=> [] | |
>> ed.update_attributes(:ean => "9781857230764") | |
Sphinx 0.9.8-release (r1371) | |
Copyright (c) 2001-2008, Andrew Aksyonoff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jh@gaz rba_staff_site (master)]$ rake ts:config --trace | |
(in /home/jh/git/rba_staff_site) | |
** Invoke ts:config (first_time) | |
** Invoke thinking_sphinx:configure (first_time) | |
** Invoke thinking_sphinx:app_env (first_time) | |
** Execute thinking_sphinx:app_env | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute thinking_sphinx:configure | |
Generating Configuration to /home/jh/git/rba_staff_site/config/development.sphinx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assume we're passing the values from the file below as arguments to the following: | |
# WTF is name always nil? | |
# I'm not sure off the top of my head, but maybe just avoid regexp's all together? | |
# - jh | |
def filtered_filenames(paths) | |
paths ||= [] | |
paths.collect { |path| | |
File.basename(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source edition_core_0 | |
{ | |
type = mysql | |
sql_host = localhost | |
sql_user = XXX | |
sql_pass = XXX | |
sql_db = rba_production | |
sql_sock = /var/run/mysqld/mysqld.sock | |
sql_query_pre = UPDATE `editions` SET `delta` = 0 WHERE `delta` = 1 | |
sql_query_pre = SET NAMES utf8 |
OlderNewer