relaton-cli 1.13.0 → 1.14.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: 67074e0aa3fa8c3f3badfa9cd924ff0f861aaf14fb456f7a051668be827f5f78
4
- data.tar.gz: b01b4c8710566bbffaa64ffd16ac3ce2f4e5a0d1fa24b1f8924b1d2ada4321db
3
+ metadata.gz: 6fd8ffb93b927616ab960caf1121e0d9a0f27626cebbcc145f29906c3fefcc99
4
+ data.tar.gz: 7a79f57146c78ddd03e18da34f0061954f6e8065cc5a7b9358bf05f338925598
5
5
  SHA512:
6
- metadata.gz: f2e2eff22baaca6079ffd6ce9fa07abac954db8bbb16138e740c910ccf8f5b5fada43c3809616e2f810fdc0f6eb54e281eff95d29d7b417ec888e6cf778053e1
7
- data.tar.gz: dcaf6f5e5fe0d708ee02b0671beb0906f6173e8e69e9334f77b41526b3c2ec0c6a5cd506d17226cc15080ee038cc6d7cdac5264b1c7fb3a32c954f70e158ab5f
6
+ metadata.gz: fd306912d09570d223bb1c10a663c6b6b94f180634f604939830246113960ecb8753126c95fdb93cfa5c18cd359ee7f002a5a9dcb9298a7e1691299eca524206
7
+ data.tar.gz: 7f9b129d4e45c4e994572a8e3fd9c5db1b5bf777d87554c62a92d3e2268d163294b34d25071b6337a90eadaca9162998d4c45ea67b76402a9192a46f7b8ee413
@@ -5,7 +5,6 @@ name: rake
5
5
  on:
6
6
  push:
7
7
  branches: [ master, main ]
8
- tags: [ v* ]
9
8
  pull_request:
10
9
 
11
10
  jobs:
@@ -15,31 +15,8 @@ on:
15
15
 
16
16
  jobs:
17
17
  release:
18
- runs-on: ubuntu-latest
19
- steps:
20
- - uses: actions/checkout@v2
21
-
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: '2.6'
25
- bundler-cache: true
26
-
27
- - run: gem install gem-release
28
-
29
- - run: |
30
- git config user.name github-actions
31
- git config user.email github-actions@github.com
32
-
33
- - if: github.event_name == 'workflow_dispatch' && github.event.inputs.next_version != 'skip'
34
- run: gem bump --version ${{ github.event.inputs.next_version }} --tag --push
35
-
36
- - name: publish to rubygems.org
37
- env:
38
- RUBYGEMS_API_KEY: ${{secrets.RELATON_CI_RUBYGEMS_API_KEY}}
39
- run: |
40
- envsubst << 'EOF' > ~/.gem/credentials
41
- ---
42
- :rubygems_api_key: ${RUBYGEMS_API_KEY}
43
- EOF
44
- chmod 0600 ~/.gem/credentials
45
- gem release
18
+ uses: relaton/support/.github/workflows/release.yml@master
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
@@ -109,7 +109,7 @@ module Relaton
109
109
  @relaton_collection ||= Bibcollection.from_xml(nokogiri_document(nil, source))
110
110
  end
111
111
 
112
- def extract_and_write_to_files
112
+ def extract_and_write_to_files # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
113
113
  select_source_files.each do |file|
114
114
  xml = nokogiri_document(nil, file)
115
115
  xml.remove_namespaces!
@@ -7,8 +7,8 @@ module Relaton
7
7
  class_option :verbose, aliases: :v, type: :boolean, desc: "Output warnings"
8
8
 
9
9
  desc "create COLLECTION", "Create collection"
10
- option :dir, aliases: :d, desc: "Directory to store collection. Default "\
11
- "is $HOME/.relaton/collections."
10
+ option :dir, aliases: :d, desc: "Directory to store collection. " \
11
+ "Default is $HOME/.relaton/collections."
12
12
  option :author, desc: "Author"
13
13
  option :title, desc: "Title"
14
14
  option :doctype, desc: "Documents type"
@@ -20,14 +20,14 @@ module Relaton
20
20
  if File.exist? file_path
21
21
  warn "Collection #{file} aready exist"
22
22
  else
23
- Dir.mkdir dir unless Dir.exist? dir
23
+ FileUtils.mkdir_p dir # unless Dir.exist? dir
24
24
  File.write file_path, col.to_yaml, encoding: "UTF-8"
25
25
  end
26
26
  end
27
27
 
28
28
  desc "info COLLECTION", "View collection information"
29
- option :dir, aliases: :d, desc: "Directory to store collection. Default "\
30
- "is $HOME/.relaton/collections."
29
+ option :dir, aliases: :d, desc: "Directory to store collection. " \
30
+ "Default is $HOME/.relaton/collections."
31
31
 
32
32
  def info(file) # rubocop:disable Metrics/AbcSize
33
33
  path = File.join directory, file
@@ -41,8 +41,8 @@ module Relaton
41
41
  end
42
42
 
43
43
  desc "list", "List collections"
44
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
45
- "$HOME/.relaton/collections."
44
+ option :dir, aliases: :d, desc: "Directory with collections. Default " \
45
+ "is $HOME/.relaton/collections."
46
46
  option :entries, aliases: :e, type: :boolean, desc: "Show entries"
47
47
 
48
48
  def list
@@ -58,13 +58,13 @@ module Relaton
58
58
  map ls: :list
59
59
 
60
60
  desc "get CODE", "Fetch document from collection by ID"
61
- option :collection, aliases: :c, desc: "Collection to fetch document. "\
61
+ option :collection, aliases: :c, desc: "Collection to fetch document. " \
62
62
  "By default fetch the first match across all collections."
63
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
64
- "$HOME/.relaton/collections."
65
- option :format, aliases: :f, desc: "Output format (xml, abb). "\
63
+ option :dir, aliases: :d, desc: "Directory with collections. Default " \
64
+ "is $HOME/.relaton/collections."
65
+ option :format, aliases: :f, desc: "Output format (xml, abb). " \
66
66
  "If not defined the output in a human-readable form."
67
- option :output, aliases: :o, desc: "Output to the specified file. The "\
67
+ option :output, aliases: :o, desc: "Output to the specified file. The " \
68
68
  " file's extension (abb, xml) defines output format."
69
69
 
70
70
  def get(docid)
@@ -79,10 +79,10 @@ module Relaton
79
79
  end
80
80
 
81
81
  desc "find TEXT", "Full-text search"
82
- option :collection, aliases: :c, desc: "Collection to search text. "\
82
+ option :collection, aliases: :c, desc: "Collection to search text. " \
83
83
  "By default search across all collections."
84
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
85
- "$HOME/.relaton/collections."
84
+ option :dir, aliases: :d, desc: "Directory with collections. Default is " \
85
+ "$HOME/.relaton/collections."
86
86
 
87
87
  def find(text)
88
88
  collections.each do |col|
@@ -98,14 +98,14 @@ module Relaton
98
98
  map search: :find
99
99
 
100
100
  desc "fetch CODE", "Fetch a document and store it into a collection"
101
- option :type, aliases: :t, required: true, desc: "Type of standard to "\
102
- "get bibliographic entry for"
103
- option :year, aliases: :y, type: :numeric, desc: "Year the standard was "\
104
- "published"
105
- option :collection, aliases: :c, required: true, desc: "Collection "\
106
- "to store a document"
107
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
108
- "$HOME/.relaton/collections."
101
+ option :type, aliases: :t, required: true,
102
+ desc: "Type of standard to get bibliographic entry for"
103
+ option :year, aliases: :y, type: :numeric,
104
+ desc: "Year the standard was published"
105
+ option :collection, aliases: :c, required: true,
106
+ desc: "Collection to store a document"
107
+ option :dir, aliases: :d, desc: "Directory with collections. Default is " \
108
+ "$HOME/.relaton/collections."
109
109
 
110
110
  def fetch(code) # rubocop:disable Metrics/AbcSize
111
111
  doc = Relaton.db.fetch(code, options[:year]&.to_s)
@@ -118,12 +118,13 @@ module Relaton
118
118
  end
119
119
  end
120
120
 
121
- desc "import FILE", "Import document or collection from an XML file "\
122
- "into another collection"
123
- option :collection, aliases: :c, required: true, desc: "Collection to "\
124
- "store a document. If collection doesn't exist then it'll be created."
125
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
126
- "$HOME/.relaton/collections."
121
+ desc "import FILE", "Import document or collection from an XML file " \
122
+ "into another collection"
123
+ option :collection, aliases: :c, required: true,
124
+ desc: "Collection to store a document. If " \
125
+ "collection doesn't exist then it'll be created."
126
+ option :dir, aliases: :d, desc: "Directory with collections. Default is " \
127
+ "$HOME/.relaton/collections."
127
128
 
128
129
  def import(file) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
129
130
  collfile = File.join directory, options[:collection]
@@ -143,12 +144,12 @@ module Relaton
143
144
  end
144
145
 
145
146
  desc "export COLLECTION", "Export collection into XML file"
146
- option :dir, aliases: :d, desc: "Directory with collections. Default is "\
147
- "$HOME/.relaton/collections."
147
+ option :dir, aliases: :d, desc: "Directory with collections. Default is " \
148
+ "$HOME/.relaton/collections."
148
149
 
149
150
  def export(file)
150
151
  coll = read_collection File.join(directory, file)
151
- outfile = file.sub(/\.\w+$/, "") + ".xml"
152
+ outfile = "#{file.sub(/\.\w+$/, '')}.xml"
152
153
  File.write outfile, coll.to_xml(bibdata: true), encoding: "UTF-8"
153
154
  end
154
155
 
@@ -194,7 +195,7 @@ module Relaton
194
195
  return unless options[:entries]
195
196
 
196
197
  Relaton::Bibcollection.new(hash["root"]).items.each do |b|
197
- puts " " + b.docidentifier
198
+ puts " #{b.docidentifier}"
198
199
  end
199
200
  end
200
201
 
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "1.13.0".freeze
3
+ VERSION = "1.14.0".freeze
4
4
  end
5
5
  end
data/relaton-cli.gemspec CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "webmock"
37
37
 
38
38
  spec.add_runtime_dependency "liquid", "~> 4"
39
- spec.add_runtime_dependency "relaton", "~> 1.13.0"
39
+ spec.add_runtime_dependency "relaton", "~> 1.14.0"
40
40
  spec.add_runtime_dependency "thor"
41
41
  spec.add_runtime_dependency "thor-hollaback"
42
42
  end
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: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.13.0
173
+ version: 1.14.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.13.0
180
+ version: 1.14.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: thor
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -256,7 +256,7 @@ homepage: https://github.com/metanorma/relaton-cli
256
256
  licenses:
257
257
  - BSD-2-Clause
258
258
  metadata: {}
259
- post_install_message:
259
+ post_install_message:
260
260
  rdoc_options: []
261
261
  require_paths:
262
262
  - lib
@@ -271,8 +271,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubygems_version: 3.2.3
275
- signing_key:
274
+ rubygems_version: 3.1.6
275
+ signing_key:
276
276
  specification_version: 4
277
277
  summary: Relaton Command-line Interface
278
278
  test_files: []