dnif 0.0.1.alpha.4 → 0.0.1.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,10 @@ dnif is a gem to index data using ActiveRecord finders, letting you index your c
23
23
  end
24
24
  end
25
25
 
26
+ rake dnif:configure
27
+ rake dnif:index
28
+ rake dnif:start
29
+
26
30
  Post.search("dnif")
27
31
 
28
32
  == TODO
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dnif}
8
- s.version = "0.0.1.alpha.4"
8
+ s.version = "0.0.1.alpha.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rafael Souza"]
@@ -7,10 +7,8 @@ module Dnif
7
7
  class Configuration
8
8
 
9
9
  def self.generate(config_path)
10
- Tilt.register 'erb', Tilt::ErubisTemplate
11
-
12
- template = Tilt.new(config_path)
13
- output = template.render(self)
10
+ template = ERB.new(File.read(config_path))
11
+ output = template.result(binding)
14
12
 
15
13
  # TODO turn "db/sphinx" and "config/sphinx" configurable
16
14
  FileUtils.mkdir_p(File.join(Dnif.root_path, "db", "sphinx", Dnif.environment))
@@ -18,7 +18,7 @@ searchd {
18
18
  source <%= name %>
19
19
  {
20
20
  type = xmlpipe2
21
- xmlpipe_command = MODEL=<%= model %> rake dnif:xml --silent
21
+ xmlpipe_command = <%= (defined?(Rails) ? "RAILS_ENV" : "RACK_ENV") %>=<%= Dnif.environment %> MODEL=<%= model %> rake dnif:xml --silent
22
22
  }
23
23
  <% end %>
24
24
 
@@ -5,11 +5,11 @@ require 'erb'
5
5
  class TestConfiguration < Test::Unit::TestCase
6
6
 
7
7
  test "generate configuration from default template" do
8
- Tilt.expects(:register).with('erb', Tilt::ErubisTemplate)
8
+ File.expects(:read).with("config/path.erb").returns("configurations")
9
9
 
10
10
  template = mock("Template")
11
- template.expects(:render).with(Dnif::Configuration).returns('output')
12
- Tilt.expects(:new).with("config/path.erb").returns(template)
11
+ template.expects(:result).returns('output')
12
+ ERB.expects(:new).with("configurations").returns(template)
13
13
 
14
14
  file = mock
15
15
  file.expects(:puts).with('output')
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 1
9
9
  - alpha
10
- - 4
11
- version: 0.0.1.alpha.4
10
+ - 5
11
+ version: 0.0.1.alpha.5
12
12
  platform: ruby
13
13
  authors:
14
14
  - Rafael Souza