PoParser 1.0.0 → 1.0.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
  SHA1:
3
- metadata.gz: 353e0d8587bb30e2c03053471cb8e81de7939893
4
- data.tar.gz: db6dcd36fe50ad4d74ddd9c4de53a539e81fa73d
3
+ metadata.gz: 839ed2d8b43387b11ebee0094af10a6f6e164e51
4
+ data.tar.gz: 2d1da0390af32f7b1ce6a0b21f78869d6b915013
5
5
  SHA512:
6
- metadata.gz: f4364ee022ee6f07667c1171446e803ac79873bee046cdb0647b053e8905f00fa4e8e7f19cd9e1bf58a3356581aa6605aa00b9da096a19bef574fb15ff8d7dbf
7
- data.tar.gz: c254de7917c3d1270486248e59411c942c46a5e178a4d0d338fbe6c126db06ad3bdd3efb1a36fac014466189191a063f12b64e9a9057434b17c56dab28fbf751
6
+ metadata.gz: 4205546fbc30d74e7a4091536a61f198d95c4f347d2166cff0a145475717789e1a79796542c457ece7eb945993d0fc4f88e48d1cf54fc8bc90cbcee61088b773
7
+ data.tar.gz: 01c7dabb307b9eeba663a0a3ea884d6c01e18886e5d5304a0b6f0bca1c0e36fa127212e5091661de9ce2fc87527af90acade4952f5bdf08470ae926d7b82ceba
data/.travis.yml CHANGED
@@ -4,4 +4,5 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.0
7
+ - 2.2.2
7
8
  script: bundle exec rspec spec
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  group :test do
4
4
  gem 'coveralls', :require => false
5
5
  gem 'pry-byebug', :platforms => :ruby_20
6
- gem 'rspec', [">= 2.14", "< 2.99"]
6
+ gem 'rspec', '~> 3.3.0'
7
7
  gem 'awesome_print'
8
8
  end
9
9
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Poparser
1
+ # PoParser
2
2
 
3
3
  [![Build Status](https://travis-ci.org/arashm/PoParser.svg?branch=master)](https://travis-ci.org/arashm/PoParser)
4
4
  [![Coverage Status](https://img.shields.io/coveralls/arashm/PoParser.svg)](https://coveralls.io/r/arashm/PoParser)
@@ -11,7 +11,7 @@ A Ruby PO file parser, editor and generator. PO files are translation files gene
11
11
 
12
12
  Add this line to your application's Gemfile:
13
13
 
14
- gem 'poparser'
14
+ gem 'PoParser'
15
15
 
16
16
  And then execute:
17
17
 
@@ -19,7 +19,7 @@ And then execute:
19
19
 
20
20
  Or install it yourself as:
21
21
 
22
- $ gem install poparser
22
+ $ gem install PoParser
23
23
 
24
24
  ## Usage
25
25
 
@@ -1,5 +1,5 @@
1
1
  module PoParser
2
- # Converts the array returned from {Parser} to a useable hash
2
+ # Converts the array returned from {Parser} to a usable hash
3
3
  class Transformer
4
4
  def initialize
5
5
  @hash = {}
@@ -15,8 +15,8 @@ module PoParser
15
15
 
16
16
  private
17
17
  # @Note: There was a problem applying all rules together. I don't know
18
- # in what order Parslet run rules, but it's not in order. I end up
19
- # making to seperate transform and feed one output to the other.
18
+ # in what order Parslet run rules, but it's not in order. I ended up
19
+ # making two separate transform and feed one output to the other.
20
20
  def first_transform
21
21
  Parslet::Transform.new do
22
22
  rule(:msgstr_plural => subtree(:plural)) do
@@ -44,7 +44,7 @@ module PoParser
44
44
 
45
45
  # Merges two hashed together. If both hashes have common keys it
46
46
  # will create an array of them
47
- #
47
+ #
48
48
  # @return [Hash]
49
49
  def merge(newh)
50
50
  @hash.merge!(newh) do |key, oldval, newval|
@@ -1,3 +1,3 @@
1
1
  module PoParser
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/poparser.gemspec CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  # Runtime deps
22
- spec.add_runtime_dependency "parslet", "~> 1.6"
22
+ spec.add_runtime_dependency "parslet", "~> 1.7"
23
23
 
24
24
  # Development deps
25
- spec.add_development_dependency "bundler", "~> 1.6"
26
- spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "bundler", "~> 1.10"
26
+ spec.add_development_dependency "rake", "~> 10.4"
27
27
  end
@@ -14,7 +14,7 @@ describe PoParser::Entry do
14
14
 
15
15
  it 'should respond to labels' do
16
16
  labels.each do |label|
17
- @entry.should respond_to label
17
+ expect(@entry).to respond_to label
18
18
  end
19
19
  end
20
20
 
@@ -36,38 +36,38 @@ describe PoParser::Entry do
36
36
  end
37
37
 
38
38
  it 'checks if the entry is translated' do
39
- expect(@entry.translated?).to be_false
39
+ expect(@entry.translated?).to be_falsy
40
40
  @entry.translate ''
41
- expect(@entry.translated?).to be_false
41
+ expect(@entry.translated?).to be_falsy
42
42
  @entry.translate 'translated'
43
- expect(@entry.complete?).to be_true
43
+ expect(@entry.complete?).to be_truthy
44
44
  end
45
45
 
46
46
  context 'Plural' do
47
47
  it 'returns false if it\'s not plural' do
48
- expect(@entry.plural?).to be_false
48
+ expect(@entry.plural?).to be_falsy
49
49
  end
50
50
 
51
51
  it 'returns true if it\'s plural' do
52
52
  @entry.msgid_plural = 'sth'
53
- expect(@entry.plural?).to be_true
53
+ expect(@entry.plural?).to be_truthy
54
54
  end
55
55
  end
56
56
 
57
57
  context 'Flags' do
58
58
  it 'should check if a entry is fuzzy' do
59
- expect(@entry.fuzzy?).to be_false
59
+ expect(@entry.fuzzy?).to be_falsy
60
60
  @entry.flag = 'fuzzy'
61
- expect(@entry.fuzzy?).to be_true
61
+ expect(@entry.fuzzy?).to be_truthy
62
62
  end
63
63
 
64
64
  it 'should flag a entry as fuzzy' do
65
- expect(@entry.flag_as_fuzzy).to be_true
65
+ expect(@entry.flag_as_fuzzy).to be_truthy
66
66
  expect(@entry.flag).to eq('fuzzy')
67
67
  end
68
68
 
69
69
  it 'should be able to set a custome flag' do
70
- expect(@entry.flag_as 'python-format').to be_true
70
+ expect(@entry.flag_as 'python-format').to be_truthy
71
71
  expect(@entry.flag).to eq('python-format')
72
72
  end
73
73
  end
@@ -98,19 +98,19 @@ describe PoParser::Entry do
98
98
  end
99
99
 
100
100
  it 'checks for chached entries' do
101
- expect(@entry.cached?).to be_true
101
+ expect(@entry.cached?).to be_truthy
102
102
  end
103
103
 
104
104
  it 'shouldn be counted as untranslated' do
105
- expect(@entry.untranslated?).to be_false
105
+ expect(@entry.untranslated?).to be_falsy
106
106
  end
107
107
 
108
108
  it 'shouldn be counted as translated' do
109
- expect(@entry.translated?).to be_false
109
+ expect(@entry.translated?).to be_falsy
110
110
  end
111
111
 
112
112
  it 'shouldn\'t mark it as fuzzy' do
113
- expect(@entry.fuzzy?).to be_false
113
+ expect(@entry.fuzzy?).to be_falsy
114
114
  end
115
115
  end
116
116
  end
@@ -26,7 +26,7 @@ describe PoParser::Header do
26
26
 
27
27
  it 'should respond to labels' do
28
28
  labels.each do |label|
29
- @header.should respond_to label
29
+ expect(@header).to respond_to label
30
30
  end
31
31
  end
32
32
 
@@ -13,27 +13,27 @@ describe PoParser::Parser do
13
13
  let(:pusc){ po.previous_untraslated_string }
14
14
 
15
15
  it 'parses the translator comment' do
16
- tc.should parse("# Persian translation for damned-lies 123123\n")
17
- tc.should parse("# Copyright (C) 2012 damned-lies's COPYRIGHT HOLDER\n")
18
- tc.should parse("# Arash Mousavi <mousavi.arash@gmail.com>, 2014.\n")
16
+ expect(tc).to parse("# Persian translation for damned-lies 123123\n")
17
+ expect(tc).to parse("# Copyright (C) 2012 damned-lies's COPYRIGHT HOLDER\n")
18
+ expect(tc).to parse("# Arash Mousavi <mousavi.arash@gmail.com>, 2014.\n")
19
19
  end
20
20
 
21
21
  it 'parses refrence comment' do
22
- rc.should parse("#: database-content.py:1 database-content.py:129 settings.py:52\n")
22
+ expect(rc).to parse("#: database-content.py:1 database-content.py:129 settings.py:52\n")
23
23
  end
24
24
 
25
25
  it 'parses extracted_comment' do
26
- ec.should parse("#. database-content.py:1 database-content.py:129 settings.py:52\n")
26
+ expect(ec).to parse("#. database-content.py:1 database-content.py:129 settings.py:52\n")
27
27
  end
28
28
 
29
29
  it 'parses flag_comment' do
30
- fc.should parse("#, python-format\n")
30
+ expect(fc).to parse("#, python-format\n")
31
31
  end
32
32
 
33
33
  it 'parses previous_untraslated_string' do
34
- pusc.should parse("#| msgid \"\"\n")
35
- pusc.should parse("#| \"Hello,\\n\"\n")
36
- pusc.should parse("#| \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is \"\n")
34
+ expect(pusc).to parse("#| msgid \"\"\n")
35
+ expect(pusc).to parse("#| \"Hello,\\n\"\n")
36
+ expect(pusc).to parse("#| \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is \"\n")
37
37
  end
38
38
 
39
39
  end
@@ -44,13 +44,13 @@ describe PoParser::Parser do
44
44
  let(:pofile){ Pathname.new('spec/poparser/fixtures/multiline.po').realpath }
45
45
 
46
46
  it 'parses msgid' do
47
- msgid.should parse "msgid \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
48
- msgid.should parse "msgid \"The new \"state\" of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
47
+ expect(msgid).to parse "msgid \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
48
+ expect(msgid).to parse "msgid \"The new \"state\" of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
49
49
  end
50
50
 
51
51
  it 'parses msgstr' do
52
- msgstr.should parse "msgstr \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
53
- msgstr.should parse "msgstr \"فعالیت نامعتبر. شاید یک نفر دیگر دقیقا قبل از شما یک فعالیت دیگر ارسال کرده ۱۲۳۱۲۳۱safda \"\n"
52
+ expect(msgstr).to parse "msgstr \"The new state of %(module)s - %(branch)s - %(domain)s (%(language)s) is now \"\n"
53
+ expect(msgstr).to parse "msgstr \"فعالیت نامعتبر. شاید یک نفر دیگر دقیقا قبل از شما یک فعالیت دیگر ارسال کرده ۱۲۳۱۲۳۱safda \"\n"
54
54
  end
55
55
 
56
56
  it 'parses multiline entries' do
data/spec/spec_helper.rb CHANGED
@@ -13,7 +13,7 @@ require 'awesome_print'
13
13
  Coveralls.wear!
14
14
 
15
15
  RSpec.configure do |config|
16
- config.treat_symbols_as_metadata_keys_with_true_values = true
16
+ config.raise_errors_for_deprecations!
17
17
  config.run_all_when_everything_filtered = true
18
18
  config.filter_run :focus
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PoParser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arash Mousavi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-03 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '1.7'
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.6'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '1.10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '10.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '10.4'
55
55
  description: A PO file parser, editor and generator. PO files are translation files
56
56
  generated by GNU/Gettext tool.
57
57
  email:
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.4.1
120
+ rubygems_version: 2.4.6
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: A PO file parser, editor and generator.