story_key 0.2.0 → 0.3.0

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: 8817282d492c7937c7e5e9cedca2b8b3bc65ed9615311bdb3bd1e00bbb665a64
4
- data.tar.gz: b4776a9cf0648428b5e3ed0e0394c54f257419d629365fa0c64b0623f0a31034
3
+ metadata.gz: 1233b236b5edf1cbec6d96eee8ace63be0c141402a9dadb6954c714b4311a8b0
4
+ data.tar.gz: b49c36a26550ca611bcbdb55ff7c7fbc37534a797fb6cad34d1112fa6f0d4480
5
5
  SHA512:
6
- metadata.gz: da93f898ecad35d8949d8d2917d7104dcae73f53b851c35e0b3a7d2ddafc010edc83bb27f24caa363c15a4235c0c37344d962f379a681ef01d2fdce1b4540dce
7
- data.tar.gz: a3a87b54e9551dec7238e6587198ad4c93eda1741fc178fb29f42d446671268851da364527cb5a8358493d39e7a8a238f4c60fbd5f716845b754d0fe7e873c08
6
+ metadata.gz: 9022e3f8f6e2d19596ab98eaff22e229c8284a1a08a7069410b307711a6442cb242ed61ab4896245451db6670966b560e75bba9d224bcd96df462888152905ed
7
+ data.tar.gz: 4ce3e4d9445922acba618a1ae402439b02d9420e47578526581ab701aa45c35aa9c9c9483aee47279f6c577756e4e85261730e6dad359fbe86a084a21d7aa39e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- story_key (0.2.0)
4
+ story_key (0.3.0)
5
5
  activesupport (~> 7.0.2)
6
6
  awesome_print (~> 1.9.2)
7
7
  base58 (~> 0.2.3)
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  | Gem Version | Locale | Lexicon SHA |
10
10
  |-------------|--------|-------------|
11
- | 0.2.0 | Miami | 4eea29f |
11
+ | 0.3.0 | Miami | 4eea29f |
12
12
 
13
13
 
14
14
  # StoryKey
@@ -195,7 +195,7 @@ When editing the lexicon, be sure to:
195
195
  2. Copy the lexicon SHA into `version.rb` as well as this README (if publishing)
196
196
  3. Increment the semantic version of the gem (if publishing)
197
197
 
198
- When incrementing the semantic version, be sure to:
198
+ When incrementing the semantic version post-1.0, be sure to:
199
199
  1. Create a new `VERSION_SLUG`, adhering to the locale convention
200
200
  2. Append a row to the version reference at the top of this README
201
201
 
@@ -5,7 +5,7 @@ class StoryKey::Decoder < StoryKey::Base
5
5
 
6
6
  def call
7
7
  @story = story.strip
8
- @format ||= StoryKey::DEFAULT_FORMAT
8
+ @format ||= StoryKey::FORMATS.first
9
9
 
10
10
  validate_version!
11
11
  validate_checksum!
@@ -18,7 +18,7 @@ class StoryKey::Encoder < StoryKey::Base
18
18
 
19
19
  def call
20
20
  @key = key.strip
21
- @format ||= StoryKey::DEFAULT_FORMAT
21
+ @format ||= StoryKey::FORMATS.first
22
22
 
23
23
  validate_format!
24
24
  validate_length!
@@ -5,7 +5,7 @@ class StoryKey::Generator < StoryKey::Base
5
5
 
6
6
  def call
7
7
  @bitsize ||= StoryKey::DEFAULT_BITSIZE
8
- @format ||= StoryKey::DEFAULT_FORMAT
8
+ @format ||= StoryKey::FORMATS.first
9
9
 
10
10
  formatted_str
11
11
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module StoryKey
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  VERSION_SLUG = 'Miami' # Name of a well-known place, no spaces
5
5
  LEXICON_SHA = '4eea29f'
6
6
  end
data/lib/story_key.rb CHANGED
@@ -19,8 +19,8 @@ loader.setup
19
19
  module StoryKey
20
20
  BITS_PER_ENTRY = 10
21
21
  DEFAULT_BITSIZE = 256
22
- DEFAULT_FORMAT = :base58
23
22
  FOOTER_BITSIZE = 4 # StoryKey::BITS_PER_ENTRY <= 2^StoryKey::FOOTER_BITSIZE
23
+ FORMATS = %i[base58 hex bin dec].freeze
24
24
  GRAMMAR = {
25
25
  4 => %i[adjective noun verb noun],
26
26
  3 => %i[noun verb noun],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: story_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Craig-Kuhn (JCK)