dunmanifestin 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a03c9a49c939ede783019bf96c30c78ecc8da467
4
- data.tar.gz: 94c48fa2ccfce6eb50e4d260f8e491b914daa048
3
+ metadata.gz: a2143a6987f15b05dfbf4f69b71779c301eceab4
4
+ data.tar.gz: 0651b4efe3c773a6b6f232212e51200c0195b9b1
5
5
  SHA512:
6
- metadata.gz: e27e5770e85c523f3183019cb265fc3fb32fb6a5188a9808f80a4010996e3a8ab3691ad5f5207da907b4a3321afd296b24ed080379fb22d47c71c2ab162a25ea
7
- data.tar.gz: 16f143e4be5d5c5d40f562a0911c6334377d88e8ba62f335e615440e76e792f22384e823f0d58bcd42ac8ef40c3ddf180492121f2e5135916777f4aad2efdf4c
6
+ metadata.gz: 2b6b5c97220bbcd08798b3b666505b5e3cb5487eeb3de1976f731a3948ad864f7136bc45b61c866ebf5c00911c9eaf2949907d53286fd1a909b98411eca94c3a
7
+ data.tar.gz: 65d95d634c347bad6bdcb8bded9353641fd17497c6df4e45277cf4cd83addf32933fac484fedf3d333c7bbe11df9c3d3517abd2934eb30ec16865f68c2673f70
@@ -8,7 +8,7 @@ user_demands = Trollop::options do
8
8
  opt :interactive, "Use an interactive command prompt", short: '-i'
9
9
  opt :count, "Specify how many lines of output to generate at once", type: :integer, short: '-n'
10
10
  opt :copy, "Copies manifestation into your clipboard", short: '-c'
11
- opt :genre, "Specify a genre, e.g. '-g scifi'", type: :string, short: '-g', default: 'default'
11
+ opt :genre, "Specify a genre by filepath, e.g. '-g lists/scifi/'", type: :string, short: '-g', default: 'default'
12
12
  opt :phrase, "Specify a phrase or list, e.g. 'The [animal] sat on the [article]' or '[weapon]'", type: :string, short: '-p'
13
13
  opt :chomp, "remove the trailing newline from the output", short: '-h'
14
14
  opt :file, "Read a file as the phrase", type: :string, short: '-f'
@@ -6,9 +6,10 @@ class List
6
6
  @members = opts.fetch(:members, [])
7
7
  @universe = opts.fetch(:universe)
8
8
  @universe.lists[name] = self
9
+ puts members
9
10
  end
10
11
 
11
-
12
+
12
13
  def << rough_member
13
14
  pieces = rough_member.split('@')
14
15
 
@@ -20,11 +21,11 @@ class List
20
21
 
21
22
  weight.times { members << member }
22
23
  end
23
-
24
+
24
25
  def sample
25
26
  members.sample
26
27
  end
27
28
 
28
- private
29
+ private
29
30
  attr_accessor :members, :universe
30
- end
31
+ end
@@ -1,42 +1,50 @@
1
1
  class ListLoader
2
2
  class << self
3
3
  def load genre=@genre
4
- Dir[list_dir('default')].each(&method(:create_list_from))
5
- Dir[list_dir(genre)].each(&method(:create_list_from)) unless genre == 'default'
4
+ Dir[DEFAULT_GENRE].each(&method(:expose_palettes))
5
+ load_genre(genre).each(&method(:expose_palettes)) unless genre == 'default'
6
6
  end
7
7
 
8
8
  private
9
+ PALETTE_TITLE = /^\|(.*?)\n/
10
+ GAP_BETWEEN_LISTS = /\n(?=\|)/
11
+ DEFAULT_GENRE = File.join(*%W(#{File.dirname(__FILE__)} .. .. lists default ** *))
9
12
 
10
- def list_dir(genre)
11
- dir_of_this_file = File.dirname(__FILE__)
12
- File.join(*%W(#{dir_of_this_file} .. .. lists #{genre} ** *))
13
+ def load_genre dirname
14
+ Dir[File.join(dirname, '**' '*')]
13
15
  end
14
16
 
15
- def create_list_from path
16
- newlines_before_a_pipe = /\n(?=\|)/
17
- everything_up_to_the_first_newline_if_first_character_is_a_pipe = /^\|(.*?)\n/
18
- everything_after_the_last_slash = /\/.+$/
17
+ def expose_palettes path
18
+ File.open(path).read.split(GAP_BETWEEN_LISTS)
19
+ .each &method(:expose_swatches)
20
+ end
19
21
 
20
- lists = File.open(path).read.split(newlines_before_a_pipe)
21
- lists.each_with_index do |_list, i|
22
- list_name = _list.match(everything_up_to_the_first_newline_if_first_character_is_a_pipe)[1].to_s
22
+ def expose_swatches body
23
+ list_name = body.match(PALETTE_TITLE)[1].to_s
23
24
 
24
25
  if list_name.empty?
25
- list_name = path.match(everything_after_the_last_slash).to_s
26
+ # This seems to support palettes without |explicitTitles,
27
+ # Taking them from the filename, instead.
28
+ list_name = Pathname.new(path).basename
26
29
  else
27
- _list.gsub!(everything_up_to_the_first_newline_if_first_character_is_a_pipe, '')
30
+ # Do not include palette title as a swatch
31
+ # These comments should be tests.
32
+ body.gsub!(PALETTE_TITLE, '')
28
33
  end
29
34
 
30
- phrase_class_name = list_name.underscore.camelize
31
- begin
32
- qlass = "Phrase::#{phrase_class_name}".constantize
33
- rescue NameError
34
- qlass = Class.new(Phrase)
35
- Phrase.const_set phrase_class_name, qlass
36
- end
35
+ # This metaprogramming is mysterious to me.
36
+ qlass = declare_phrase_class list_name
37
+ # Where is 'list' defined?
38
+ qlass.list body
39
+ end
37
40
 
38
- qlass.list(_list)
39
- end
41
+ def declare_phrase_class list_name
42
+ name = list_name.underscore.camelize
43
+ qlass = "Phrase::#{name}".constantize
44
+ rescue NameError
45
+ # This seems to always happen.
46
+ qlass = Class.new(Phrase)
47
+ Phrase.const_set name, qlass
40
48
  end
41
49
  end
42
50
  end
@@ -3,45 +3,36 @@
3
3
  [nonPreciousMetal] shovel
4
4
  [nonPreciousMetal] trawl
5
5
  [nonPreciousMetal] sword
6
+ [utensil]
7
+ [instrument]
8
+ [tool]
9
+ [weapon]
10
+ [vestment]
11
+
12
+ |utensil
13
+ bowl
6
14
  bowl made of [hardMaterial]
7
15
  wand made of [hardMaterial]
16
+ knife
17
+ spoon
18
+ wand
19
+ orb
20
+
21
+ |instrument
22
+ whistle
23
+ pipe
24
+ pipe made of [hardMaterial]
25
+ bagpipe
26
+
27
+ |tool
8
28
  [metal] axe
9
29
  [metal] knife
10
30
  shovel
11
31
  trawl
12
- sword
13
- axe
14
32
  plough
15
- bowl
16
33
  knife
17
34
  hammer
18
- club
19
- spoon
20
- bow
21
- spear
22
- staff
23
- gun
24
- dagger
25
- crossbow
26
- wand
27
- mace
28
- polearm
29
- cannon
30
- halberd
31
- orb
32
- lance
33
35
  power saw
34
- whistle
35
- pipe
36
- pipe made of [hardMaterial]
37
- shield
38
- javelin
39
- claw
40
36
  peg leg
41
37
  hook for a hand
42
- scimitar
43
- fuzzy hat
44
- flail
45
- bagpipe
46
- book
47
-
38
+ crowbar
@@ -3,8 +3,8 @@
3
3
  10@[structure]
4
4
 
5
5
  |settlement
6
- [placeName], [settlementType.article] built on [geologicalFormation.article] in [province]. [settlementDetail]
6
+ [placeName], [settlementType.article] built on [geologicalFormation.article] in [province] and [settlementDetail]
7
7
 
8
8
  |structure
9
- [placeName], [structureType.article] built on [geologicalFormation.article] in [province]. [structureDetail]
9
+ [placeName], [structureType.article] built on [geologicalFormation.article] in [province] and [structureDetail]
10
10
 
@@ -1,6 +1,6 @@
1
1
  |settlementDetail
2
- Its economy is based on [economy].
3
- It is known for its many [buildingType.plural] and [quality] populace.
4
- It is known for being the home of [denizen].
5
- It was once a thriving hub of [facetOfCulture].
6
- The inhabitants are [attitude] towards [race.plural].
2
+ well-known to have an economy based on [economy]
3
+ known for its many [buildingType.plural] and [quality] populace
4
+ known for being the home of [denizen]
5
+ known to be a once-thriving hub of [facetOfCulture]
6
+ infamous for inhabitants who are [attitude] towards [race.plural]
@@ -1,8 +1,8 @@
1
1
  |structureDetail
2
- It was once attacked by [personName] and [group.article] of [raceOrProfession.plural] with [baseItem.plural].
3
- It was once attacked by [denizen].
4
- It is rumored that beneath its foundations, lies the treasure of [personName]: [artefact].
5
- It is rumored to be haunted by the ghost of [person]
6
- It is said to contain many priceless artifacts made of [hardMaterial].
7
- Some say it contains priceless [baseItem.plural] made of [hardMaterial].
2
+ famous for being the target of an attack by [personName] and [group.article] of [raceOrProfession.plural] with [baseItem.plural]
3
+ famous for being the target of an attack by [denizen]
4
+ rumored to hide the treasure of [personName] beneath its foundations: [artefact]
5
+ rumored to be haunted by the ghost of [person]
6
+ said to contain many priceless artifacts made of [hardMaterial]
7
+ said to contain many [baseItem.plural] made of [hardMaterial]
8
8
 
@@ -1,7 +1,8 @@
1
- |clothing
1
+ |vestment
2
2
  10@pair of boots
3
3
  2@pair of sandals
4
4
  2@pair of leggings
5
5
  2@headdress
6
6
  5@hat
7
7
  2@helmet
8
+ fuzzy hat
@@ -3,6 +3,21 @@
3
3
  2@[bow#plural]
4
4
  [bow#plural] and [arrow.plural]
5
5
  2@[knife#plural]
6
+ axe
7
+ club
8
+ bow
9
+ spear
10
+ staff
11
+ gun
12
+ mace
13
+ polearm
14
+ cannon
15
+ halberd
16
+ lance
17
+ shield
18
+ javelin
19
+ claw
20
+ flail
6
21
 
7
22
  |sword
8
23
  [nonPreciousMetal] [swordType#plural]
@@ -51,6 +66,7 @@ barbed [arrowType#plural]
51
66
 
52
67
  |arrowType
53
68
  arrow
69
+ bolt
54
70
 
55
71
  |arrowShaftType
56
72
  shaft
@@ -68,82 +84,10 @@ shaft
68
84
  [itemQuality] [knifeType#plural] inlaid with [preciousMetal]
69
85
  [itemQuality] [knifeType#plural] with [preciousStone.article] on the handle
70
86
  [itemQuality] [knifeType#plural] encrusted with [preciousStone.plural]
71
- [nonPreciousMetal] [knifeType#plural] named [weaponName] [weaponEpithet]
87
+ [nonPreciousMetal] [knifeType#plural] named [weaponName]
72
88
 
73
89
  |knifeType
74
90
  5@knife
75
91
  hunting knife
76
92
  dagger
77
93
  cleaver
78
-
79
- |weaponName
80
- 6@[weaponNameInitial][weaponNameVowel][weaponNameConsonant][weaponNameSuffix]
81
- 2@[weaponNameInitial][weaponNameVowel][weaponNameConsonant]
82
- [weaponNameInitialVowel][weaponNameConsonant][weaponNameVowel][weaponNameConsonant]
83
- [weaponNameInitialVowel][weaponNameConsonant][weaponNameVowel][weaponNameConsonant][weaponNameSuffix]
84
- [name]
85
- [weaponName]-[weaponName]
86
-
87
- |weaponNameInitial
88
- Kr
89
- Gr
90
- Gl
91
- K
92
- G
93
- D
94
- Th
95
- Ch
96
- S
97
- Sh
98
- Dr
99
-
100
- |weaponNameVowel
101
- 3@a
102
- 3@o
103
- 2@au
104
- 2@i
105
- u
106
- e
107
- aa
108
-
109
- |weaponNameInitialVowel
110
- 3@A
111
- 3@O
112
- 2@Au
113
- 2@I
114
- U
115
- E
116
-
117
- |weaponNameConsonant
118
- n
119
- l
120
- r
121
- sh
122
- th
123
- dh
124
- rh
125
- lh
126
- g
127
-
128
- |weaponNameSuffix
129
- or
130
- ex
131
- ic
132
- il
133
- tar
134
- gar
135
- og
136
- rok
137
- nor
138
- w
139
- rist
140
- anz
141
- az
142
-
143
- |weaponEpithet
144
- [race]bane
145
- [monster]bane
146
- the [monster]-slayer
147
- slayer of [monster.plural]
148
- bane of [monster.plural]
149
- terror of [race.plural]
@@ -0,0 +1,72 @@
1
+ |weaponName
2
+ 6@[weaponNameInitial][weaponNameVowel][weaponNameConsonant][weaponNameSuffix]
3
+ 2@[weaponNameInitial][weaponNameVowel][weaponNameConsonant]
4
+ [weaponNameInitialVowel][weaponNameConsonant][weaponNameVowel][weaponNameConsonant]
5
+ [weaponNameInitialVowel][weaponNameConsonant][weaponNameVowel][weaponNameConsonant][weaponNameSuffix]
6
+ [name]
7
+ [weaponName]-[weaponName]
8
+ [weaponName] [weaponEpithet]
9
+
10
+ |weaponNameInitial
11
+ Kr
12
+ Gr
13
+ Gl
14
+ K
15
+ G
16
+ D
17
+ Th
18
+ Ch
19
+ S
20
+ Sh
21
+ Dr
22
+
23
+ |weaponNameVowel
24
+ 3@a
25
+ 3@o
26
+ 2@au
27
+ 2@i
28
+ u
29
+ e
30
+ aa
31
+
32
+ |weaponNameInitialVowel
33
+ 3@A
34
+ 3@O
35
+ 2@Au
36
+ 2@I
37
+ U
38
+ E
39
+
40
+ |weaponNameConsonant
41
+ n
42
+ l
43
+ r
44
+ sh
45
+ th
46
+ dh
47
+ rh
48
+ lh
49
+ g
50
+
51
+ |weaponNameSuffix
52
+ or
53
+ ex
54
+ ic
55
+ il
56
+ tar
57
+ gar
58
+ og
59
+ rok
60
+ nor
61
+ w
62
+ rist
63
+ anz
64
+ az
65
+
66
+ |weaponEpithet
67
+ [race]bane
68
+ [monster]bane
69
+ the [monster]-slayer
70
+ slayer of [monster.plural]
71
+ bane of [monster.plural]
72
+ terror of [race.plural]
@@ -0,0 +1,28 @@
1
+ |familiarPlace
2
+ Athcoham, a village built on a canyon in Nophece-Tela and once a thriving hub of economics.
3
+ Foxpale, a catacomb built on a canyon in Tilre and famous for being the target of an attack by Nohte Arrowson, an ugly, stubborn thief with a longsword and a great love of meat
4
+ Tedshohall, a catacomb built on an isthmus in Take-Nohsa and rumored to be haunted by the ghost of Glebe Witchson, a violent orc
5
+ Taiwalk, a museum built on a cliff in Tuin and famous for being the target of an attack by Rile Shoreec and a pair of bards with
6
+ Shoredell, a keep built on an island in Kehitas and said to contain many lances made of opal
7
+
8
+ |familiarPerson
9
+ Nohte Arrowson of Athcoham, an ugly, stubborn thief with a longsword and a great love of meat
10
+ the ghost of Glebe Witchson, a violent orc
11
+ Nilnenu Kineeld, a frighteningly lazy orc
12
+ Frisele the Anxious, a pretty, bisexual farmer
13
+ Hities Keashebury, an industrious ranger
14
+ Pyif of Taiwalk, a fat, quiet hobgoblin-kobold hybrid
15
+ Thomrade Owlred, a rugged, calm elf
16
+ Sinlonis Heshath, a tall, emotional orc
17
+ Kobjak Lela, a slightly unfortunate kobold
18
+ Hirela of Nadezwalk, an attractive, domineering human
19
+ Chareig Redec, an ethereal kobold slave
20
+
21
+ |familiarThing
22
+ Uncha, the claw which turns into an eagle when sung to.
23
+ Pizterf, the lance whose wielders are cursed to hunger for the flesh of human
24
+ Friyck, the fuzzy hat which never loses its edge
25
+ Isoas, the wand made of gold which contains the trapped souls of its every victim
26
+ Taci, the lance about-which-no-sound-travels
27
+ Loghtry, the wand which glows when sung to
28
+ Chardess, the orb which cannot harm a human
@@ -0,0 +1,11 @@
1
+ |plotHook
2
+ A child in a nearby settlement is said to be possessed, upon investigation it becomes apparent that everyone but the child has been overtaken.
3
+ The sentries of a nearby estate have become sentient and have begun murdering and experimenting on its residents.
4
+ An unearthed obelisk has been brought back to town for study. The sun has not risen since, and strange, unspeakable deaths have become commonplace.
5
+ [person], a member of the local government, is rumored to never age, and is purportedly found in several paintings dating back centuries.
6
+ A fallen star has crashed into [place]. Starry eyed, long dead relatives return home and attempt to resume their lives where they left off.
7
+ A small group of feral children is discovered in the nearby wilds, attempting to care for them has proved to be a bloody endeavor for locals.
8
+ A mysterious stranger visits the players and leaves them with a velvet pouch containing an iron idol, said to be the sixth and final horcrux of God from a time beyond time.
9
+ Local children have recently been committing suicide in various ways, after death, they reanimate and walk slowly, indomitably toward the abandoned manor house.
10
+ The local job board contains a high-paying babysitting job for just one night which also happens to take place during an unprecedented astrological event.
11
+ While traveling and passing through a thick, mysterious fog, the party finds themselves lost in a strange place . The lands here are home to cannibals and abominations who stalk them from treetop and cave depths. Grotestque effigies made of humanoid remains scatter the landscape.
@@ -1,2 +1,2 @@
1
1
  |root
2
- I like hats.
2
+ meet [familiarPerson] in [familiarPlace]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dunmanifestin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - quavmo
@@ -10,8 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-27 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2014-11-29 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: trollop
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rspec
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
15
43
  description: The point of Dunmanifestin [is] to inject chaos into humans' cliched
16
44
  ideas or, at least, let them be hunter-gatherers instead of farmers of culture.
17
45
  -- B. Christel
@@ -44,7 +72,6 @@ files:
44
72
  - lists/default/baggage
45
73
  - lists/default/baseItem
46
74
  - lists/default/buildingType
47
- - lists/default/clothing
48
75
  - lists/default/color
49
76
  - lists/default/container
50
77
  - lists/default/curse
@@ -114,11 +141,15 @@ files:
114
141
  - lists/default/structureType
115
142
  - lists/default/superpower
116
143
  - lists/default/topicOfConversation
144
+ - lists/default/vestment
117
145
  - lists/default/weapon
146
+ - lists/default/weaponName
118
147
  - lists/default/wearable
119
148
  - lists/default/wearableQuality
120
149
  - lists/default/weildable
121
150
  - lists/default/welshName
151
+ - lists/gritty-horror-fantasty/familiarPlace
152
+ - lists/gritty-horror-fantasty/plotHook
122
153
  - lists/gritty-horror-fantasty/root
123
154
  - lists/huoquitlan/originalAnimal
124
155
  - lists/huoquitlan/originalDenizen