ruby_terminal_games 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df8bd7f4d4ef25f9d86cfb2ce96c7f3c73881a66
4
- data.tar.gz: 64bc917a5019557ca83075d38243ba30067efb8c
3
+ metadata.gz: 33a5a845ad2fa70bcfb583e07de91e99365c6166
4
+ data.tar.gz: 71a0188aca20407a84d330fcc146eee7e0fd1c2c
5
5
  SHA512:
6
- metadata.gz: e58341a15e2fea6300bd8c8d0a0afb1e4225bf61a219740041812de155dd6a73ee64df2371cdbbbf474c8c08742de033e68bc3d173a8adff12127823e51bfa7d
7
- data.tar.gz: 680de05aebd0d1fc65fc858c77e4465a09648a91cf492edbba95cb7a0278f79ebd312f3c3ce2a41c619af094aa4629f2b83c9c2ae2f22f9439c6447996ab2b53
6
+ metadata.gz: d8290f1216a58bd49934b890c0583797ea65e370502a4d1b784902d6f4f6ede849cf09fa9d19eb92c0af40c0aade950afe2379b3cd3ee01039c39994a069ca11
7
+ data.tar.gz: f74ba59d7a52048571bbfb7951efea69b81389c1d99aad6451bc47b4b8e87bba537730504416523d19b21ded48822e33ca8a6af4be55a594072770cdfc023eff
@@ -9,7 +9,7 @@ module RubyTerminalGames
9
9
 
10
10
  def guess!(key)
11
11
  return true if won?
12
-
12
+
13
13
  found = false
14
14
  letters.each_with_index do |letter, index|
15
15
  next unless letter == key
@@ -26,7 +26,10 @@ module RubyTerminalGames
26
26
  private
27
27
 
28
28
  def random_word
29
- File.readlines('./lib/ruby_terminal_games/hangman/words.txt')
29
+ path = File.expand_path(
30
+ File.join(File.dirname(__FILE__), "words.txt"))
31
+
32
+ File.readlines(path)
30
33
  .map { |line|
31
34
  line.strip.downcase
32
35
  }.reject { |w| w.empty? }.sample
@@ -1,3 +1,3 @@
1
1
  module RubyTerminalGames
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_terminal_games
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
  - Daniel Alves