wcc-pericope 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4fc5e33172604c960f86b73289ae09770adda27ed8ac499067e2d00f5d7f751d
4
+ data.tar.gz: c8172b4ecc085b9fff250403e5d9131857fd3ec7f8f16ba66bf6f2c9b809b65b
5
+ SHA512:
6
+ metadata.gz: 94eb6db5566ed2dacb1b8a7c5289c386c0b74637ca776a0f11c4d58d5d79c41e9e56b6c98dac545c5220a547189fd068d6a9ae7a6f3512e98ffa5e2ad1002e3b
7
+ data.tar.gz: b3f160201aea79317e60e23f62fd0f302d92ebda37ff81b468ec6a9c48361865f8c54c3dcc2ca5a91d91d5c41c3f781051e501ea401e33163eee6211db65582e
data/README.mdown ADDED
@@ -0,0 +1,70 @@
1
+ # Pericope
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/pericope.svg)](https://rubygems.org/gems/pericope)
4
+ [![Code Climate](https://codeclimate.com/github/boblail/pericope.svg)](https://codeclimate.com/github/boblail/pericope)
5
+ [![Build Status](https://travis-ci.org/boblail/pericope.svg)](https://travis-ci.org/boblail/pericope)
6
+
7
+ Pericope is a gem for parsing Bible references.
8
+
9
+ It recognizes common abbreviations and misspellings for names of the books of the Bible and a variety of ways of denoting ranges of chapters and verses. It can parse pericopes singly or out of a block of text. It's useful for comparing two pericopes for intersection and normalizing them into a well-formatted string.
10
+
11
+ ## Examples
12
+
13
+ ##### Recognize common abbreviations and misspellings for names of the books of the Bible
14
+
15
+ ```ruby
16
+ Pericope.new("ps 118:17").to_s # => Psalm 118:17
17
+ Pericope.new("jas 3:1-5").to_s # => James 3:1-5
18
+ Pericope.new("1 jn 4:4").to_s # => 1 John 4:4
19
+ ```
20
+
21
+ ##### Compare two pericopes to see if they intersect
22
+
23
+ ```ruby
24
+ a = Pericope.new("Mark 13:1-6")
25
+ b = Pericope.new("Mark 13:5")
26
+ c = Pericope.new("Mark 13:6, 7")
27
+
28
+ a.intersects?(b) # => true
29
+ a.intersects?(c) # => true
30
+ b.intersects?(c) # => false
31
+ ```
32
+
33
+ ##### Parse pericopes out of a block of text
34
+
35
+ ```ruby
36
+ text = <<-TEXT
37
+ If then, the Word is so significant, great important attaches to its exact form. It has the form of a promise as in Isaiah 43:1: "Do not fear, for I have redeemed you; I have called you by name, you are mine," or as in Luke 2:10-11, "Do not be afraid..to you is born this day...a Savior." (Bayer, p51)
38
+ TEXT
39
+
40
+ Pericope.parse(text) # => [Isaiah 43:1, Luke 2:10-11]
41
+
42
+ Pericope.split(text) # => [" If then, the Word is so significant, great important attaches to its exact form. It has the form of a promise as in ", Isaiah 43:1, ": \"Do not fear, for I have redeemed you; I have called you by name, you are mine,\" or as in ", Luke 2:10-11, ", \"Do not be afraid..to you is born this day...a Savior.\" (Bayer, p51)\n"]
43
+ ```
44
+
45
+ ##### Converts pericopes into arrays of verses and reconstructs them from arrays of verses
46
+
47
+ ```ruby
48
+ array = Pericope.new("gen 1:1-3").to_a # => [1001001, 1001002, 1001003]
49
+ Pericope.new(array) # => Genesis 1:1-3
50
+ ```
51
+
52
+
53
+ ## History
54
+
55
+ ##### 0.6.1
56
+
57
+ - Deprecated the `report` and `extract` methods (they will be removed in 0.7.0)
58
+
59
+ ##### 0.6.0
60
+
61
+ - Removed the `index` attribute
62
+ - Deprecated the `pattern` argument to the method `Pericope.split(text, pattern=nil)` (it will be removed in 0.7.0)
63
+ - Improved performance by 2x
64
+ - Added this README
65
+ - Fixed a bug with parsing inverted [invalid] ranges (e.g. Mark 3-1)
66
+
67
+
68
+ ## License
69
+
70
+ Copyright (c) 2012 Bob Lail, released under the MIT license
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pericope"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/pericope ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.expand_path("../../lib", __FILE__)
4
+ require "pericope/cli"
5
+
6
+ command = ARGV.shift
7
+ arguments = ARGV
8
+
9
+ Pericope::CLI.run(command, *arguments)