toccatore 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1afd42c0c6cfb9ec371f68b9740a5a8c42b9037
4
- data.tar.gz: 328861ead255c1c3517fb4c0116e0f052a0111e5
3
+ metadata.gz: 14d61cfc855fd0511c6edcf78f76a3ba92adad8d
4
+ data.tar.gz: 32b946eb6a965502362b03978fe9fd31f62dbd5e
5
5
  SHA512:
6
- metadata.gz: 1787c3236d5f45f37e5be68cf4d13cd13f64c01f57617e79e370f505715bc78122eb0bf2001a5efb29e2e8512ebf465593b790abe6d85f37f7fcf9da6586d4c3
7
- data.tar.gz: e53dad6ed6caf890251327f2352c13562403ffe55ae553b59caa7f616385eda9de8f842dfc7abf162a86574c065c9f9528ceedf8f11188664d241717c9de19c3
6
+ metadata.gz: 8f6dd4249013ab2d738848542df78755526978ba0043ac75991e855dd3389f68fc54fa119d6cc4cee20c654f7dbccd8b15b3945aaa4f6b553d4ceb1b6985cbec
7
+ data.tar.gz: d588055da5420519137cdebbaf9bcaeff3abe9842991ee410caa88be0e0939aecf651e415d839b833d00114b9bbda78b19ae0e8b0b9d3b03f49ead2c42277bd8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toccatore (0.3.3)
4
+ toccatore (0.3.4)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  dotenv (~> 2.1, >= 2.1.1)
7
7
  gender_detector (~> 1.0)
data/lib/toccatore/cli.rb CHANGED
@@ -39,6 +39,7 @@ module Toccatore
39
39
  method_option :q, type: :string
40
40
  method_option :related_identifier, type: :string
41
41
  method_option :doi, type: :string
42
+ method_option :jsonapi, :type => :boolean, :force => false
42
43
  def datacite_related
43
44
  datacite_related = Toccatore::DataciteRelated.new
44
45
  datacite_related.queue_jobs(datacite_related.unfreeze(options))
@@ -60,7 +60,7 @@ module Toccatore
60
60
  host = options[:push_url].presence || "https://bus.eventdata.crossref.org"
61
61
  push_url = host + "/events"
62
62
 
63
- if host.ends_with?("datacite.org")
63
+ if options[:jsonapi]
64
64
  data = { "data" => {
65
65
  "id" => item["id"],
66
66
  "type" => "events",
@@ -1,3 +1,3 @@
1
1
  module Toccatore
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe Toccatore::CLI do
8
8
 
9
9
  describe "version" do
10
10
  it 'has version' do
11
- expect { subject.__print_version }.to output("0.3.3\n").to_stdout
11
+ expect { subject.__print_version }.to output("0.3.4\n").to_stdout
12
12
  end
13
13
  end
14
14
 
@@ -136,7 +136,7 @@ describe Toccatore::DataciteRelated, vcr: true do
136
136
  body = File.read(fixture_path + 'datacite_related.json')
137
137
  result = OpenStruct.new(body: { "data" => JSON.parse(body) })
138
138
  result = subject.parse_data(result, source_token: ENV['SOURCE_TOKEN'])
139
- options = { push_url: ENV['LAGOTTO_URL'], access_token: ENV['LAGOTTO_TOKEN'] }
139
+ options = { push_url: ENV['LAGOTTO_URL'], access_token: ENV['LAGOTTO_TOKEN'], jsonapi: true }
140
140
  expect { subject.push_data(result, options) }.to output(/https:\/\/doi.org\/10.15468\/dl.mb4das references https:\/\/doi.org\/10.3897\/phytokeys.12.2849 pushed to Event Data service.\n/).to_stdout
141
141
  end
142
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toccatore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner