polint 0.2.2 → 0.2.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
- SHA1:
3
- metadata.gz: 5581d49373dcf898408c22673c59507e11f9b24b
4
- data.tar.gz: 171d892f367886303386b34c33edc664e56efdaa
2
+ SHA256:
3
+ metadata.gz: f744d2e7bb0a9fc647d2c748156c429eaafd19a3a64be8108d014847036692db
4
+ data.tar.gz: b59ef6a71f426e6e450965cf310b2d266876f7324428c2ffe1f6500692316b27
5
5
  SHA512:
6
- metadata.gz: 795013d51d2c71423f00be82b3855cd1ba9d9bc8cadb504a7596e46ec343f956acd1dc009b92ac26aadace8efdf6424dd7b225e3968bef93a745d24a22b27d48
7
- data.tar.gz: dfd3f6fa9f36a281e3e4bb3b5263adcfa476c7546e647d09a932e94796e15d067a1bb6db39c2fb38706457e7fdaaf6082242cef2eb5e83d9a94211fa656caae5
6
+ metadata.gz: c21194377b3172e5c21d23986122edbbd7f770ecb3d8382b9243e3c85d62160b9ad34249970d3df58c57914215c55abb33bc3bbf02bf054b42f08127b1f5f003
7
+ data.tar.gz: 1bc81e36b32b77cde0aff2bdf4585beb42462b8b369b2533d2d7866d6767d9318f697244ce89d72611ef171f9af9d8dc7f9f4217919312f0d57b92085c50ac99
data/Gemfile.lock CHANGED
@@ -1,86 +1,82 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polint (0.2.2)
5
- parslet (~> 1.7, >= 1.7.1)
4
+ polint (0.2.3)
5
+ parslet (~> 1.8)
6
6
  term-ansicolor
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- blankslate (3.1.3)
12
- byebug (9.0.5)
13
- coderay (1.1.1)
14
- diff-lcs (1.2.5)
15
- ffi (1.9.10)
16
- formatador (0.2.5)
17
- guard (2.14.0)
11
+ byebug (11.1.3)
12
+ coderay (1.1.3)
13
+ diff-lcs (1.5.0)
14
+ ffi (1.15.5)
15
+ formatador (1.1.0)
16
+ guard (2.18.0)
18
17
  formatador (>= 0.2.4)
19
18
  listen (>= 2.7, < 4.0)
20
- lumberjack (~> 1.0)
19
+ lumberjack (>= 1.0.12, < 2.0)
21
20
  nenv (~> 0.1)
22
21
  notiffany (~> 0.0)
23
- pry (>= 0.9.12)
22
+ pry (>= 0.13.0)
24
23
  shellany (~> 0.0)
25
24
  thor (>= 0.18.1)
26
25
  guard-compat (1.2.1)
27
- guard-rspec (4.7.2)
26
+ guard-rspec (4.7.3)
28
27
  guard (~> 2.1)
29
28
  guard-compat (~> 1.1)
30
29
  rspec (>= 2.99.0, < 4.0)
31
- listen (3.1.5)
32
- rb-fsevent (~> 0.9, >= 0.9.4)
33
- rb-inotify (~> 0.9, >= 0.9.7)
34
- ruby_dep (~> 1.2)
35
- lumberjack (1.0.10)
36
- method_source (0.8.2)
30
+ listen (3.7.1)
31
+ rb-fsevent (~> 0.10, >= 0.10.3)
32
+ rb-inotify (~> 0.9, >= 0.9.10)
33
+ lumberjack (1.2.8)
34
+ method_source (1.0.0)
37
35
  nenv (0.3.0)
38
- notiffany (0.1.0)
36
+ notiffany (0.1.3)
39
37
  nenv (~> 0.1)
40
38
  shellany (~> 0.0)
41
- parslet (1.7.1)
42
- blankslate (>= 2.0, <= 4.0)
43
- pry (0.10.3)
44
- coderay (~> 1.1.0)
45
- method_source (~> 0.8.1)
46
- slop (~> 3.4)
47
- pry-byebug (3.4.0)
48
- byebug (~> 9.0)
49
- pry (~> 0.10)
50
- rake (10.5.0)
51
- rb-fsevent (0.9.7)
52
- rb-inotify (0.9.7)
53
- ffi (>= 0.5.0)
54
- rspec (3.4.0)
55
- rspec-core (~> 3.4.0)
56
- rspec-expectations (~> 3.4.0)
57
- rspec-mocks (~> 3.4.0)
58
- rspec-core (3.4.4)
59
- rspec-support (~> 3.4.0)
60
- rspec-expectations (3.4.0)
39
+ parslet (1.8.2)
40
+ pry (0.14.1)
41
+ coderay (~> 1.1)
42
+ method_source (~> 1.0)
43
+ pry-byebug (3.10.1)
44
+ byebug (~> 11.0)
45
+ pry (>= 0.13, < 0.15)
46
+ rake (13.0.6)
47
+ rb-fsevent (0.11.1)
48
+ rb-inotify (0.10.1)
49
+ ffi (~> 1.0)
50
+ rspec (3.11.0)
51
+ rspec-core (~> 3.11.0)
52
+ rspec-expectations (~> 3.11.0)
53
+ rspec-mocks (~> 3.11.0)
54
+ rspec-core (3.11.0)
55
+ rspec-support (~> 3.11.0)
56
+ rspec-expectations (3.11.0)
61
57
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.4.0)
63
- rspec-mocks (3.4.1)
58
+ rspec-support (~> 3.11.0)
59
+ rspec-mocks (3.11.1)
64
60
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.4.0)
66
- rspec-support (3.4.1)
67
- ruby_dep (1.3.1)
61
+ rspec-support (~> 3.11.0)
62
+ rspec-support (3.11.0)
68
63
  shellany (0.0.1)
69
- slop (3.6.0)
70
- term-ansicolor (1.3.2)
64
+ sync (0.5.0)
65
+ term-ansicolor (1.7.1)
71
66
  tins (~> 1.0)
72
- thor (0.19.1)
73
- tins (1.10.2)
67
+ thor (1.2.1)
68
+ tins (1.31.1)
69
+ sync
74
70
 
75
71
  PLATFORMS
76
- ruby
72
+ x86_64-linux
77
73
 
78
74
  DEPENDENCIES
79
- bundler (~> 1.7)
75
+ bundler (~> 2.3)
80
76
  guard-rspec
81
77
  polint!
82
78
  pry-byebug
83
- rake (~> 10.0)
79
+ rake (~> 13.0)
84
80
 
85
81
  BUNDLED WITH
86
- 1.12.5
82
+ 2.3.6
data/lib/polint/parser.rb CHANGED
@@ -43,7 +43,7 @@ module Polint
43
43
  rule(:index) { str('[') >> match(/[0-9]/).repeat(1).as(:index) >> str(']') }
44
44
  rule(:msgstr) { str('msgstr') >> (index.maybe >> lwsp >> quoted_strings).as(:msgstr) }
45
45
 
46
- rule(:translation) { (comments >> msgid >> msgid_plural.maybe >> msgstr.repeat(1)).as(:translation) >> blank_line }
46
+ rule(:translation) { (comments >> msgid >> msgid_plural.repeat(0, 1) >> msgstr.repeat(1)).as(:translation) >> blank_line }
47
47
  rule(:translations) { translation.repeat }
48
48
 
49
49
  rule(:obsolete_line) { start_comment >> str('~') >> lwsp >> match(/[^\n]/).repeat >> endl }
@@ -1,3 +1,3 @@
1
1
  module Polint
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/polint.gemspec CHANGED
@@ -17,11 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.7"
21
- spec.add_development_dependency "rake", "~> 10.0"
20
+ spec.add_development_dependency "bundler", "~> 2.3"
21
+ spec.add_development_dependency "rake", "~> 13.0"
22
22
  spec.add_development_dependency "pry-byebug"
23
23
  spec.add_development_dependency "guard-rspec"
24
24
 
25
25
  spec.add_dependency "term-ansicolor"
26
- spec.add_dependency "parslet", "~> 1.7", ">= 1.7.1"
26
+ spec.add_dependency "parslet", "~> 1.8"
27
27
  end
@@ -231,6 +231,25 @@ RSpec.describe Polint::Parser do
231
231
  }
232
232
  end
233
233
 
234
+ context 'when matching without comments' do
235
+ let(:lines) {
236
+ [
237
+ 'msgid "Hello World"',
238
+ 'msgid_plural "Hello %{n} Worlds"',
239
+ 'msgstr[0] "Hello World"',
240
+ 'msgstr[1] "Hello %{n} Worlds"'
241
+ ]
242
+ }
243
+ it {
244
+ expect(tree).to eq translation: [
245
+ { msgid: [{ quoted_string: 'Hello World' }] },
246
+ { msgid_plural: [{ quoted_string: 'Hello %{n} Worlds' }] },
247
+ { msgstr: [{ index: '0' }, { quoted_string: 'Hello World' }] },
248
+ { msgstr: [{ index: '1' }, { quoted_string: 'Hello %{n} Worlds' }] }
249
+ ]
250
+ }
251
+ end
252
+
234
253
  # TODO: Multiline strings and negative cases
235
254
  end
236
255
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
8
8
  - Greg Beech
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-23 00:00:00.000000000 Z
12
+ date: 2022-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.7'
20
+ version: '2.3'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.7'
27
+ version: '2.3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '10.0'
34
+ version: '13.0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '10.0'
41
+ version: '13.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: pry-byebug
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -87,21 +87,15 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '1.7'
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: 1.7.1
90
+ version: '1.8'
94
91
  type: :runtime
95
92
  prerelease: false
96
93
  version_requirements: !ruby/object:Gem::Requirement
97
94
  requirements:
98
95
  - - "~>"
99
96
  - !ruby/object:Gem::Version
100
- version: '1.7'
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 1.7.1
104
- description:
97
+ version: '1.8'
98
+ description:
105
99
  email:
106
100
  - julien.letessier@gmail.com
107
101
  - greg@gregbeech.com
@@ -136,7 +130,7 @@ homepage: ''
136
130
  licenses:
137
131
  - MIT
138
132
  metadata: {}
139
- post_install_message:
133
+ post_install_message:
140
134
  rdoc_options: []
141
135
  require_paths:
142
136
  - lib
@@ -151,9 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
145
  - !ruby/object:Gem::Version
152
146
  version: '0'
153
147
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.4.8
156
- signing_key:
148
+ rubygems_version: 3.2.22
149
+ signing_key:
157
150
  specification_version: 4
158
151
  summary: A linter for Uniforum PO files.
159
152
  test_files: