dsu 1.2.0 → 1.2.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
  SHA256:
3
- metadata.gz: f500cfe8707d939020d669f5196f30167ae14195827f96066a594463b549d6d7
4
- data.tar.gz: 4399c77c765050e3af7b6c2310c57063c6a89e46c8a0d69fadac6936a7269501
3
+ metadata.gz: 6ce3877d498ca52f9395b713e062dd3448ef447028823b880d5a3e514009d8a9
4
+ data.tar.gz: 3c3a7ea5fd481d5d1e2ff409a812d5581d779d9061c736a8bd1994276c67e343
5
5
  SHA512:
6
- metadata.gz: 9db967077cdbb83eff72ae203f87c88d3bf835f0339b4ec9e15db9fa2918dc0275a01fa6ff2752019505eaf8ffe61fece1dccd64b5255ad74fcbe449acdca22d
7
- data.tar.gz: ed725fc2bba98f3a4b8ad2ec3e4e6fc1e36e9a3e20102580f406ec6ea253e7a99a61edbc0b3832473491ff93dd97099db38aa2cd060e6d6c3b4571b33f180840
6
+ metadata.gz: e25b5428fa6779df05b47b37323e5ae25ae776dfa9eb78463f79c2332d84e338b3f668f805ac5c9f24e5702db4d2802e46ee8439fa94d01ffafc6e15093f650a
7
+ data.tar.gz: 46aa0bbd606a025f9ffc458c98cc59d0070caac1d89d73eafec90d57da7cc7aedc552ece986fbede7bf7f7977d9afbbd314027f61c371d637d5187ae2968cbd2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.2.1] 2023-06-02
2
+ * Bug fixes
3
+ - Fixed a bug that raises an error `NoMethodError` for `entry_group_file_exists?` if the `carry_over_entries_to_today` configuration option is set to true, and attempting to edit today's dsu entries.
1
4
  ## [1.2.0] 2023-05-26
2
5
  * Changes
3
6
  - Various refactors.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dsu (1.2.0)
4
+ dsu (1.2.1)
5
5
  activemodel (~> 7.0, >= 7.0.4.3)
6
6
  activesupport (~> 7.0, >= 7.0.4)
7
7
  colorize (~> 0.8.1)
@@ -14,6 +14,11 @@ module Dsu
14
14
  File.exist?(entry_group_file_path)
15
15
  end
16
16
 
17
+ def entry_group_file_exists_for?(time:)
18
+ entries_file_name = time.strftime(configuration_or_options_configuration[:entries_file_name])
19
+ File.join(entries_folder, entries_file_name)
20
+ end
21
+
17
22
  private
18
23
 
19
24
  def entry_group_path_exists?
data/lib/dsu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dsu
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../../models/entry_group'
4
- require_relative '../../support/configurable'
4
+ require_relative '../../support/entry_group_fileable'
5
5
 
6
6
  module Dsu
7
7
  module Views
8
8
  module EntryGroup
9
9
  class Edit
10
- include Support::Configurable
10
+ include Support::EntryGroupFileable
11
11
 
12
12
  def initialize(entry_group:, options: {})
13
13
  raise ArgumentError, 'entry_group is nil' if entry_group.nil?
@@ -100,7 +100,7 @@ module Dsu
100
100
  end
101
101
 
102
102
  def previous_entry_group?
103
- previous_entry_group.present?
103
+ previous_entry_group.entries.present?
104
104
  end
105
105
 
106
106
  def previous_entry_group
@@ -108,13 +108,13 @@ module Dsu
108
108
  # TODO: Make this configurable or accept an option?
109
109
  @previous_entry_group ||= (1..7).each do |days|
110
110
  t = time.days_ago(days)
111
- return Models::EntryGroup.load(time: t) if Support::EntryGroupFileable.entry_group_file_exists?(time: t)
111
+ return Models::EntryGroup.load(time: t) if entry_group_file_exists_for?(time: t)
112
112
  end
113
113
  nil
114
114
  end
115
115
 
116
116
  def carry_over_entries_to_today?
117
- configuration[:carry_over_entries_to_today]
117
+ configuration.merge(options)[:carry_over_entries_to_today]
118
118
  end
119
119
  end
120
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gene M. Angelo, Jr.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-26 00:00:00.000000000 Z
11
+ date: 2023-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport