lit_ipsum 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lit_ipsum/austen/sense_and_sensibility.rb +19 -0
- data/lib/lit_ipsum/poe/usher.rb +19 -0
- data/lib/lit_ipsum/version.rb +1 -1
- data/lib/lit_ipsum.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c1347bddbd8d6422ae670de0da6d39118d539a01ae59d9a5c8d8c0421e2c9cd
|
4
|
+
data.tar.gz: 718510d78994ca3e138dd6acd7e94d89517bfb383ab39b0484986821d3545d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25bc663e7a9a45f3f4ca8c50c4a675c98524ceeab3eede585e94efd616cb94f15b08dc59a18198b4a01273a457ddf7a92a9aad502352bf65034c976ba8418940
|
7
|
+
data.tar.gz: 03f169d41ac38b760903637d5fc6c37086b21c3535adf2bedaa4639ae6f92fb78fc52cbcf917d74038044e726ae7c41d6640d6c00406a62668237d4ca836d6cb
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LitIpsum
|
4
|
+
class Austen
|
5
|
+
class SenseAndSensibility < Base
|
6
|
+
FILENAME = 'texts/austen/sense-and-sensibility.txt'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def sentences(count, max_sentence = 0, filename = FILENAME)
|
10
|
+
super(count, max_sentence, filename)
|
11
|
+
end
|
12
|
+
|
13
|
+
def words(count, filename = FILENAME)
|
14
|
+
super(count, filename)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LitIpsum
|
4
|
+
class Poe
|
5
|
+
class Usher < Base
|
6
|
+
FILENAME = 'texts/poe/the-fall-of-house-usher.txt'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def sentences(count, max_sentence = 0, filename = FILENAME)
|
10
|
+
super(count, max_sentence, filename)
|
11
|
+
end
|
12
|
+
|
13
|
+
def words(count, filename = FILENAME)
|
14
|
+
super(count, filename)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/lit_ipsum/version.rb
CHANGED
data/lib/lit_ipsum.rb
CHANGED
@@ -22,6 +22,8 @@ module LitIpsum
|
|
22
22
|
|
23
23
|
def sentences(count, max_sentence, filename)
|
24
24
|
source = max_sentence.zero? ? get_text(filename) : get_text(filename).select { |sentence| sentence.length <= max_sentence }
|
25
|
+
raise Error, "Unable to find sentences of length <= #{max_sentence}." if source.empty?
|
26
|
+
|
25
27
|
obj = []
|
26
28
|
count.times do
|
27
29
|
sentence = source.sample
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lit_ipsum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jac Bergenson
|
@@ -64,7 +64,9 @@ files:
|
|
64
64
|
- README.md
|
65
65
|
- lib/lit_ipsum.rb
|
66
66
|
- lib/lit_ipsum/austen/pride_and_prejudice.rb
|
67
|
+
- lib/lit_ipsum/austen/sense_and_sensibility.rb
|
67
68
|
- lib/lit_ipsum/doyle/sherlock_holmes.rb
|
69
|
+
- lib/lit_ipsum/poe/usher.rb
|
68
70
|
- lib/lit_ipsum/version.rb
|
69
71
|
homepage: https://github.com/bergbergs/lit_ipsum
|
70
72
|
licenses:
|