anki_record 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: b89baf921abc0de4f35babe65cb40cf5fa5647d4d1fe9b3b81ecb80f8a47a15b
4
- data.tar.gz: f766e3344683a73d46450c8bf3cf6ae8226f4cbefee4d5126a194c6dcd831cab
3
+ metadata.gz: 909927e79a46b38b4a538e4fd0a32cf9a727ac0a9e276645fdd2296ad6d9a464
4
+ data.tar.gz: 2e75c487b6345606661d746b7d945b538592bbb6bed16b882a6ce42a87892368
5
5
  SHA512:
6
- metadata.gz: 3533d5803a630df54a2c52605fefc8f4dc4ce87e0a649a34672a7a3e369a53722f7d2481e9362388519eb89bd59fbfce8f7f226e0e489433e1d1a7d12fb285fd
7
- data.tar.gz: 7b2ee79fd7ba76b1f229e06831909d3e4b7949c6edc79e608fdc2aae6fe481caa9ccf14c0cd586212b78ef1deddf9e47a91d505c30bd645cf4dae8282e3ff6a8
6
+ metadata.gz: aeb071caaf37a4fcd72c99f66e31b60676b412890883bf2968400bae46ac756433b0d051495a1ff34e477313ab8a296296e1fc1ecdf2b2227c241439712cef48
7
+ data.tar.gz: 36e4e21fa7238736ac63239e59507042e6567869add24d09523d201b1cf606738de055484e5c21ea7b37e05a1b5872a76c8241890ad32eaea611f56a8038cbc0
data/CHANGELOG.md CHANGED
@@ -37,8 +37,12 @@
37
37
  - API documentation changed from using RDoc to SDoc with the Rails template.
38
38
  - RSpec test suite was refactored to improve speed: 4 minutes -> 1.5 minutes.
39
39
 
40
- ## [0.4.0] - Not released
40
+ ## [0.3.1] - 04-29-2023
41
41
 
42
42
  - `Deck.new` was saving the deck to the `collection.anki21` database. Now it will only instantiate it and `#save` must be called to save it.
43
43
  - `Helper` modules moved into the `Helpers` module namespace.
44
44
  - Bug fix addressing using the approximate milliseconds since the epoch as the primary key id causing the uniqueness constraint to fail when creating a lot of notes.
45
+
46
+ ## [0.3.2] - 05-20-2023
47
+ - The private `Note` method `globally_unique_id` has been moved to `NoteGuidHelper` and included into note.
48
+ - The `guid` attribute also now has a public setter.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anki_record (0.3.1)
4
+ anki_record (0.3.2)
5
5
  rubyzip (>= 2.3)
6
6
  sqlite3 (~> 1.3)
7
7
 
@@ -68,7 +68,7 @@ GEM
68
68
  simplecov_json_formatter (~> 0.1)
69
69
  simplecov-html (0.12.3)
70
70
  simplecov_json_formatter (0.1.4)
71
- sqlite3 (1.6.0-x86_64-linux)
71
+ sqlite3 (1.6.2-x86_64-linux)
72
72
  stringio (3.0.5)
73
73
  unicode-display_width (2.4.2)
74
74
 
@@ -5,6 +5,7 @@ require "securerandom"
5
5
  require_relative "../helpers/checksum_helper"
6
6
  require_relative "../helpers/time_helper"
7
7
  require_relative "note_attributes"
8
+ require_relative "note_guid_helper"
8
9
 
9
10
  # rubocop:disable Metrics/ClassLength
10
11
  module AnkiRecord
@@ -13,6 +14,7 @@ module AnkiRecord
13
14
  class Note
14
15
  include Helpers::ChecksumHelper
15
16
  include NoteAttributes
17
+ include NoteGuidHelper
16
18
  include Helpers::TimeHelper
17
19
  include Helpers::SharedConstantsHelper
18
20
 
@@ -161,10 +163,6 @@ module AnkiRecord
161
163
 
162
164
  private
163
165
 
164
- def globally_unique_id
165
- SecureRandom.uuid.slice(5...15)
166
- end
167
-
168
166
  def field_values_separated_by_us
169
167
  # The ASCII control code represented by hexadecimal 1F is the Unit Separator (US)
170
168
  note_type.snake_case_field_names.map { |field_name| @field_contents[field_name] }.join("\x1F")
@@ -9,7 +9,7 @@ module AnkiRecord
9
9
 
10
10
  ##
11
11
  # The note's globally unique id.
12
- attr_reader :guid
12
+ attr_accessor :guid
13
13
 
14
14
  ##
15
15
  # The number of seconds since the 1970 epoch at which the note was last modified.
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AnkiRecord
4
+ # Module with the helper method to generate the note guid.
5
+ module NoteGuidHelper
6
+ def globally_unique_id
7
+ SecureRandom.uuid.slice(5...15)
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnkiRecord
4
- VERSION = "0.3.1" # :nodoc:
4
+ VERSION = "0.3.2" # :nodoc:
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anki_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Rego
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-29 00:00:00.000000000 Z
11
+ date: 2023-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -76,6 +76,7 @@ files:
76
76
  - lib/anki_record/helpers/time_helper.rb
77
77
  - lib/anki_record/note/note.rb
78
78
  - lib/anki_record/note/note_attributes.rb
79
+ - lib/anki_record/note/note_guid_helper.rb
79
80
  - lib/anki_record/note_field/note_field.rb
80
81
  - lib/anki_record/note_field/note_field_attributes.rb
81
82
  - lib/anki_record/note_field/note_field_defaults.rb