repetition 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/repetition/flashcard.rb +3 -9
- data/lib/repetition/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 826e21633be8df5c5b6bc2aa81d135ddf9c8fda98e60fde9fa3b4a755ec30848
|
4
|
+
data.tar.gz: f82050e3e0d8f0fcc12d083bc104f54eb6353de42d6dabe5a41427ba56b7eb32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1be09f787eba95cef2ced80f86180a2be07a69c2df4526a161e1d24906eea81d52fe196159bd39e19b63eb9e809958ecc9454d85951fd5b6156b8ec4568d8057
|
7
|
+
data.tar.gz: ee711126fbbaf9f505b9a838e2057a459b99615b6af955bc8447d6a7d8fd983ad81d773926aa9f7cf034e306e6fb500fb89726565d09b4702d48d41586363aa1
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.1.0] - 2018-08-18
|
10
|
+
### Added
|
11
|
+
- Add `due_at` attribute with exact time
|
12
|
+
|
13
|
+
## [2.0.1] - 2018-08-17
|
9
14
|
### Fixed
|
10
15
|
- Fix interval calculation bug
|
11
16
|
|
data/lib/repetition/flashcard.rb
CHANGED
@@ -17,6 +17,7 @@ require 'date'
|
|
17
17
|
module Repetition
|
18
18
|
class Flashcard
|
19
19
|
attr_reader :easiness_factor, :interval, :repetitions
|
20
|
+
attr_reader :due_at, :due_on
|
20
21
|
|
21
22
|
def initialize(easiness_factor: 2.5, interval: 0, repetitions: 0)
|
22
23
|
@easiness_factor = easiness_factor
|
@@ -49,19 +50,12 @@ module Repetition
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
def due_on
|
56
|
-
today + @interval
|
53
|
+
@due_at = DateTime.now + @interval
|
54
|
+
@due_on = Date.today + @interval
|
57
55
|
end
|
58
56
|
|
59
57
|
private
|
60
58
|
|
61
|
-
def today
|
62
|
-
@today ||= Date.today
|
63
|
-
end
|
64
|
-
|
65
59
|
def calculate_easiness_factor(easiness_factor, quality)
|
66
60
|
result = easiness_factor - 0.8 + (0.28 * quality) - (0.02 * quality * quality)
|
67
61
|
result < 1.3 ? 1.3 : result
|
data/lib/repetition/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repetition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|