madlibber 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -12
- data/lib/madlibber.rb +9 -9
- data/lib/madlibber/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: 9011d53decdc221949e1d652ff9b96e1bebe671c
|
4
|
+
data.tar.gz: e60e326318f5e3af2cf1beb41c5da930103b19a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39f1027b46d663b0e53360c70924eefed3ab638bd85638f0a00a6c4be68f4d34790e387bdc9b41fcad05f0e5f2c968657166cf2647a747fb11a1e6d8eaacaa8e
|
7
|
+
data.tar.gz: 8bf071adc5cd82f23a4de8615c0bf6ac933feb267c7aa7f8af42e2232f2d2c328698e5ba3424ba86a0710e956532973a75e7cdfcae2669af306ef000ff44be4b
|
data/README.md
CHANGED
@@ -47,7 +47,13 @@ love our dogs , good food , <noun> , and post-it notes ! <plural_noun>
|
|
47
47
|
of post-it notes !
|
48
48
|
```
|
49
49
|
|
50
|
-
|
50
|
+
###OPTIONS
|
51
|
+
```
|
52
|
+
num_of_blanks (defaults to 10)
|
53
|
+
html_form (defaults to false)
|
54
|
+
```
|
55
|
+
|
56
|
+
The following example illustrates how you could specify how many fillable fields that you would like and that you want response as an HTML form:
|
51
57
|
|
52
58
|
```ruby
|
53
59
|
require 'madlibber'
|
@@ -63,20 +69,30 @@ text = "At Indiegogo you’ll find a welcoming, supportive community
|
|
63
69
|
work. We love our dogs, good food, coffee, and post-it notes!
|
64
70
|
Lots of post-it notes!"
|
65
71
|
|
66
|
-
MadLibber.libberfy text, { num_of_blanks: 15 }
|
72
|
+
MadLibber.libberfy text, { num_of_blanks: 15, html_form: 1 }
|
67
73
|
```
|
68
74
|
EXAMPLE OUTPUT:
|
69
75
|
```
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
<
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
<form id='madlib-form'>
|
77
|
+
At Indiegogo you'll <input type='text' placeholder=''verb> a
|
78
|
+
welcoming , supportive community that embraces collaboration ,
|
79
|
+
fearlessness and <input type='text' placeholder='noun'> . We are a
|
80
|
+
<input type='text' placeholder='adverb'> growing organization and
|
81
|
+
our platform is used by people all over the <input type='text'
|
82
|
+
placeholder='noun'> to <input type='text' placeholder='verb'>
|
83
|
+
<input type='text' placeholder='noun'> for their <input type='text'
|
84
|
+
placeholder='adjective'> , <input type='text' placeholder='adjective'> ,
|
85
|
+
or entrepreneurial ideas . Our <input type='text'
|
86
|
+
placeholder='plural_noun'> are passionate about their funding
|
87
|
+
campaigns , and <input type='text' placeholder='adverb'> are we !
|
88
|
+
We are a team of passionate , <input type='text'
|
89
|
+
placeholder='adjective'> , <input type='text' placeholder='noun'> who
|
90
|
+
are lucky enough to be able to call helping people achieve their dream
|
91
|
+
work . We love our dogs , good food , <input type='text'
|
92
|
+
placeholder='noun'> , and post-it <input type='text'
|
93
|
+
placeholder='plural_noun'> ! Lots of post-it <input type='text'
|
94
|
+
placeholder='plural_noun'> !
|
95
|
+
</form>
|
80
96
|
```
|
81
97
|
|
82
98
|
## Available fillable fields
|
data/lib/madlibber.rb
CHANGED
@@ -22,15 +22,15 @@ module MadLibber
|
|
22
22
|
}
|
23
23
|
|
24
24
|
TAGS_HTML = {
|
25
|
-
"NN" => "<input type='text' placeholder='noun'>",
|
26
|
-
"NNS" => "<input type='text' placeholder='plural_noun'>",
|
27
|
-
"NNP" => "<input type='text' placeholder='proper_noun'>",
|
28
|
-
"VB" => "<input type='text' placeholder='verb'>",
|
29
|
-
"VBD" => "<input type='text' placeholder='verb_past_tense'>",
|
30
|
-
"VBG" => "<input type='text' placeholder='verb_ending_with_ing'>",
|
31
|
-
"JJ" => "<input type='text' placeholder='adjective'>",
|
32
|
-
"RB" => "<input type='text' placeholder='adverb'>",
|
33
|
-
"UH" => "<input type='text' placeholder='interjection'>"
|
25
|
+
"NN" => "<input type='text' placeholder='noun' required>",
|
26
|
+
"NNS" => "<input type='text' placeholder='plural_noun' required>",
|
27
|
+
"NNP" => "<input type='text' placeholder='proper_noun' required>",
|
28
|
+
"VB" => "<input type='text' placeholder='verb' required>",
|
29
|
+
"VBD" => "<input type='text' placeholder='verb_past_tense' required>",
|
30
|
+
"VBG" => "<input type='text' placeholder='verb_ending_with_ing' required>",
|
31
|
+
"JJ" => "<input type='text' placeholder='adjective' required>",
|
32
|
+
"RB" => "<input type='text' placeholder='adverb' required>",
|
33
|
+
"UH" => "<input type='text' placeholder='interjection' required>"
|
34
34
|
}
|
35
35
|
|
36
36
|
def libberfy text, options = OPTIONS
|
data/lib/madlibber/version.rb
CHANGED