commonmeta-ruby 3.5.3 → 3.5.5

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: 3c2acea093c17e097fef5234c724c32893b6df9bb8192fcd356bbee1321d5ad5
4
- data.tar.gz: 9a93f805c39e517b7659d91508918bb7ad84a9270700f9662f90910fcf081f21
3
+ metadata.gz: 9c8e2d972bcad519ed4521af6b13bfd4f21d708b99df243f038d62d2896091a8
4
+ data.tar.gz: b2eadeaf3d3e52ab88e7c0cfb1c1317e8191fe9d7ab367597d269fb684bbde1a
5
5
  SHA512:
6
- metadata.gz: 570d1f410f9dd9608967697c3f3f6476cf767877441d3626eccf9993d56d551588bf2b39d514f5cfcd96043ad44f379c325334802f015445d99e19438d05f5a7
7
- data.tar.gz: '0678f6e2adc93ac9d740654efc9b5583e525dc1496fc75d01d22be26939ac8f07fd0c00f58e635ce4a97e1344672ef162c95ddfae72f489b3db72e5a51eb028d'
6
+ metadata.gz: f89aaf3a281c2cd60996ce69731fde9885cacfb2cabaa06226850167ac4d1928f317552423d13a3cf20c3356276952352d376bfa88ceaeb4dae5f5aac50bf1ae
7
+ data.tar.gz: ebf2502cdfee9151809656ea81f372e1e8e52f8da3bead8de70f5914882b570299b3ce4aa03e3fa9a01be307d4b064f5a5b32e5b772c9d80f56c45b9856319be
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.5.3)
4
+ commonmeta-ruby (3.5.5)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
6
  addressable (~> 2.8.1, < 2.8.2)
7
7
  base32-url (>= 0.7.0, < 1)
@@ -232,7 +232,7 @@ GEM
232
232
  unf_ext
233
233
  unf_ext (0.0.8.2)
234
234
  unicode-display_width (2.4.2)
235
- unicode-types (1.8.0)
235
+ unicode-types (1.9.0)
236
236
  uuidtools (2.2.0)
237
237
  vcr (6.2.0)
238
238
  webmock (3.19.1)
data/bin/commonmeta CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require File.expand_path("../../lib/commonmeta", __FILE__)
4
4
 
5
- if (ARGV & %w(--version -v help --help encode decode encode_id decode_id encode_by_blog encode_by_id json_feed_not_indexed json_feed_unregistered json_feed_by_blog update_ghost_post generate_ghost_api_token)).empty?
5
+ if (ARGV & %w(--version -v help --help encode decode encode_id decode_id encode_by_blog encode_by_id json_feed_not_indexed json_feed_unregistered json_feed_by_blog json_feed_blog_id update_ghost_post generate_ghost_api_token)).empty?
6
6
  Commonmeta::CLI.start(ARGV.dup.unshift("convert"))
7
7
  else
8
8
  Commonmeta::CLI.start
@@ -26,7 +26,7 @@ module Commonmeta
26
26
 
27
27
  desc "", "convert metadata"
28
28
  method_option :from, aliases: "-f"
29
- method_option :to, aliases: "-t", default: "schema_org"
29
+ method_option :to, aliases: "-t", default: "commonmeta"
30
30
  method_option :regenerate, type: :boolean, force: false
31
31
  method_option :style, aliases: "-s", default: "apa"
32
32
  method_option :locale, aliases: "-l", default: "en-US"
@@ -115,6 +115,12 @@ module Commonmeta
115
115
  puts get_json_feed_by_blog(id)
116
116
  end
117
117
 
118
+ desc "", "json_feed_blog_id"
119
+
120
+ def json_feed_blog_id(id)
121
+ puts get_json_feed_blog_id(id)
122
+ end
123
+
118
124
  desc "", "update_ghost_post"
119
125
 
120
126
  def update_ghost_post(id)
@@ -198,6 +198,17 @@ module Commonmeta
198
198
  blog["items"].map { |item| item["id"] }.first
199
199
  end
200
200
 
201
+ def get_json_feed_blog_id(id)
202
+ # get JSON Feed item by id and return blog id
203
+
204
+ url = json_feed_item_by_id_url(id)
205
+ response = HTTP.get(url)
206
+ return nil unless response.status.success?
207
+
208
+ post = JSON.parse(response.body.to_s)
209
+ post.to_h.dig("blog", "slug")
210
+ end
211
+
201
212
  def get_doi_prefix_by_blog_id(blog_id)
202
213
  # for generating a random DOI.
203
214
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmeta
4
- VERSION = '3.5.3'
4
+ VERSION = '3.5.5'
5
5
  end
data/spec/cli_spec.rb CHANGED
@@ -378,5 +378,10 @@ describe Commonmeta::CLI do
378
378
  input = "tyfqw20"
379
379
  expect { subject.json_feed_by_blog input }.to output(/37538c38-66e6-4ac4-ab5c-679684622ade/).to_stdout
380
380
  end
381
+
382
+ it "json_feed_blog_id" do
383
+ input = "01a92f9a-f8e0-442b-86e2-11530d9d5635"
384
+ expect { subject.json_feed_blog_id input }.to output(/eve/).to_stdout
385
+ end
381
386
  end
382
387
  end
@@ -0,0 +1,117 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://rogue-scholar.org/api/blogs/01a92f9a-f8e0-442b-86e2-11530d9d5635
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ''
9
+ headers:
10
+ Connection:
11
+ - close
12
+ Host:
13
+ - rogue-scholar.org
14
+ User-Agent:
15
+ - http.rb/5.1.1
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Age:
22
+ - '0'
23
+ Cache-Control:
24
+ - public, max-age=0, must-revalidate
25
+ Content-Length:
26
+ - '0'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Sun, 01 Oct 2023 13:03:42 GMT
31
+ Server:
32
+ - Vercel
33
+ Strict-Transport-Security:
34
+ - max-age=63072000
35
+ X-Matched-Path:
36
+ - "/api/blogs/[...params]"
37
+ X-Vercel-Cache:
38
+ - MISS
39
+ X-Vercel-Id:
40
+ - fra1::iad1::l5p8f-1696165422190-26d900c36ebf
41
+ Connection:
42
+ - close
43
+ body:
44
+ encoding: UTF-8
45
+ string: ''
46
+ recorded_at: Sun, 01 Oct 2023 13:03:42 GMT
47
+ - request:
48
+ method: get
49
+ uri: https://rogue-scholar.org/api/posts/01a92f9a-f8e0-442b-86e2-11530d9d5635
50
+ body:
51
+ encoding: ASCII-8BIT
52
+ string: ''
53
+ headers:
54
+ Connection:
55
+ - close
56
+ Host:
57
+ - rogue-scholar.org
58
+ User-Agent:
59
+ - http.rb/5.1.1
60
+ response:
61
+ status:
62
+ code: 200
63
+ message: OK
64
+ headers:
65
+ Age:
66
+ - '0'
67
+ Cache-Control:
68
+ - public, max-age=0, must-revalidate
69
+ Content-Length:
70
+ - '3101'
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ Date:
74
+ - Sun, 01 Oct 2023 13:04:10 GMT
75
+ Etag:
76
+ - '"m7vq2i46dx2df"'
77
+ Server:
78
+ - Vercel
79
+ Strict-Transport-Security:
80
+ - max-age=63072000
81
+ X-Matched-Path:
82
+ - "/api/posts/[[...params]]"
83
+ X-Vercel-Cache:
84
+ - MISS
85
+ X-Vercel-Id:
86
+ - fra1::iad1::m4qk2-1696165449788-443242d21f91
87
+ Connection:
88
+ - close
89
+ body:
90
+ encoding: UTF-8
91
+ string: '{"id":"01a92f9a-f8e0-442b-86e2-11530d9d5635","doi":"https://doi.org/10.59348/dmq66-f5d26","url":"https://eve.gd/2017/05/07/an-important-note-if-you-have-a-lenovo-g580","archive_url":null,"title":"An
92
+ important note if you have a Lenovo G580","summary":"The Lenovo G580 comes
93
+ with Windows 8. It is possible to permanently lock yourself out of the operating
94
+ system if you begin with a Microsoft account and migrate this to a local account.","content_html":"<p>The
95
+ Lenovo G580 comes with Windows 8. It is possible to permanently lock yourself
96
+ out of the operating system if you begin with a Microsoft account and migrate
97
+ this to a local account. Further, you won’t be able to rescue the system since
98
+ <em>it is impossible to enter the BIOS setup in the machine’s default state
99
+ if you cannot login to Windows</em>.</p>\n\n<p>To fix this:</p>\n\n<ol>\n <li>Disable
100
+ “fast boot” mode in Windows 8. You can do this in “Power Settings”. If you
101
+ don’t do this, you can’t modify the Windows disk partition when booting from
102
+ a recovery USB.</li>\n <li><a href=\"https://download.lenovo.com/consumer/mobiles/62cn97ww_64.exe\">Update
103
+ your BIOS</a>. Do it now or you won’t be able to unless you can still login
104
+ to Windows 8.</li>\n <li>Go into the BIOS (shutdown the machine then press
105
+ the small button next to the power button and select “BIOS setup”). Then,
106
+ set an administrator password in the BIOS settings. Then, “disable secure
107
+ boot”. This will allow you to boot from a recovery USB stick such as Kali
108
+ or Ubuntu.</li>\n</ol>\n\n<p>Urgh. A Catch-22 where Microsoft Windows corrupted
109
+ a login (thanks, Microsoft) and a hardware defect stops you booting into a
110
+ recovery medium (thanks, Lenovo).</p>\n\n <p><a href=\"https://eve.gd/2017/05/07/an-important-note-if-you-have-a-lenovo-g580/\">An
111
+ important note if you have a Lenovo G580</a> was originally published by Martin
112
+ Paul Eve at <a href=\"https://eve.gd\">Martin Paul Eve</a> on May 07, 2017.</p>","published_at":1494172558,"updated_at":1494172558,"indexed_at":1696162656,"authors":[{"url":"https://orcid.org/0000-0002-5589-8511","name":"Martin
113
+ Paul Eve"}],"image":null,"tags":[],"language":"en","reference":[],"relationships":[],"blog_id":"z4b9d78","blog_name":"Martin
114
+ Paul Eve","blog_slug":"eve","blog":{"id":"z4b9d78","title":"Martin Paul Eve","description":null,"language":"en","favicon":"https://eve.gd/favicon.png","feed_url":"https://eve.gd/feed_all.xml","home_page_url":"https://eve.gd","user_id":"eb3f6a26-3e38-42ad-b752-250eb2c0bf89","created_at":"2023-07-26","feed_format":"application/atom+xml","license":"https://creativecommons.org/licenses/by/4.0/legalcode","generator":"Jekyll","category":"languagesAndLiterature","prefix":"10.59348","modified_at":"1970-01-01T00:00:00+00:00","version":"https://jsonfeed.org/version/1.1","current_feed_url":"https://eve.gd/feed.xml","status":"active","issn":null,"backlog":0,"authors":[{"url":null,"name":"Martin
115
+ Paul Eve"}],"plan":"Team","slug":"eve","use_mastodon":false,"api":false,"funding":null,"archive_prefix":null,"use_api":null,"relative_url":"blog","canonical_url":null}}'
116
+ recorded_at: Sun, 01 Oct 2023 13:04:10 GMT
117
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,132 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://rogue-scholar.org/api/posts/1898d2d7-4d87-4487-96c4-3073cf99e9a5
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ''
9
+ headers:
10
+ Connection:
11
+ - close
12
+ Host:
13
+ - rogue-scholar.org
14
+ User-Agent:
15
+ - http.rb/5.1.1
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Age:
22
+ - '0'
23
+ Cache-Control:
24
+ - public, max-age=0, must-revalidate
25
+ Content-Length:
26
+ - '8651'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Sun, 01 Oct 2023 12:54:48 GMT
31
+ Etag:
32
+ - '"cgg0qca1si6o1"'
33
+ Server:
34
+ - Vercel
35
+ Strict-Transport-Security:
36
+ - max-age=63072000
37
+ X-Matched-Path:
38
+ - "/api/posts/[[...params]]"
39
+ X-Vercel-Cache:
40
+ - MISS
41
+ X-Vercel-Id:
42
+ - fra1::iad1::chhkb-1696164887801-9f1569e3d50b
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"id":"1898d2d7-4d87-4487-96c4-3073cf99e9a5","doi":"https://doi.org/10.59350/63055-a8604","url":"http://sfmatheson.blogspot.com/2023/01/quintessence-of-dust-2023-restart-why.html","archive_url":null,"title":"Quintessence
48
+ of Dust 2023 restart: the why","summary":"It''s early January 2023, a little
49
+ before sunset in Tucson. Live image below, showing the glorious Santa Catalina
50
+ mountains (the snow on the upper reaches is more apparent earlier in the day)
51
+ and my dinner preparations (shrimp and veggies on the grill).I''ve decided
52
+ to start writing here at <i>Quintessence of Dust</i>, after another long hiatus.","content_html":"It''s
53
+ early January 2023, a little before sunset in Tucson. Live image below, showing
54
+ the glorious Santa Catalina mountains (the snow on the upper reaches is more
55
+ apparent earlier in the day) and my dinner preparations (shrimp and veggies
56
+ on the grill).<div><a href=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgBx9BU21qMDFnLxgHmnsl6TQVfb3QCwOXrC1zcXq7WH9gN8E0TcH3pTslRBG6O8mb5gcuF9JVtDlJ2je6dFcfyzKE4OD38-ftr66nBxddo892_NkyuevrrX65ndSbwmXMaLh3F5yiqU1QIj8JtA8FLkKOcHOEVwVafz0rzh7PejbFzp3XT25nQxc/s4032/Jan%207.jpg\"><img
57
+ height=\"320\" src=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgBx9BU21qMDFnLxgHmnsl6TQVfb3QCwOXrC1zcXq7WH9gN8E0TcH3pTslRBG6O8mb5gcuF9JVtDlJ2je6dFcfyzKE4OD38-ftr66nBxddo892_NkyuevrrX65ndSbwmXMaLh3F5yiqU1QIj8JtA8FLkKOcHOEVwVafz0rzh7PejbFzp3XT25nQxc/s320/Jan%207.jpg\"
58
+ width=\"240\" /></a></div><br /><div><div>I''ve decided to start writing here
59
+ at <i>Quintessence of Dust</i>, after another long hiatus. Here are some of
60
+ my reasons.</div><div><br /></div><div>1. I like to write, and I have things
61
+ to say, and I self-identify as an author. For eight years, I have co-organized
62
+ and taught in the <a href=\"https://meetings.cshl.edu/courses.aspx?course=C-WRITE&amp;year=23\"
63
+ target=\"_blank\">Scientific Writing Retreat at Cold Spring Harbor Laboratory</a>.
64
+ I''m a writer and I need to write, if only for myself.</div><div><br /></div><div>2.
65
+ I have an idea for a book, along with some introductory work (but no sample
66
+ chapters yet) and writing here will help me develop those thoughts. The idea
67
+ is over twelve years old and has never faded away, which I take to mean that
68
+ I need to get it out of my system somehow.</div><div><br /></div><div>3. I
69
+ have other ideas kicking around in my head and most of them are worth writing
70
+ about. I have one new intellectual passion that is totally worth writing about:
71
+ <a href=\"https://skyislandalliance.org/the-sky-islands/\" target=\"_blank\">the
72
+ Sky Islands</a> that nearly surround us here in Tucson.</div><div><br /></div><div>4.
73
+ I have an exciting new job with great new people at <a href=\"https://plos.org/\"
74
+ target=\"_blank\">an organization</a> that''s all in for <a href=\"https://plos.org/open-science/\"
75
+ target=\"_blank\">open science</a>. I recently turned over the tens digit
76
+ on my age-o-meter. My kids will very soon be all out of college. (One is about
77
+ to start a postdoc!) All of this led, predictably, to a spasm of reflection
78
+ on projects and vision. One clear result is that I''m feeling more inspired.<span><a
79
+ name=\"more\"></a></span></div><div><br /></div><div>5. The demise of Twitter
80
+ has led to a lot of <a href=\"https://www.theatlantic.com/technology/archive/2022/11/twitter-facebook-social-media-decline/672074/\"
81
+ target=\"_blank\">useful commentary</a> about the nature of social media.
82
+ I left Facebook two years ago and all but left Twitter two months ago. I''m
83
+ on a <a href=\"https://fediscience.org/explore\" target=\"_blank\">good server
84
+ at Mastodon</a> and I like it; maybe microblogging there can satisfy my desire
85
+ for conversation and connection. But <a href=\"https://www.theverge.com/23513418/bring-back-personal-blogging\"
86
+ target=\"_blank\">this recent piece</a> at <i>The Verge</i> by <a href=\"https://moniquejudge.com/\"
87
+ target=\"_blank\">Monique Judge</a> convinced me that blogging could (again)
88
+ have a place in the future.</div><div><br /><div>Here''s her summary, emphasis
89
+ mine:</div><div><blockquote>At the end of the day, we don’t know what is going
90
+ to happen next with Twitter or any of these platforms. We don’t know what
91
+ changes <a href=\"https://www.techtarget.com/whatis/definition/Web-30\" target=\"_blank\">Web
92
+ 3.0</a> is going to bring to the internet. We do know that <b>we will all
93
+ still be here, wanting to share our thoughts, talk about anything and everything,
94
+ and commune with our people</b>. Personal blogging is the simplest and fastest
95
+ way to do all of that. </blockquote></div><div>That''s what I want! A place
96
+ to write, and (if I''m lucky) a place to discuss and \"commune\" with people.
97
+ That used to happen a lot at <i>Quintessence of Dust</i>.<span></span></div></div></div><div><br
98
+ /></div><div>Okay, but why here? This blog is over 15 years old and was started
99
+ when I was a Christian believer. <a href=\"https://sfmatheson.blogspot.com/2007/08/kicking-off-my-blog.html\"
100
+ target=\"_blank\">Its founding themes</a> were anchored in a desire to help
101
+ Christians understand and enjoy biology, to help them shake free of misinformation
102
+ and dishonesty. It has twice languished through long hiatuses and was <a href=\"https://sfmatheson.blogspot.com/p/about.html\"
103
+ target=\"_blank\">remodeled</a> back in 2017 a few years after I deconverted.
104
+ Maybe it''s time to start anew? I think not, for many of those same reasons:
105
+ I''m still a biologist who loves science, still worried about misinformation,
106
+ and still rooted in the power of scientific explanation. I''m still a bardolator
107
+ and a Red Sox fan. <a href=\"https://sfmatheson.blogspot.com/p/about.html\">I''m
108
+ still me</a>, and <i>Quintessence of Dust</i> is still my blog. The new <a
109
+ href=\"https://sfmatheson.blogspot.com/p/about.html\" target=\"_blank\">About
110
+ page</a> is slightly remodeled from 2017, and hints at the next post, which
111
+ will outline some new goals and ongoing projects.</div><div><br /></div><div>A
112
+ final note on inspiration, from Imani Perry, writing in her newsletter (<a
113
+ href=\"https://newsletters.theatlantic.com/unsettled-territory/\" target=\"_blank\">Unsettled
114
+ Territory</a>) at <i>The Atlantic</i>. The piece is \"<a href=\"https://newsletters.theatlantic.com/unsettled-territory/63af3facace609003751bacc/becoming-writer-habit-journalism/\"
115
+ target=\"_blank\">Writing is a Democratic Art</a>.\" It''s for subscribers
116
+ only but here is her challenge:</div><div><blockquote>Thinking and writing
117
+ at a faster pace stretched me and gave me greater confidence. Sometimes I
118
+ changed my mind about what I’d written a day later. But that was okay; a newsletter
119
+ is a moment in time. Writing it each week gave me a lovely rhythm in what
120
+ has otherwise been a difficult and disorienting season in history. Feeling
121
+ stuck can get you stuck. But writing can, and should, inspire deeds.</blockquote></div>","published_at":1673233380,"updated_at":1680470227,"indexed_at":1689006804,"authors":[{"url":null,"name":"Stephen
122
+ Matheson"}],"image":"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgBx9BU21qMDFnLxgHmnsl6TQVfb3QCwOXrC1zcXq7WH9gN8E0TcH3pTslRBG6O8mb5gcuF9JVtDlJ2je6dFcfyzKE4OD38-ftr66nBxddo892_NkyuevrrX65ndSbwmXMaLh3F5yiqU1QIj8JtA8FLkKOcHOEVwVafz0rzh7PejbFzp3XT25nQxc/s320/Jan%207.jpg","tags":["Introduction"],"language":"en","reference":[],"relationships":[],"blog_id":"5764g49","blog_name":"Quintessence
123
+ of Dust","blog_slug":"sfmatheson","blog":{"id":"5764g49","title":"Quintessence
124
+ of Dust","description":"<i>Quintessence of Dust</i> explores science, society,
125
+ and human nature, focusing on genetics, development, evolution, neuroscience,
126
+ systems biology, and topics related to scientific literacy. I occasionally
127
+ discuss intelligent design, creationism, science denial, and other political/social
128
+ influences on scientific literacy. Additional topics: philosophy, baseball,
129
+ scientific culture, and Shakespeare. My main theme is <b><u>scientific explanation</u></b>.","language":"en","favicon":null,"feed_url":"http://sfmatheson.blogspot.com/feeds/posts/default","home_page_url":"http://sfmatheson.blogspot.com","user_id":"656f9875-3304-4056-935b-b29429e14222","created_at":"2023-04-18","feed_format":"application/atom+xml","license":"https://creativecommons.org/licenses/by/4.0/legalcode","generator":"Blogger
130
+ 7.00","category":"socialSciences","prefix":"10.59350","modified_at":"2023-09-11T17:46:56+00:00","version":"https://jsonfeed.org/version/1.1","current_feed_url":null,"status":"active","issn":null,"backlog":0,"authors":null,"plan":"Team","slug":"sfmatheson","use_mastodon":false,"api":false,"funding":null,"archive_prefix":null,"use_api":null,"relative_url":null,"canonical_url":null}}'
131
+ recorded_at: Sun, 01 Oct 2023 12:54:48 GMT
132
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://rogue-scholar.org/api/posts/2b22bbba-bcba-4072-94cc-3f88442fff55
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ''
9
+ headers:
10
+ Connection:
11
+ - close
12
+ Host:
13
+ - rogue-scholar.org
14
+ User-Agent:
15
+ - http.rb/5.1.1
16
+ response:
17
+ status:
18
+ code: 404
19
+ message: Not Found
20
+ headers:
21
+ Age:
22
+ - '0'
23
+ Cache-Control:
24
+ - public, max-age=0, must-revalidate
25
+ Content-Length:
26
+ - '28'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Sun, 01 Oct 2023 12:54:48 GMT
31
+ Etag:
32
+ - '"jtxxi9yf69s"'
33
+ Server:
34
+ - Vercel
35
+ Strict-Transport-Security:
36
+ - max-age=63072000
37
+ X-Matched-Path:
38
+ - "/api/posts/[[...params]]"
39
+ X-Vercel-Cache:
40
+ - MISS
41
+ X-Vercel-Id:
42
+ - fra1::iad1::6plz2-1696164888551-86b03621bd39
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"message":"Post not found"}'
48
+ recorded_at: Sun, 01 Oct 2023 12:54:48 GMT
49
+ recorded_with: VCR 6.2.0
@@ -541,4 +541,16 @@ describe Commonmeta::Metadata, vcr: true do
541
541
  expect(response).to eq("10.54900")
542
542
  end
543
543
  end
544
+
545
+ context "get blog_id for json_feed item id", vcr: true do
546
+ it "by blog post id" do
547
+ response = subject.get_json_feed_blog_id("1898d2d7-4d87-4487-96c4-3073cf99e9a5")
548
+ expect(response).to eq("sfmatheson")
549
+ end
550
+
551
+ it "not found" do
552
+ response = subject.get_doi_prefix_by_json_feed_item_id("2b22bbba-bcba-4072-94cc-3f88442fff55")
553
+ expect(response).to eq(nil)
554
+ end
555
+ end
544
556
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmeta-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.3
4
+ version: 3.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
@@ -795,6 +795,7 @@ files:
795
795
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/find_from_format_by_id/kisti.yml
796
796
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/find_from_format_by_id/medra.yml
797
797
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/find_from_format_by_id/op.yml
798
+ - spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed/json_feed_blog_id.yml
798
799
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed/json_feed_by_blog.yml
799
800
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed/json_feed_not_indexed.yml
800
801
  - spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed/json_feed_unregistered.yml
@@ -811,6 +812,8 @@ files:
811
812
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/find_from_format_by_ID/datacite.yml
812
813
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/find_from_format_by_ID/datacite_doi_http.yml
813
814
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml
815
+ - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_blog_id_for_json_feed_item_id/by_blog_post_id.yml
816
+ - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_blog_id_for_json_feed_item_id/not_found.yml
814
817
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_cff_metadata/cff-converter-python.yml
815
818
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_cff_metadata/ruby-cff.yml
816
819
  - spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_cff_metadata/ruby-cff_repository_url.yml