aro 0.1.4 → 0.1.5

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: a276927c911f1781041e6d5c274c1611f0a23a948edb9b0fb6bc17518d22eee5
4
- data.tar.gz: 415a4ad29297c5c8815127fb4bae7c5dc97f4f8eb12cda4aacf2235997cb895e
3
+ metadata.gz: 7cb6ddc2d0cf6217e44a7d7a9da17b0f171b93172e66458e987780d70d70bce2
4
+ data.tar.gz: 0e32b0de35602cafd2d82fe592f2a1599fc39abe401c1c6c905304288de3b740
5
5
  SHA512:
6
- metadata.gz: a91cb814964c27d4aa6c53aea311dc530ecd897d4534f19b3295ad8954c7611268102b8113dc4ecaea52d23fb975dbf890bcfbcfc575727741c497942f3ea36f
7
- data.tar.gz: b8270db12a879b8738d014f748929641d234234f61cbba5cc351907319d5616bfef2ae1f58616827930673703258841c2ee6c70d732ab247ae87941cf1bf0073
6
+ metadata.gz: de0e46fb3bcc6f7b8e89b0b8d13cbc576e8eab279c60d964852c12e4ea5dc35063c9b91f59e1c13644e1f902e2f313662cefb69e1511b425b309731b5885f0e7
7
+ data.tar.gz: 83091df7de94c8cd29c69c6274344727854105767bf53f3fa820ada8f8a3c8a9a70664aef565cf9d64b65bcae46e8f39a447a8e8aa2cc13fd52462bb9bf6963a
data/.release CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 1) update version and release notes (manually)
6
6
  # 2) test and build
7
- # $ rake make
7
+ # $ rake make && gem build
8
8
  # 3) build checksum
9
9
  # $ rake build:checksum
10
10
  # 4) create a commit
@@ -12,7 +12,7 @@
12
12
  # tag message format:
13
13
  # vx.x.x
14
14
  # <release_note_text>
15
- # $ gitaga vx.x.x && gush tag vx.x.x
15
+ # $ gitaga vx.x.x && gutaga vx.x.x
16
16
  # 6) push develop
17
17
  # 7) pull request develop -> master & merge
18
18
  # 8) checkout and pull master
data/aro.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/i2097i/aro"
13
13
  spec.license = "MIT"
14
14
 
15
- spec.files = `git ls-files`.split("\n").reject{|f| f.match(%r{^(spec)/})}
15
+ spec.files = `git ls-files`.split("\n").reject{|f| f.match(%r{^(spec|pkg)/})}
16
16
  spec.bindir = "bin"
17
17
  spec.executables = ["aro"]
18
18
  spec.require_paths = ["lib", "bin/cli"]
data/bin/cli/config.rb CHANGED
@@ -53,7 +53,7 @@ module CLI
53
53
  description: I18n.t("cli.config.type_values_description"),
54
54
  validator: Proc.new{|unvalid, deff, key|
55
55
  CLI::Config.def_valid?(deff, key) &&
56
- deff[:possible_values].keys.include?(unvalid.to_sym)
56
+ deff[:possible_values].keys.include?(unvalid&.to_sym)
57
57
  }
58
58
  },
59
59
  }
@@ -197,11 +197,19 @@ module CLI
197
197
  end
198
198
 
199
199
  def source_config
200
- invalid_defs = validate_config
201
200
  Aro::P.say(I18n.t("cli.config.sourcing_config", name: CLI::Config::CONFIG_FILE_PATH))
202
- system("source #{CLI::Config::CONFIG_FILE_PATH}")
201
+ File.read(CLI::Config::CONFIG_FILE_PATH).split("\n").select{|line|
202
+ line.match?("export #{CLI::Config::VAR_PREFIX}")
203
+ }.map{|line|
204
+ line.gsub("export ", "").split("=")
205
+ }.each{|kv|
206
+ ENV[kv[0]] = kv[1]
207
+ }
208
+
209
+ # todo: implement
210
+ # invalid_defs = validate_config
203
211
  CLI::Config::DEF.keys.each{|dfk|
204
- next if invalid_defs.include?(dfk)
212
+ # next if invalid_defs.include?(dfk)
205
213
  Aro::P.say("$#{CLI::Config.var_key_with_suffix(dfk)}=#{CLI::Config.var_value_with_suffix(dfk)}")
206
214
  }
207
215
 
data/bin/cli/deck.rb CHANGED
@@ -41,7 +41,7 @@ module CLI
41
41
  Aro::P.say(I18n.t("cli.messages.drawing", name: Aro::Mancy.game.name))
42
42
  Aro::P.p.say(I18n.t("cli.messages.drawing_from_dimension", dimension: "#{CLI::Config.var_value_with_suffix(:DIMENSION)}"))
43
43
  Aro::Mancy.game.draw(
44
- is_dt_dimension: CLI::Config.var_value_with_suffix(:DIMENSION).to_sym == CLI::Config::DMS[:DEV_TAROT],
44
+ is_dt_dimension: CLI::Config.var_value_with_suffix(:DIMENSION)&.to_sym == CLI::Config::DMS[:DEV_TAROT],
45
45
  z_max: CLI::Config.var_value_with_suffix(:Z_MAX).to_i,
46
46
  z: CLI::Config.var_value_with_suffix(:Z)
47
47
  )
@@ -49,7 +49,7 @@ module CLI
49
49
  Aro::P.say(I18n.t("cli.messages.replacing_drawn", name: Aro::Mancy.game.name))
50
50
  Aro::Mancy.game.replace
51
51
  when CLI::LOAD_DECK_ACTIONS[:RESET]
52
- if Aro::AROYES != Aro::P.p.ask(I18n.t("cli.messages.confirmation_prompt", name: Aro::Mancy.game.name))
52
+ if Aro::AROYES.to_s != Aro::P.p.ask(I18n.t("cli.messages.confirmation_prompt", name: Aro::Mancy.game.name))
53
53
  Aro::P.say(I18n.t("cli.messages.understood", name: Aro::Mancy.game.name))
54
54
  exit(CLI::EXIT_CODES[:SUCCESS])
55
55
  end
@@ -1 +1 @@
1
- 5a6af41ca8e0e2eee62a129aca162bc709d5c3ded0c4ec7b6326fa6768d949313f320bd659cf00d5a0056c1adced4898fdd6d9c91c2a79f7d06018cc9cc61ad7
1
+ 5ef49535f30fa0fe1c89b806541f7e3c21f38311281264eb1b848a021f73711d8f3d429a4d26acf95c112c231dc824a391db863fbf79776c7dbd43fc54a1e7bf
@@ -0,0 +1 @@
1
+ 5a4098d5c0416b43bd46f3fc949035debbd42b28d5e1ab82a7948c4beb3ef390383543ce5089f5014c84b395c3589f556522f25b3de82725b16ed285c8b7e121
data/lib/aro/c.rb CHANGED
@@ -3,7 +3,7 @@ module Aro
3
3
  ARO: Proc.new{Aro::IS_TEST.call ? ".aro_test" : ".aro"},
4
4
  }
5
5
 
6
- AROYES = "aroyes"
6
+ AROYES = :aroyes
7
7
 
8
8
  NUMERALS = {
9
9
  O: 0,
data/lib/aro/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Aro
2
- VERSION = :"0.1.4"
3
- RELEASE_NOTES = :"add multiple config variables, add much improved randomness"
2
+ VERSION = :"0.1.5"
3
+ RELEASE_NOTES = :"fix issue with config loading"
4
4
  end
data/lib/models/deck.rb CHANGED
@@ -244,20 +244,20 @@ class Aro::Deck < ActiveRecord::Base
244
244
  # get drawn
245
245
  drawn_arr = drawn&.split(Aro::Deck::CARD_DELIM) || []
246
246
 
247
- # use fallback randomness if /dev/tarot unavailable
248
- if !is_dt_dimension || !File.exist?(Aro::Deck::DEV_TAROT_FILE)
249
- dev_tarot = summon_ruby_facot(cards_arr)
250
- abs_dev_tarot = Aro::Deck.card_strip(dev_tarot)
251
- end
252
-
253
247
  sleeps = 0
254
248
  sleeps_max = z_max
255
249
 
256
250
  # find a card that is not already drawn
257
251
  while sleeps <= sleeps_max && dev_tarot.nil? do
258
- # preferred randomness
259
- dev_tarot = Aro::Deck.read_dev_tarot&.strip&.split("")
260
- if dev_tarot.present?
252
+ # use fallback randomness if /dev/tarot unavailable
253
+ if !is_dt_dimension || !File.exist?(Aro::Deck::DEV_TAROT_FILE)
254
+ dev_tarot = summon_ruby_facot(cards_arr).split("")
255
+ else
256
+ # preferred randomness
257
+ dev_tarot = Aro::Deck.read_dev_tarot&.strip&.split("")
258
+ end
259
+
260
+ unless dev_tarot.nil?
261
261
  abs_dev_tarot = dev_tarot[1] + Aro::NUMERALS.key(
262
262
  dev_tarot.select{|c| !dev_tarot.first(2).include?(c)}.join("").to_i
263
263
  ).to_s
@@ -268,7 +268,7 @@ class Aro::Deck < ActiveRecord::Base
268
268
  else
269
269
  # dev_tarot is invalid
270
270
  sleeps += 1
271
- sleep(z)
271
+ sleep(z.to_i)
272
272
  end
273
273
  end
274
274
 
data/locale/en.usage.yml CHANGED
@@ -28,7 +28,7 @@ en:
28
28
  $ aro create <name>
29
29
 
30
30
  config
31
- manage your aro config - not yet implemented
31
+ todo: manage your aro config - not yet implemented
32
32
 
33
33
  deck
34
34
  perform operations on the deck(s) in current aro instance
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2097i
@@ -174,6 +174,7 @@ files:
174
174
  - bin/cli/deck.rb
175
175
  - bin/cli/usage.rb
176
176
  - checksums/aro-0.1.4.gem.sha512
177
+ - checksums/aro-0.1.5.gem.sha512
177
178
  - db/migrate/1763374647_create_decks.rb
178
179
  - db/migrate/1763432541_create_logs.rb
179
180
  - lib/aro.rb
@@ -189,11 +190,6 @@ files:
189
190
  - locale/en.cards.yml
190
191
  - locale/en.usage.yml
191
192
  - locale/en.yml
192
- - pkg/aro-0.1.0.gem
193
- - pkg/aro-0.1.1.gem
194
- - pkg/aro-0.1.2.gem
195
- - pkg/aro-0.1.3.gem
196
- - pkg/aro-0.1.4.gem
197
193
  - tasks/console.rake
198
194
  - tasks/make.rake
199
195
  homepage: https://github.com/i2097i/aro
data/pkg/aro-0.1.0.gem DELETED
Binary file
data/pkg/aro-0.1.1.gem DELETED
Binary file
data/pkg/aro-0.1.2.gem DELETED
Binary file
data/pkg/aro-0.1.3.gem DELETED
Binary file
data/pkg/aro-0.1.4.gem DELETED
Binary file