dunmanifestin 0.0.4 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{lists/default → default-genre}/activated +0 -0
- data/{lists/default → default-genre}/adverb +0 -0
- data/{lists/default → default-genre}/ageGroup +0 -0
- data/{lists/default → default-genre}/alienName +0 -0
- data/{lists/default → default-genre}/alignment +0 -0
- data/{lists/default → default-genre}/animal +0 -0
- data/{lists/default → default-genre}/appearance +0 -0
- data/{lists/default → default-genre}/attitude +0 -0
- data/{lists/default → default-genre}/bag +0 -0
- data/{lists/default → default-genre}/baggage +0 -0
- data/default-genre/baseItem +51 -0
- data/{lists/default → default-genre}/buildingType +0 -0
- data/{lists/default → default-genre}/color +0 -0
- data/{lists/default → default-genre}/container +0 -0
- data/{lists/default → default-genre}/curse +0 -0
- data/{lists/default → default-genre}/denizen +0 -0
- data/{lists/default → default-genre}/denizenDetail +0 -0
- data/{lists/default → default-genre}/description +0 -0
- data/{lists/default → default-genre}/desire +0 -0
- data/{lists/default → default-genre}/disability +0 -0
- data/{lists/default → default-genre}/disease +0 -0
- data/{lists/default → default-genre}/economy +0 -0
- data/{lists/default → default-genre}/encounter +0 -0
- data/{lists/default → default-genre}/englishName +0 -0
- data/{lists/default → default-genre}/epithet +0 -0
- data/{lists/default → default-genre}/facet +0 -0
- data/{lists/default → default-genre}/facetOfCulture +0 -0
- data/{lists/default → default-genre}/family +0 -0
- data/{lists/default → default-genre}/fear +0 -0
- data/{lists/default → default-genre}/finnishName +0 -0
- data/{lists/default → default-genre}/foodOrDrink +0 -0
- data/{lists/default → default-genre}/geologicalFormation +0 -0
- data/{lists/default → default-genre}/greenlandicName +0 -0
- data/{lists/default → default-genre}/grossBodyPart +0 -0
- data/{lists/default → default-genre}/group +0 -0
- data/{lists/default → default-genre}/hardMaterial +0 -0
- data/{lists/default → default-genre}/height +0 -0
- data/{lists/default → default-genre}/japaneseName +0 -0
- data/{lists/default → default-genre}/jewelery +0 -0
- data/{lists/default → default-genre}/koboldName +0 -0
- data/{lists/default → default-genre}/latinName +0 -0
- data/{lists/default → default-genre}/magicItemDescription +0 -0
- data/{lists/default → default-genre}/material +0 -0
- data/{lists/default → default-genre}/metal +0 -0
- data/{lists/default → default-genre}/mineral +0 -0
- data/{lists/default → default-genre}/monster +0 -0
- data/{lists/default → default-genre}/name +0 -0
- data/{lists/default → default-genre}/namePrefix +0 -0
- data/{lists/default → default-genre}/nameSuffix +0 -0
- data/{lists/default → default-genre}/negativeAdverb +0 -0
- data/{lists/default → default-genre}/negativeQuality +0 -0
- data/{lists/default → default-genre}/neutralQuality +0 -0
- data/{lists/default → default-genre}/nonPreciousMetal +0 -0
- data/{lists/default → default-genre}/object +0 -0
- data/{lists/default → default-genre}/person +0 -0
- data/{lists/default → default-genre}/personName +0 -0
- data/{lists/default → default-genre}/personality +0 -0
- data/{lists/default → default-genre}/place +0 -0
- data/{lists/default → default-genre}/placeName +0 -0
- data/{lists/default → default-genre}/placeSuffix +0 -0
- data/{lists/default → default-genre}/positiveAdverb +0 -0
- data/{lists/default → default-genre}/positiveQuality +0 -0
- data/{lists/default → default-genre}/preciousMetal +0 -0
- data/{lists/default → default-genre}/preciousStone +0 -0
- data/{lists/default → default-genre}/profession +0 -0
- data/{lists/default → default-genre}/province +0 -0
- data/{lists/default → default-genre}/quality +0 -0
- data/{lists/default → default-genre}/qualityWithAdverb +0 -0
- data/{lists/default → default-genre}/race +0 -0
- data/{lists/default → default-genre}/raceOrProfession +0 -0
- data/{lists/default → default-genre}/reason +0 -0
- data/{lists/default → default-genre}/resource +0 -0
- data/{lists/default → default-genre}/root +0 -0
- data/{lists/default → default-genre}/secret +0 -0
- data/{lists/default → default-genre}/settlementDetail +0 -0
- data/{lists/default → default-genre}/settlementType +0 -0
- data/{lists/default → default-genre}/softMaterial +0 -0
- data/{lists/default → default-genre}/structureDetail +0 -0
- data/{lists/default → default-genre}/structureType +0 -0
- data/{lists/default → default-genre}/superpower +0 -0
- data/{lists/default → default-genre}/topicOfConversation +0 -0
- data/{lists/default → default-genre}/vestment +0 -0
- data/{lists/default → default-genre}/weapon +16 -10
- data/{lists/default → default-genre}/weaponName +0 -0
- data/default-genre/wearable +4 -0
- data/{lists/default → default-genre}/wearableQuality +0 -0
- data/{lists/default → default-genre}/weildable +0 -0
- data/{lists/default → default-genre}/welshName +0 -0
- data/default-genre/|minorMagicItem +51 -0
- data/lib/dunmanifestin/custom_inflections.rb +4 -3
- data/lib/dunmanifestin/list_loader.rb +2 -2
- data/lib/dunmanifestin/phrase.rb +31 -9
- data/lib/dunmanifestin/terminator.rb +3 -2
- metadata +102 -114
- data/lists/default/baseItem +0 -38
- data/lists/default/wearable +0 -4
- data/lists/gritty-horror-fantasty/familiarPlace +0 -28
- data/lists/gritty-horror-fantasty/plotHook +0 -11
- data/lists/gritty-horror-fantasty/root +0 -2
- data/lists/huoquitlan/originalAnimal +0 -250
- data/lists/huoquitlan/originalDenizen +0 -849
- data/lists/huoquitlan/originalItemName +0 -33
- data/lists/huoquitlan/originalNPC +0 -99
- data/lists/huoquitlan/originalName +0 -226
- data/lists/hypotheticals/noun +0 -373
- data/lists/hypotheticals/root +0 -15
- data/lists/hypotheticals/transitiveVerb +0 -628
- data/lists/hypotheticals/verbs +0 -653
- data/lists/sophistry/root +0 -269
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea2d90ab3bc08d446d7cd1d365eb2500f57a0efd
|
4
|
+
data.tar.gz: 5fd9b1380e338b4c686854fc06550467f9a0e45c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e32bec3cd9c3a1bd2f8924e1640caa60349ad81dce9329c2807006381cd13f013436ae19b2bec3d50031c02d6274b59668179623f6371c4bd0ea8a615e08ff72
|
7
|
+
data.tar.gz: 1db3aa470634cfb60b5e8e394f35995c72d3c5b643791196cc04fd9794284b8bef620ee393188af0183965e1b9f1a223b262cb203be01154149aa8ce31976a11
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|baseItem
|
2
|
+
[nonPreciousMetal] shield
|
3
|
+
[nonPreciousMetal] shovel
|
4
|
+
[nonPreciousMetal] trawl
|
5
|
+
[nonPreciousMetal] sword
|
6
|
+
[utensil#plural]
|
7
|
+
[instrument#plural]
|
8
|
+
[tool#plural]
|
9
|
+
[weapon#plural]
|
10
|
+
[vestment#plural]
|
11
|
+
|
12
|
+
|utensil
|
13
|
+
bowl
|
14
|
+
2@[hardUtensil#plural] made of [hardMaterial]
|
15
|
+
knife
|
16
|
+
spoon
|
17
|
+
wand
|
18
|
+
orb
|
19
|
+
|
20
|
+
|instrument
|
21
|
+
whistle
|
22
|
+
pipe
|
23
|
+
[hardInstrument#plural] made of [hardMaterial]
|
24
|
+
bagpipe
|
25
|
+
|
26
|
+
|tool
|
27
|
+
100@ax
|
28
|
+
[metal] axe
|
29
|
+
[metal] knife
|
30
|
+
shovel
|
31
|
+
trawl
|
32
|
+
plough
|
33
|
+
knife
|
34
|
+
hammer
|
35
|
+
power saw
|
36
|
+
peg leg
|
37
|
+
[_hook#plural] for [_hand.article#plural]
|
38
|
+
crowbar
|
39
|
+
|
40
|
+
|hardUtensil
|
41
|
+
bowl
|
42
|
+
wand
|
43
|
+
|
44
|
+
|hardInstrument
|
45
|
+
pipe
|
46
|
+
|
47
|
+
|_hook
|
48
|
+
hook
|
49
|
+
|
50
|
+
|_hand
|
51
|
+
hand
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -21,15 +21,15 @@ flail
|
|
21
21
|
|
22
22
|
|sword
|
23
23
|
[nonPreciousMetal] [swordType#plural]
|
24
|
-
[nonPreciousMetal] [swordType#plural] with
|
24
|
+
[nonPreciousMetal] [swordType#plural] with [_hilt.article#plural] made of [hardMaterial]
|
25
25
|
[nonPreciousMetal] [swordType#plural] inlaid with [preciousMetal]
|
26
26
|
[nonPreciousMetal] [swordType#plural] encrusted with [preciousStone.plural]
|
27
27
|
[swordType#plural]
|
28
|
-
[swordType#plural] with
|
28
|
+
[swordType#plural] with [_hilt.article#plural] made of [hardMaterial]
|
29
29
|
[swordType#plural] inlaid with [preciousMetal]
|
30
30
|
[swordType#plural] encrusted with [preciousStone.plural]
|
31
31
|
[itemQuality] [swordType#plural]
|
32
|
-
[itemQuality] [swordType#plural] with
|
32
|
+
[itemQuality] [swordType#plural] with [_hilt.article#plural] made of [hardMaterial]
|
33
33
|
[itemQuality] [swordType#plural] inlaid with [preciousMetal]
|
34
34
|
[itemQuality] [swordType#plural] encrusted with [preciousStone.plural]
|
35
35
|
[nonPreciousMetal] [swordType#plural], [weaponName], [weaponEpithet]
|
@@ -58,7 +58,7 @@ repeating crossbow
|
|
58
58
|
2@[hardMaterial] [arrowType#plural]
|
59
59
|
poison [arrowType#plural]
|
60
60
|
barbed [arrowType#plural]
|
61
|
-
2@[arrowType#plural
|
61
|
+
2@[arrowType#plural] with [arrowShaftType.article#plural] of [hardMaterial]
|
62
62
|
[basicColor]-flighted [arrowType#plural]
|
63
63
|
[basicColor]-fletched [arrowType#plural]
|
64
64
|
[basicColor]-feathered [arrowType#plural]
|
@@ -72,17 +72,17 @@ bolt
|
|
72
72
|
shaft
|
73
73
|
|
74
74
|
|knife
|
75
|
-
[knifeType#plural] with
|
75
|
+
[knifeType#plural] with [_handle.article#plural] of [hardMaterial]
|
76
76
|
[knifeType#plural] inlaid with [preciousMetal]
|
77
|
-
[knifeType#plural] with [preciousStone.article] on the
|
77
|
+
[knifeType#plural] with [preciousStone.article#plural] on the [_handle#plural]
|
78
78
|
[knifeType#plural] encrusted with [preciousStone.plural]
|
79
|
-
[nonPreciousMetal] [knifeType#plural] with
|
79
|
+
[nonPreciousMetal] [knifeType#plural] with [_handle.article#plural] of [hardMaterial]
|
80
80
|
[nonPreciousMetal] [knifeType#plural] inlaid with [preciousMetal]
|
81
|
-
[nonPreciousMetal] [knifeType#plural] with [preciousStone.article] on the
|
81
|
+
[nonPreciousMetal] [knifeType#plural] with [preciousStone.article#plural] on the [_handle#plural]
|
82
82
|
[nonPreciousMetal] [knifeType#plural] encrusted with [preciousStone.plural]
|
83
|
-
[itemQuality] [knifeType#plural] with
|
83
|
+
[itemQuality] [knifeType#plural] with [_handle.article#plural] of [hardMaterial]
|
84
84
|
[itemQuality] [knifeType#plural] inlaid with [preciousMetal]
|
85
|
-
[itemQuality] [knifeType#plural] with [preciousStone.article] on the
|
85
|
+
[itemQuality] [knifeType#plural] with [preciousStone.article#plural] on the [_handle#plural]
|
86
86
|
[itemQuality] [knifeType#plural] encrusted with [preciousStone.plural]
|
87
87
|
[nonPreciousMetal] [knifeType#plural] named [weaponName]
|
88
88
|
|
@@ -91,3 +91,9 @@ shaft
|
|
91
91
|
hunting knife
|
92
92
|
dagger
|
93
93
|
cleaver
|
94
|
+
|
95
|
+
|_hilt
|
96
|
+
hilt
|
97
|
+
|
98
|
+
|_handle
|
99
|
+
handle
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|minorMagicItem
|
2
|
+
A small silver figurine that, when given away, will return to your pocket after 1d6 minutes. The only way to permanently get rid of it is for the recipient to similarly give it away before the 1d6 minutes expire. (Alternatively, the original owner could die.) Yes, this is great for scamming people. Apparent value: 1d100 silver.
|
3
|
+
A rock that, when thrown, always hits its target. Always. Cannot do anything that you couldn't conceivably do with a really lucky throw.
|
4
|
+
A saddle that turns any animal into a horse when it is strapped on. The horse cannot remove the saddle on its own. Currently owned by a bounty hunter who is fond of riding his bounties back to town.
|
5
|
+
A key that can unlock any door, but cannot be removed from the mechanism until the door is relocked.
|
6
|
+
A mug that points the way to the nearest tavern when it is balanced on its edge.
|
7
|
+
An egg cup that can hatch any egg that is placed atop it.
|
8
|
+
A ring that gives the wearer a magnificent mustache/beard, depending on which finger it is worn on. The left ring finger, for example, always yields a Van Dyke.
|
9
|
+
A ring that makes your eyeball pop out. This is not a problem, and you can continue to see through the eye just fine, like a spy-eye. Reversible if the ring is removed.
|
10
|
+
A ring that makes you invisible, but not your equipment or clothing.
|
11
|
+
An umbrella that allows you float downwards at 60'/round when open, negating fall damage.
|
12
|
+
Chicken Arrows (1d6). On a hit, target must save vs fear (first arrow only). If sat upon like an egg, quickly turns into an adult chicken. Fletched with white feathers.
|
13
|
+
Bag of Infinite Manure. Useful for campfires.
|
14
|
+
Wand of Necromantic Cooking. Can enchant a corpse or cut of meat to cut, prepare, marinate, and cook itself. A slaughtered pig will seek out gravy to roll around in. Sausages will jump into the saucepan, and then seek out your plate when cooked.
|
15
|
+
Omnidress. Can turn into any type of dress (can even imitate leather armor, but not metal).
|
16
|
+
Indelible Pen. Can write on anything. Writing is permanent. Works 1d6 times.
|
17
|
+
Ring that makes the wearer appear to be dead and rotten.
|
18
|
+
Scones (1d6). When broken in half, it erupts into 1d100 scones (10 scones = food for a day). Alternatively, it can be eaten to restore 1d6 HP.
|
19
|
+
Wooden hand. 1/day, can turn into a living-but-disembodied hand for 1 hour. Will obey your commands for the duration. Str 1, can climb most walls. Int 6, can see normally, but cannot speak.
|
20
|
+
Locket. Woman's face inside the amulet always looks towards Meltheria.
|
21
|
+
Box of paired snails. When one snail dies, so does its mate. Normally used to send very crude, binary messages. There are 1d6 pairs of snails. Feed them leaves.
|
22
|
+
Hungry coin. Cursed. Will attempt to eat other coins that it comes into contact with. Eats 100 coins an hour.
|
23
|
+
Armor of Glamour. Looks like a fancy dinner suit. Is actually a suit of plate mail.
|
24
|
+
Ring of Good Omen. The first time you fail a save against a curse or other magic, the ring breaks and you instead make your save.
|
25
|
+
Prayer of the Seal. When this sheet of paper is attached to a door or portal, it become locked (until the paper is removed or destroyed.)
|
26
|
+
Boots of the Aristocrat. When you click them together, your clothes become clean, your skin becomes perfumed, and your hair is styled.
|
27
|
+
Cursed matches (1d6). When lit, the match does not ignite. Instead, whatever the PC is looking at catches fire. (Tiny match-sized fire. Does no damage unless allowed to progress.)
|
28
|
+
Preservative jar. Anything placed in this jar enters stasis. Cannot hold anything bigger than a toad. Currently holds a toad.
|
29
|
+
Library Box. When a non-magical book is placed inside it, another of the same type will be found there the next day.
|
30
|
+
Monocle of Entropy. If you stare at something long enough, it will fall over. 1 round for a candlestick, 1 minute for a sleeping cow, 1 hour for a small tree, 1 day for a cottage or large tree, 1 week for a castle. Must be within 100'.
|
31
|
+
Girdle of Masculinity/Femininity. Non-cursed because that's way more fun.
|
32
|
+
Stick of the Titan. Hits for 2d8, then breaks.
|
33
|
+
Singing frog. Knows 1d6 songs. Good for a free round of drinks in pretty much any bar you walk in to, with only a 20% chance that someone will try to steal it from you at the end of the night.
|
34
|
+
Perpetual motion machine. Utterly unremarkable in a world filled with magic, but still cool.
|
35
|
+
Seed of Moon Ice. If dropped in a body of water, will "freeze" an area up to 20' diameter. If swallowed, you die. If touched, save or die. Leaves awesomely frozen corpses that are not cold to the touch and never thaw.
|
36
|
+
Small broom. When activated, will attempt to clean the dirtiest thing nearby.
|
37
|
+
Black cat, winged. When you tap it on the nose, it enters stasis. (This is why you found it in a treasure chest.)
|
38
|
+
Blindfold of the Spirits. When worn, you can attack incorporeal things as if they weren't. Also, you're blind.
|
39
|
+
Night's Black Windchimes. 25% chance of alerting you when you would be attacked during the night. If one of the 1d6+1 chimes is broken in half, a refreshing (but also quite cold) breeze blows through the area.
|
40
|
+
Dust of Vermicide. When thrown, does 1 damage to everything in a 5' diameter area. Alternatively, does 2d6 damage against a swarm.
|
41
|
+
Sovereign Glue.
|
42
|
+
Universal Solvent.
|
43
|
+
Goblin cloak. Invisible while in shadowy areas, but stinks like a mound of goblin shit.
|
44
|
+
Miser's Flute. When played, all unsecured coins in 20' will leap up and roll after you. They will follow you as long as you play, and as fast as normal running speed. Uphill is fine, stairs are not.
|
45
|
+
Donkey Legs. These wooden donkey legs can be attached to anything (but are not strong enough to carry literally anything). Once attached, the thing will follow you around like a loyal donkey. For example, you can attach them to a heavy statue and then have it walk itself out of the dungeon. Donkey legs are as strong as two donkeys!
|
46
|
+
Giant's Ochre. Anything painted with this pigment will double in size. Washes off easily with water or sweat. (If you paint yourself, it'll wash off after 1d6 rounds of sweaty combat).
|
47
|
+
Mask of the Jester. Anyone seeing it for the first time must save vs charm or be compelled to attack the wearer.
|
48
|
+
Eye of Zin. If this jewel is pressed into the forehead, the wearer's eyes turn jet black, they gain darkvision, and they are blinded by even small amounts of light (a nearby torch will blind them, for example).
|
49
|
+
Metal Eye Mask. Wearing this mask obscures you normal vision, but allows you to see from above, sort of like an orbital satellite's view. At sea level, you can see an area 200' in diameter, centered on the mask.
|
50
|
+
Pink Bead. When smashed on the ground, immediately turns into a huge mountain of fluffy bubbles, similar in consistency to a mass of fused marshmallows. Can cushion a fall or block a hallway or something. 10' in diameter, can be cut through with 6 slashing attacks, lasts 1d6 minutes.
|
51
|
+
Animate rope with the personality of a loyal dog. 50'. Must be taught knots the way a dog must be taught tricks.
|
@@ -2,13 +2,13 @@ class ListLoader
|
|
2
2
|
class << self
|
3
3
|
def load genre=@genre
|
4
4
|
Dir[DEFAULT_GENRE].each(&method(:expose_palettes))
|
5
|
-
load_genre(genre).each(&method(:expose_palettes))
|
5
|
+
load_genre(genre).each(&method(:expose_palettes))
|
6
6
|
end
|
7
7
|
|
8
8
|
private
|
9
9
|
PALETTE_TITLE = /^\|(.*?)\n/
|
10
10
|
GAP_BETWEEN_LISTS = /\n(?=\|)/
|
11
|
-
DEFAULT_GENRE = File.join(*%W(#{File.dirname(__FILE__)} .. ..
|
11
|
+
DEFAULT_GENRE = File.join(*%W(#{File.dirname(__FILE__)} .. .. default-genre ** *))
|
12
12
|
|
13
13
|
def load_genre dirname
|
14
14
|
Dir[File.join(dirname, '**' '*')]
|
data/lib/dunmanifestin/phrase.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'active_support/inflector'
|
2
|
+
require_relative 'custom_inflections'
|
2
3
|
|
3
4
|
class Phrase
|
4
|
-
def self.list new_list = nil
|
5
|
+
def self.list new_list = nil, multiline_document = false
|
5
6
|
return (@list || []) unless new_list
|
6
7
|
|
7
|
-
if new_list.is_a?
|
8
|
-
|
9
|
-
end
|
8
|
+
new_list = new_list.split_on_newlines_and_strip if new_list.is_a?(String) unless multiline_document
|
9
|
+
new_list = [new_list] if multiline_document
|
10
10
|
|
11
11
|
new_list.map! do |line|
|
12
12
|
multiplier_regex = /^\d+@/
|
@@ -52,11 +52,7 @@ class Phrase
|
|
52
52
|
begin
|
53
53
|
@variable_classes << "Phrase::#{rough_var_class.camelize}".constantize
|
54
54
|
rescue NameError
|
55
|
-
@variable_classes <<
|
56
|
-
def initialize
|
57
|
-
@to_s_proc = -> { "{#{rough_var_class} ??}" }
|
58
|
-
end
|
59
|
-
end|)
|
55
|
+
@variable_classes << empty_phrase_class(rough_var_class)
|
60
56
|
end
|
61
57
|
end
|
62
58
|
|
@@ -127,6 +123,7 @@ class Phrase
|
|
127
123
|
def possessive?; !!@possessive end
|
128
124
|
def article?; !!@article end
|
129
125
|
def capitalize?; !!@capitalize end
|
126
|
+
def titleize?; !!@titleize end
|
130
127
|
|
131
128
|
def plural!
|
132
129
|
@plural = true
|
@@ -164,6 +161,15 @@ class Phrase
|
|
164
161
|
self
|
165
162
|
end
|
166
163
|
|
164
|
+
def titleize!
|
165
|
+
@titleize = true
|
166
|
+
|
167
|
+
@inflection_delegates[:capitalize].each do |delegate|
|
168
|
+
variables[delegate].capitalize!
|
169
|
+
end
|
170
|
+
self
|
171
|
+
end
|
172
|
+
|
167
173
|
def to_s
|
168
174
|
render_inflections @to_s_proc.call
|
169
175
|
end
|
@@ -193,7 +199,23 @@ class Phrase
|
|
193
199
|
end
|
194
200
|
|
195
201
|
string = string[0].capitalize + string[1 .. -1] if capitalize?
|
202
|
+
string = string.titleize if titleize?
|
196
203
|
|
197
204
|
string
|
198
205
|
end
|
206
|
+
|
207
|
+
private
|
208
|
+
|
209
|
+
def empty_phrase_class name
|
210
|
+
class_definition = <<-RUBY
|
211
|
+
Class.new(Phrase) do
|
212
|
+
def initialize
|
213
|
+
@to_s_proc = -> { "{#{name} ??}" }
|
214
|
+
end
|
215
|
+
end
|
216
|
+
RUBY
|
217
|
+
|
218
|
+
eval(class_definition)
|
219
|
+
end
|
220
|
+
|
199
221
|
end
|