chaos_scenario 0.1 → 0.2

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.
data/README.md CHANGED
@@ -1,3 +1,21 @@
1
1
  # Chaos Scenario
2
2
 
3
3
  A random scenario generator.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ $ gem install chaos_scenario
9
+ ```
10
+
11
+ ...or in your Gemfile:
12
+
13
+ ```txt
14
+ require 'chaos_scenario'
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ruby
20
+ ChaosScenario.ensue
21
+ ```
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "chaos_scenario"
3
- s.version = "0.1"
3
+ s.version = "0.2"
4
4
  s.authors = ["Paul Meskers"]
5
5
  s.email = ["paul@paulmeskers.com"]
6
6
  s.files = `git ls-files`.split("\n")
@@ -7,8 +7,11 @@ module ChaosScenario
7
7
  autoload :Generator, 'chaos_scenario/generator'
8
8
 
9
9
  def self.ensue
10
- puts ROOT_PATH
11
10
  Generator.create_scenario
12
11
  end
13
12
 
13
+ def self.ensue!
14
+ puts Generator.create_scenario
15
+ end
16
+
14
17
  end
@@ -2,13 +2,35 @@ module ChaosScenario
2
2
  module Generator
3
3
  extend self
4
4
 
5
- def create_scenario
6
- puts "A #{protagonist} #{placement} #{location} #{goal}"
5
+ def create_scenario definition=:scenario
6
+ scenario = create_string(definition) << "."
7
+ scenario[0].upcase!
8
+ scenario
7
9
  end
8
10
 
9
- def method_missing classifier
10
- list = YAML.load_file("#{ROOT_PATH}/data/#{classifier}s.yml")
11
- list["#{classifier}s"].sample
11
+ def create_string type
12
+ list = YAML.load_file("#{ROOT_PATH}/data/#{type}s.yml")
13
+ input = list["#{type}s"].sample
14
+
15
+ phrase = []
16
+ input.split(" ").each do |word|
17
+ if word[0] == '@'
18
+ phrase << create_string(word[1..-1])
19
+ else
20
+ phrase << word
21
+ end
22
+ end
23
+
24
+ full_phrase = phrase.flatten.join(" ")
25
+ full_phrase.gsub!(" ,", ",")
26
+ full_phrase.gsub!(" 's", "'s")
27
+
28
+ # Take care of a/an
29
+ while (pos = full_phrase.rindex(/(^| )a [aeiou]/i)) != nil
30
+ full_phrase[pos] = "an"
31
+ end
32
+
33
+ full_phrase
12
34
  end
13
35
 
14
36
  end
@@ -0,0 +1,6 @@
1
+ antagonists:
2
+ - Lord Dracula
3
+ - the @descriptor djinn of @origin
4
+ - the tyrant of @origin
5
+ - the spider queen
6
+ - the Cult of the @item
@@ -0,0 +1,7 @@
1
+ attempts:
2
+ - looking for
3
+ - attempting to find
4
+ - searching for
5
+ - seeking
6
+ - yearning for
7
+ - on a quest to find
@@ -0,0 +1,14 @@
1
+ descriptors:
2
+ - retired
3
+ - corrupt
4
+ - possessed
5
+ - innocent
6
+ - childish
7
+ - wise
8
+ - magical
9
+ - elderly
10
+ - powerful
11
+ - vengeful
12
+ - blood-stained
13
+ - divine
14
+ - lovesick
data/lib/data/goals.yml CHANGED
@@ -1,3 +1,17 @@
1
1
  goals:
2
- - looking for love
3
- - trying to get home
2
+ - love
3
+ - a home
4
+ - the only known antidote
5
+ - peace of mind
6
+ - the way out
7
+ - revenge
8
+ - vengeance
9
+ - money and fortune
10
+ - hidden treasure
11
+ - their lost loved one
12
+ - a powerful artifact
13
+ - to find the sacred @item
14
+ - to destroy @antagonist 's @item
15
+ - raze the lair of @antagonist
16
+ - to recover their mother 's @item
17
+ - to defeat @antagonist
@@ -0,0 +1,11 @@
1
+ items:
2
+ - saxophone
3
+ - pumpkin
4
+ - armchair
5
+ - half-finished novel
6
+ - broadsword
7
+ - Artifact
8
+ - piano
9
+ - Spirit Orb
10
+ - seashell
11
+ - executioner's axe
@@ -2,3 +2,18 @@ locations:
2
2
  - a nether world
3
3
  - the ruins of an ancient civilization
4
4
  - abandoned subway tunnels
5
+ - a mystical forest
6
+ - an underground labyrinth
7
+ - the botanical gardens
8
+ - Dracula's castle
9
+ - a dilapidated industrial facility
10
+ - a haunted apartment complex
11
+ - the underworld
12
+ - a ghostly pirate ship
13
+ - the seedy underbelly of @origin
14
+ - a vast desert
15
+ - the rocky shoreline of @origin
16
+ - the chamber of the @item
17
+ - a treetop metropolis
18
+ - a graveyard
19
+ - the crater of a volcano
@@ -0,0 +1,9 @@
1
+ origins:
2
+ - the North
3
+ - the South
4
+ - the East
5
+ - the West
6
+ - the Forgotten Lands
7
+ - the Silent Realm
8
+ - the Void
9
+ - the Sunken Peaks
@@ -3,3 +3,10 @@ placements:
3
3
  - in the depths of
4
4
  - at the edge of
5
5
  - hiding in
6
+ - lost in
7
+ - overlooking the sprawl of
8
+ - dreaming of
9
+ - at the center of
10
+ - in the outskirts of
11
+ - inside
12
+ - standing before
@@ -1,4 +1,19 @@
1
1
  protagonists:
2
- - man
3
2
  - goat
4
3
  - wizard
4
+ - monk
5
+ - sorceress
6
+ - child
7
+ - sheep
8
+ - warrior
9
+ - ninja
10
+ - samurai
11
+ - pilot
12
+ - spaceship captain
13
+ - blacksmith
14
+ - shaman
15
+ - priestess
16
+ - vampire
17
+ - demon
18
+ - door-to-door salesman
19
+ - anthromorphic @item
@@ -0,0 +1,7 @@
1
+ roles:
2
+ - Guardian of the @item
3
+ - Defender of the @item
4
+ - Protector of the @item
5
+ - local hero
6
+ - Inquisitor
7
+ - master of lies
@@ -0,0 +1,5 @@
1
+ scenarios:
2
+ - A @descriptor @protagonist @placement @location , @attempt @goal
3
+ - A @protagonist @placement @location , @attempt @goal
4
+ - A @descriptor @protagonist from @origin @placement @location , @attempt @goal
5
+ - The @role , a @protagonist , @attempt @goal @placement @location
metadata CHANGED
@@ -1,70 +1,62 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: chaos_scenario
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- version: "0.1"
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ prerelease:
9
6
  platform: ruby
10
- authors:
7
+ authors:
11
8
  - Paul Meskers
12
9
  autorequire:
13
10
  bindir: bin
14
11
  cert_chain: []
15
-
16
- date: 2012-09-30 00:00:00 -04:00
17
- default_executable:
12
+ date: 2012-10-02 00:00:00.000000000 Z
18
13
  dependencies: []
19
-
20
14
  description:
21
- email:
15
+ email:
22
16
  - paul@paulmeskers.com
23
17
  executables: []
24
-
25
18
  extensions: []
26
-
27
19
  extra_rdoc_files: []
28
-
29
- files:
20
+ files:
30
21
  - .gitignore
31
22
  - README.md
32
23
  - chaos_scenario.gemspec
33
24
  - lib/chaos_scenario.rb
34
25
  - lib/chaos_scenario/generator.rb
26
+ - lib/data/antagonists.yml
27
+ - lib/data/attempts.yml
28
+ - lib/data/descriptors.yml
35
29
  - lib/data/goals.yml
30
+ - lib/data/items.yml
36
31
  - lib/data/locations.yml
32
+ - lib/data/origins.yml
37
33
  - lib/data/placements.yml
38
34
  - lib/data/protagonists.yml
39
- has_rdoc: true
35
+ - lib/data/roles.yml
36
+ - lib/data/scenarios.yml
40
37
  homepage:
41
- licenses:
38
+ licenses:
42
39
  - MIT
43
40
  post_install_message:
44
41
  rdoc_options: []
45
-
46
- require_paths:
42
+ require_paths:
47
43
  - lib
48
- required_ruby_version: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- segments:
53
- - 0
54
- version: "0"
55
- required_rubygems_version: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- segments:
60
- - 0
61
- version: "0"
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
62
56
  requirements: []
63
-
64
57
  rubyforge_project:
65
- rubygems_version: 1.3.6
58
+ rubygems_version: 1.8.24
66
59
  signing_key:
67
60
  specification_version: 3
68
61
  summary: Generate random scenarios or plots.
69
62
  test_files: []
70
-