dunmanifestin 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZGY3OWM3NzkwOWIwZmNjYjllYjlkMWUzMzIwOWE5ZmU2YzY5MDhkNA==
5
- data.tar.gz: !binary |-
6
- MmZhYjIwYWYyOWU3ZjkzYWFmMGMyN2U1YzE3NDY4NmE2N2YwZGQzYQ==
2
+ SHA1:
3
+ metadata.gz: e40ee6b7d4f94357e4aceece03bb97a1785104fc
4
+ data.tar.gz: d7ab9c6d30676dd2bcac92b189940d628e14f53b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MDdjOGY5ODNiOTMyYzViNmIwNjUwN2RjNjViOTk4ZGQxYWEyMmQ2ZmM4NmY4
10
- YjVlYmI0ZDRmNGRjNjBlYTdmNzU3N2Q0MmVhY2ViZmQyZjVjMDA0MmNkZDgx
11
- MzI3MTAyODA4NWIwMTEzNDIwYmU4MzY1Zjg5NzFiYTJlNzIyYmY=
12
- data.tar.gz: !binary |-
13
- M2U3MWZmNjUwM2FhZWNlZjg1M2Y1M2VlZDA0MTdkNDhmMDRlNjQzNDAxM2Mx
14
- N2EzNjg4ZTliOWEyMDQ3YzNjMTc1OWRjMDk4Yzk3NzA4NmZlNmFiNzhjMWMw
15
- ZjI5MDJmNGM4YjU0OTc3MjEwZTc3M2VjMzA3ZDFkMDAzNjcxYWM=
6
+ metadata.gz: 071ebd150957ca2407f263a8bf79b815a3bb08f740f7113936054b953793d9ebb0da7ada53f4d05d5f0516f1a1fc43f63c1cea7cacaec8f920b658c69471651c
7
+ data.tar.gz: 3f29e20d24f0abc5fc021a45a12e754e1fdf2fe232df8fd4a398b4180ea90ae49d650e5e330a5f7d940e145d08d28f4ac28fc91ebe5052fe29990046829f5889
data/bin/dunmanifestin CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'dunmanifestin'
3
+ require 'trollop'
4
+ require_relative '../lib/dunmanifestin'
4
5
 
5
6
  user_demands = Trollop::options do
6
7
  opt :debug, "Display errors and logging", short: '-d'
@@ -17,31 +18,32 @@ def get_from_prompt
17
18
  gets.chomp
18
19
  end
19
20
 
21
+ def print_interactive_banner
22
+ print "---------------------------------------------------------------------\n"+
23
+ "Type 'quit' to exit the prompt. Press return to generate more output.\n"+
24
+ "---------------------------------------------------------------------\n\n"
25
+ end
26
+
20
27
  begin
21
28
  root_phrase_class = Class.new(Phrase) { list user_demands[:phrase] }
22
29
  ListLoader.new(user_demands[:genre]).load
23
30
 
24
- if user_demands[:interactive]
25
- print "---------------------------------------------------------------------\n"+
26
- "Type 'quit' to exit the prompt. Press return to generate more output.\n"+
27
- "---------------------------------------------------------------------\n\n"
28
- end
31
+ print_interactive_banner if user_demands[:interactive]
29
32
 
30
33
  fulltext = ""
31
34
 
32
35
  while true
33
36
  (user_demands[:count] || 1).times do
34
- text = root_phrase_class.new.inspect
37
+ text = root_phrase_class.new.to_s
35
38
  fulltext += "\n#{text}"
36
39
  text += "\n" unless user_demands[:chomp]
37
- print text
40
+ puts text
38
41
  end
39
42
 
40
43
  `echo #{fulltext.inspect} | pbcopy $1` if user_demands[:copy]
41
44
 
42
45
  break if !user_demands[:interactive] || get_from_prompt == 'quit'
43
46
  end
44
-
45
47
  rescue => e
46
48
  raise e if user_demands[:debug]
47
49
  ensure
data/lib/dunmanifestin.rb CHANGED
@@ -1,11 +1,10 @@
1
- $:.unshift File.dirname(__FILE__) # For dev/use when no gem is installed
1
+ # $:.unshift File.dirname(__FILE__) # For dev/use when no gem is installed
2
2
 
3
- require 'trollop'
4
- require 'dunmanifestin/member.rb'
5
- require 'dunmanifestin/list.rb'
6
- require 'dunmanifestin/generator.rb'
7
- require 'dunmanifestin/string.rb'
8
- require 'dunmanifestin/custom_inflections.rb'
9
- require 'dunmanifestin/phrase.rb'
10
- require 'dunmanifestin/manifestation.rb'
11
- require 'dunmanifestin/list_loader.rb'
3
+ require_relative 'dunmanifestin/member'
4
+ require_relative 'dunmanifestin/list'
5
+ require_relative 'dunmanifestin/generator'
6
+ require_relative 'dunmanifestin/string'
7
+ require_relative 'dunmanifestin/custom_inflections'
8
+ require_relative 'dunmanifestin/phrase'
9
+ require_relative 'dunmanifestin/manifestation'
10
+ require_relative 'dunmanifestin/list_loader'
@@ -4,17 +4,17 @@ class ListLoader
4
4
  end
5
5
 
6
6
  def load genre=@genre
7
- dir_of_this_file = File.dirname(__FILE__)
8
- default_list_dir = File.join(*%W(#{dir_of_this_file} .. .. lists default ** *))
9
- Dir[default_list_dir].each { |list_path| create_list_from(list_path) }
10
-
11
- if genre != 'default'
12
- Dir[File.join(*%W(#{dir_of_this_file} .. lists #{genre} ** *))].each { |list_path| create_list_from(list_path) }
13
- end
7
+ Dir[list_dir('default')].each(&method(:create_list_from))
8
+ Dir[list_dir(genre)].each(&method(:create_list_from)) unless genre == 'default'
14
9
  end
15
10
 
16
11
  private
17
12
 
13
+ def list_dir(genre)
14
+ dir_of_this_file = File.dirname(__FILE__)
15
+ File.join(*%W(#{dir_of_this_file} .. .. lists #{genre} ** *))
16
+ end
17
+
18
18
  def create_list_from path
19
19
  newlines_before_a_pipe = /\n(?=\|)/
20
20
  everything_up_to_the_first_newline_if_first_character_is_a_pipe = /^\|(.*?)\n/
@@ -191,7 +191,7 @@ class Phrase
191
191
  end
192
192
  end
193
193
 
194
- string = string.capitalize if capitalize?
194
+ string = string[0].capitalize + string[1 .. -1] if capitalize?
195
195
 
196
196
  string
197
197
  end
@@ -0,0 +1,2 @@
1
+ |root
2
+ I like hats.
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - quavmo
@@ -118,6 +118,7 @@ files:
118
118
  - lists/default/wearableQuality
119
119
  - lists/default/weildable
120
120
  - lists/default/welshName
121
+ - lists/gritty-horror-fantasty/root
121
122
  - lists/huoquitlan/originalAnimal
122
123
  - lists/huoquitlan/originalDenizen
123
124
  - lists/huoquitlan/originalItemName
@@ -138,12 +139,12 @@ require_paths:
138
139
  - lib
139
140
  required_ruby_version: !ruby/object:Gem::Requirement
140
141
  requirements:
141
- - - ! '>='
142
+ - - ">="
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  requirements:
146
- - - ! '>='
147
+ - - ">="
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
149
150
  requirements: []
@@ -153,4 +154,3 @@ signing_key:
153
154
  specification_version: 4
154
155
  summary: A verisimilitude generator.
155
156
  test_files: []
156
- has_rdoc: