openstax_content 1.2.0 → 1.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: 606de08c8e8a83ca196e43eef4d8159f4bddd9d94bf5a357af6e5e8109ed57ad
4
- data.tar.gz: 4ef85c1b6bba83ef5a2605d76a8fc76fd3ce63dc80d84a3030a2f1943a56251d
3
+ metadata.gz: 82eddc2890b74eeea7b59646cda86001dbb0385ddc00ad874ae5f69573441d57
4
+ data.tar.gz: a8f83e6c1a5bb7c0e5cda4e6171da21da8cfce91e1e89c74ecc954a8299015eb
5
5
  SHA512:
6
- metadata.gz: 6f994e45ad7f63e9d2ac8e2e143ef6b23a2688fee58c7de54a230cda84723bfa43eb1febeade0687e007d3453d1c970f7c4c6dad04cd75cee5ff0b9bc01003b2
7
- data.tar.gz: 345ec56a1b9aecf201612f67ee3b283f22928afba02ec1ddeb2ad9f6e4243ab95f33049bb1f7892b570515538588c3a97859e4aa009f5f24038bf57fcf6aff0b
6
+ metadata.gz: 34fe275a54727deb10d3636fbc82cf3c9a86461d67f6695ea157209b71ae0ded2660d4c0e4f100af332c5db9bb5b8b54769ce22f060ff96d13e2b3be9a3f98cc
7
+ data.tar.gz: 05ec447981510aac02c672ba6606aaf111ffe785ffdc5b7a8d1a0223f7e8c3807da7168b61551e1acc23d48cf31134a6d080e2a65ee4864a7a2491787b85eac3
@@ -71,7 +71,9 @@ class OpenStax::Content::Abl
71
71
  uuid: book[:uuid],
72
72
  version: version[:commit_sha][0..6],
73
73
  slug: book[:slug],
74
- style: book[:style]
74
+ style: book[:style],
75
+ min_code_version: version[:min_code_version],
76
+ committed_at: commit_metadata[:committed_at]
75
77
  )
76
78
  end
77
79
  end
@@ -1,11 +1,15 @@
1
+ require 'forwardable'
1
2
  require_relative 'book_part'
2
3
 
3
4
  class OpenStax::Content::Book
4
5
  extend Forwardable
5
6
 
6
- attr_reader :archive, :uuid, :version, :slug, :style
7
+ attr_reader :archive, :uuid, :version, :slug, :style, :min_code_version, :committed_at
7
8
 
8
- def initialize(archive:, uuid:, version:, url: nil, hash: nil, slug: nil, style: nil)
9
+ def initialize(
10
+ archive:, uuid:, version:,
11
+ url: nil, hash: nil, slug: nil, style: nil, min_code_version: nil, committed_at: nil
12
+ )
9
13
  @archive = archive
10
14
  @uuid = uuid
11
15
  @version = version
@@ -13,6 +17,12 @@ class OpenStax::Content::Book
13
17
  @hash = hash
14
18
  @slug = slug
15
19
  @style = style
20
+ @min_code_version = min_code_version
21
+ @committed_at = committed_at
22
+ end
23
+
24
+ def valid?
25
+ min_code_version.nil? || min_code_version <= archive.version
16
26
  end
17
27
 
18
28
  def url
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Content
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2022-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3