Skip to content

Commit 76a83f8

Browse files
committed
Fix #78: Format Ruby Hash literals correctly
1 parent 5a2bb72 commit 76a83f8

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ gem install paru
6969
```
7070

7171
You can also download the latest gem
72-
[paru-1.1.1.gem](https://github.com/htdebeer/paru/blob/master/releases/paru-1.1.1.gem)
72+
[paru-1.1.2.gem](https://github.com/htdebeer/paru/blob/master/releases/paru-1.1.2.gem)
7373
and install it by:
7474

7575
``` bash
7676
cd /directory/you/downloaded/the/gem/to
77-
gem install paru-1.1.1.gem
77+
gem install paru-1.1.2.gem
7878
```
7979

8080
Paru, obviously, requires pandoc. See

index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ gem install paru
4646
```
4747

4848
You can also download the latest gem
49-
[paru-1.1.1.gem](https://github.com/htdebeer/paru/blob/master/releases/paru-1.1.1.gem)
49+
[paru-1.1.2.gem](https://github.com/htdebeer/paru/blob/master/releases/paru-1.1.2.gem)
5050
and install it by:
5151

5252
``` bash
5353
cd /directory/you/downloaded/the/gem/to
54-
gem install paru-1.1.1.gem
54+
gem install paru-1.1.2.gem
5555
```
5656

5757
Paru, obviously, requires pandoc. See

lib/paru.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
#++
1919
module Paru
2020
# Paru's current version
21-
VERSION = [1, 1, 1].freeze
21+
VERSION = [1, 1, 2].freeze
2222
end

lib/paru/filter/col_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#--
2-
# Copyright 2020 Huub de Beer <Huub@heerdebeer.org>
2+
# Copyright 2020, 2032 Huub de Beer <Huub@heerdebeer.org>
33
#
44
# This file is part of Paru
55
#
@@ -28,7 +28,7 @@ module PandocFilter
2828

2929
# Default value for a column specification: left aligned with default
3030
# width
31-
DEFAULT_COLSPEC = [{"t": "AlignLeft"}, {"t": COL_WIDTH_DEFAULT}]
31+
DEFAULT_COLSPEC = [{"t" => "AlignLeft"}, {"t" => COL_WIDTH_DEFAULT}]
3232

3333
# ColSpec represents a colspec definition for a table column. It contains an alignment and the column's width.
3434
#
@@ -40,7 +40,7 @@ module PandocFilter
4040
# @!attribute width
4141
# @return [Double|COL_WIDTH_DEFAULT]
4242
class ColSpec
43-
attr_accessor :alignment, :width
43+
attr_reader :alignment, :width
4444

4545
# Create a new ColSpec object
4646
#
@@ -56,9 +56,9 @@ def initialize(contents = DEFAULT_COLSPEC)
5656
# "ColWidthDefault", it uses the default value.
5757
def width=(new_width)
5858
if new_width == "ColWidthDefault" then
59-
@width = Value.new({"t": new_width})
59+
@width = Value.new({"t" => new_width})
6060
else
61-
@width = Value.new({"t": "ColWidth", "c": new_width})
61+
@width = Value.new({"t" => "ColWidth", "c" => new_width})
6262
end
6363
end
6464

lib/paru/filter/table.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ module PandocFilter
3939
# @return Attr
4040
#
4141
# @!attribute colspec
42-
# @return [ColSpec]
42+
# @return ColSpec[]
4343
#
4444
# @!attribute head
45-
# @return [TableHead]
45+
# @return TableHead[]
4646
#
4747
# @!attribute foot
48-
# @return [TableHead]
48+
# @return TableHead[]
4949
class Table < Block
5050
attr_accessor :caption, :attr, :colspec, :head, :foot
5151

lib/paru/filter/value.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class Value < Node
3535
# @param contents [Array<pandoc node in JSON> = []] the contents of
3636
# this node
3737
def initialize(contents)
38-
@type = contents["t"]
38+
@type = contents['t']
3939

40-
if contents.has_key? "c" then
41-
@value = contents["c"]
40+
if contents.has_key? 'c' then
41+
@value = contents['c']
4242
else
4343
@value = VALUE_ENCODED_IN_TYPE_NAME
4444
end

paru.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
44
s.name = 'paru'
55
s.license = 'GPL-3.0'
66
s.version = Paru::VERSION.join "."
7-
s.date = '2023-05-13'
7+
s.date = '2023-06-30'
88
s.authors = ['Huub de Beer']
99
s.email = 'Huub@heerdebeer.org'
1010

releases/paru-1.1.2.gem

35.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)