sequitur 0.1.20 → 0.1.22

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: 8193a64b5b2c9a7d8b73f86db45f4209f9fa2f0a
4
- data.tar.gz: 30286f7b8424bfd1e6b4479a25d5d68b38cd1228
2
+ SHA256:
3
+ metadata.gz: 8120ed261178fac280e46bcd3cc35edf3717603031738349f5177114b9fe8bc0
4
+ data.tar.gz: f799bff2dfaa09c0649e6416a789ab684e226e6eb1ccba974db8670932174050
5
5
  SHA512:
6
- metadata.gz: 63cc43d00ceb0f58ab8865e747182b59fd2b6d579de9381e54a195f945817977dccefe2fb428182b9c17fa88afeabf765cb008eeb5fdce3aeaccb8e07cdfdc29
7
- data.tar.gz: 5123a46113267d7e88a5f05cb813d65ee6a31ed0300440ef65281e703129f99cb2d5e65e88ecc434843d319bbf3a11a9ff469b14fddf39d95138c067082694ab
6
+ metadata.gz: ec4f16080571ec66e2256898b0f414815d430484ef5221d53e99acf8982da870ddb4a459158005c6f52107ccf7ef52af0e55cdd8a2b4b9982ff6066e189651b0
7
+ data.tar.gz: 95a95f2f8b5812e3e859b94909432d25f629682b1afa6aed8a6c17439d4e57b3d8abd055f3be3f4e4008a7927de22ee2201174f3ee602fd3c680623b7261c554
@@ -1,25 +1,27 @@
1
1
  language: ruby
2
+ dist: trusty
3
+
4
+ before_install:
5
+ - gem update --system
6
+ - gem install bundler
7
+
8
+ script:
9
+ - bundle exec rake
10
+
2
11
  rvm:
3
- - 2.6.0
4
- - 2.5.3
5
- - 2.4.5
12
+ - 2.6.3
13
+ - 2.5.5
14
+ - 2.4.6
6
15
  - 2.3.8
7
- - 2.2.10
8
- - 2.1.10
9
- - 2.0.0-p648
10
- - ruby-head
16
+ - ruby-head
11
17
  - jruby-9.1.9.0
12
- - jruby-head
13
-
18
+ - jruby-head
19
+
14
20
  matrix:
15
21
  allow_failures:
16
- - rvm: jruby
17
22
  - rvm: ruby-head
18
23
  - rvm: jruby-head
19
- fast_finish: true
20
24
 
21
- gemfile:
22
- - Gemfile
23
25
 
24
26
  # whitelist
25
27
  branches:
@@ -1,3 +1,13 @@
1
+ ## [0.1.22] - 2019-08-18
2
+ - Code refactoring to use string frozen magic comments (as a consequence, srl_ruby runs only on Rubies 2.3 or newer).
3
+ - Code restyling to please rubocop 0.7.40.
4
+
5
+ * [CHANGE] Files `Gemfile`, `.travis.yml`, `appveyor.yml` updated.
6
+
7
+ ## 0.1.21 - 2019-01-13
8
+ - Removed Ruby versions older than 2.3 in CI testing because of breaking changes by Bundler 2.0
9
+ * [CHANGE] Files `Gemfile`, `.travis.yml`, `appveyor.yml` updated.
10
+
1
11
  ### 0.1.20 / 2019-01-03
2
12
  Maintenance release.
3
13
  * [CHANGE] File `.travis.yml`: updated Ruby versions.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  # Prevent Bundler to load the dependencies from our .gemspec file
3
5
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require_relative './lib/sequitur/constants'
3
5
 
@@ -1,25 +1,28 @@
1
1
  version: '{build}'
2
- max_jobs: 3
2
+ max_jobs: 5
3
3
  environment:
4
4
  matrix:
5
- - Ruby_version: 25-x64
5
+ - Ruby_version: 26-x64
6
+ - Ruby_version: 25-x64
6
7
  - Ruby_version: 24-x64
7
8
  - Ruby_version: 23-x64
8
- - Ruby_version: 22-x64
9
- - Ruby_version: 21-x64
10
- - Ruby_version: 200-x64
11
- - Ruby_version: 25
9
+ - Ruby_version: 26
10
+ - Ruby_version: 25
12
11
  - Ruby_version: 24
13
12
  - Ruby_version: 23
14
- - Ruby_version: 22
15
- - Ruby_version: 21
16
- - Ruby_version: 200
17
13
 
18
14
  install:
19
15
  - set PATH=C:\Ruby%Ruby_version%\bin;%PATH%
16
+ - gem update --system
17
+ - gem install bundler
20
18
  - bundle install --retry=3 --clean --force
21
19
 
22
20
  build: off
23
21
 
22
+ before_test:
23
+ - ruby -v
24
+ - gem -v
25
+ - bundle -v
26
+
24
27
  test_script:
25
- - bundle exec rake
28
+ - bundle exec rake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sequitur' # Load the Sequitur library
2
4
 
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sequitur' # Load the Sequitur library
2
4
 
3
5
  # Purpose: demo to show that sequitur gem works on example from sequitur.info website
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sequitur' # Load the Sequitur library
2
4
 
3
5
  # Purpose: show how to apply Sequitur on a stream of single characters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sequitur' # Load the Sequitur library
2
4
 
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sequitur' # Load the Sequitur library
2
4
 
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # File: sequitur.rb
2
4
  # This file acts as a jumping-off point for loading dependencies expected
3
5
  # for a Sequitur client.
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # File: constants.rb
2
4
  # Purpose: definition of Sequitur constants.
3
5
 
4
6
  module Sequitur # Module used as a namespace
5
7
  # The version number of the gem.
6
- Version = '0.1.20'.freeze
8
+ Version = '0.1.22'
7
9
 
8
10
  # Brief description of the gem.
9
- Description = 'Ruby implementation of the Sequitur algorithm'.freeze
11
+ Description = 'Ruby implementation of the Sequitur algorithm'
10
12
 
11
13
  # Constant Sequitur::RootDir contains the absolute path of Sequitur's
12
14
  # start directory. Note: it also ends with a slash character.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # File: digram.rb
2
4
 
3
5
  module Sequitur # Module for classes implementing the Sequitur algorithm
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'production'
2
4
  require_relative 'grammar_visitor'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Sequitur
2
4
  # Namespace dedicated to grammar formatters.
3
5
  module Formatter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'base_formatter'
2
4
 
3
5
  module Sequitur
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'base_formatter'
2
4
 
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Sequitur # Module for classes implementing the Sequitur algorithm
2
4
  # A visitor class dedicated in the visit of Grammar.
3
5
  class GrammarVisitor
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'digram'
2
4
  require_relative 'symbol_sequence'
3
5
  require_relative 'production_ref'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Sequitur # Module for classes implementing the Sequitur algorithm
2
4
  # A production reference is a grammar symbol that may appear in the right-hand
3
5
  # side of a production P1 and that refers to a production P2.
@@ -81,7 +83,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
81
83
  def bind_to(aProduction)
82
84
  return if aProduction == @production
83
85
 
84
- production.decr_refcount if production
86
+ production&.decr_refcount
85
87
  unless aProduction.kind_of?(Production)
86
88
  raise StandardError, "Illegal production type #{aProduction.class}"
87
89
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'dynamic_grammar'
2
4
 
3
5
 
@@ -111,7 +113,7 @@ class SequiturGrammar < DynamicGrammar
111
113
  # Return a production that is used less than twice in the grammar.
112
114
  def detect_useless_production
113
115
  useless = productions.index { |prod| prod.refcount < 2 }
114
- useless = nil if useless && useless.zero?
116
+ useless = nil if useless&.zero?
115
117
 
116
118
  return useless
117
119
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Sequitur # Module for classes implementing the Sequitur algorithm
2
4
  # Represents a sequence (concatenation) of grammar symbols
3
5
  # as they appear in rhs of productions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../spec_helper'
2
4
  require 'stringio'
3
5
 
@@ -32,11 +34,11 @@ describe BaseText do
32
34
  grm
33
35
  end
34
36
 
35
- let(:destination) { StringIO.new('', 'w') }
37
+ let(:destination) { StringIO.new(+'', 'w') }
36
38
 
37
39
  context 'Standard creation & initialization:' do
38
40
  it 'should be initialized with an IO argument' do
39
- expect { BaseText.new(StringIO.new('', 'w')) }.not_to raise_error
41
+ expect { BaseText.new(StringIO.new(+'', 'w')) }.not_to raise_error
40
42
  end
41
43
 
42
44
  it 'should know its output destination' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../spec_helper'
2
4
  require 'stringio'
3
5
 
@@ -32,11 +34,11 @@ describe Debug do
32
34
  grm
33
35
  end
34
36
 
35
- let(:destination) { StringIO.new('', 'w') }
37
+ let(:destination) { StringIO.new(+'', 'w') }
36
38
 
37
39
  context 'Standard creation & initialization:' do
38
40
  it 'should be initialized with an IO argument' do
39
- expect { Debug.new(StringIO.new('', 'w')) }.not_to raise_error
41
+ expect { Debug.new(StringIO.new(+'', 'w')) }.not_to raise_error
40
42
  end
41
43
 
42
44
  it 'should know its output destination' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -176,7 +178,7 @@ describe Production do
176
178
  instance = Production.new
177
179
  symbols = [:a, :b, 'c', :d, :e, 1000, instance]
178
180
  symbols.each { |symb| subject.append_symbol(symb) }
179
- expectation = "#{subject.object_id} : "
181
+ expectation = +"#{subject.object_id} : "
180
182
  expectation << "a b 'c' d e 1000 #{instance.object_id}."
181
183
  expect(subject.to_string).to eq(expectation)
182
184
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  # Load the class under test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # File: spec_helper.rb
2
4
  # Purpose: utility file that is loaded by all our RSpec files
3
5
 
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequitur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-03 00:00:00.000000000 Z
11
+ date: 2019-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.7'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 0.7.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.7'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '0.7'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 0.7.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 10.0.0
40
- - - ">="
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 10.0.0
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 10.0.0
50
- - - ">="
50
+ - - "~>"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 10.0.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: 3.0.0
60
- - - ">="
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: 3.0.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: 3.0.0
70
- - - ">="
70
+ - - "~>"
71
71
  - !ruby/object:Gem::Version
72
72
  version: 3.0.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: rubygems
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '2.0'
80
77
  - - ">="
81
78
  - !ruby/object:Gem::Version
82
79
  version: 2.0.0
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '2.0'
90
87
  - - ">="
91
88
  - !ruby/object:Gem::Version
92
89
  version: 2.0.0
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '2.0'
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: simplecov
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: 0.8.0
100
- - - ">="
100
+ - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 0.8.0
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - "~>"
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: 0.8.0
110
- - - ">="
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: 0.8.0
113
113
  description: |
@@ -127,7 +127,6 @@ files:
127
127
  - ".rspec"
128
128
  - ".rubocop.yml"
129
129
  - ".ruby-gemset"
130
- - ".ruby-version"
131
130
  - ".simplecov"
132
131
  - ".travis.yml"
133
132
  - ".yardopts"
@@ -180,15 +179,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
179
  requirements:
181
180
  - - ">="
182
181
  - !ruby/object:Gem::Version
183
- version: 2.0.0
182
+ version: 2.3.0
184
183
  required_rubygems_version: !ruby/object:Gem::Requirement
185
184
  requirements:
186
185
  - - ">="
187
186
  - !ruby/object:Gem::Version
188
187
  version: '0'
189
188
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.6.13
189
+ rubygems_version: 3.0.3
192
190
  signing_key:
193
191
  specification_version: 4
194
192
  summary: Ruby implementation of the Sequitur algorithm
@@ -1 +0,0 @@
1
- 2.2.3