picture_frame 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +31 -4
- data/lib/picture_frame/version.rb +1 -1
- data/lib/picture_frame.rb +2 -2
- metadata +1 -1
data/README.md
CHANGED
@@ -18,6 +18,28 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
+
> f = PictureFrame.create
|
22
|
+
> puts f.frame('Hello, World!')
|
23
|
+
+---------------+
|
24
|
+
| Hello, World! |
|
25
|
+
+---------------+
|
26
|
+
|
27
|
+
> f = PictureFrame.create(:stars)
|
28
|
+
> puts f.frame('Hello, World!')
|
29
|
+
*****************
|
30
|
+
* Hello, World! *
|
31
|
+
*****************
|
32
|
+
|
33
|
+
puts PictureFrame.create(:random).frame('Surprise!')
|
34
|
+
⌜ ⌝
|
35
|
+
Surprise!
|
36
|
+
⌞ ⌟
|
37
|
+
|
38
|
+
> f = PictureFrame.create("-- * --", :placeholder => '*')
|
39
|
+
> puts f.frame('Just a line')
|
40
|
+
-- Just a line --
|
41
|
+
|
42
|
+
### Showcase
|
21
43
|
|
22
44
|
> PictureFrame.showcase("Hello, World!")
|
23
45
|
:default
|
@@ -42,9 +64,9 @@ Or install it yourself as:
|
|
42
64
|
|
43
65
|
:ornate
|
44
66
|
%=---------------=%
|
45
|
-
∥
|
67
|
+
∥ ∥
|
46
68
|
| Hello, World! |
|
47
|
-
∥
|
69
|
+
∥ ∥
|
48
70
|
%=---------------=%
|
49
71
|
|
50
72
|
:ephemeral
|
@@ -89,10 +111,10 @@ Or install it yourself as:
|
|
89
111
|
|
90
112
|
:ornate
|
91
113
|
%=-------=%
|
92
|
-
∥
|
114
|
+
∥ ∥
|
93
115
|
| Hello |
|
94
116
|
| World |
|
95
|
-
∥
|
117
|
+
∥ ∥
|
96
118
|
%=-------=%
|
97
119
|
|
98
120
|
:ephemeral
|
@@ -121,3 +143,8 @@ Or install it yourself as:
|
|
121
143
|
4. Push to the branch (`git push origin my-new-feature`)
|
122
144
|
5. Create new Pull Request
|
123
145
|
|
146
|
+
|
147
|
+
## TODO
|
148
|
+
|
149
|
+
* Ensure that multibyte characters work properly
|
150
|
+
* Support ANSI colors.
|
data/lib/picture_frame.rb
CHANGED
@@ -5,7 +5,7 @@ require 'picture_frame/predefined'
|
|
5
5
|
module PictureFrame
|
6
6
|
class << self
|
7
7
|
|
8
|
-
def create(frame_spec = nil)
|
8
|
+
def create(frame_spec = nil, options = {})
|
9
9
|
case frame_spec
|
10
10
|
when String
|
11
11
|
template = frame_spec
|
@@ -17,7 +17,7 @@ module PictureFrame
|
|
17
17
|
template = Predefined.default
|
18
18
|
end
|
19
19
|
raise ArgumentError, "No such template: #{frame_spec.inspect}" unless template
|
20
|
-
Frame.new(template)
|
20
|
+
Frame.new(template, options)
|
21
21
|
end
|
22
22
|
|
23
23
|
def showcase(text)
|