gbbib 0.2.0 → 0.2.1

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: be8b8056be4856d110ff8bdfb78f1d3075879bdd17c54e4848de39d278b65a68
4
- data.tar.gz: b151f547e1d7ec7c89824ccad47fef315f2665938789b36f18336101feb5b91a
3
+ metadata.gz: 18b85e35f313100356d7f8afcc53cf27cd49c5e255b9e89456dd91f1d413f932
4
+ data.tar.gz: 64603146155ab214747fe59aa4dce48eca374611a298878ffd9cd31eee6bf67b
5
5
  SHA512:
6
- metadata.gz: 62742ccbc9c15f182015550a4166ca5b09fd9127cabec488d7fb184743e78000d616c83f136e9171c6aa578419c80d3986ab168d202e4ce875fb963fac93a7a4
7
- data.tar.gz: 68d3a7bb83d9ebd8d2d63e1a0800430c2a8e132658f7583579f21af411fde1530014f89a5d9dfcdc8bcafd88cb5f7261f386862f94fefda339b96125d5dc5926
6
+ metadata.gz: 2a5d9f1cadb9623e82d7b61564fe1909e9b38f3873580bccc59b6808f284eb94ef5dd59faac3f051654261bbf906a44d0e81d3c36aac017a83709e562f90b93b
7
+ data.tar.gz: 7a674cf192020d60a91a32e68d92e65ac1daebb8ba7d67aec66552da9ce5937433316e5f64c515457985b62710fc5d3a1946dd2b6f74573bc34f6d3693fbea23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gbbib (0.1.5)
4
+ gbbib (0.2.1)
5
5
  cnccs (~> 0.1.1)
6
6
  iso-bib-item (~> 0.2)
7
7
 
@@ -15,7 +15,7 @@ GEM
15
15
  docile (1.3.1)
16
16
  equivalent-xml (0.6.0)
17
17
  nokogiri (>= 1.4.3)
18
- iso-bib-item (0.2.1)
18
+ iso-bib-item (0.2.2)
19
19
  isoics (~> 0.1.6)
20
20
  nokogiri (~> 1.8.4)
21
21
  ruby_deep_clone (~> 0.8.0)
@@ -54,12 +54,11 @@ module Gbbib
54
54
  # * :language [String]
55
55
  # * :script [String]
56
56
  def get_titles(doc)
57
- titles = [{ title_intro: doc.css('div.page-header h4').text,
58
- title_main: '', language: 'zh', script: 'Hans' }]
59
- title_intro = doc.css('div.page-header h5').text
60
- unless title_intro.empty?
61
- titles << { title_intro: title_intro, title_main: '', language: 'en',
62
- script: 'Latn' }
57
+ titles = [{ title_main: doc.css('div.page-header h4').text, title_intro: nil,
58
+ language: 'zh', script: 'Hans' }]
59
+ title_main = doc.css('div.page-header h5').text
60
+ unless title_main.empty?
61
+ titles << { title_main: title_main, title_intro: nil, language: 'en', script: 'Latn' }
63
62
  end
64
63
  titles
65
64
  end
@@ -75,12 +75,12 @@ module Gbbib
75
75
 
76
76
  def get_titles(doc)
77
77
  xpath = '//td[contains(.,"中文标题")]/following-sibling::td[1]'
78
- titles = [{ title_intro: doc.xpath(xpath).text,
79
- title_main: '', language: 'zh', script: 'Hans' }]
78
+ titles = [{ title_main: doc.xpath(xpath).text,
79
+ title_intro: nil, language: 'zh', script: 'Hans' }]
80
80
  xpath = '//td[contains(.,"英文标题")]/following-sibling::td[1]'
81
- title_intro = doc.xpath(xpath).text
82
- unless title_intro.empty?
83
- titles << { title_intro: title_intro, title_main: '', language: 'en',
81
+ title_main = doc.xpath(xpath).text
82
+ unless title_main.empty?
83
+ titles << { title_main: title_main, title_intro: nil, language: 'en',
84
84
  script: 'Latn' }
85
85
  end
86
86
  titles
data/lib/gbbib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gbbib
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -6,7 +6,8 @@ module Relaton
6
6
 
7
7
  def initialize
8
8
  @short = :gbbib
9
- @prefix = %r{^(GB|GJ|GS)|^ZB|^DB|^Q\/|^T\/[^\s]{3,6}\s}
9
+ #@prefix = %r{^(GB|GJ|GS)|^ZB|^DB|^Q\/|^T\/[^\s]{3,6}\s}
10
+ @prefix = %r{^GB Standard }
10
11
  end
11
12
 
12
13
  def get(code, date, opts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gbbib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-22 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler