openstax_content 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstax/content/archive.rb +10 -3
- data/lib/openstax/content/book.rb +4 -4
- data/lib/openstax/content/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: 606de08c8e8a83ca196e43eef4d8159f4bddd9d94bf5a357af6e5e8109ed57ad
|
4
|
+
data.tar.gz: 4ef85c1b6bba83ef5a2605d76a8fc76fd3ce63dc80d84a3030a2f1943a56251d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f994e45ad7f63e9d2ac8e2e143ef6b23a2688fee58c7de54a230cda84723bfa43eb1febeade0687e007d3453d1c970f7c4c6dad04cd75cee5ff0b9bc01003b2
|
7
|
+
data.tar.gz: 345ec56a1b9aecf201612f67ee3b283f22928afba02ec1ddeb2ad9f6e4243ab95f33049bb1f7892b570515538588c3a97859e4aa009f5f24038bf57fcf6aff0b
|
@@ -11,13 +11,20 @@ class OpenStax::Content::Archive
|
|
11
11
|
@s3 ||= OpenStax::Content::S3.new
|
12
12
|
end
|
13
13
|
|
14
|
+
def versions
|
15
|
+
@versions ||= s3.ls.reverse
|
16
|
+
end
|
17
|
+
|
14
18
|
def version
|
15
|
-
@version
|
19
|
+
@version || versions.first
|
20
|
+
end
|
21
|
+
|
22
|
+
def previous_version
|
23
|
+
versions[versions.index(version) + 1]
|
16
24
|
end
|
17
25
|
|
18
26
|
def base_url
|
19
|
-
@base_url ||= "https://#{OpenStax::Content.domain}/#{
|
20
|
-
OpenStax::Content.archive_path}/#{version}"
|
27
|
+
@base_url ||= "https://#{OpenStax::Content.domain}/#{OpenStax::Content.archive_path}/#{version}"
|
21
28
|
end
|
22
29
|
|
23
30
|
def url_for(object)
|
@@ -19,14 +19,14 @@ class OpenStax::Content::Book
|
|
19
19
|
@url ||= archive.url_for "#{uuid}@#{version}"
|
20
20
|
end
|
21
21
|
|
22
|
-
def hash
|
23
|
-
@hash ||= archive.json url
|
24
|
-
end
|
25
|
-
|
26
22
|
def url_fragment
|
27
23
|
@url_fragment ||= url.chomp('.json')
|
28
24
|
end
|
29
25
|
|
26
|
+
def hash
|
27
|
+
@hash ||= archive.json url
|
28
|
+
end
|
29
|
+
|
30
30
|
def baked
|
31
31
|
@baked ||= hash['baked']
|
32
32
|
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.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|