spell_generator 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: eaa3176f66adf6369ed3ce482d398c02dec401f5
4
- data.tar.gz: 3492310efb7ce61f67c6668da1e1fb79c5cb3b9b
3
+ metadata.gz: 3600a0d86743c56befe61fbe9f64e261ac799ee0
4
+ data.tar.gz: eb186b091e7eb666950a62dac04e1033832ee10b
5
5
  SHA512:
6
- metadata.gz: baa3b5b72e282ffbd075c88f53444bfb9c750b4d46116497c0e64c5e4f50fadbf96fdcfcf34d2edc8e096b2246813d84390725d79ce6fe64e72ee8bab90d08fa
7
- data.tar.gz: 81b5f0784d8e806310ada8ae69e02e9a8372fae1e2902d49849b998cee88002f148f6f1c63ba646cbf7e2d29e3e5ed5dda94fc0c275e4e51e14f25600130e597
6
+ metadata.gz: 4b49a08f015f6af1117d66eb66f92b00b3ed34a031745b894150d0c11b01d469fcbd581a81f87cc496036080dd85344065b9ff13770bbf89cc3e29a04c675b3e
7
+ data.tar.gz: 6b5271330a5ef94b34eec92b7bb4889e05df96afbdbc1ec54d3fddb9b0cc66b8c9756133249cee9bd35846e4e3d68f5ddb5e06cc899873c3bbbc52307cd7a477
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spell_generator (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.3)
10
+ rake (10.5.0)
11
+ rspec (3.8.0)
12
+ rspec-core (~> 3.8.0)
13
+ rspec-expectations (~> 3.8.0)
14
+ rspec-mocks (~> 3.8.0)
15
+ rspec-core (3.8.0)
16
+ rspec-support (~> 3.8.0)
17
+ rspec-expectations (3.8.1)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.8.0)
20
+ rspec-mocks (3.8.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.8.0)
23
+ rspec-support (3.8.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ bundler (~> 1.16)
30
+ rake (~> 10.0)
31
+ rspec (~> 3.0)
32
+ spell_generator!
33
+
34
+ BUNDLED WITH
35
+ 1.16.2
data/README.md CHANGED
@@ -1,8 +1,5 @@
1
1
  # SpellGenerator
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/spell_generator`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
2
+ This is a pretty useless gem I created for practice.
6
3
 
7
4
  ## Installation
8
5
 
@@ -21,18 +18,22 @@ Or install it yourself as:
21
18
  $ gem install spell_generator
22
19
 
23
20
  ## Usage
21
+ You can do two things with this gem.
24
22
 
25
- TODO: Write usage instructions here
23
+ (1) Create a random spell.
26
24
 
27
- ## Development
28
-
29
- 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.
25
+ ```ruby
26
+ SpellGenerator::Generator.generate #=> "Brave fire"
27
+ SpellGenerator::Generato.new.generate #=> "Symptomatic punch"
28
+ ```
30
29
 
31
- 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+ (2) Create a spell.
32
31
 
33
- ## Contributing
32
+ ```ruby
33
+ SpellGenerator::Generato.new.self_generate('Random' 'Fire') #=> "Random Fire"
34
+ ```
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/spell_generator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+ Told you it's useless.
36
37
 
37
38
  ## License
38
39
 
@@ -1,11 +1,24 @@
1
1
  require_relative 'spells'
2
2
 
3
3
  class SpellGenerator::Generator
4
- def self.generate
5
- "#{SPELL_SET1[rand(0..9)]} #{SPELL_SET2[rand(0..9)]}"
4
+ SPELL_SET1_NUMBER = SPELL_SET1.size
5
+ SPELL_SET2_NUMBER = SPELL_SET2.size
6
+
7
+ class << self
8
+ def generate
9
+ spell_part1 = SPELL_SET1[rand(0...SPELL_SET1_NUMBER)]
10
+ spell_part2 = SPELL_SET2[rand(0...SPELL_SET2_NUMBER)]
11
+ "#{spell_part1} #{spell_part2}"
12
+ end
6
13
  end
7
14
 
8
15
  def generate
9
- "#{SPELL_SET1[rand(0..9)]} #{SPELL_SET2[rand(0..9)]}"
16
+ spell_part1 = SPELL_SET1[rand(0...SPELL_SET1_NUMBER)]
17
+ spell_part2 = SPELL_SET2[rand(0...SPELL_SET2_NUMBER)]
18
+ "#{spell_part1} #{spell_part2}"
19
+ end
20
+
21
+ def self_generate(*spell_parts)
22
+ spell_parts.join(' ')
10
23
  end
11
24
  end
@@ -1,2 +1,7 @@
1
- SPELL_SET1 = %w(accurate sufficient ugly useful immediate entire healthy hot efficient dramatic)
2
- SPELL_SET2 = %w(punch kick attack blow smash strike smack cut poke stab)
1
+ SPELL_SET1 = %w[accurate sufficient ugly useful immediate entire healthy hot efficient
2
+ dramatic threatening brave greedy racial regular glorious pretty alcoholic
3
+ instinctive symptomatic merciful cute perpetual average astonishing shallow
4
+ shallow hateful sacred divine].freeze
5
+
6
+ SPELL_SET2 = %w[fire thunder attack blow smash strike smack cut poke stab punch kick kiss
7
+ flame darkness storm favor jump step hunt].freeze
@@ -1,3 +1,3 @@
1
1
  module SpellGenerator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spell_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - K-Sato
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-06 00:00:00.000000000 Z
11
+ date: 2019-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,6 +64,7 @@ files:
64
64
  - ".travis.yml"
65
65
  - CODE_OF_CONDUCT.md
66
66
  - Gemfile
67
+ - Gemfile.lock
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile