xsay 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xsay.rb +7 -6
  3. data/lib/xsay/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47d6830533ac8b502f9c3b20e4e8bdb45d4d6ac4a107e0e9635b5a4f6e9bfba2
4
- data.tar.gz: 4571c0d3ca3bd1e5b1b7b95856976d0a719dc4c8f5ec41d660631e19a7adb8fd
3
+ metadata.gz: da403ee03507c6166b8e37febef799b2c0f9aea3fc410ea62141fe2616b01dd6
4
+ data.tar.gz: a791a342b414ce587290ef8ce888a448d61b88dced992bcff5917ddc832aa8a2
5
5
  SHA512:
6
- metadata.gz: f98978780abbe4443b45d05ee5e6e37b0b5b956c95f9131617862e4c11488198417192994d218525ea021a6d97a2845e4fffb82faf05a9513aaa40b12cbedadd
7
- data.tar.gz: 5295ea93078ac60691b428c099a6b85316996ff864d6232841851366fad01810d0000318a3f8f53e45003f98384d6cdaa7638eb7e7d9bc8b8eb2cf76a149c2a0
6
+ metadata.gz: 84334bdc4466855689dd6db479a8df0c969437e716d6d9943f2b0052b7ad006c8ff8671fe1435da1a15f94cd2f663043018714df770ada87febc47ee8e78322d
7
+ data.tar.gz: ecf1d4fe18be44db9ec5b7f320fa98277b3d3de454820a35a907797e51cc0430c31ce3fc8725f4865dec3dbf05839bd734badf3e68d95f3620aa9c73d72ab6c3
data/lib/xsay.rb CHANGED
@@ -9,26 +9,27 @@ module Xsay
9
9
  animal = File.basename(filename).split(".")[0]
10
10
 
11
11
  desc "#{animal} <message>", "xsay #{animal} hello"
12
- define_method animal do |message|
13
- render(message, IO.read(filename))
12
+ define_method animal do |*args|
13
+ render(args, IO.read(filename))
14
14
  end
15
15
  end
16
16
 
17
17
  desc "all <message>", "xsay all hello"
18
- def all(message)
18
+ def all(*args)
19
19
  ANIMALS.each do |filename|
20
- render(message, IO.read(filename))
20
+ render(args, IO.read(filename))
21
21
  end
22
22
  end
23
23
 
24
24
  desc "random <message>", "xsay random hello"
25
- def random(message)
26
- render(message, IO.read(ANIMALS.shuffle.sample))
25
+ def random(*args)
26
+ render(args, IO.read(ANIMALS.shuffle.sample))
27
27
  end
28
28
 
29
29
  private
30
30
 
31
31
  def render(message, template)
32
+ message = message.join(' ') if message.respond_to?(:join)
32
33
  line_break = "-" * message.length
33
34
  say <<-MESSAGE
34
35
  #{line_break}
data/lib/xsay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xsay
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mokha