metanorma-gb 1.0.12 → 1.1.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: d4ccd7f3961a3138c3aa4126b3d6efb68fe3d2e2efd5216563c7bc5e48c7269c
4
- data.tar.gz: c547a63cca08a9f0b3a46b536c893bc75ef4fdff233bc050ff906efc4f3ce347
3
+ metadata.gz: 10351e9508e07385bebe80fc1655dcb55da123a23263140f8bc5d2924289a404
4
+ data.tar.gz: 05ac2092d8dcab14fd2010de03473265835427d0326c0c565fe6c824483e777d
5
5
  SHA512:
6
- metadata.gz: f60532239eae7906adea6f217d21d6a25f620c0686574fd791903072a3053355cc08e923616c8639171d6fe101a75ca33d476f4ffd88b5151831b7bdd34aea3a
7
- data.tar.gz: b0b54bdb356f951dfa7b05a91c8f3b0ed8106e733382d61c9b2835c405df938a2cf14c7bbfc9154d9c097705eb57cf4d7e3130d5cd7fe34238d4cad0a20ae065
6
+ metadata.gz: 2267cd3211dd73c0d7add935a7f1318f44e18ea771ea90e744a85d0b1d609a8cc42203142128a288bbb1895f9e633387d65c4d400b09392257b91405e217b5b8
7
+ data.tar.gz: 361e89d32fd9f188d2d117e596760ada3f67442a074d42e32fba1ef8d0f12ce41118861085cd85b27de786571d9d2ce7264805fbf5097d583d27acb1e5b27564
data/.travis.yml CHANGED
@@ -7,7 +7,7 @@ rvm:
7
7
  - 2.3
8
8
  - ruby-head
9
9
  before_install:
10
- - gem install bundler -v 1.16.1
10
+ - gem install bundler -v 2.0.1
11
11
  - unset _JAVA_OPTIONS
12
12
  matrix:
13
13
  allow_failures:
@@ -286,18 +286,23 @@
286
286
  </define>
287
287
  <define name="address">
288
288
  <element name="address">
289
- <oneOrMore>
289
+ <choice>
290
290
  <!-- iso191606 TODO -->
291
- <ref name="street"/>
292
- </oneOrMore>
293
- <ref name="city"/>
294
- <optional>
295
- <ref name="state"/>
296
- </optional>
297
- <ref name="country"/>
298
- <optional>
299
- <ref name="postcode"/>
300
- </optional>
291
+ <group>
292
+ <oneOrMore>
293
+ <ref name="street"/>
294
+ </oneOrMore>
295
+ <ref name="city"/>
296
+ <optional>
297
+ <ref name="state"/>
298
+ </optional>
299
+ <ref name="country"/>
300
+ <optional>
301
+ <ref name="postcode"/>
302
+ </optional>
303
+ </group>
304
+ <ref name="formattedAddress"/>
305
+ </choice>
301
306
  </element>
302
307
  </define>
303
308
  <define name="street">
@@ -325,6 +330,11 @@
325
330
  <text/>
326
331
  </element>
327
332
  </define>
333
+ <define name="formattedAddress">
334
+ <element name="formattedAddress">
335
+ <text/>
336
+ </element>
337
+ </define>
328
338
  <define name="person-identifier">
329
339
  <element name="identifier">
330
340
  <attribute name="type">
@@ -911,6 +911,9 @@
911
911
  </choice>
912
912
  </attribute>
913
913
  </optional>
914
+ <optional>
915
+ <attribute name="alt"/>
916
+ </optional>
914
917
  </element>
915
918
  </define>
916
919
  <define name="stem">
@@ -21,11 +21,11 @@ module IsoDoc
21
21
  File.join(File.dirname(__FILE__), loc)
22
22
  end
23
23
 
24
- def format_agency(agency, format)
25
- return "<img class='logo' src='#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
24
+ def format_agency(agency, format, localdir)
25
+ return "<img class='logo' src='#{localdir}/#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
26
26
  return agency unless agency.is_a?(Array)
27
27
  if agency == ["中华人民共和国国家质量监督检验检疫总局", "中国国家标准化管理委员会"]
28
- logo = "gb-issuer-default.gif"
28
+ logo = "#{localdir}/gb-issuer-default.gif"
29
29
  FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
30
30
  return "<img class='logo' src='#{logo}' alt='#{agency.join(",")}'></img>"
31
31
  end
@@ -40,14 +40,14 @@ module IsoDoc
40
40
  ret
41
41
  end
42
42
 
43
- def format_logo(prefix, scope, _format)
43
+ def format_logo(prefix, scope, _format, localdir)
44
44
  logo = @meta.standard_logo(prefix)
45
- return format_logo1(logo, prefix, scope) if @standardlogoimg
45
+ return format_logo1(logo, prefix, scope, localdir) if @standardlogoimg
46
46
  return "" if %w(enterprise social-group).include? scope
47
47
  if logo.nil?
48
48
  "<span style='font-size:36pt;font-weight:bold'>#{prefix}</span>"
49
49
  else
50
- format_logo1(logo, prefix, scope)
50
+ format_logo1("#{localdir}/#{logo}", prefix, scope, localdir)
51
51
  end
52
52
  end
53
53
 
@@ -58,9 +58,9 @@ module IsoDoc
58
58
  end
59
59
 
60
60
 
61
- def format_logo1(logo, prefix, scope)
61
+ def format_logo1(logo, prefix, scope, localdir)
62
62
  local = local_logo_suffix(scope)
63
- return "<img class='logo' width='113' height='56' src='#{@standardlogoimg}' alt='#{prefix}'></img>"\
63
+ return "<img class='logo' width='113' height='56' src='#{localdir}/#{@standardlogoimg}' alt='#{prefix}'></img>"\
64
64
  "#{local}" if @standardlogoimg
65
65
  logo += ".gif"
66
66
  FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
@@ -39,17 +39,8 @@ module IsoDoc
39
39
  { valign: "top", class: "example_label",
40
40
  style: "padding:2pt 2pt 2pt 2pt" }.freeze
41
41
 
42
- def example_parse(node, out)
43
- out.table **attr_code(id: node["id"], class: "example") do |t|
44
- t.tr do |tr|
45
- tr.td **EXAMPLE_TBL_ATTR do |td|
46
- td << l10n(example_label(node) + ":")
47
- end
48
- tr.td **{ valign: "top", class: "example" } do |td|
49
- node.children.each { |n| parse(n, td) }
50
- end
51
- end
52
- end
42
+ def example_label(node)
43
+ l10n(super + ":")
53
44
  end
54
45
 
55
46
  def note_parse(node, out)
@@ -134,11 +125,11 @@ module IsoDoc
134
125
 
135
126
  def populate_template(docxml, format)
136
127
  meta = @meta.get.merge(@labels)
137
- logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format)
128
+ logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format, @localdir)
138
129
  logofile = @meta.standard_logo(meta[:gbprefix])
139
130
  docxml = termref_resolve(docxml)
140
131
  meta[:standard_agency_formatted] =
141
- @common.format_agency(meta[:standard_agency], format)
132
+ @common.format_agency(meta[:standard_agency], format, @localdir)
142
133
  meta[:standard_logo] = logo
143
134
  template = Liquid::Template.parse(docxml)
144
135
  template.render(meta.map { |k, v| [k.to_s, v] }.to_h)
@@ -183,8 +174,8 @@ module IsoDoc
183
174
  div.h1 **{ class: "Annex" } do |t|
184
175
  t << "#{get_anchors[annex['id']][:label]}<br/><br/>"
185
176
  t.b do |b|
186
- name&.children&.each { |c2| parse(c2, b) }
187
- end
177
+ name&.children&.each { |c2| parse(c2, b) }
178
+ end
188
179
  end
189
180
  end
190
181
 
@@ -134,12 +134,12 @@ module IsoDoc
134
134
 
135
135
  def populate_template(docxml, format)
136
136
  meta = @meta.get.merge(@labels)
137
- logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format)
137
+ logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format, @localdir)
138
138
  logofile = @meta.standard_logo(meta[:gbprefix])
139
139
  @files_to_delete << logofile + ".gif" unless logofile.nil?
140
140
  docxml = termref_resolve(docxml)
141
141
  meta[:standard_agency_formatted] =
142
- @common.format_agency(meta[:standard_agency], format)
142
+ @common.format_agency(meta[:standard_agency], format, @localdir)
143
143
  meta[:standard_logo] = logo
144
144
  template = Liquid::Template.parse(docxml)
145
145
  template.render(meta.map { |k, v| [k.to_s, v] }.to_h)
@@ -1091,7 +1091,6 @@ font-family: $headerfont;
1091
1091
  .example .example-title {
1092
1092
  font-weight: 700;
1093
1093
  text-transform: uppercase;
1094
- text-align: center;
1095
1094
  margin-top:0;
1096
1095
  }
1097
1096
 
@@ -878,6 +878,7 @@ text-align: center;
878
878
  padding: 0.5em;
879
879
  margin: 2em 0 1em 0;
880
880
  text-align: left;
881
+ padding-left: 2em;
881
882
  }
882
883
 
883
884
  .example p {
@@ -887,8 +888,8 @@ text-align: center;
887
888
  .example .example-title {
888
889
  font-weight: 700;
889
890
  text-transform: uppercase;
890
- text-align: center;
891
891
  margin-top:0;
892
+ margin-left:-1.5em;
892
893
  }
893
894
 
894
895
  /*
@@ -158,7 +158,7 @@ module IsoDoc
158
158
  def standard_class(scope, prefix, mandate)
159
159
  standardclassimg = get[:standardclassimg]
160
160
  ret = @agencies.standard_class(scope, prefix, mandate)
161
- return "<img class='logo' src='#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
161
+ return "<img class='logo' src='#{@localdir}/#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
162
162
  ret
163
163
  end
164
164
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Gb
3
- VERSION = "1.0.12"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
data/metanorma-gb.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "metanorma-iso", "~> 1.0.1"
31
+ spec.add_dependency "metanorma-iso", "~> 1.1.0"
32
32
  spec.add_dependency "isodoc", "~> 0.9.1"
33
33
  spec.add_dependency "twitter_cldr"
34
34
  spec.add_dependency "gb-agencies", "~> 0.0.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.1.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-01-11 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.1
19
+ version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.1
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isodoc
29
29
  requirement: !ruby/object:Gem::Requirement