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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d91d66591b463b992c1e88502da6abe02779388b33c4e4ea3429084b1ccff40
4
- data.tar.gz: 109c5ed2640867cc047f1a81f250e9fc4e1c5a5fb17fb15db81ed977de2e93c6
3
+ metadata.gz: 8c1347bddbd8d6422ae670de0da6d39118d539a01ae59d9a5c8d8c0421e2c9cd
4
+ data.tar.gz: 718510d78994ca3e138dd6acd7e94d89517bfb383ab39b0484986821d3545d85
5
5
  SHA512:
6
- metadata.gz: 4c0c8fc68b428174bb365f4d1c74257f15ce4c8438f27ef7908fca1e283a4c5697df40bee686112b1de736fdfa61abe2790854acee48b1ffd86697db55c79bf6
7
- data.tar.gz: 5ecf16bab610554f34f4f23b33719b82fb4fca65557217be1ed48bcf2d4a892115a48f0aec0e82174e01a64ee3e605fb9e095a672417638d35a2b7dc445671fc
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LitIpsum
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.3'
5
5
  end
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.1
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: