relaton-cli 0.1.10 → 0.2.0

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
  SHA256:
3
- metadata.gz: f1e8d976c2b02974585ecdae77bf5737e7d3b2701c79f168ab44d775c005935e
4
- data.tar.gz: 39c205cb7863fb70e43c465c28e87ae54935501b1f9ef0427ef0349b7cbb3047
3
+ metadata.gz: c65fdfca202de14e05173d9c20a7fac23b11f33a45bb496adcfd5a67eb51c5d4
4
+ data.tar.gz: 790a6d8d9af1e2b72d59a430db1e7a37ab3f3cf67b6083abbac1b87713f30104
5
5
  SHA512:
6
- metadata.gz: fa32c9beb7744a8eba3d41661ac68a5010923b7a7017e29c145d75b37694916203a71365daa69a8ff76148164aee335837752904c3daa3c3d7ecbac16e5cdfb3
7
- data.tar.gz: c430918d1db7b87438a8e5b64e34bed702ffdeabf07dc06bcc3911b60327d9ad05ab8ab4ec2a70a7b03f7129d8a7626e0bd599b3e86a06ca341d5232f0eec86f
6
+ metadata.gz: f59e8cc8d04a9251a4e2dda174d0cbcbd371439d2d292f3ef7e83ba0ba007d4cd2c9294d381fe7b81b7124a5f39cb1d0a1f492db0b230c962c3b2c8753be8bdc
7
+ data.tar.gz: 2c8c6a3515dd92143a4b824aeaeb4bf7aac3f48ee95ec94b5916966bb3d0f08c8f8c4f9ccc21b8d426c467a77aed9aab97efceeb998815b24d1231b4b2d9dd6c
data/.travis.yml CHANGED
@@ -1,3 +1,5 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
3
  language: ruby
2
4
  cache: bundler
3
5
  os:
@@ -6,14 +8,10 @@ os:
6
8
  rvm:
7
9
  - 2.5
8
10
  - 2.4
9
- - 2.3
10
11
  - ruby-head
11
- before_install:
12
+ before_install:
12
13
  - gem install bundler -v 2.0.1
13
14
  - bundle update
14
- - mkdir ./tmp
15
- - mkdir ~/.relaton
16
15
  matrix:
17
16
  allow_failures:
18
- - rvm: 2.3
19
17
  - rvm: ruby-head
data/appveyor.yml CHANGED
@@ -1,5 +1,10 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
3
  version: '{build}'
2
4
 
5
+ cache:
6
+ - vendor/bundle
7
+
3
8
  environment:
4
9
  matrix:
5
10
  - RUBY_VERSION: 25
@@ -16,6 +21,8 @@ install:
16
21
 
17
22
  build_script:
18
23
  - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
24
+ - set GIT_TERMINAL_PROMPT=0
25
+ - bundle config --local path vendor/bundle
19
26
  - bundle update
20
27
  - bundle install
21
28
 
@@ -26,4 +33,3 @@ before_test:
26
33
 
27
34
  test_script:
28
35
  - bundle exec rake
29
-
@@ -21,6 +21,7 @@ module Relaton
21
21
  copyright_owner
22
22
  contributor_author_role
23
23
  contributor_author_organization
24
+ contributor_author_person
24
25
  contributor_publisher_role
25
26
  contributor_publisher_organization
26
27
  language
@@ -28,6 +29,7 @@ module Relaton
28
29
  edition
29
30
  datetype
30
31
  bib_rxl
32
+ ref
31
33
  ]
32
34
 
33
35
  attr_accessor *ATTRIBS
@@ -61,7 +63,7 @@ module Relaton
61
63
  def to_xml
62
64
  #datetype = stage&.casecmp("published") == 0 ? "published" : "circulated"
63
65
 
64
- ret = "<bibdata type='#{doctype}'>\n"
66
+ ret = ref ? "<bibitem id= '#{ref}' type='#{doctype}'>\n" : "<bibdata type='#{doctype}'>\n"
65
67
  ret += "<fetched>#{Date.today.to_s}</fetched>\n"
66
68
  ret += "<title>#{title}</title>\n"
67
69
  ret += "<docidentifier>#{docidentifier}</docidentifier>\n" if docidentifier
@@ -89,6 +91,15 @@ module Relaton
89
91
  ret += "</contributor>\n"
90
92
  end
91
93
 
94
+ if contributor_author_person
95
+ Array(contributor_author_person).each do |name|
96
+ ret += "<contributor>\n"
97
+ ret += "<role type='author'/>\n"
98
+ ret += "<person><name><completename>#{name}</completename></name></person>\n"
99
+ ret += "</contributor>\n"
100
+ end
101
+ end
102
+
92
103
  if contributor_publisher_role
93
104
  ret += "<contributor>\n"
94
105
  ret += "<role type='publisher'/>\n"
@@ -105,7 +116,7 @@ module Relaton
105
116
  ret += "<abstract>#{abstract}</abstract>\n" if abstract
106
117
  ret += "<status>#{stage}</status>\n" if stage
107
118
  ret += "<editorialgroup><technical-committee>#{technical_committee}</technical-committee></editorialgroup>\n" if technical_committee
108
- ret += "</bibdata>\n"
119
+ ret += ref ? "</bibitem>\n" : "</bibdata>\n"
109
120
  end
110
121
 
111
122
  def to_h
@@ -82,7 +82,7 @@ module Relaton
82
82
 
83
83
  def fetch_document(code, options)
84
84
  if registered_types.include?(options[:type])
85
- doc = Cli.relaton.fetch_std(code, options[:year], options[:type])
85
+ doc = Cli.relaton.fetch(code, options[:year])
86
86
  doc ? doc.to_xml : "No matching bibliographic entry found"
87
87
  end
88
88
  end
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "0.1.10".freeze
3
+ VERSION = "0.2.0".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ require_relative "relaton/bibcollection"
2
+ require_relative "relaton/bibdata"
3
+ require_relative "relaton/element_finder"
4
+ require_relative "relaton/xml_document"
5
+
data/relaton-cli.gemspec CHANGED
@@ -21,8 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
-
25
- spec.required_ruby_version = ">= 2.3.0"
24
+ spec.required_ruby_version = ">= 2.4.0"
26
25
 
27
26
  spec.add_development_dependency "rake", "~> 12.0"
28
27
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -32,7 +31,7 @@ Gem::Specification.new do |spec|
32
31
  spec.add_development_dependency "rspec-core", "~> 3.4"
33
32
  spec.add_development_dependency "pry"
34
33
 
35
- spec.add_runtime_dependency "relaton", "~> 0.3"
34
+ spec.add_runtime_dependency "relaton", "~> 0.4"
36
35
  spec.add_runtime_dependency "thor"
37
36
  spec.add_runtime_dependency "liquid"
38
37
  # spec.add_runtime_dependency 'byebug'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-03 00:00:00.000000000 Z
11
+ date: 2019-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.3'
117
+ version: '0.4'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.3'
124
+ version: '0.4'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: thor
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +175,7 @@ files:
175
175
  - docs/README.adoc
176
176
  - exe/relaton
177
177
  - i18n.yaml
178
+ - lib/relaton-cli.rb
178
179
  - lib/relaton/bibcollection.rb
179
180
  - lib/relaton/bibdata.rb
180
181
  - lib/relaton/cli.rb
@@ -205,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
206
  requirements:
206
207
  - - ">="
207
208
  - !ruby/object:Gem::Version
208
- version: 2.3.0
209
+ version: 2.4.0
209
210
  required_rubygems_version: !ruby/object:Gem::Requirement
210
211
  requirements:
211
212
  - - ">="