dogsay 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -1
- data/lib/dogsay.rb +1 -1
- data/lib/dogsay/dog.rb +6 -1
- data/lib/dogsay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53b69d03536e181374a1a1ed0db0f7ceddcc907c
|
4
|
+
data.tar.gz: 6765a26ed5cd8a994e02a7536b5bf494c8286ef2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99e9d4a9246eb5dcdbc1a7b45436d0934f5fdcf9cd09294928fd462b5505b4dac20e6bbbe28af8a538bd7c78bfe8bb90b0634121cf62341c3bf1fd7cc6619ea9
|
7
|
+
data.tar.gz: f3479858143be1bd27cf92a6f7d6c44fe1d4ff2e80ebd26c12fbeb1a6afd328c38b02ee30eac5c65364434f4dcaf52a25076a3761456fb86aa03fb34e0b387e7
|
data/README.md
CHANGED
@@ -64,6 +64,30 @@ or
|
|
64
64
|
|
65
65
|
If you're feeling saucy, you can try out `dinosay` as well.
|
66
66
|
|
67
|
+
## Configuration
|
68
|
+
|
69
|
+
Edit `.dogsay` in your home directory. It is a Yaml file that looks something
|
70
|
+
like this:
|
71
|
+
```yaml
|
72
|
+
:pose: :small
|
73
|
+
:justify: :center
|
74
|
+
:strip: :true
|
75
|
+
:text_width: 35
|
76
|
+
```
|
77
|
+
|
78
|
+
The full options (though some, like `:raw`, are incompatible with others, like
|
79
|
+
`:justify`) are:
|
80
|
+
```yaml
|
81
|
+
:pose: <see dogs directory or use dogsay --list>
|
82
|
+
:justify: <:ljust|:center|:rjust>
|
83
|
+
:strip: <true|false>
|
84
|
+
:raw: <true|false>
|
85
|
+
:text_width: <integer>
|
86
|
+
```
|
87
|
+
|
88
|
+
Note that you can't set `:animal` in your dotfile, as if you want a dog you use
|
89
|
+
`dogsay` and if you want a dinosaur you use `dinosay`.
|
90
|
+
|
67
91
|
## Contributing
|
68
92
|
|
69
93
|
1. Fork it ( https://github.com/ffleming/dogsay/fork )
|
@@ -72,7 +96,8 @@ If you're feeling saucy, you can try out `dinosay` as well.
|
|
72
96
|
4. Push to the branch (`git push origin my-new-feature`)
|
73
97
|
5. Create a new Pull Request
|
74
98
|
|
75
|
-
##Acknowledgments
|
99
|
+
## Acknowledgments
|
100
|
+
|
76
101
|
* `default.dog` by 'dgs' at [Ascii-art.de](http://www.ascii-art.de/ascii/def/dogs.txt)
|
77
102
|
* `small.dog` from [Ascii-art.de](http://www.ascii-art.de/ascii/def/dogs.txt)
|
78
103
|
* `sit.dog` from [AsciiWorld.com](http://www.asciiworld.com/-Dogs-.html)
|
data/lib/dogsay.rb
CHANGED
@@ -15,7 +15,7 @@ module Dogsay
|
|
15
15
|
options = config.merge opts
|
16
16
|
dog = Dogsay::Dog.new(options)
|
17
17
|
text = Dogsay::TextBox.new(string, options)
|
18
|
-
boxed =
|
18
|
+
boxed = options[:raw] ? text.raw : text.ascii
|
19
19
|
dog.add_art(boxed, on_the: dog.text_position)
|
20
20
|
end
|
21
21
|
|
data/lib/dogsay/dog.rb
CHANGED
@@ -35,7 +35,12 @@ class Dogsay::Dog
|
|
35
35
|
begin
|
36
36
|
yaml_hash = YAML.load_file filename
|
37
37
|
rescue Errno::ENOENT
|
38
|
-
|
38
|
+
begin
|
39
|
+
@pose = :default
|
40
|
+
yaml_hash = YAML.load_file filename
|
41
|
+
rescue Errno::ENOENT
|
42
|
+
raise Dogsay::InvalidDogError.new("Invalid dog file #{filename}")
|
43
|
+
end
|
39
44
|
end
|
40
45
|
@ascii = ascii_from(yaml_hash)
|
41
46
|
@text_position = yaml_hash[:text_position]
|
data/lib/dogsay/version.rb
CHANGED