catsay 0.0.2 → 0.1.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.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/catsay.rb +11 -6
  4. data.tar.gz.sig +0 -0
  5. metadata +30 -12
  6. metadata.gz.sig +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 474c13400af219856921605b1cc1d9afd699c75f
4
+ data.tar.gz: ab379ebecf1bdad6fe6f784e9479d330adaade02
5
+ SHA512:
6
+ metadata.gz: cb012f5b5852b4aed31e005d1190a1b8fa31c9728f9064b33bf587b04b590ebc7d2c3f5f08d6970fc82beff0e0fb131d162a1872a887e11b696a57c1afeeb3e3
7
+ data.tar.gz: 7fcd9f9dd3b30ab9337f70f7d70dd3c4ce4c81acec4236df79eb5bc4412a38eec96e93de3006214dc22785555b404748611749ae410ed8866084034429be1e7d
checksums.yaml.gz.sig ADDED
Binary file
data/lib/catsay.rb CHANGED
@@ -1,11 +1,9 @@
1
1
  require 'erb'
2
2
 
3
- # this is real ugly
4
- includes = %w{cat exceptions}
3
+ $:.unshift File.expand_path(File.dirname(__FILE__))
5
4
 
6
- includes.each do |inc|
7
- require File.expand_path(File.join(File.dirname(__FILE__), inc))
8
- end
5
+ require 'cat'
6
+ require 'exceptions'
9
7
 
10
8
  module Catsay
11
9
 
@@ -23,7 +21,9 @@ module Catsay
23
21
  p @options
24
22
  end
25
23
 
26
- cat = @options[:cat]
24
+ if @options[:cat] == :random
25
+ @options[:cat] = cats.sample
26
+ end
27
27
 
28
28
  output_handle.puts Cat.new(:template => template).meow(message)
29
29
  end
@@ -90,6 +90,11 @@ module Catsay
90
90
  File.join(File.expand_path(File.dirname(__FILE__)), '..', 'cats', "#{template_id}.erb")
91
91
  end
92
92
 
93
+ def cats
94
+ catfiles = Dir[File.join(File.expand_path(File.dirname(__FILE__)), '..', 'cats', '*.erb')]
95
+ catfiles.map! { |x| File.basename(x, '.erb') }
96
+ end
97
+
93
98
  # fetches the input by first looking for
94
99
  # an input handle and then looking for
95
100
  # options[:text] (text specified after arguments)
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,15 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catsay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Austin G. Davis-Richardson
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain: []
12
- date: 2014-04-03 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDIDCCAgigAwIBAgIBADANBgkqhkiG9w0BAQUFADA2MQowCAYDVQQDDAFfMRQw
14
+ EgYKCZImiZPyLGQBGRYEYWdkcjESMBAGCgmSJomT8ixkARkWAmNvMB4XDTE0MDcw
15
+ OTE5MDc1MVoXDTE1MDcwOTE5MDc1MVowNjEKMAgGA1UEAwwBXzEUMBIGCgmSJomT
16
+ 8ixkARkWBGFnZHIxEjAQBgoJkiaJk/IsZAEZFgJjbzCCASIwDQYJKoZIhvcNAQEB
17
+ BQADggEPADCCAQoCggEBANcJT8ftI2ex4cCJGBTexorBoQTyVE5Zamdi51/zPNgU
18
+ 1ew59izYGv8/JjMpUyTFdFbz8l7rlyeEssoz5Yf6gckxl+nlmiBxvILKu8W2ZjyF
19
+ a3ymCbyehr/1i+GPozZFyVKdIEIHLagAWej4Md2FsQDKwmaA/+5sSqu1b80R675e
20
+ Ae9o5G76GniNptiAC/QF/zYwXGcMJRJatYx1qIdK4rdZahlBaozTrI5Dl49yLOb/
21
+ fZKnRa6IZCL+DuXUViNTipPuOLvnUSPTzfnnw3dq+ybLpD2YppMFHR65gioidbeV
22
+ 3rKgZau6mfzS7bne/m/SIjYTpPlYhHTExiJXhEJNzRUCAwEAAaM5MDcwCQYDVR0T
23
+ BAIwADAdBgNVHQ4EFgQUMP97xnvyjtlzDTrfwsWNNbFTIC0wCwYDVR0PBAQDAgSw
24
+ MA0GCSqGSIb3DQEBBQUAA4IBAQCuU9TA7hSQD7dytWLYfQ8S4uHreSdca4PRksxH
25
+ 36iy8SpmynKIh83UxZH9Nr8xX3kVnHX9sFYqUeyQYrLsog+etwwD51C+taMRUzYU
26
+ y2ICMXGl9U9u/lecKj/kCOJE8bDhbVD9adm+ZKVqAoq0DGlJI4xarIxwzDCVZr3v
27
+ 43LDK6ouZt7pt5TZ3wZbBsSYXcC4NVQHrxb+6YakULkyUFl6Ld2p6ID97hTOAHd2
28
+ b9RS3+P0pRzQyo2osQTnOup3ZAlfqtG90F/m5mSIvWeJQBwcZld9X2CvJ/DgSfvX
29
+ hArlAbz8jIiZ5FhHecQVQ6Q0sDljNdFh5N6SQp9afYfJ0Dlb
30
+ -----END CERTIFICATE-----
31
+ date: 2014-11-17 00:00:00.000000000 Z
13
32
  dependencies: []
14
33
  description: Like cowsay but with cats
15
34
  email: harekrishna@gmail.com
@@ -19,34 +38,33 @@ extensions: []
19
38
  extra_rdoc_files: []
20
39
  files:
21
40
  - bin/catsay
41
+ - cats/default.erb
42
+ - cats/test.erb
22
43
  - lib/cat.rb
23
44
  - lib/catsay.rb
24
45
  - lib/exceptions.rb
25
- - cats/default.erb
26
- - cats/test.erb
27
46
  homepage: https://github.com/audy/catsay
28
47
  licenses:
29
48
  - MIT
49
+ metadata: {}
30
50
  post_install_message:
31
51
  rdoc_options: []
32
52
  require_paths:
33
53
  - lib
34
54
  required_ruby_version: !ruby/object:Gem::Requirement
35
- none: false
36
55
  requirements:
37
- - - ! '>='
56
+ - - ">="
38
57
  - !ruby/object:Gem::Version
39
58
  version: '0'
40
59
  required_rubygems_version: !ruby/object:Gem::Requirement
41
- none: false
42
60
  requirements:
43
- - - ! '>='
61
+ - - ">="
44
62
  - !ruby/object:Gem::Version
45
63
  version: '0'
46
64
  requirements: []
47
65
  rubyforge_project:
48
- rubygems_version: 1.8.23
66
+ rubygems_version: 2.4.1
49
67
  signing_key:
50
- specification_version: 3
68
+ specification_version: 4
51
69
  summary: Cats in your terminal
52
70
  test_files: []
metadata.gz.sig ADDED
Binary file