fish 0.0.2 → 0.0.3
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 +17 -17
- data/Fish.gemspec +23 -23
- data/Gemfile +8 -8
- data/LICENSE.txt +19 -19
- data/README.md +38 -32
- data/Rakefile +1 -1
- data/lib/Fish.rb +33 -33
- data/lib/Fish/version.rb +1 -1
- data/test/fish_spec.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2f95fbb760741d5bb904db91f62463f91402aca
|
4
|
+
data.tar.gz: ef0ab8a52eda32f07d1abff3e3e5fea8ad69901b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8df0ed7067c5d6d37b94ee67b4abd588b541f512660224c95e591d38bd5bd51d1ae543c35fe12cd5b7422c10bf59ca536b59a15b6c8cd4d312b5421ceaf3427
|
7
|
+
data.tar.gz: 8b2077441abe62abe803a732a2260acff165685f5479040ac09327258079f4f75cde92e49902da0fda3ccfa02a342f0c725b3a9d690dda41d258dd8f5b862586
|
data/.gitignore
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
data/Fish.gemspec
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'Fish/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'fish'
|
8
|
-
spec.version = Fish::VERSION
|
9
|
-
spec.authors = %w(walru5)
|
10
|
-
spec.email = %w(whitepoizon@gmail.com)
|
11
|
-
spec.description = 'A gem for printing ascii fish'
|
12
|
-
spec.summary = '
|
13
|
-
spec.homepage = 'https://github.com/walru5/
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = %w(lib)
|
20
|
-
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
-
spec.add_development_dependency 'rake'
|
23
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'Fish/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'fish'
|
8
|
+
spec.version = Fish::VERSION
|
9
|
+
spec.authors = %w(walru5)
|
10
|
+
spec.email = %w(whitepoizon@gmail.com)
|
11
|
+
spec.description = 'A gem for printing ascii fish'
|
12
|
+
spec.summary = 'Did you ever want to have ASCII-fish in your application, but you are too lazy to make them yourself? This gem does the job for you.'
|
13
|
+
spec.homepage = 'https://github.com/walru5/fish'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = %w(lib)
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
end
|
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
group :development do
|
4
|
-
gem 'rspec'
|
5
|
-
gem 'rspec-core'
|
6
|
-
end
|
7
|
-
|
8
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rspec'
|
5
|
+
gem 'rspec-core'
|
6
|
+
end
|
7
|
+
|
8
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,32 +1,38 @@
|
|
1
|
-
# Fish
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
Fish.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
# Fish
|
2
|
+
|
3
|
+
Did you ever want to have ASCII-fish in your application, but you are too lazy to make them yourself?
|
4
|
+
This gem does the job for you.
|
5
|
+
|
6
|
+
Fish is inspired by the gem 'dicks'.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
gem 'fish'
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install fish
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Fish.fish # '><(((°>'
|
25
|
+
Fish.fish(5) # '><(((((°>'
|
26
|
+
Fish.fish(3, false) # '<°)))><'
|
27
|
+
Fish.many_fish(3, 3, false) # ['<°)))><', '<°)))><', '<°)))><']
|
28
|
+
Fish.random_fish # returns random fish
|
29
|
+
Fish.many_random_fish(3) # return an array of 3 random fish
|
30
|
+
Fish.is_fish?('<°)))><') # true
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
1. Fork it
|
35
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
37
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
38
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/Fish.rb
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
require 'Fish/version'
|
2
|
-
|
3
|
-
module Fish
|
4
|
-
def self.fish(len = 3, looks_right = true)
|
5
|
-
if looks_right
|
6
|
-
"><#{'(' * len}°>"
|
7
|
-
else
|
8
|
-
"<°#{')' * len}><"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.many_fish(num, len = 3, looks_right = true)
|
13
|
-
a = []
|
14
|
-
num.times {a << fish(len, looks_right)}
|
15
|
-
return a
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.is_fish?(str)
|
19
|
-
ret = false
|
20
|
-
ret = true if str.match(/><\(+°>/) != nil
|
21
|
-
ret = true if str.match(/<°\)+></) != nil
|
22
|
-
return ret
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.random_fish(max_len = 10)
|
26
|
-
fish(1 + rand(max_len), rand(2) == 1)
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.many_random_fish(num, max_len = 10)
|
30
|
-
a = []
|
31
|
-
num.times {a << random_fish(max_len)}
|
32
|
-
return a
|
33
|
-
end
|
1
|
+
require 'Fish/version'
|
2
|
+
|
3
|
+
module Fish
|
4
|
+
def self.fish(len = 3, looks_right = true)
|
5
|
+
if looks_right
|
6
|
+
"><#{'(' * len}°>"
|
7
|
+
else
|
8
|
+
"<°#{')' * len}><"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.many_fish(num, len = 3, looks_right = true)
|
13
|
+
a = []
|
14
|
+
num.times {a << fish(len, looks_right)}
|
15
|
+
return a
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.is_fish?(str)
|
19
|
+
ret = false
|
20
|
+
ret = true if str.match(/><\(+°>/) != nil
|
21
|
+
ret = true if str.match(/<°\)+></) != nil
|
22
|
+
return ret
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.random_fish(max_len = 10)
|
26
|
+
fish(1 + rand(max_len), rand(2) == 1)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.many_random_fish(num, max_len = 10)
|
30
|
+
a = []
|
31
|
+
num.times {a << random_fish(max_len)}
|
32
|
+
return a
|
33
|
+
end
|
34
34
|
end
|
data/lib/Fish/version.rb
CHANGED
data/test/fish_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- walru5
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- lib/Fish.rb
|
55
55
|
- lib/Fish/version.rb
|
56
56
|
- test/fish_spec.rb
|
57
|
-
homepage: https://github.com/walru5/
|
57
|
+
homepage: https://github.com/walru5/fish
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|
@@ -77,6 +77,7 @@ rubyforge_project:
|
|
77
77
|
rubygems_version: 2.0.2
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
|
-
summary:
|
80
|
+
summary: Did you ever want to have ASCII-fish in your application, but you are too
|
81
|
+
lazy to make them yourself? This gem does the job for you.
|
81
82
|
test_files:
|
82
83
|
- test/fish_spec.rb
|