aphorism 0.1.3 → 0.1.4

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: be338dbec9cddef9413072277ca2314c873286cc2d0b23d3f86ffdee95f4fca9
4
- data.tar.gz: 3ba58eacc2f978d4d20532f9dcc573cd28b515c19446665b8e6ed5fb559fb654
3
+ metadata.gz: e2c5b67b09c4a58e0b6a96264c953c58e9115d9dca462151e47a6a208f96f1fe
4
+ data.tar.gz: 86c37fb6b242d97e0db01d3af0dbd21b46e52c209eb33606706a873eafb28f83
5
5
  SHA512:
6
- metadata.gz: fb223534e6840eace1bd362e8ce28b04771aedeffa397fe26f6375f41a4ff0b8272ba27ea2a48acbb2a8b7b320f9276d56f89c31d05378514df51089c46fa158
7
- data.tar.gz: b4069f687aaead2f2cf2d47ed19d42e75200cf680feacd5260d2482dc5f448a8671257ec179c56c72be1ea00a0ea4a4bac84d078f0bd069c892fd9de5a9f341f
6
+ metadata.gz: 9ede685158caad67cccd720aa89348a32c28803f007388fe18e4d36c8c1be0d24076f8de68df58efaacdef63706fcbf1592a75dbd10375f470a2f5da46a0f986
7
+ data.tar.gz: 88a3bd68305d98bb5b305a6e913ee30cbe8071df3bbd5774a9a7092ca732de23e826a58d58f15fc2d2801cf7b3f011833e50cd0c994f32fc23cb74edd3eb500c
@@ -9,11 +9,11 @@ module Aphorism
9
9
  class Orator
10
10
  def say
11
11
  aphorisms = internal_aphorisms + custom_aphorisms
12
- puts (aphorisms).sample
12
+ puts aphorisms.sample
13
13
  end
14
14
 
15
15
  private
16
-
16
+
17
17
  def internal_aphorisms
18
18
  aphorisms_path = File.join(__dir__, 'content/aphorisms.txt')
19
19
  IO.read(aphorisms_path).split("\n%\n")
@@ -21,9 +21,11 @@ module Aphorism
21
21
 
22
22
  def custom_aphorisms
23
23
  custom_path = File.join(Dir.home, '.aphorism')
24
- custom_files = Dir.children(custom_path)
24
+ custom_files = Dir.entries(custom_path) - ['.', '..']
25
25
  custom_aphorisms = []
26
- custom_files.each { |file| custom_aphorisms += IO.read(File.join(custom_path, file)).split("\n%\n") }
26
+ custom_files.each do |file|
27
+ custom_aphorisms += IO.read(File.join(custom_path, file)).split("\n%\n")
28
+ end
27
29
  custom_aphorisms
28
30
  end
29
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aphorism
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aphorism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kate Donaldson