scriptures 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -28,10 +28,19 @@ Needs sqlite engine installed. My preference on OSX is to install through homebr
28
28
 
29
29
  $ brew install sqlite
30
30
 
31
- ## Usage
31
+ ## Usage Examples
32
32
 
33
33
  require 'scriptures'
34
+
34
35
  puts Scriptures::Verse.all(:scripture.like => "%faith%").first.scripture
36
+
37
+ puts Scripures.search("faith").count
38
+
39
+ ## TODO
40
+
41
+ * Make search improvements.
42
+ * Improve Readme and describe API
43
+
35
44
 
36
45
  ## Contributing
37
46
 
data/lib/scriptures.rb CHANGED
@@ -8,6 +8,8 @@ require "scriptures/models/book"
8
8
  require "scriptures/models/chapter"
9
9
  require "scriptures/models/verse"
10
10
 
11
+ require "scriptures/search"
12
+
11
13
  module Scriptures
12
14
 
13
15
  end
@@ -28,6 +28,5 @@ module Scriptures
28
28
  before :update do |i|
29
29
  throw :halt
30
30
  end
31
-
32
31
  end
33
32
  end
@@ -0,0 +1,5 @@
1
+ module Scriptures
2
+ def self.search(query)
3
+ Scriptures::Verse.all(:scripture.like => "%#{query}%")
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Scriptures
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
File without changes
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Scriptures do
4
+ it "returns scriptures on search" do
5
+ verse = Scriptures.search("faith").first.scripture
6
+ verse.should == "My servant Moses is not so, who is faithful in all mine house."
7
+
8
+ count = Scriptures.search("faith").count
9
+ count.should eql(820)
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scriptures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,11 +60,13 @@ files:
60
60
  - lib/scriptures/models/chapter.rb
61
61
  - lib/scriptures/models/verse.rb
62
62
  - lib/scriptures/models/volume.rb
63
+ - lib/scriptures/search.rb
63
64
  - lib/scriptures/setup.rb
64
65
  - lib/scriptures/version.rb
65
66
  - scriptures.db
66
67
  - scriptures.gemspec
67
- - spec/database_spec.rb
68
+ - spec/models_spec.rb
69
+ - spec/search_spec.rb
68
70
  - spec/spec_helper.rb
69
71
  homepage: http://github.com/lukeholder/scriptures
70
72
  licenses:
@@ -93,6 +95,7 @@ signing_key:
93
95
  specification_version: 3
94
96
  summary: The Scriptures
95
97
  test_files:
96
- - spec/database_spec.rb
98
+ - spec/models_spec.rb
99
+ - spec/search_spec.rb
97
100
  - spec/spec_helper.rb
98
101
  has_rdoc: