dharma_quotes 1.0.1
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 +7 -0
- data/LICENCE.md +21 -0
- data/README.md +28 -0
- data/lib/dharma_quotes.rb +40 -0
- data/lib/quote_libraries/dhammapada.rb +67 -0
- data/lib/quote_libraries/four_noble_truths.rb +15 -0
- data/lib/quote_libraries/noble_eightfold_path.rb +19 -0
- data/lib/quote_libraries/other_texts.rb +72 -0
- metadata +66 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: c5f84566f17cee4f83cd471e68d4908c3a0cdad4
|
|
4
|
+
data.tar.gz: ce460cd05b8608698f2577cbfc2e48582ef75ada
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 275204ca1af89ffdff353e02207a6839c9f5d97029f5bd8a31919e96bdcf43e67aa917eb617762a3da611b094ce2e7745fc660db9734566d98629ca69a85284e
|
|
7
|
+
data.tar.gz: f3b88eb3384a39945fec70eea7fb913ed72f8e253bf3d16f98db28d0ce9ac42903989838c0004f4f609f1ad2d4b5a189f2de18d60f5c06a04e7638ac550566b3
|
data/LICENCE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Evie Skinner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Dharma Quotes 1.0.0
|
|
2
|
+
|
|
3
|
+
## Well namaste, it's the Ruby library of Dharma quotes!
|
|
4
|
+
|
|
5
|
+
## How to Install
|
|
6
|
+
In your command line, run the following command:
|
|
7
|
+
```bash
|
|
8
|
+
gem install dharma_quotes
|
|
9
|
+
```
|
|
10
|
+
## Usage
|
|
11
|
+
You can start using dharma_quotes with just a few lines of Ruby. In your Ruby file, type the following:
|
|
12
|
+
```ruby
|
|
13
|
+
require 'dharma_quotes'
|
|
14
|
+
|
|
15
|
+
dharma_quotes = DharmaQuotes.new
|
|
16
|
+
random_quote = dharma_quotes.get_quote
|
|
17
|
+
puts random_quote
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
You can be more specific too if you like! Ask for a quote from the Dhammapada; a quote from a miscellaneous source; one of the Four Noble Truths; or one of the tenets of the Noble Eightfold Path.
|
|
21
|
+
```ruby
|
|
22
|
+
dhammapada_quote = dharma_quotes.get_dhammapada_quote
|
|
23
|
+
misc_quote = dharma_quotes.get_quote_from_other_texts
|
|
24
|
+
noble_truth = dharma_quotes.get_noble_truth
|
|
25
|
+
part_of_noble_eightfold_path = dharma_quotes.get_part_of_eightfold_path
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Enjoy life!
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require_relative './quote_libraries/dhammapada.rb'
|
|
2
|
+
require_relative './quote_libraries/other_texts.rb'
|
|
3
|
+
require_relative './quote_libraries/four_noble_truths.rb'
|
|
4
|
+
require_relative './quote_libraries/noble_eightfold_path.rb'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DharmaQuotes
|
|
8
|
+
def initialize
|
|
9
|
+
@dhammapada_quotes = Dhammapada.new.quotes
|
|
10
|
+
@other_texts_quotes = OtherTexts.new.quotes
|
|
11
|
+
@four_noble_truths = FourNobleTruths.new.quotes
|
|
12
|
+
@parts_of_eightfold_path = NobleEightfoldPath.new.quotes
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# pick a random quote
|
|
16
|
+
def get_quote
|
|
17
|
+
dhammapada_and_other_texts_quotes = @dhammapada_quotes.concat(@other_texts_quotes)
|
|
18
|
+
dhammapada_and_other_texts_quotes.sample
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# pick a random dhammapada quote
|
|
22
|
+
def get_dhammapada_quote
|
|
23
|
+
@dhammapada_quotes.sample
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# pick a random quote from other texts
|
|
27
|
+
def get_quote_from_other_texts
|
|
28
|
+
@other_texts_quotes.sample
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# pick one of the parts of the eightfold path
|
|
32
|
+
def get_part_of_eightfold_path
|
|
33
|
+
@parts_of_eightfold_path.sample
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# pick one of the four noble truths
|
|
37
|
+
def get_noble_truth
|
|
38
|
+
@four_noble_truths.sample
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
class Dhammapada
|
|
2
|
+
def initialize
|
|
3
|
+
@dhammapada_quotes =
|
|
4
|
+
[
|
|
5
|
+
'
|
|
6
|
+
Animosity does not eradicate animosity.
|
|
7
|
+
Only by loving kindness is animosity dissolved.
|
|
8
|
+
This law is ancient and eternal. - The Dhammapada',
|
|
9
|
+
'
|
|
10
|
+
Mind is the forerunner of all actions.
|
|
11
|
+
All deeds are led by mind, created by mind.
|
|
12
|
+
If one speaks or acts with corrupt mind, suffering follows,
|
|
13
|
+
As the wheel follows the hoof of an ox pulling a cart. - The Dhammapada',
|
|
14
|
+
'
|
|
15
|
+
Mind is the forerunner of all actions.
|
|
16
|
+
All deeds are led by mind, created by mind.
|
|
17
|
+
If one speaks or acts with a serene mind, happiness follows,
|
|
18
|
+
As surely as one\'s shadow. - The Dhammapada',
|
|
19
|
+
'
|
|
20
|
+
By oneself the evil is done, by oneself one suffers.
|
|
21
|
+
By oneself evil is left undone, by oneself one is purified.
|
|
22
|
+
The pure and the impure (stand and fall) by themselves: no one can purify another. - The Dhammapada
|
|
23
|
+
',
|
|
24
|
+
'
|
|
25
|
+
The wise one makes straight
|
|
26
|
+
The trembling, fickle mind
|
|
27
|
+
So hard to guard, so hard to control,
|
|
28
|
+
As the fletcher makes straight the arrow. - The Dhammapada
|
|
29
|
+
',
|
|
30
|
+
'
|
|
31
|
+
The mind is hard to restrain, light,
|
|
32
|
+
Flying where it will.
|
|
33
|
+
Control of it is good.
|
|
34
|
+
Mind controlled brings happiness. - The Dhammapada
|
|
35
|
+
',
|
|
36
|
+
'
|
|
37
|
+
Whatever an enemy can do to an enemy,
|
|
38
|
+
Or a rival to a rival,
|
|
39
|
+
A wrongly directed mind
|
|
40
|
+
Will do worse to you than that. - The Dhammapada
|
|
41
|
+
',
|
|
42
|
+
'
|
|
43
|
+
What mother or father can do,
|
|
44
|
+
Or any other kin,
|
|
45
|
+
A rightly directed mind
|
|
46
|
+
Will do better for you than that. - The Dhammapada
|
|
47
|
+
',
|
|
48
|
+
'
|
|
49
|
+
The Learner will conquer this earth,
|
|
50
|
+
And this world of Yama with its gods.
|
|
51
|
+
The Learner will pluck the well-taught word of Dhamma
|
|
52
|
+
As a skilled one plucks a flower. - The Dhammapada
|
|
53
|
+
',
|
|
54
|
+
'
|
|
55
|
+
Like a beautiful flower,
|
|
56
|
+
Colourful but scentless,
|
|
57
|
+
The well-taught word is fruitless
|
|
58
|
+
For one who does not practise. - The Dhammapada
|
|
59
|
+
'
|
|
60
|
+
]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# return the @dhammapada_quotes array stored in the instance var
|
|
64
|
+
def quotes
|
|
65
|
+
@dhammapada_quotes
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class FourNobleTruths
|
|
2
|
+
def initialize
|
|
3
|
+
@four_noble_truths =
|
|
4
|
+
[
|
|
5
|
+
'To live is to suffer.',
|
|
6
|
+
'There is a cause to our suffering, and that is desire.',
|
|
7
|
+
'We can end this suffering.',
|
|
8
|
+
'The way to end our suffering is by following the Noble Eightfold Path.'
|
|
9
|
+
]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def quotes
|
|
13
|
+
@four_noble_truths
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class NobleEightfoldPath
|
|
2
|
+
def initialize
|
|
3
|
+
@parts_of_eightfold_path =
|
|
4
|
+
[
|
|
5
|
+
'Samma Ditthi: right understanding',
|
|
6
|
+
'Samma Sankappa: right thought',
|
|
7
|
+
'Samma Vaca: right speech',
|
|
8
|
+
'Samma Kammanta: right action',
|
|
9
|
+
'Samma Ajiva: right livelihood',
|
|
10
|
+
'Samma Vayama: right effort',
|
|
11
|
+
'Samma Sati: right mindfulness',
|
|
12
|
+
'Samma Samadhi: right concentration'
|
|
13
|
+
]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def quotes
|
|
17
|
+
@parts_of_eightfold_path
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
class OtherTexts
|
|
2
|
+
def initialize
|
|
3
|
+
@quotes =
|
|
4
|
+
[
|
|
5
|
+
'
|
|
6
|
+
On whom the heart insinctively rests,
|
|
7
|
+
In whom the spirit finds delight,
|
|
8
|
+
With him, though one ne\'er seen before,
|
|
9
|
+
Safely in friendship one may dwell. - The Jataka
|
|
10
|
+
',
|
|
11
|
+
'
|
|
12
|
+
This is what should be done by one who is skilled in goodness,
|
|
13
|
+
And who knows the path of of peace: let them be able and upright,
|
|
14
|
+
Straightforward and gentle in speech,
|
|
15
|
+
Humble and not conceited,
|
|
16
|
+
Contented and easily satisfied,
|
|
17
|
+
Unburdened with duties and frugal in their ways. - Morning and Evening Puja and Reflections
|
|
18
|
+
',
|
|
19
|
+
'
|
|
20
|
+
Let none through anger or ill will wish harm upon another.
|
|
21
|
+
Even as a mother protects with her life her child, her only child,
|
|
22
|
+
So with a boundless heart
|
|
23
|
+
Should one cherish all living beings;
|
|
24
|
+
Radiating kindness over the entire world. - Morning and Evening Puja and Reflections
|
|
25
|
+
',
|
|
26
|
+
'
|
|
27
|
+
By not holding to fixed views,
|
|
28
|
+
The pure-hearted one, having clarity of vision,
|
|
29
|
+
Being freed from all sense-desires,
|
|
30
|
+
Is not born again in this world. - Morning and Evening Puja and Reflections
|
|
31
|
+
',
|
|
32
|
+
'
|
|
33
|
+
Do not accept any of my words on faith, believing them jsut because I said them.
|
|
34
|
+
Be like an analyst buying gold, who cuts, burns, and critically examines his product for authenticity.
|
|
35
|
+
Only accept what passes the test
|
|
36
|
+
By proving useful and beneficial in your life. - Gautama Buddha
|
|
37
|
+
',
|
|
38
|
+
'
|
|
39
|
+
Even if the teacher speaks the truth, don\'t just believe it, because you don\'t yet know the
|
|
40
|
+
truth of it yourself. - Luang Por Chah
|
|
41
|
+
',
|
|
42
|
+
'
|
|
43
|
+
Know all things to be like this:
|
|
44
|
+
A mirage, a cloud castle,
|
|
45
|
+
A dream, an apparition,
|
|
46
|
+
Without essence, but with qualities that can be seen. - Samadhi Raja Sutra
|
|
47
|
+
',
|
|
48
|
+
'
|
|
49
|
+
Know all things to be like this:
|
|
50
|
+
As the moon in a bright sky
|
|
51
|
+
In some clear lake reflected,
|
|
52
|
+
Though to that lake the moon has never moved. - Samadhi Raja Sutra
|
|
53
|
+
',
|
|
54
|
+
'
|
|
55
|
+
Know all things to be like this:
|
|
56
|
+
As an echo that derives
|
|
57
|
+
From music, sounds, and weeping,
|
|
58
|
+
Yet in that echo is no melody. - Samadhi Raja Sutra
|
|
59
|
+
',
|
|
60
|
+
'
|
|
61
|
+
Know all things to be like this:
|
|
62
|
+
As a magician makes illusions
|
|
63
|
+
Of horses, oxen, carts and other things
|
|
64
|
+
Nothing is as it appears. - Samadhi Raja Sutra
|
|
65
|
+
'
|
|
66
|
+
]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def quotes
|
|
70
|
+
@quotes
|
|
71
|
+
end
|
|
72
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: dharma_quotes
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Evie Skinner
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-03-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rspec
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '3.7'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '3.7'
|
|
27
|
+
description: |-
|
|
28
|
+
dharma_quotes is a cheerful library of quotes from Buddhist texts. It provides functionality
|
|
29
|
+
to run methods that return random quotes from the Dharma.
|
|
30
|
+
email: ohowkind@gmail.com
|
|
31
|
+
executables: []
|
|
32
|
+
extensions: []
|
|
33
|
+
extra_rdoc_files: []
|
|
34
|
+
files:
|
|
35
|
+
- LICENCE.md
|
|
36
|
+
- README.md
|
|
37
|
+
- lib/dharma_quotes.rb
|
|
38
|
+
- lib/quote_libraries/dhammapada.rb
|
|
39
|
+
- lib/quote_libraries/four_noble_truths.rb
|
|
40
|
+
- lib/quote_libraries/noble_eightfold_path.rb
|
|
41
|
+
- lib/quote_libraries/other_texts.rb
|
|
42
|
+
homepage: https://github.com/Evie-Skinner18/dharma_quotes
|
|
43
|
+
licenses:
|
|
44
|
+
- MIT
|
|
45
|
+
metadata: {}
|
|
46
|
+
post_install_message:
|
|
47
|
+
rdoc_options: []
|
|
48
|
+
require_paths:
|
|
49
|
+
- lib
|
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '2.3'
|
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
requirements: []
|
|
61
|
+
rubyforge_project:
|
|
62
|
+
rubygems_version: 2.5.2.3
|
|
63
|
+
signing_key:
|
|
64
|
+
specification_version: 4
|
|
65
|
+
summary: Generate random quotes from Buddhist texts
|
|
66
|
+
test_files: []
|