dogsay 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5df247b502946379da74b5e098e732811cb17ca9
4
- data.tar.gz: b169a1c95d05e9578a6d1a13dfa24688f8c4b9df
3
+ metadata.gz: 61ad1bbaef3bdabe95c7d6cf946b1b3a9fb57568
4
+ data.tar.gz: c8f03c1221a155a8bdf730288cc986101d327723
5
5
  SHA512:
6
- metadata.gz: 2b1f11fa91ff6b29ce4b20db2677f72df26432521d0c6a540548f610d790d2c294320e237f4479d1ae947a148c779ddcffbd4d460e0fb98a24e0dd98e3f030c0
7
- data.tar.gz: ace5e5c81199a92141021b50edbf398a6c1f7a97c80e155c36e807e017444c6fa2e2be68103e0abe6d49f633972c3147aa77a409eaf85dddc353c2a1ece006fa
6
+ metadata.gz: f749d9167e7b4c7fb9a19fe08da78bcd67d8f16123c6e8a078bf8a3a0052b9c2dd29192309fc2968e2794408e587fadad2f3ccf2ab3600ed0ac683d32b6b2a08
7
+ data.tar.gz: b3860283688e5ff725ebf0b5afacda3a73f7c0d207661392680148d9de18324e95f3ce050e72267ea269bdb3669aad26026ff17f108f88cd7162145ef557b9d1
@@ -1,3 +1,3 @@
1
1
  module Dogsay
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
data/lib/dogsay.rb CHANGED
@@ -12,9 +12,10 @@ String.include CoreExtensions::String::Box
12
12
  module Dogsay
13
13
  class << self
14
14
  def say(string, opts={})
15
- dog = Dogsay::Dog.new(config.merge opts)
16
- text = Dogsay::TextBox.new(string, opts)
17
- boxed = opts[:raw] ? text.raw : text.ascii
15
+ options = config.merge opts
16
+ dog = Dogsay::Dog.new(options)
17
+ text = Dogsay::TextBox.new(string, options)
18
+ boxed = opts[:raw] ? text.raw : text.ascii
18
19
  dog.add_art(boxed, on_the: dog.text_position)
19
20
  end
20
21
 
data/spec/dogsay_spec.rb CHANGED
@@ -4,16 +4,26 @@ RSpec.describe Dogsay do
4
4
  end
5
5
 
6
6
  describe '#say' do
7
+ let(:defaults) do
8
+ {
9
+ animal: :dog,
10
+ pose: :default,
11
+ raw: false,
12
+ text_width: 40,
13
+ strip: false
14
+ }
15
+ end
16
+
7
17
  it 'shoud bark' do
8
18
  woof = File.open(File.join 'spec', 'fixtures', 'say_woof').read
9
- expect(Dogsay.say('woof')).to eq woof
19
+ expect(Dogsay.say('woof', defaults)).to eq woof
10
20
  end
11
21
 
12
22
  it 'should know poetry' do
13
23
  sappho = File.open(File.join 'spec', 'fixtures', 'say_sappho').read
14
24
  poem = "We know this much\nDeath is an evil;\nwe have the gods'\n" <<
15
25
  "word for it; they too\nwould die if death\nwere a good thing"
16
- expect(Dogsay.say(poem)).to eq sappho
26
+ expect(Dogsay.say(poem, defaults)).to eq sappho
17
27
  end
18
28
 
19
29
  context 'without a configuration file' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogsay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forrest Fleming