aphorism 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/exe/aphorism +3 -2
- data/lib/aphorism/version.rb +3 -1
- data/lib/aphorism.rb +21 -3
- data/lib/content/aphorisms.txt +0 -4
- metadata +29 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be338dbec9cddef9413072277ca2314c873286cc2d0b23d3f86ffdee95f4fca9
|
4
|
+
data.tar.gz: 3ba58eacc2f978d4d20532f9dcc573cd28b515c19446665b8e6ed5fb559fb654
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb223534e6840eace1bd362e8ce28b04771aedeffa397fe26f6375f41a4ff0b8272ba27ea2a48acbb2a8b7b320f9276d56f89c31d05378514df51089c46fa158
|
7
|
+
data.tar.gz: b4069f687aaead2f2cf2d47ed19d42e75200cf680feacd5260d2482dc5f448a8671257ec179c56c72be1ea00a0ea4a4bac84d078f0bd069c892fd9de5a9f341f
|
data/README.md
CHANGED
@@ -34,13 +34,11 @@ For extra joy:
|
|
34
34
|
### Add more aphorisms
|
35
35
|
|
36
36
|
```
|
37
|
-
$
|
38
|
-
/
|
39
|
-
cd /path/to/lib/content
|
40
|
-
[text editor of choice open command] aphorisms.txt
|
37
|
+
mkdir $HOME/.aphorism
|
38
|
+
touch $HOME/.aphorism/my_category.txt
|
41
39
|
```
|
42
40
|
|
43
|
-
Add new content, separating each aphorism from the prior entry with a `%` symbol on a newline.
|
41
|
+
Add new content to any number of `.txt` files in your `$HOME/.aphorism` directory, separating each aphorism from the prior entry with a `%` symbol on a newline.
|
44
42
|
|
45
43
|
## Development
|
46
44
|
|
data/exe/aphorism
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
lib = File.expand_path(
|
4
|
+
lib = File.expand_path('../lib', __dir__)
|
4
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
6
|
|
6
7
|
require 'aphorism'
|
7
8
|
|
8
9
|
orator = Aphorism::Orator.new
|
9
|
-
orator.say
|
10
|
+
orator.say
|
data/lib/aphorism/version.rb
CHANGED
data/lib/aphorism.rb
CHANGED
@@ -1,12 +1,30 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'aphorism/version'
|
2
4
|
|
3
5
|
module Aphorism
|
4
6
|
class Error < StandardError; end
|
7
|
+
|
8
|
+
# displays aphorisms
|
5
9
|
class Orator
|
6
10
|
def say
|
11
|
+
aphorisms = internal_aphorisms + custom_aphorisms
|
12
|
+
puts (aphorisms).sample
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def internal_aphorisms
|
7
18
|
aphorisms_path = File.join(__dir__, 'content/aphorisms.txt')
|
8
|
-
|
9
|
-
|
19
|
+
IO.read(aphorisms_path).split("\n%\n")
|
20
|
+
end
|
21
|
+
|
22
|
+
def custom_aphorisms
|
23
|
+
custom_path = File.join(Dir.home, '.aphorism')
|
24
|
+
custom_files = Dir.children(custom_path)
|
25
|
+
custom_aphorisms = []
|
26
|
+
custom_files.each { |file| custom_aphorisms += IO.read(File.join(custom_path, file)).split("\n%\n") }
|
27
|
+
custom_aphorisms
|
10
28
|
end
|
11
29
|
end
|
12
30
|
end
|
data/lib/content/aphorisms.txt
CHANGED
@@ -82,10 +82,6 @@
|
|
82
82
|
%
|
83
83
|
"In order to be irreplaceable one must always be different." - Coco Chanel
|
84
84
|
%
|
85
|
-
"The question isn’t who is going to let me; it’s who is going to stop me." - Ayn Rand
|
86
|
-
%
|
87
|
-
"Spread love everywhere you go. Let no one ever come to you without leaving happier." - Mother Teresa
|
88
|
-
%
|
89
85
|
"Take criticism seriously, but not personally. If there is truth or merit in the criticism, try to learn from it. Otherwise, let it roll right off you." - Hillary Clinton
|
90
86
|
%
|
91
87
|
"When we speak we are afraid our words will not be heard or welcomed. But when we are silent, we are still afraid. So it is better to speak." - Audre Lorde
|
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kate Donaldson
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.71'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.71'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.16'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.16'
|
55
83
|
description:
|
56
84
|
email:
|
57
85
|
- kate@katelovescode.com
|