isodoc 1.5.4 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -4
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +11 -11
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc/base_style/all.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.scss +8 -0
- data/lib/isodoc/base_style/reset.css +7 -0
- data/lib/isodoc/base_style/reset.scss +9 -0
- data/lib/isodoc/base_style/scripts.html +187 -0
- data/lib/isodoc/class_utils.rb +6 -5
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +30 -17
- data/lib/isodoc/css.rb +42 -28
- data/lib/isodoc/function/blocks.rb +21 -4
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +1 -2
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +32 -10
- data/lib/isodoc/function/references.rb +55 -42
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +29 -28
- data/lib/isodoc/function/utils.rb +41 -38
- data/lib/isodoc/gem_tasks.rb +30 -31
- data/lib/isodoc/html_convert.rb +6 -4
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/postprocess.rb +35 -76
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/pdf_convert.rb +1 -3
- data/lib/isodoc/presentation_function/bibdata.rb +13 -10
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +75 -118
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +20 -22
- data/lib/isodoc/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +16 -6
- data/lib/isodoc/xref.rb +10 -11
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +45 -32
- data/lib/isodoc/xref/xref_sect_gen.rb +33 -31
- data/lib/isodoc/xslfo_convert.rb +36 -25
- data/spec/assets/html_override.css +1 -0
- data/spec/assets/word_override.css +1 -0
- data/spec/isodoc/blocks_spec.rb +2518 -2570
- data/spec/isodoc/cleanup_spec.rb +1107 -1109
- data/spec/isodoc/footnotes_spec.rb +1 -16
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +984 -972
- data/spec/isodoc/inline_spec.rb +984 -920
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/postproc_spec.rb +1692 -1538
- data/spec/isodoc/presentation_xml_spec.rb +345 -342
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +910 -902
- data/spec/isodoc/table_spec.rb +566 -556
- data/spec/isodoc/terms_spec.rb +252 -256
- data/spec/isodoc/xref_spec.rb +3040 -2985
- data/spec/isodoc/xslfo_convert_spec.rb +39 -0
- data/spec/spec_helper.rb +30 -29
- metadata +80 -70
- data/.rubocop.ribose.yml +0 -65
- data/.rubocop.tb.yml +0 -650
- data/lib/twitter-cldr/patch.rb +0 -39
data/lib/twitter-cldr/patch.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
module ::TwitterCldr
|
2
|
-
module Formatters
|
3
|
-
class NumberFormatter
|
4
|
-
def parse_number(number, options = {})
|
5
|
-
precision = options[:precision] || precision_from(number)
|
6
|
-
rounding = options[:rounding] || 0
|
7
|
-
if number.is_a? BigDecimal
|
8
|
-
number = precision == 0 ?
|
9
|
-
round_to(number, precision, rounding).abs.fix.to_s("F") :
|
10
|
-
round_to(number, precision, rounding).abs.round(precision).to_s("F")
|
11
|
-
else
|
12
|
-
number = "%.#{precision}f" % round_to(number, precision, rounding).abs
|
13
|
-
end
|
14
|
-
number.split(".")
|
15
|
-
end
|
16
|
-
|
17
|
-
def round_to(number, precision, rounding = 0)
|
18
|
-
factor = 10 ** precision
|
19
|
-
result = number.is_a?(BigDecimal) ?
|
20
|
-
((number * factor).fix / factor) :
|
21
|
-
((number * factor).round.to_f / factor)
|
22
|
-
if rounding > 0
|
23
|
-
rounding = rounding.to_f / factor
|
24
|
-
result = number.is_a?(BigDecimal) ?
|
25
|
-
((result * (1.0 / rounding)).fix / (1.0 / rounding)) :
|
26
|
-
((result * (1.0 / rounding)).round.to_f / (1.0 / rounding))
|
27
|
-
end
|
28
|
-
result
|
29
|
-
end
|
30
|
-
|
31
|
-
def precision_from(num)
|
32
|
-
return 0 if num.is_a?(BigDecimal) && num.fix == num
|
33
|
-
parts = (num.is_a?(BigDecimal) ? num.to_s("F") : num.to_s ).split(".")
|
34
|
-
parts.size == 2 ? parts[1].size : 0
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|