balm 0.1.2 → 1.0.1

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
  SHA256:
3
- metadata.gz: 0fa3963043f90dc596b712fd792aa41f43e15fd54e76e2cf081f0516d15872f8
4
- data.tar.gz: 7825696f68cb676bd7830a3d203f7bc30c7b437d9baefb09799cbb95ff651b85
3
+ metadata.gz: b61f96993fc482b82969ca1b93afa8e18b32c3132f36862baf801aa826900f6f
4
+ data.tar.gz: 9ecfdf42d35b44e4131f22a3dd1a066d1d1022e0ec5c0c02d8495dcd91605e89
5
5
  SHA512:
6
- metadata.gz: ff5b3e60cd69d127061fc1f837ad8b0f7eb047020c8712e8954d189c4da25a6a5a32fdcf89df8ba5b4e9ee53af8d256a6f7802d1dfcdb8f026866f7c4bfe1b11
7
- data.tar.gz: '02093a9228be9c3ccaafbdcebc722973e13a51bdd99034679112e7e112e5e362de9162364984fc9f23348aae8a47825e61fde5eaa7b53d0a0ebf093bdbb4a5f7'
6
+ metadata.gz: e5be33bbf9e7e4d050450d04e04b407179d5b8a600e9ba674613d00eeae606f2bd9682976b2d5646c0770ba99f8a10a486547ab519c3be677af2349373167a7b
7
+ data.tar.gz: 121ed9549a6cd9c1160c6d960a7811b7a997b3b66f6cac69802588ae0a13f9ec132c9dd4bb9d6723984ba38f16f03e2e8d104c0af86d348637f5460374fb770e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- balm (0.1.2)
4
+ balm (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Balm
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/balm`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A simple to use gem that will generate random character types, tropes and/or settings. Most useful for writers in a rut if you need to jumpstart inspiration.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Called 'balm' to soothe the headaches of writer's block. Also great to generate random prompts for writing practice.
6
6
 
7
7
  ## Installation
8
8
 
@@ -21,27 +21,20 @@ Or install it yourself as:
21
21
  $ gem install balm
22
22
 
23
23
  ## Usage
24
+
24
25
  ```ruby
25
26
  require 'balm'
26
27
 
27
28
  Balm::Plot.trope #=> "Arranged Marriage"
28
- Balm::Plot.archetype(4) #=> "Minor God, Curate, Bard, Ghost"
29
+ Balm::Plot.archetype(4) #=> "Minor God, Curate, Bard, and Ghost"
29
30
  Balm::Plot.setting #=> "The ruins of a Castle"
30
- Balm::Plot.all(3) #=> "Mage, Princess, Dandy
31
- #=> One is a Celebrity and the other is not
32
- #=> The city just before dawn "
33
-
34
- ```
35
-
36
- ## Development
31
+ Balm::Plot.all(3) #=> "Once upon a time, a Mage, Princess, and Dandy in The city just before dawn and One is a Celebrity and the other is not."
37
32
 
38
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
-
40
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
33
+ ```
41
34
 
42
35
  ## Contributing
43
36
 
44
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/balm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/balm/blob/master/CODE_OF_CONDUCT.md).
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chelsearostonrappazzo/balm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/balm/blob/master/CODE_OF_CONDUCT.md).
45
38
 
46
39
  ## License
47
40
 
data/lib/balm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Balm
4
- VERSION = "0.1.2"
4
+ VERSION = "1.0.1"
5
5
  end
data/lib/balm.rb CHANGED
@@ -10,39 +10,42 @@ module Balm
10
10
  class Plot
11
11
  class << self
12
12
  def trope
13
+ trope_data = File.join(File.dirname(__FILE__), "tropes.yaml")
13
14
  tropes = []
14
- trope_data = YAML.load_file("lib/tropes.yaml")
15
- trope_data.each { |trope| tropes << trope.strip }
16
- puts tropes.sample
15
+ YAML.load_file(trope_data).each do |trope|
16
+ tropes << trope.strip
17
+ end
18
+ tropes.sample
17
19
  end
18
20
 
19
21
  def archetype(num)
20
22
  archetypes = []
21
- archetype_data = YAML.load_file("lib/archetypes.yaml")
22
- archetype_data.each { |archetype| archetypes << archetype.strip }
23
- if (1..5).include?(num)
24
- puts archetypes.sample(num).join(", ")
25
- elsif num < 1
26
- puts archetypes.sample(1)
27
- else
28
- puts archetypes.sample(5).join(", ")
23
+ archetype_data = File.join(File.dirname(__FILE__), "archetypes.yaml")
24
+ YAML.load_file(archetype_data).each do |archetype|
25
+ archetypes << archetype.strip
26
+ end
27
+ if num === 1
28
+ archetypes.sample(num)
29
+ elsif num === 2
30
+ archetypes.sample(num).join(" and ")
31
+ elsif num >= 3
32
+ archetypes_list = archetypes.sample(num)
33
+ archetypes_list[-1] = "and " + archetypes_list[-1]
34
+ archetypes_list.join(" , ")
29
35
  end
30
36
  end
31
37
 
32
38
  def setting
39
+ setting_data = File.join(File.dirname(__FILE__), "settings.yaml")
33
40
  settings = []
34
- setting_data = YAML.load_file("lib/settings.yaml")
35
- setting_data.each { |setting| settings << setting.strip }
36
- puts settings.sample
41
+ YAML.load_file(setting_data).each do |setting|
42
+ settings << setting.strip
43
+ end
44
+ settings.sample
37
45
  end
38
46
 
39
47
  def all(num)
40
- puts "~Characters~"
41
- archetype(num)
42
- puts "~Trope~"
43
- trope
44
- puts "~Setting~"
45
- setting
48
+ "Once upon a time, a #{archetype(num)} in a #{setting} and #{trope} happens. Have you found your path?"
46
49
  end
47
50
  end
48
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chelsea Roston
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-07 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 3.2.3
77
+ rubygems_version: 3.2.15
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: '"The purpose of this gem is to generate random plots for those creatively