say-anything 1.0.1 → 1.2.0
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 +4 -4
- data/.gitignore +0 -0
- data/.travis.yml +4 -0
- data/LICENSE +21 -0
- data/README.md +73 -0
- data/bin/say-anything +57 -0
- data/say-anything.gemspec +13 -0
- data/spec/say-anything_spec.rb +33 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9aeb8b60f0f5ec56b2e9bc0d81cca7840165893e
|
|
4
|
+
data.tar.gz: 97a390757780d2c4a566462504253bceeeb25618
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27537247e5e2c5e4428af6c8476d7b6ca3e54da39502aeb2f33e94c1bfae7bac2f0b0c39ca3d6cca2f24e1e82d7d1dfeb29ce080455ba98d0d609e7011533682
|
|
7
|
+
data.tar.gz: 267f84cbd4da19f10a76a050b00223ed9cca114f103d08eaf1f714f8c846775fda9502908910d8b566b9649381fd1c2a392b24a35b1effc118a4f78c1f6ccb6f
|
data/.gitignore
ADDED
|
File without changes
|
data/.travis.yml
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Axel Rozo--Brézillac
|
|
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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Say-Anything [](https://travis-ci.org/rozaxe/say-anything)
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
> Get random words.
|
|
5
|
+
|
|
6
|
+
The list contains 109 582 english words.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Install
|
|
10
|
+
-------
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ gem install say-anything
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Usage
|
|
18
|
+
-----
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
require 'say-anything'
|
|
22
|
+
|
|
23
|
+
SayAnything.one
|
|
24
|
+
# => rainbow
|
|
25
|
+
|
|
26
|
+
SayAnything.one
|
|
27
|
+
# => cat
|
|
28
|
+
|
|
29
|
+
SayAnything.times 3
|
|
30
|
+
# => [ "sugar", "chocolate", "spicy" ]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
API
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### .one
|
|
38
|
+
|
|
39
|
+
Return : `String`
|
|
40
|
+
|
|
41
|
+
Random word.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### .times(number)
|
|
45
|
+
|
|
46
|
+
Return : `Array`
|
|
47
|
+
|
|
48
|
+
Times random words.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### .words
|
|
52
|
+
|
|
53
|
+
Return : `Array`
|
|
54
|
+
|
|
55
|
+
All words.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
CLI
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
$ say-anything --help
|
|
63
|
+
Usage: say-anything [OPTION]
|
|
64
|
+
|
|
65
|
+
-t, --times [NUMBER]
|
|
66
|
+
return times random words
|
|
67
|
+
|
|
68
|
+
-a, --all
|
|
69
|
+
return all words
|
|
70
|
+
|
|
71
|
+
-h, --help
|
|
72
|
+
display this help
|
|
73
|
+
```
|
data/bin/say-anything
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'say-anything'
|
|
4
|
+
|
|
5
|
+
def helper
|
|
6
|
+
|
|
7
|
+
puts %q(
|
|
8
|
+
Usage: say-anything [OPTION]
|
|
9
|
+
|
|
10
|
+
-t, --times [NUMBER]
|
|
11
|
+
return times random words
|
|
12
|
+
|
|
13
|
+
-a, --all
|
|
14
|
+
return all words
|
|
15
|
+
|
|
16
|
+
-h, --help
|
|
17
|
+
display this help
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
if ARGV.size > 0
|
|
23
|
+
|
|
24
|
+
# Help
|
|
25
|
+
if ARGV.include? "-h" or ARGV.include? "--help"
|
|
26
|
+
helper
|
|
27
|
+
|
|
28
|
+
# Times
|
|
29
|
+
elsif ARGV.include? "-t" or ARGV.include? "--times"
|
|
30
|
+
i = ARGV.index do |x| ["-t", "--times"].include?(x) end
|
|
31
|
+
|
|
32
|
+
if ARGV[i.to_i + 1].to_i != 0
|
|
33
|
+
(SayAnything.times ARGV[i.to_i + 1].to_i).each do |x|
|
|
34
|
+
puts x
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
else
|
|
38
|
+
helper
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# All
|
|
43
|
+
elsif ARGV.include? "-a" or ARGV.include? "--all"
|
|
44
|
+
SayAnything.words.each do |x|
|
|
45
|
+
puts x
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Unknow
|
|
49
|
+
else
|
|
50
|
+
puts "Unknow option"
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
else
|
|
55
|
+
puts SayAnything.one
|
|
56
|
+
|
|
57
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.name = "say-anything"
|
|
3
|
+
s.version = "1.2.0"
|
|
4
|
+
s.summary = "Rainbow !"
|
|
5
|
+
s.description = "This literally say anything."
|
|
6
|
+
s.authors = ["Axel Rozo--Brézillac"]
|
|
7
|
+
s.email = "axel.rozobrezillac@gmail.com"
|
|
8
|
+
s.homepage = "https://github.com/rozaxe/say-anything"
|
|
9
|
+
s.license = "MIT"
|
|
10
|
+
|
|
11
|
+
s.files = `git ls-files`.split($\)
|
|
12
|
+
s.executables = ["say-anything"]
|
|
13
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "./lib/say-anything"
|
|
3
|
+
|
|
4
|
+
describe SayAnything do
|
|
5
|
+
|
|
6
|
+
it "must have a words list" do
|
|
7
|
+
r = SayAnything.words
|
|
8
|
+
|
|
9
|
+
r.must_be_instance_of Array
|
|
10
|
+
r.size.must_be :>, 0
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "must return a random word" do
|
|
14
|
+
r = SayAnything.one
|
|
15
|
+
|
|
16
|
+
r.must_be_instance_of String
|
|
17
|
+
r.wont_be_empty
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "must return an array of random words" do
|
|
21
|
+
r = SayAnything.times 3
|
|
22
|
+
|
|
23
|
+
r.must_be_instance_of Array
|
|
24
|
+
r.size.must_equal 3
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "must have the list private" do
|
|
28
|
+
proc do
|
|
29
|
+
SayAnything.list
|
|
30
|
+
end.must_raise NoMethodError
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: say-anything
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Axel Rozo--Brézillac
|
|
@@ -12,12 +12,20 @@ date: 2015-06-23 00:00:00.000000000 Z
|
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: This literally say anything.
|
|
14
14
|
email: axel.rozobrezillac@gmail.com
|
|
15
|
-
executables:
|
|
15
|
+
executables:
|
|
16
|
+
- say-anything
|
|
16
17
|
extensions: []
|
|
17
18
|
extra_rdoc_files: []
|
|
18
19
|
files:
|
|
20
|
+
- ".gitignore"
|
|
21
|
+
- ".travis.yml"
|
|
22
|
+
- LICENSE
|
|
23
|
+
- README.md
|
|
24
|
+
- bin/say-anything
|
|
19
25
|
- lib/say-anything.rb
|
|
20
26
|
- lib/say-anything/words.yaml
|
|
27
|
+
- say-anything.gemspec
|
|
28
|
+
- spec/say-anything_spec.rb
|
|
21
29
|
homepage: https://github.com/rozaxe/say-anything
|
|
22
30
|
licenses:
|
|
23
31
|
- MIT
|