dnif 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,14 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rake"
4
- gem "activerecord", ">= 3.0.0", :require => "active_record"
5
- gem "activesupport", ">= 3.0.0", :require => "active_support"
6
- gem "riddle", ">= 1.1.0"
7
- gem "builder", ">= 2.1.2"
8
-
9
- group :development do
10
- gem "jeweler", ">= 1.5.0.pre2"
11
- gem "rspec", ">= 2.0.0.beta.20"
12
- gem "database_cleaner"
13
- gem "sqlite3-ruby", :require => "sqlite3"
14
- end
3
+ gemspec
@@ -1,23 +1,32 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dnif (0.1.1)
5
+ activerecord (>= 3.0.3)
6
+ activesupport (>= 3.0.3)
7
+ builder (>= 2.1.2)
8
+ rake
9
+ riddle (>= 1.1.0)
10
+
1
11
  GEM
2
12
  remote: http://rubygems.org/
3
13
  specs:
4
- activemodel (3.0.0)
5
- activesupport (= 3.0.0)
14
+ activemodel (3.0.3)
15
+ activesupport (= 3.0.3)
6
16
  builder (~> 2.1.2)
7
- i18n (~> 0.4.1)
8
- activerecord (3.0.0)
9
- activemodel (= 3.0.0)
10
- activesupport (= 3.0.0)
11
- arel (~> 1.0.0)
17
+ i18n (~> 0.4)
18
+ activerecord (3.0.3)
19
+ activemodel (= 3.0.3)
20
+ activesupport (= 3.0.3)
21
+ arel (~> 2.0.2)
12
22
  tzinfo (~> 0.3.23)
13
- activesupport (3.0.0)
14
- arel (1.0.1)
15
- activesupport (~> 3.0.0)
23
+ activesupport (3.0.3)
24
+ arel (2.0.4)
16
25
  builder (2.1.2)
17
26
  database_cleaner (0.5.2)
18
27
  diff-lcs (1.1.2)
19
28
  git (1.2.5)
20
- i18n (0.4.1)
29
+ i18n (0.4.2)
21
30
  jeweler (1.5.0.pre2)
22
31
  bundler (>= 1.0.0.rc.5)
23
32
  git (>= 1.2.5)
@@ -39,10 +48,11 @@ PLATFORMS
39
48
  ruby
40
49
 
41
50
  DEPENDENCIES
42
- activerecord (>= 3.0.0)
43
- activesupport (>= 3.0.0)
51
+ activerecord (>= 3.0.3)
52
+ activesupport (>= 3.0.3)
44
53
  builder (>= 2.1.2)
45
54
  database_cleaner
55
+ dnif!
46
56
  jeweler (>= 1.5.0.pre2)
47
57
  rake
48
58
  riddle (>= 1.1.0)
@@ -4,6 +4,18 @@ dnif is the new find... for sphinx
4
4
 
5
5
  dnif is a gem to index data using ActiveRecord finders (for now), letting you index custom methods and not only table columns
6
6
 
7
+ == Installation
8
+
9
+ Install gem
10
+
11
+ gem install dnif
12
+
13
+ Put line below in your Gemfile
14
+
15
+ gem "dnif"
16
+
17
+ Now, all you need is configure your models and run rake tasks. See below.
18
+
7
19
  == Usage
8
20
 
9
21
  require "dnif"
@@ -15,7 +27,7 @@ dnif is a gem to index data using ActiveRecord finders (for now), letting you in
15
27
  field :email
16
28
  attribute :created_at, :type => :datetime
17
29
 
18
- where ["active = ?", false]
30
+ where "active = ?", false
19
31
  end
20
32
 
21
33
  def full_name
@@ -31,13 +43,11 @@ dnif is a gem to index data using ActiveRecord finders (for now), letting you in
31
43
 
32
44
  == TODO
33
45
 
34
- - Add messages for rake tasks
35
- - Better error handler
36
- - Try to remove ActiveRecord dependency, making it work with others ORMs/ODMs/etc
37
- - Documentation
38
46
  - Improve test suite
39
- - Index in chunks
47
+ - Documentation
40
48
  - Support to delta index (or something like that)
49
+ - Improve error handler
50
+ - Try to remove ActiveRecord dependency, making it work with others ORMs/ODMs/etc
41
51
  - Remove the class_name (seems not be necessary anymore)
42
52
  - Move this TODO to Issues
43
53
 
data/Rakefile CHANGED
@@ -1,30 +1,5 @@
1
- require "bundler"
2
- begin
3
- Bundler.setup(:default, :development)
4
- rescue Bundler::BundlerError => e
5
- $stderr.puts e.message
6
- $stderr.puts "Run `bundle install` to install missing gems"
7
- exit e.status_code
8
- end
9
-
10
- require "jeweler"
11
-
12
- $LOAD_PATH.unshift('lib')
13
- require "dnif/version"
14
-
15
- Jeweler::Tasks.new do |gemspec|
16
- gemspec.name = "dnif"
17
- gemspec.version = Dnif::Version::STRING
18
- gemspec.summary = "dnif is the new find... for sphinx"
19
- gemspec.description = "dnif is a gem to index data using ActiveRecord finders, letting you index your custom methods and not only your table fields"
20
- gemspec.email = "me@rafaelss.com"
21
- gemspec.homepage = "http://github.com/rafaelss/dnif"
22
- gemspec.authors = ["Rafael Souza"]
23
- gemspec.has_rdoc = false
24
- gemspec.files.include %w(.gitignore .rspec templates/config.erb)
25
- end
26
-
27
- Jeweler::GemcutterTasks.new
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
28
3
 
29
4
  require "rspec/core/rake_task"
30
5
  RSpec::Core::RakeTask.new(:spec)
@@ -1,79 +1,21 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "dnif/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{dnif}
8
- s.version = "0.1.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Rafael Souza"]
12
- s.date = %q{2010-10-21}
6
+ s.name = "dnif"
7
+ s.version = Dnif::Version::STRING
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Rafael Souza"]
10
+ s.email = ["me@rafaelss.com"]
11
+ s.homepage = "http://rubygems.org/gems/dnif"
12
+ s.summary = %q{dnif is the new find... for sphinx}
13
13
  s.description = %q{dnif is a gem to index data using ActiveRecord finders, letting you index your custom methods and not only your table fields}
14
- s.email = %q{me@rafaelss.com}
15
- s.extra_rdoc_files = [
16
- "README.rdoc"
17
- ]
18
- s.files = [
19
- ".gitignore",
20
- ".rspec",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "README.rdoc",
24
- "Rakefile",
25
- "dnif.gemspec",
26
- "lib/dnif.rb",
27
- "lib/dnif/configuration.rb",
28
- "lib/dnif/document.rb",
29
- "lib/dnif/index.rb",
30
- "lib/dnif/indexer.rb",
31
- "lib/dnif/multi_attribute.rb",
32
- "lib/dnif/railtie.rb",
33
- "lib/dnif/schema.rb",
34
- "lib/dnif/search.rb",
35
- "lib/dnif/tasks.rb",
36
- "lib/dnif/version.rb",
37
- "spec/dnif/configuration_spec.rb",
38
- "spec/dnif/dnif_spec.rb",
39
- "spec/dnif/document_spec.rb",
40
- "spec/dnif/index_spec.rb",
41
- "spec/dnif/indexer_spec.rb",
42
- "spec/dnif/multi_attribute_spec.rb",
43
- "spec/dnif/schema_spec.rb",
44
- "spec/dnif/search_spec.rb",
45
- "spec/fixtures/db/schema.rb",
46
- "spec/fixtures/log/searchd.pid",
47
- "spec/fixtures/models.rb",
48
- "spec/fixtures/sphinx_1.xml",
49
- "spec/fixtures/sphinx_2.xml",
50
- "spec/fixtures/sphinx_3.xml",
51
- "spec/fixtures/sphinx_4.xml",
52
- "spec/fixtures/sphinx_5.xml",
53
- "spec/fixtures/templates/config.erb",
54
- "spec/spec_helper.rb",
55
- "spec/support/activerecord/models.rb",
56
- "templates/config.erb"
57
- ]
58
- s.has_rdoc = false
59
- s.homepage = %q{http://github.com/rafaelss/dnif}
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
60
18
  s.require_paths = ["lib"]
61
- s.rubygems_version = %q{1.3.7}
62
- s.summary = %q{dnif is the new find... for sphinx}
63
- s.test_files = [
64
- "spec/dnif/configuration_spec.rb",
65
- "spec/dnif/dnif_spec.rb",
66
- "spec/dnif/document_spec.rb",
67
- "spec/dnif/index_spec.rb",
68
- "spec/dnif/indexer_spec.rb",
69
- "spec/dnif/multi_attribute_spec.rb",
70
- "spec/dnif/schema_spec.rb",
71
- "spec/dnif/search_spec.rb",
72
- "spec/fixtures/db/schema.rb",
73
- "spec/fixtures/models.rb",
74
- "spec/spec_helper.rb",
75
- "spec/support/activerecord/models.rb"
76
- ]
77
19
 
78
20
  if s.respond_to? :specification_version then
79
21
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -81,8 +23,8 @@ Gem::Specification.new do |s|
81
23
 
82
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
83
25
  s.add_runtime_dependency(%q<rake>, [">= 0"])
84
- s.add_runtime_dependency(%q<activerecord>, [">= 3.0.0"])
85
- s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
26
+ s.add_runtime_dependency(%q<activerecord>, [">= 3.0.3"])
27
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.3"])
86
28
  s.add_runtime_dependency(%q<riddle>, [">= 1.1.0"])
87
29
  s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
88
30
  s.add_development_dependency(%q<jeweler>, [">= 1.5.0.pre2"])
@@ -91,8 +33,8 @@ Gem::Specification.new do |s|
91
33
  s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
92
34
  else
93
35
  s.add_dependency(%q<rake>, [">= 0"])
94
- s.add_dependency(%q<activerecord>, [">= 3.0.0"])
95
- s.add_dependency(%q<activesupport>, [">= 3.0.0"])
36
+ s.add_dependency(%q<activerecord>, [">= 3.0.3"])
37
+ s.add_dependency(%q<activesupport>, [">= 3.0.3"])
96
38
  s.add_dependency(%q<riddle>, [">= 1.1.0"])
97
39
  s.add_dependency(%q<builder>, [">= 2.1.2"])
98
40
  s.add_dependency(%q<jeweler>, [">= 1.5.0.pre2"])
@@ -102,8 +44,8 @@ Gem::Specification.new do |s|
102
44
  end
103
45
  else
104
46
  s.add_dependency(%q<rake>, [">= 0"])
105
- s.add_dependency(%q<activerecord>, [">= 3.0.0"])
106
- s.add_dependency(%q<activesupport>, [">= 3.0.0"])
47
+ s.add_dependency(%q<activerecord>, [">= 3.0.3"])
48
+ s.add_dependency(%q<activesupport>, [">= 3.0.3"])
107
49
  s.add_dependency(%q<riddle>, [">= 1.1.0"])
108
50
  s.add_dependency(%q<builder>, [">= 2.1.2"])
109
51
  s.add_dependency(%q<jeweler>, [">= 1.5.0.pre2"])
@@ -112,4 +54,3 @@ Gem::Specification.new do |s|
112
54
  s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
113
55
  end
114
56
  end
115
-
@@ -1,7 +1,4 @@
1
1
  # encoding: utf-8
2
- require "bundler"
3
- Bundler.setup(:default)
4
-
5
2
  require "riddle"
6
3
 
7
4
  module Dnif
@@ -98,6 +95,10 @@ module Dnif
98
95
  end
99
96
  end
100
97
 
98
+ if defined?(Rails)
99
+ require "dnif/railtie"
100
+ end
101
+
101
102
  if defined?(ActiveRecord::Base)
102
103
  ActiveRecord::Base.extend(Dnif::Indexer)
103
104
  ActiveRecord::Base.extend(Dnif::Search)
@@ -1,3 +1,5 @@
1
+ require "builder"
2
+
1
3
  module Dnif
2
4
  module Indexer
3
5
 
@@ -2,8 +2,8 @@ module Dnif
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
6
- BUILD = nil # "beta.6"
5
+ PATCH = 1
6
+ BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
- require "bundler"
3
- Bundler.require(:default, :development)
2
+ require "bundler/setup"
3
+ require "active_record"
4
+ require "rspec"
5
+ require "database_cleaner"
4
6
 
5
7
  $:.unshift(File.dirname(__FILE__) + '/../lib')
6
8
  require "dnif"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Rafael Souza
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-21 00:00:00 -02:00
17
+ date: 2010-11-24 00:00:00 -02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -40,8 +40,8 @@ dependencies:
40
40
  segments:
41
41
  - 3
42
42
  - 0
43
- - 0
44
- version: 3.0.0
43
+ - 3
44
+ version: 3.0.3
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: *id002
@@ -55,8 +55,8 @@ dependencies:
55
55
  segments:
56
56
  - 3
57
57
  - 0
58
- - 0
59
- version: 3.0.0
58
+ - 3
59
+ version: 3.0.3
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: *id003
@@ -150,13 +150,14 @@ dependencies:
150
150
  prerelease: false
151
151
  version_requirements: *id009
152
152
  description: dnif is a gem to index data using ActiveRecord finders, letting you index your custom methods and not only your table fields
153
- email: me@rafaelss.com
153
+ email:
154
+ - me@rafaelss.com
154
155
  executables: []
155
156
 
156
157
  extensions: []
157
158
 
158
- extra_rdoc_files:
159
- - README.rdoc
159
+ extra_rdoc_files: []
160
+
160
161
  files:
161
162
  - .gitignore
162
163
  - .rspec
@@ -196,8 +197,8 @@ files:
196
197
  - spec/spec_helper.rb
197
198
  - spec/support/activerecord/models.rb
198
199
  - templates/config.erb
199
- has_rdoc: false
200
- homepage: http://github.com/rafaelss/dnif
200
+ has_rdoc: true
201
+ homepage: http://rubygems.org/gems/dnif
201
202
  licenses: []
202
203
 
203
204
  post_install_message:
@@ -210,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
211
  requirements:
211
212
  - - ">="
212
213
  - !ruby/object:Gem::Version
213
- hash: -121134360209263234
214
+ hash: -3974449168105955734
214
215
  segments:
215
216
  - 0
216
217
  version: "0"
@@ -219,6 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  requirements:
220
221
  - - ">="
221
222
  - !ruby/object:Gem::Version
223
+ hash: -3974449168105955734
222
224
  segments:
223
225
  - 0
224
226
  version: "0"
@@ -239,6 +241,13 @@ test_files:
239
241
  - spec/dnif/schema_spec.rb
240
242
  - spec/dnif/search_spec.rb
241
243
  - spec/fixtures/db/schema.rb
244
+ - spec/fixtures/log/searchd.pid
242
245
  - spec/fixtures/models.rb
246
+ - spec/fixtures/sphinx_1.xml
247
+ - spec/fixtures/sphinx_2.xml
248
+ - spec/fixtures/sphinx_3.xml
249
+ - spec/fixtures/sphinx_4.xml
250
+ - spec/fixtures/sphinx_5.xml
251
+ - spec/fixtures/templates/config.erb
243
252
  - spec/spec_helper.rb
244
253
  - spec/support/activerecord/models.rb