riddle 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.textile +1 -0
  2. data/lib/riddle.rb +30 -4
  3. data/lib/riddle/0.9.8.rb +1 -0
  4. data/lib/riddle/0.9.9.rb +2 -0
  5. data/lib/riddle/auto_version.rb +11 -0
  6. data/lib/riddle/client.rb +2 -0
  7. data/lib/riddle/configuration.rb +3 -1
  8. data/lib/riddle/configuration/sql_source.rb +13 -0
  9. data/lib/riddle/controller.rb +29 -2
  10. data/spec/functional/excerpt_spec.rb +2 -2
  11. data/spec/functional/status_spec.rb +1 -1
  12. data/spec/riddle/auto_version_spec.rb +24 -0
  13. data/spec/riddle/client_spec.rb +11 -0
  14. data/spec/riddle/configuration_spec.rb +11 -0
  15. data/spec/riddle/controller_spec.rb +29 -0
  16. data/spec/riddle_spec.rb +27 -0
  17. data/spec/spec_helper.rb +1 -4
  18. data/spec/unit/client_spec.rb +1 -1
  19. data/spec/unit/configuration/searchd_spec.rb +2 -2
  20. data/spec/unit/configuration/sql_source_spec.rb +21 -0
  21. metadata +8 -48
  22. data/spec/fixtures/data/anchor.bin +0 -0
  23. data/spec/fixtures/data/any.bin +0 -0
  24. data/spec/fixtures/data/boolean.bin +0 -0
  25. data/spec/fixtures/data/comment.bin +0 -0
  26. data/spec/fixtures/data/distinct.bin +0 -0
  27. data/spec/fixtures/data/field_weights.bin +0 -0
  28. data/spec/fixtures/data/filter.bin +0 -0
  29. data/spec/fixtures/data/filter_array.bin +0 -0
  30. data/spec/fixtures/data/filter_array_exclude.bin +0 -0
  31. data/spec/fixtures/data/filter_boolean.bin +0 -0
  32. data/spec/fixtures/data/filter_floats.bin +0 -0
  33. data/spec/fixtures/data/filter_floats_exclude.bin +0 -0
  34. data/spec/fixtures/data/filter_range.bin +0 -0
  35. data/spec/fixtures/data/filter_range_exclude.bin +0 -0
  36. data/spec/fixtures/data/group.bin +0 -0
  37. data/spec/fixtures/data/index.bin +0 -0
  38. data/spec/fixtures/data/index_weights.bin +0 -0
  39. data/spec/fixtures/data/keywords_with_hits.bin +0 -0
  40. data/spec/fixtures/data/keywords_without_hits.bin +0 -0
  41. data/spec/fixtures/data/overrides.bin +0 -0
  42. data/spec/fixtures/data/phrase.bin +0 -0
  43. data/spec/fixtures/data/rank_mode.bin +0 -0
  44. data/spec/fixtures/data/select.bin +0 -0
  45. data/spec/fixtures/data/simple.bin +0 -0
  46. data/spec/fixtures/data/sort.bin +0 -0
  47. data/spec/fixtures/data/update_simple.bin +0 -0
  48. data/spec/fixtures/data/weights.bin +0 -0
  49. data/spec/fixtures/data_generator.0.9.8.php +0 -208
  50. data/spec/fixtures/data_generator.0.9.9.php +0 -225
  51. data/spec/fixtures/sphinx/configuration.erb +0 -38
  52. data/spec/fixtures/sphinx/people.spa +0 -0
  53. data/spec/fixtures/sphinx/people.spd +0 -0
  54. data/spec/fixtures/sphinx/people.sph +0 -0
  55. data/spec/fixtures/sphinx/people.spi +0 -0
  56. data/spec/fixtures/sphinx/people.spk +0 -0
  57. data/spec/fixtures/sphinx/people.spm +0 -0
  58. data/spec/fixtures/sphinx/people.spp +0 -0
  59. data/spec/fixtures/sphinx/searchd.log +0 -4430
  60. data/spec/fixtures/sphinx/searchd.query.log +0 -1234
  61. data/spec/fixtures/sphinx/spec.conf +0 -38
  62. data/spec/fixtures/sphinxapi.0.9.8.php +0 -1228
  63. data/spec/fixtures/sphinxapi.0.9.9.php +0 -1646
  64. data/spec/fixtures/sql/conf.example.yml +0 -3
  65. data/spec/fixtures/sql/conf.yml +0 -3
  66. data/spec/fixtures/sql/data.sql +0 -25000
  67. data/spec/fixtures/sql/structure.sql +0 -16
@@ -79,3 +79,4 @@ Thanks to the following people who have contributed to Riddle in some shape or f
79
79
  * Dylan Egan
80
80
  * Jerry Vos
81
81
  * Piotr Sarnacki
82
+ * Tim Preston
@@ -1,10 +1,6 @@
1
1
  require 'socket'
2
2
  require 'timeout'
3
3
 
4
- require 'riddle/client'
5
- require 'riddle/configuration'
6
- require 'riddle/controller'
7
-
8
4
  module Riddle #:nodoc:
9
5
  class ConnectionError < StandardError #:nodoc:
10
6
  #
@@ -21,4 +17,34 @@ module Riddle #:nodoc:
21
17
  def self.escape(string)
22
18
  string.gsub(escape_pattern) { |char| "\\#{char}" }
23
19
  end
20
+
21
+ def self.loaded_version
22
+ Thread.current[:riddle_sphinx_version]
23
+ end
24
+
25
+ def self.loaded_version=(version)
26
+ Thread.current[:riddle_sphinx_version] = version
27
+ end
28
+
29
+ def self.version_warning
30
+ return if loaded_version
31
+
32
+ STDERR.puts %Q{
33
+ Riddle cannot detect Sphinx on your machine, and so can't determine which
34
+ version of Sphinx you are planning on using. Please use one of the following
35
+ lines after "require 'riddle'" to avoid this warning.
36
+
37
+ require 'riddle/0.9.8'
38
+ # or
39
+ require 'riddle/0.9.9'
40
+
41
+ }
42
+ end
24
43
  end
44
+
45
+ require 'riddle/auto_version'
46
+ require 'riddle/client'
47
+ require 'riddle/configuration'
48
+ require 'riddle/controller'
49
+
50
+ Riddle::AutoVersion.configure
@@ -0,0 +1 @@
1
+ Riddle.loaded_version = '0.9.8'
@@ -1,3 +1,5 @@
1
+ Riddle.loaded_version = '0.9.9'
2
+
1
3
  require 'riddle/0.9.9/client'
2
4
  require 'riddle/0.9.9/client/filter'
3
5
  require 'riddle/0.9.9/configuration/searchd'
@@ -0,0 +1,11 @@
1
+ class Riddle::AutoVersion
2
+ def self.configure
3
+ controller = Riddle::Controller.new nil, ''
4
+ version = controller.sphinx_version
5
+
6
+ case version
7
+ when '0.9.8', '0.9.9'
8
+ require "riddle/#{version}"
9
+ end
10
+ end
11
+ end
@@ -129,6 +129,8 @@ module Riddle
129
129
  # defaults of localhost and 3312 respectively. All other settings can be
130
130
  # accessed and changed via the attribute accessors.
131
131
  def initialize(server=nil, port=nil)
132
+ Riddle.version_warning
133
+
132
134
  @server = server || "localhost"
133
135
  @port = port || 3312
134
136
  @socket = nil
@@ -18,6 +18,8 @@ module Riddle
18
18
  attr_accessor :indexer
19
19
 
20
20
  def initialize
21
+ Riddle.version_warning
22
+
21
23
  @indexer = Riddle::Configuration::Indexer.new
22
24
  @searchd = Riddle::Configuration::Searchd.new
23
25
  @indexes = []
@@ -30,4 +32,4 @@ module Riddle
30
32
  ).join("\n")
31
33
  end
32
34
  end
33
- end
35
+ end
@@ -30,6 +30,19 @@ module Riddle
30
30
  @unpack_zlib = []
31
31
  @unpack_mysqlcompress = []
32
32
  end
33
+
34
+ def sql_query=(query)
35
+ unless query.nil?
36
+ max_length = 8178 # max is: 8192 - "sql_query = ".length - "\\\n".length
37
+ i = max_length
38
+ while i < query.length
39
+ i = query.rindex(" ", i)
40
+ query.insert(i, "\\" + "\n")
41
+ i = i + max_length
42
+ end
43
+ end
44
+ @sql_query = query
45
+ end
33
46
 
34
47
  def valid?
35
48
  super && (!( @sql_host.nil? || @sql_user.nil? || @sql_db.nil? ||
@@ -1,14 +1,31 @@
1
1
  module Riddle
2
2
  class Controller
3
+ attr_accessor :path, :bin_path, :searchd_binary_name, :indexer_binary_name
4
+
3
5
  def initialize(configuration, path)
4
6
  @configuration = configuration
5
7
  @path = path
8
+
9
+ @bin_path = ''
10
+ @searchd_binary_name = 'searchd'
11
+ @indexer_binary_name = 'indexer'
12
+ end
13
+
14
+ def sphinx_version
15
+ stderr = $stderr.dup
16
+ read, write = IO.pipe
17
+ $stderr.reopen(write)
18
+ `#{indexer}`[/^Sphinx (\d\.\d\.\d)/, 1]
19
+ rescue
20
+ nil
21
+ ensure
22
+ $stderr.reopen(stderr)
6
23
  end
7
24
 
8
25
  def index(*indexes)
9
26
  indexes << '--all' if indexes.empty?
10
27
 
11
- cmd = "indexer --config #{@path} #{indexes.join(' ')}"
28
+ cmd = "#{indexer} --config #{@path} #{indexes.join(' ')}"
12
29
  cmd << " --rotate" if running?
13
30
  `#{cmd}`
14
31
  end
@@ -16,7 +33,7 @@ module Riddle
16
33
  def start
17
34
  return if running?
18
35
 
19
- cmd = "searchd --pidfile --config #{@path}"
36
+ cmd = "#{searchd} --pidfile --config #{@path}"
20
37
 
21
38
  if RUBY_PLATFORM =~ /mswin/
22
39
  system("start /B #{cmd} 1> NUL 2>&1")
@@ -51,5 +68,15 @@ module Riddle
51
68
  rescue
52
69
  false
53
70
  end
71
+
72
+ private
73
+
74
+ def indexer
75
+ "#{bin_path}#{indexer_binary_name}"
76
+ end
77
+
78
+ def searchd
79
+ "#{bin_path}#{searchd_binary_name}"
80
+ end
54
81
  end
55
82
  end
@@ -48,7 +48,7 @@ not. It's just my name: Pat.
48
48
  )
49
49
 
50
50
 
51
- if SphinxVersion == '0.9.9'
51
+ if Riddle.loaded_version == '0.9.9'
52
52
  excerpts.should == [
53
53
  <<-SENTENCE
54
54
  This is a really long sentence written by <em>Pat</em>. It has to be over 256
@@ -90,7 +90,7 @@ not. It's just my name: Pat.
90
90
  :chunk_separator => " --- "
91
91
  )
92
92
 
93
- if SphinxVersion == '0.9.9'
93
+ if Riddle.loaded_version == '0.9.9'
94
94
  excerpts.should == [
95
95
  <<-SENTENCE
96
96
  This is a really long sentence written by <em>Pat</em>. It has to be over 256
@@ -1,6 +1,6 @@
1
1
  require 'spec/spec_helper'
2
2
 
3
- if SphinxVersion == '0.9.9'
3
+ if Riddle.loaded_version == '0.9.9'
4
4
  describe "Sphinx Status" do
5
5
  before :each do
6
6
  @client = Riddle::Client.new("localhost", 3313)
@@ -0,0 +1,24 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Riddle::AutoVersion do
4
+ describe '.configure' do
5
+ before :each do
6
+ @controller = Riddle::Controller.new stub('configuration'), 'sphinx.conf'
7
+ Riddle::Controller.stub!(:new => @controller)
8
+ end
9
+
10
+ it "should require 0.9.8 if that is the known version" do
11
+ Riddle::AutoVersion.should_receive(:require).with('riddle/0.9.8')
12
+
13
+ @controller.stub!(:sphinx_version => '0.9.8')
14
+ Riddle::AutoVersion.configure
15
+ end
16
+
17
+ it "should require 0.9.9 if that is the known version" do
18
+ Riddle::AutoVersion.should_receive(:require).with('riddle/0.9.9')
19
+
20
+ @controller.stub!(:sphinx_version => '0.9.9')
21
+ Riddle::AutoVersion.configure
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Riddle::Client do
4
+ describe '#initialize' do
5
+ it "should check the loaded Sphinx version" do
6
+ Riddle.should_receive(:version_warning)
7
+
8
+ Riddle::Client.new
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Riddle::Configuration do
4
+ describe '#initialize' do
5
+ it "should check the loaded Sphinx version" do
6
+ Riddle.should_receive(:version_warning)
7
+
8
+ Riddle::Configuration.new
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Riddle::Controller do
4
+ describe '#sphinx_version' do
5
+ before :each do
6
+ @controller = Riddle::Controller.new stub('controller'), 'sphinx.conf'
7
+ end
8
+
9
+ it "should return 0.9.9 if using 0.9.9 rc2" do
10
+ @controller.stub!(:` => 'Sphinx 0.9.9-rc2 (r1785)')
11
+ @controller.sphinx_version.should == '0.9.9'
12
+ end
13
+
14
+ it "should return 0.9.9 if using 0.9.9 rc1" do
15
+ @controller.stub!(:` => 'Sphinx 0.9.9-rc1 (r1566)')
16
+ @controller.sphinx_version.should == '0.9.9'
17
+ end
18
+
19
+ it "should return 0.9.8 if using 0.9.8.1" do
20
+ @controller.stub!(:` => 'Sphinx 0.9.8.1-release (r1533)')
21
+ @controller.sphinx_version.should == '0.9.8'
22
+ end
23
+
24
+ it "should return 0.9.8 if using 0.9.8" do
25
+ @controller.stub!(:` => 'Sphinx 0.9.8-release (r1371)')
26
+ @controller.sphinx_version.should == '0.9.8'
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Riddle do
4
+ describe '.version_warning' do
5
+ before :each do
6
+ @existing_version = Riddle.loaded_version
7
+ end
8
+
9
+ after :each do
10
+ Riddle.loaded_version = @existing_version
11
+ end
12
+
13
+ it "should do nothing if there is a Sphinx version loaded" do
14
+ STDERR.should_not_receive(:puts)
15
+
16
+ Riddle.loaded_version = '0.9.8'
17
+ Riddle.version_warning
18
+ end
19
+
20
+ it "should output a warning if no version is loaded" do
21
+ STDERR.should_receive(:puts)
22
+
23
+ Riddle.loaded_version = nil
24
+ Riddle.version_warning
25
+ end
26
+ end
27
+ end
@@ -1,9 +1,6 @@
1
1
  $:.unshift File.dirname(__FILE__) + '/../lib'
2
2
 
3
- SphinxVersion = ENV['VERSION'] || '0.9.8'
4
-
5
3
  require 'riddle'
6
- require "riddle/#{SphinxVersion}"
7
4
  require 'spec'
8
5
  require 'spec/sphinx_helper'
9
6
 
@@ -14,7 +11,7 @@ Spec::Runner.configure do |config|
14
11
  sphinx.index
15
12
 
16
13
  config.before :all do
17
- `php -f spec/fixtures/data_generator.#{SphinxVersion}.php`
14
+ `php -f spec/fixtures/data_generator.#{Riddle.loaded_version}.php`
18
15
  sphinx.start
19
16
  end
20
17
 
@@ -130,7 +130,7 @@ describe Riddle::Client do
130
130
  client.queue.first.should == query_contents(:comment)
131
131
  end
132
132
 
133
- if SphinxVersion == '0.9.9'
133
+ if Riddle.loaded_version == '0.9.9'
134
134
  it "should build a message with overrides correctly" do
135
135
  client = Riddle::Client.new
136
136
  client.add_override("rating", :float, {1 => 10.0})
@@ -1,7 +1,7 @@
1
1
  require 'spec/spec_helper'
2
2
 
3
3
  describe Riddle::Configuration::Searchd do
4
- if SphinxVersion == '0.9.9'
4
+ if Riddle.loaded_version == '0.9.9'
5
5
  it "should be invalid without a listen or pid_file" do
6
6
  searchd = Riddle::Configuration::Searchd.new
7
7
  searchd.should_not be_valid
@@ -60,7 +60,7 @@ describe Riddle::Configuration::Searchd do
60
60
  searchd.port = 3312
61
61
  searchd.pid_file = "file.pid"
62
62
 
63
- if SphinxVersion == '0.9.9'
63
+ if Riddle.loaded_version == '0.9.9'
64
64
  searchd.render.should == <<-SEARCHD
65
65
  searchd
66
66
  {
@@ -112,4 +112,25 @@ source src1
112
112
  }
113
113
  SQLSOURCE
114
114
  end
115
+
116
+ it "should insert a backslash-newline into an sql_query when greater than 8178 characters" do
117
+ source = Riddle::Configuration::SQLSource.new("src1", "mysql")
118
+ source.sql_query = big_query_string[0, 8200]
119
+
120
+ (source.sql_query.index("\\\n") < 8178).should be_true
121
+ end
122
+
123
+ it "should insert two backslash-newlines into an sql_query when greater than 16,356 characters" do
124
+ source = Riddle::Configuration::SQLSource.new("src1", "mysql")
125
+ source.sql_query = big_query_string
126
+
127
+ (source.sql_query.index("\\\n") < 8178).should be_true
128
+ (source.sql_query.index("\\\n", 8178) < 16356).should be_true
129
+ end
130
+
131
+ def big_query_string
132
+ return <<-SQL
133
+ SELECT MARLEY was dead to begin with There is no doubtwhatever about that The register of his burial wassigned by the clergyman the clerk the undertakerand the chief mourner Scrooge signed it andScrooges name was good upon Change for anything hechose to put his hand to Old Marley was as dead as adoornailMind I dont mean to say that I know of myown knowledge what there is particularly dead abouta doornail I might have been inclined myself toregard a coffinnail as the deadest piece of ironmongeryin the trade But the wisdom of our ancestorsis in the simile and my unhallowed handsshall not disturb it or the Countrys done for Youwill therefore permit me to repeat emphatically thatMarley was as dead as a doornailScrooge knew he was dead Of course he didHow could it be otherwise Scrooge and he werepartners for I dont know how many years Scroogewas his sole executor his sole administrator his soleassign his sole residuary legatee his sole friend andsole mourner And even Scrooge was not so dreadfullycut up by the sad event but that he was an excellentman of business on the very day of the funeraland solemnised it with an undoubted bargainThe mention of Marleys funeral brings me back tothe point I started from There is no doubt that Marleywas dead This must be distinctly understood ornothing wonderful can come of the story I am goingto relate If we were not perfectly convinced thatHamlets Father died before the play began therewould be nothing more remarkable in his taking astroll at night in an easterly wind upon his own rampartsthan there would be in any other middleagedgentleman rashly turning out after dark in a breezyspotsay Saint Pauls Churchyard for instanceliterally to astonish his sons weak mindScrooge never painted out Old Marleys nameThere it stood years afterwards above the warehousedoor Scrooge and Marley The firm was known asScrooge and Marley Sometimes people new to thebusiness called Scrooge Scrooge and sometimes Marleybut he answered to both names It was all thesame to himOh But he was a tightfisted hand at the grindstoneScrooge a squeezing wrenching grasping scrapingclutching covetous old sinner Hard and sharp as flintfrom which no steel had ever struck out generous firesecret and selfcontained and solitary as an oyster Thecold within him froze his old features nipped his pointednose shrivelled his cheek stiffened his gait made hiseyes red his thin lips blue and spoke out shrewdly in hisgrating voice A frosty rime was on his head and on hiseyebrows and his wiry chin He carried his own lowtemperature always about with him he iced his office inthe dogdays and didnt thaw it one degree at ChristmasExternal heat and cold had little influence onScrooge No warmth could warm no wintry weatherchill him No wind that blew was bitterer than heno falling snow was more intent upon its purpose nopelting rain less open to entreaty Foul weather didntknow where to have him The heaviest rain andsnow and hail and sleet could boast of the advantageover him in only one respect They often came downhandsomely and Scrooge never didNobody ever stopped him in the street to say withgladsome looks My dear Scrooge how are youWhen will you come to see me No beggars imploredhim to bestow a trifle no children asked himwhat it was oclock no man or woman ever once in allhis life inquired the way to such and such a place ofScrooge Even the blind mens dogs appeared toknow him and when they saw him coming on wouldtug their owners into doorways and up courts andthen would wag their tails as though they said Noeye at all is better than an evil eye dark masterBut what did Scrooge care It was the very thinghe liked To edge his way along the crowded pathsof life warning all human sympathy to keep its distancewas what the knowing ones call nuts to ScroogeOnce upon a timeof all the good days in the yearon Christmas Eveold Scrooge sat busy in hiscountinghouse It was cold bleak biting weather foggywithal and he could hear the people in the court outsidego wheezing up and down beating their handsupon their breasts and stamping their feet upon thepavement stones to warm them The city clocks hadonly just gone three but it was quite dark alreadyit had not been light all dayand candles were flaringin the windows of the neighbouring offices likeruddy smears upon the palpable brown air The fogcame pouring in at every chink and keyhole and wasso dense without that although the court was of thenarrowest the houses opposite were mere phantomsTo see the dingy cloud come drooping down obscuringeverything one might have thought that Naturelived hard by and was brewing on a large scaleThe door of Scrooges countinghouse was openthat he might keep his eye upon his clerk who in adismal little cell beyond a sort of tank was copyingletters Scrooge had a very small fire but the clerksfire was so very much smaller that it looked like onecoal But he couldnt replenish it for Scrooge keptthe coalbox in his own room and so surely as theclerk came in with the shovel the master predictedthat it would be necessary for them to part Whereforethe clerk put on his white comforter and tried towarm himself at the candle in which effort not beinga man of a strong imagination he failedA merry Christmas uncle God save you crieda cheerful voice It was the voice of Scroogesnephew who came upon him so quickly that this wasthe first intimation he had of his approachBah said Scrooge HumbugHe had so heated himself with rapid walking in thefog and frost this nephew of Scrooges that he wasall in a glow his face was ruddy and handsome hiseyes sparkled and his breath smoked againChristmas a humbug uncle said Scroogesnephew You dont mean that I am sureI do said Scrooge Merry Christmas Whatright have you to be merry What reason have youto be merry Youre poor enoughCome then returned the nephew gaily Whatright have you to be dismal What reason have youto be morose Youre rich enoughScrooge having no better answer ready on the spurof the moment said Bah again and followed it upwith HumbugDont be cross uncle said the nephewWhat else can I be returned the uncle when Ilive in such a world of fools as this Merry ChristmasOut upon merry Christmas Whats Christmastime to you but a time for paying bills withoutmoney a time for finding yourself a year older butnot an hour richer a time for balancing your booksand having every item in em through a round dozenof months presented dead against you If I couldwork my will said Scrooge indignantly every idiotwho goes about with Merry Christmas on his lipsshould be boiled with his own pudding and buriedwith a stake of holly through his heart He shouldUncle pleaded the nephewNephew returned the uncle sternly keep Christmasin your own way and let me keep it in mineKeep it repeated Scrooges nephew But youdont keep itLet me leave it alone then said Scrooge Muchgood may it do you Much good it has ever doneyouThere are many things from which I might havederived good by which I have not profited I daresay returned the nephew Christmas among therest But I am sure I have always thought of Christmastime when it has come roundapart from theveneration due to its sacred name and origin if anythingbelonging to it can be apart from thatas agood time a kind forgiving charitable pleasanttime the only time I know of in the long calendarof the year when men and women seem by one consentto open their shutup hearts freely and to thinkof people below them as if they really werefellowpassengers to the grave and not another raceof creatures bound on other journeys And thereforeuncle though it has never put a scrap of gold orsilver in my pocket I believe that it has done megood and will do me good and I say God bless itThe clerk in the Tank involuntarily applaudedBecoming immediately sensible of the improprietyhe poked the fire and extinguished the last frail sparkfor everLet me hear another sound from you saidScrooge and youll keep your Christmas by losingyour situation Youre quite a powerful speakersir he added turning to his nephew I wonder youdont go into ParliamentDont be angry uncle Come Dine with us tomorrowScrooge said that he would see himyes indeed hedid He went the whole length of the expressionand said that he would see him in that extremity firstBut why cried Scrooges nephew WhyWhy did you get married said ScroogeBecause I fell in loveBecause you fell in love growled Scrooge as ifthat were the only one thing in the world more ridiculousthan a merry Christmas Good afternoonNay uncle but you never came to see me beforethat happened Why give it as a reason for notcoming nowGood afternoon said ScroogeI want nothing from you I ask nothing of youwhy cannot we be friendsGood afternoon said ScroogeI am sorry with all my heart to find you soresolute We have never had any quarrel to which Ihave been a party But I have made the trial inhomage to Christmas and Ill keep my Christmashumour to the last So A Merry Christmas uncleGood afternoon said ScroogeAnd A Happy New YearGood afternoon said ScroogeHis nephew left the room without an angry wordnotwithstanding He stopped at the outer door tobestow the greetings of the season on the clerk whocold as he was was warmer than Scrooge for he returnedthem cordiallyTheres another fellow muttered Scrooge whooverheard him my clerk with fifteen shillings aweek and a wife and family talking about a merryChristmas Ill retire to BedlamThis lunatic in letting Scrooges nephew out hadlet two other people in They were portly gentlemenpleasant to behold and now stood with their hats offin Scrooges office They had books and papers intheir hands and bowed to himScrooge and Marleys I believe said one of thegentlemen referring to his list Have I the pleasureof addressing Mr Scrooge or Mr MarleyMr Marley has been dead these seven yearsScrooge replied He died seven years ago this verynightWe have no doubt his liberality is well representedby his surviving partner said the gentleman presentinghis credentialsIt certainly was for they had been two kindredspirits At the ominous word liberality Scroogefrowned and shook his head and handed the credentialsbackAt this festive season of the year Mr Scroogesaid the gentleman taking up a pen it is more thanusually desirable that we should make some slightprovision for the Poor and destitute who suffergreatly at the present time Many thousands are inwant of common necessaries hundreds of thousandsare in want of common comforts sirAre there no prisons asked ScroogePlenty of prisons said the gentleman laying downthe pen againAnd the Union workhouses demanded ScroogeAre they still in operationThey are Still returned the gentleman I wishI could say they were notThe Treadmill and the Poor Law are in full vigourthen said ScroogeBoth very busy sirOh I was afraid from what you said at firstthat something had occurred to stop them in theiruseful course said Scrooge Im very glad tohear itUnder the impression that they scarcely furnishChristian cheer of mind or body to the multitudereturned the gentleman a few of us are endeavouringto raise a fund to buy the Poor some meat and drinkand means of warmth We choose this time becauseit is a time of all others when Want is keenly feltand Abundance rejoices What shall I put you downforNothing Scrooge repliedYou wish to be anonymousI wish to be left alone said Scrooge Since youask me what I wish gentlemen that is my answerI dont make merry myself at Christmas and I cantafford to make idle people merry I help to supportthe establishments I have mentionedthey costenough and those who are badly off must go thereMany cant go there and many would rather dieIf they would rather die said Scrooge they hadbetter do it and decrease the surplus populationBesidesexcuse meI dont know thatBut you might know it observed the gentlemanIts not my business Scrooge returned Itsenough for a man to understand his own business andnot to interfere with other peoples Mine occupiesme constantly Good afternoon gentlemenSeeing clearly that it would be useless to pursuetheir point the gentlemen withdrew Scrooge resumedhis labours with an improved opinion of himselfand in a more facetious temper than was usualwith himMeanwhile the fog and darkness thickened so thatpeople ran about with flaring links proffering theirservices to go before horses in carriages and conductthem on their way The ancient tower of a churchwhose gruff old bell was always peeping slily downat Scrooge out of a Gothic window in the wall becameinvisible and struck the hours and quarters in theclouds with tremulous vibrations afterwards as ifits teeth were chattering in its frozen head up thereThe cold became intense In the main street at thecorner of the court some labourers were repairingthe gaspipes and had lighted a great fire in a brazierround which a party of ragged men and boys weregathered warming their hands and winking theireyes before the blaze in rapture The waterplugbeing left in solitude its overflowings sullenly congealedand turned to misanthropic ice The brightnessof the shops where holly sprigs and berriescrackled in the lamp heat of the windows made palefaces ruddy as they passed Poulterers and grocerstrades became a splendid joke a glorious pageantwith which it was next to impossible to believe thatsuch dull principles as bargain and sale had anythingto do The Lord Mayor in the stronghold of themighty Mansion House gave orders to his fifty cooksand butlers to keep Christmas as a Lord Mayorshousehold should and even the little tailor whom hehad fined five shillings on the previous Monday forbeing drunk and bloodthirsty in the streets stirred uptomorrows pudding in his garret while his leanwife and the baby sallied out to buy the beefFoggier yet and colder Piercing searching bitingcold If the good Saint Dunstan had but nippedthe Evil Spirits nose with a touch of such weatheras that instead of using his familiar weapons thenindeed he would have roared to lusty purpose Theowner of one scant young nose gnawed and mumbledby the hungry cold as bones are gnawed by dogsstooped down at Scrooges keyhole to regale him witha Christmas carol but at the first sound of God bless you merry gentleman May nothing you dismayScrooge seized the ruler with such energy of actionthat the singer fled in terror leaving the keyhole tothe fog and even more congenial frostAt length the hour of shutting up the countinghousearrived With an illwill Scrooge dismounted from hisstool and tacitly admitted the fact to the expectantclerk in the Tank who instantly snuffed his candle outand put on his hatYoull want all day tomorrow I suppose saidScroogeIf quite convenient sirIts not convenient said Scrooge and its notfair If I was to stop halfacrown for it youdthink yourself illused Ill be boundThe clerk smiled faintlyAnd yet said Scrooge you dont think me illusedwhen I pay a days wages for no workThe clerk observed that it was only once a yearA poor excuse for picking a mans pocket everytwentyfifth of December said Scrooge buttoninghis greatcoat to the chin But I suppose you musthave the whole day Be here all the earlier nextmorningThe clerk promised that he would and Scroogewalked out with a growl The office was closed in atwinkling and the clerk with the long ends of hiswhite comforter dangling below his waist for heboasted no greatcoat went down a slide on Cornhillat the end of a lane of boys twenty times inhonour of its being Christmas Eve and then ran hometo Camden Town as hard as he could pelt to playat blindmansbuffScrooge took his melancholy dinner in his usualmelancholy tavern and having read all the newspapers andbeguiled the rest of the evening with hisbankersbook went home to bed He lived inchambers which had once belonged to his deceasedpartner They were a gloomy suite of rooms in alowering pile of building up a yard where it had solittle business to be that one could scarcely helpfancying it must have run there when it was a younghouse playing at hideandseek with other housesand forgotten the way out again It was old enoughnow and dreary enough for nobody lived in it butScrooge the other rooms being all let out as officesThe yard was so dark that even Scrooge who knewits every stone was fain to grope with his handsThe fog and frost so hung about the black old gatewayof the house that it seemed as if the Genius ofthe Weather sat in mournful meditation on thethresholdNow it is a fact that there was nothing at allparticular about the knocker on the door except that itwas very large It is also a fact that Scrooge hadseen it night and morning during his whole residencein that place also that Scrooge had as little of whatis called fancy about him as any man in the city ofLondon even includingwhich is a bold wordthecorporation aldermen and livery Let it also beborne in mind that Scrooge had not bestowed onethought on Marley since his last mention of hisseven years dead partner that afternoon And thenlet any man explain to me if he can how it happenedthat Scrooge having his key in the lock of the doorsaw in the knocker without its undergoing any intermediateprocess of changenot a knocker but Marleys faceMarleys face It was not in impenetrable shadowas the other objects in the yard were but had adismal light about it like a bad lobster in a darkcellar It was not angry or ferocious but lookedat Scrooge as Marley used to look with ghostlyspectacles turned up on its ghostly forehead Thehair was curiously stirred as if by breath or hot airand though the eyes were wide open they were perfectlymotionless FROM documents
134
+ SQL
135
+ end
115
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-27 00:00:00 +11:00
12
+ date: 2009-12-01 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,7 @@ files:
48
48
  - lib/riddle/0.9.9/client.rb
49
49
  - lib/riddle/0.9.9/client/filter.rb
50
50
  - lib/riddle/0.9.9/configuration/searchd.rb
51
+ - lib/riddle/auto_version.rb
51
52
  - lib/riddle/client.rb
52
53
  - lib/riddle/client/filter.rb
53
54
  - lib/riddle/client/message.rb
@@ -92,52 +93,6 @@ signing_key:
92
93
  specification_version: 3
93
94
  summary: An API for Sphinx, written in and for Ruby.
94
95
  test_files:
95
- - spec/fixtures/data/anchor.bin
96
- - spec/fixtures/data/any.bin
97
- - spec/fixtures/data/boolean.bin
98
- - spec/fixtures/data/comment.bin
99
- - spec/fixtures/data/distinct.bin
100
- - spec/fixtures/data/field_weights.bin
101
- - spec/fixtures/data/filter.bin
102
- - spec/fixtures/data/filter_array.bin
103
- - spec/fixtures/data/filter_array_exclude.bin
104
- - spec/fixtures/data/filter_boolean.bin
105
- - spec/fixtures/data/filter_floats.bin
106
- - spec/fixtures/data/filter_floats_exclude.bin
107
- - spec/fixtures/data/filter_range.bin
108
- - spec/fixtures/data/filter_range_exclude.bin
109
- - spec/fixtures/data/group.bin
110
- - spec/fixtures/data/index.bin
111
- - spec/fixtures/data/index_weights.bin
112
- - spec/fixtures/data/keywords_with_hits.bin
113
- - spec/fixtures/data/keywords_without_hits.bin
114
- - spec/fixtures/data/overrides.bin
115
- - spec/fixtures/data/phrase.bin
116
- - spec/fixtures/data/rank_mode.bin
117
- - spec/fixtures/data/select.bin
118
- - spec/fixtures/data/simple.bin
119
- - spec/fixtures/data/sort.bin
120
- - spec/fixtures/data/update_simple.bin
121
- - spec/fixtures/data/weights.bin
122
- - spec/fixtures/data_generator.0.9.8.php
123
- - spec/fixtures/data_generator.0.9.9.php
124
- - spec/fixtures/sphinx/configuration.erb
125
- - spec/fixtures/sphinx/people.spa
126
- - spec/fixtures/sphinx/people.spd
127
- - spec/fixtures/sphinx/people.sph
128
- - spec/fixtures/sphinx/people.spi
129
- - spec/fixtures/sphinx/people.spk
130
- - spec/fixtures/sphinx/people.spm
131
- - spec/fixtures/sphinx/people.spp
132
- - spec/fixtures/sphinx/searchd.log
133
- - spec/fixtures/sphinx/searchd.query.log
134
- - spec/fixtures/sphinx/spec.conf
135
- - spec/fixtures/sphinxapi.0.9.8.php
136
- - spec/fixtures/sphinxapi.0.9.9.php
137
- - spec/fixtures/sql/conf.example.yml
138
- - spec/fixtures/sql/conf.yml
139
- - spec/fixtures/sql/data.sql
140
- - spec/fixtures/sql/structure.sql
141
96
  - spec/functional/connection_spec.rb
142
97
  - spec/functional/excerpt_spec.rb
143
98
  - spec/functional/keywords_spec.rb
@@ -145,6 +100,11 @@ test_files:
145
100
  - spec/functional/search_spec.rb
146
101
  - spec/functional/status_spec.rb
147
102
  - spec/functional/update_spec.rb
103
+ - spec/riddle/auto_version_spec.rb
104
+ - spec/riddle/client_spec.rb
105
+ - spec/riddle/configuration_spec.rb
106
+ - spec/riddle/controller_spec.rb
107
+ - spec/riddle_spec.rb
148
108
  - spec/spec_helper.rb
149
109
  - spec/sphinx_helper.rb
150
110
  - spec/unit/client_spec.rb