relaton-cli 1.1.2 → 1.1.3

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: 189c177f77c4ebd844d4df2dbe9deb987d90443e3e91ff50d8ebf1a7ce8d3685
4
- data.tar.gz: 73a886c43a4b0262a6f96725143a5714dae88440715122a36360e343d753ea56
3
+ metadata.gz: 57f7abf09dc691dbeca299fe1960057c040778da128d45b5cff25748c8442f72
4
+ data.tar.gz: 39520c2293ea0f938ba81acfe13b5def8cd505bf3d6a0bf0e4c8d2ff2ec90beb
5
5
  SHA512:
6
- metadata.gz: 7d7e76cfa44de6d91dc4ce1f631c68b845fa152de4ecbfa76a5deebb59e706784c0f0a5c1dea302336e153d751217e612f42c324498336390ce67891f4f773fa
7
- data.tar.gz: ea44768cba9f5a88b46f03c588237d0de5fe91d0fb4952b5761236fafcabe1ec5992b921ecbd87052e3082e0f45c24ee074409825c0f32f934055ffac7eb2b93
6
+ metadata.gz: 8efa168c29a5d1a6f49142e19d86a24f3e2ad26afb97f8126e2104f14eb86276d8e0a778bc58ff328f542d4579776ddd925d130a406c959616ece08a0a997583
7
+ data.tar.gz: 75aedff7abac327dfe3b7d0abd9948fba5447e326a887dc06f0fe8fbc1b247797303193e788e13c7330f2c6b6ad0febd2f8752701b363e411f69ee34c28e35be
@@ -48,7 +48,7 @@ module Relaton
48
48
  end
49
49
 
50
50
  def to_h
51
- URL_TYPES.reduce({ items: [] }.merge(@bibitem.to_hash)) do |h, t|
51
+ URL_TYPES.reduce(@bibitem.to_hash) do |h, t|
52
52
  value = send t
53
53
  h[t.to_s] = value
54
54
  h
@@ -28,7 +28,7 @@ module Relaton
28
28
  option :title, aliases: :t, desc: "Title of resulting Relaton collection"
29
29
  option :organization, aliases: :g, desc: "Organization owner of Relaton collection"
30
30
  option :new, aliases: :n, type: :boolean, desc: "Use the new Relaton YAML format"
31
- option :extension, aliases: :x, default: "rxl", desc: "File extension of destination Relaton file, defaults to 'rxl'"
31
+ option :extension, aliases: :x, desc: "File extension of destination Relaton file, defaults to 'rxl'"
32
32
 
33
33
  def concatenate(source_dir, outfile)
34
34
  Relaton::Cli::RelatonFile.concatenate(source_dir, outfile, options)
@@ -174,14 +174,16 @@ module Relaton
174
174
  end
175
175
  end
176
176
 
177
- def output_type(ext=options[:extension])
177
+ def output_type(ext = options[:extension])
178
+ ext ||= File.extname(outfile)[1..-1] if outfile
178
179
  case ext
179
180
  when "rxl", "xml"
180
181
  :to_xml
181
182
  when "yml", "yaml"
182
183
  :to_yaml
183
184
  else
184
- puts "[relaton-cli] the given extension of '#{ext}' is not supported."
185
+ puts "[relaton-cli] the given extension of '#{ext}' is "\
186
+ "not supported. Use 'rxl'."
185
187
  :to_xml
186
188
  end
187
189
  end
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "1.1.2".freeze
3
+ VERSION = "1.1.3".freeze
4
4
  end
5
5
  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.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug