yodaism 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +49 -5
- data/lib/yodaism/quote.rb +2 -2
- data/lib/yodaism/version.rb +1 -1
- data/yodaism.gemspec +1 -0
- metadata +6 -4
data/README.md
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
-
|
2
1
|
Yodaism
|
3
2
|
============
|
4
|
-
|
3
|
+
|
5
4
|
### Desc
|
6
5
|
|
7
6
|
Ever need a quick quote from Yoda? Maybe you just need him to give you some quick advice.
|
8
7
|
Yodaism is a collection of quotes and some ascii porn to get your Yoda fix.
|
9
8
|
|
9
|
+
### Requirements
|
10
|
+
|
11
|
+
Ruby >= 1.9.2
|
12
|
+
|
10
13
|
### Install
|
11
14
|
|
12
15
|
`gem install yodaism`
|
@@ -18,13 +21,54 @@ There is really only two modes right now for it.
|
|
18
21
|
|
19
22
|
To get just a plain quote just execute the gem with no options
|
20
23
|
|
21
|
-
|
24
|
+
```bash
|
25
|
+
[~/yoda]$ yodaism
|
26
|
+
..........
|
27
|
+
```
|
28
|
+
|
29
|
+
To get a picture of yoda in ascii format
|
22
30
|
|
23
|
-
|
31
|
+
```bash
|
32
|
+
[~/yoda]$ yodaism ascii
|
33
|
+
..........
|
34
|
+
```
|
24
35
|
|
25
|
-
|
36
|
+
|
37
|
+
![picture alt](http://i.imgur.com/5hBdY.png "Yodaism")
|
26
38
|
|
27
39
|
|
28
40
|
That's all there is, very simple.
|
29
41
|
|
30
42
|
|
43
|
+
### Use it in your script
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
require 'yodaism'
|
47
|
+
|
48
|
+
class YodaQuote
|
49
|
+
include Yodaism
|
50
|
+
|
51
|
+
attr_accessor :yoda_quote
|
52
|
+
|
53
|
+
def initialize
|
54
|
+
@yoda_quote = Yodaism.quote
|
55
|
+
end
|
56
|
+
|
57
|
+
def random
|
58
|
+
@yoda_quote.random
|
59
|
+
end
|
60
|
+
|
61
|
+
def ascii
|
62
|
+
@yoda_quote.ascii
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
example = YodaQuote.new
|
67
|
+
puts example.ascii
|
68
|
+
puts example.random
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
data/lib/yodaism/quote.rb
CHANGED
@@ -12,11 +12,11 @@ module Yodaism
|
|
12
12
|
def random
|
13
13
|
r = Random.new
|
14
14
|
c = r.rand(0..@quotes.size - 1)
|
15
|
-
|
15
|
+
@quotes[c].strip
|
16
16
|
end
|
17
17
|
|
18
18
|
def ascii
|
19
|
-
quote_with_yoda
|
19
|
+
quote_with_yoda(split_quote_text(random))
|
20
20
|
end
|
21
21
|
|
22
22
|
def quote_with_yoda(yoda_quote)
|
data/lib/yodaism/version.rb
CHANGED
data/yodaism.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
20
|
s.require_paths = ["lib"]
|
21
|
+
s.required_ruby_version = '>= 1.9.2'
|
21
22
|
|
22
23
|
s.executables = ["yodaism"]
|
23
24
|
s.default_executable = 'yodaism'
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- willywos
|
@@ -73,8 +73,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
segments:
|
76
|
-
-
|
77
|
-
|
76
|
+
- 1
|
77
|
+
- 9
|
78
|
+
- 2
|
79
|
+
version: 1.9.2
|
78
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
81
|
none: false
|
80
82
|
requirements:
|