ecma-re-validator 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: bafea38d705c1e1e8e569c3c2eed88c785dcedf420895624b826a46f59e8a0ea
4
- data.tar.gz: ba450d3898f13f5e92c6a8658025acfd759d9d6ee37cb90732654c6ac2ef2ca1
3
+ metadata.gz: 5df81fd4c41a74e3a8fa2bde6a020c5c01738742bd118d4a42c67d7aab5cbb79
4
+ data.tar.gz: d1d84b618d322222355f94e51e1cb5ae074c1554074295a49b240f7bceb9a401
5
5
  SHA512:
6
- metadata.gz: f07737a70d92894fd9d3ea201058478dcb571b9a3f76e2f2d8e401d602e31d790e97bf2059e1486105df33467bf5ec3cba5dca98fdd4349b6fe57073d61d354d
7
- data.tar.gz: 49c33901873a4cd42a99fabb253d5740854a162bdd8e74732f41e179481d22db1fd9b77429c35376c3e6b44e70aaf8790fbb4ab662aefca59f03323704a97ace
6
+ metadata.gz: a9ad8f0061e7326dbb1fbf9e2d64f166b8e3438f0df702c0d137d279188c94664f1b1db9065bfaaa357f8f8f7777feee8ace3d420a1f893bfd04361ec02d934c
7
+ data.tar.gz: 58db004cd71b7bd490d00f23edd3210d5daab998292ac14212e4639fa7b9d0278bcf4ce8f5dcae899674aa17433dee2d47c5c3c598d22e3872b61eeefea5e361
@@ -0,0 +1,28 @@
1
+ name: Ruby CI
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby-version: [3.1.0, 3.0.0, 2.7.5]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+
18
+ - name: Set up Ruby ${{ matrix.ruby-version }}
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby-version }}
22
+ bundler-cache: true
23
+
24
+ - name: Install dependencies
25
+ run: bundle install
26
+
27
+ - name: Run tests
28
+ run: bundle exec rake spec
@@ -0,0 +1,17 @@
1
+ name: Linting
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0
14
+ bundler-cache: true
15
+ - run: bundle install
16
+ - name: Rubocop
17
+ run: bundle exec rake rubocop
data/.gitignore CHANGED
@@ -1,10 +1,4 @@
1
- # File generated by script/bootstrap
2
- /.bundle/
3
- /bin
4
- /vendor/ruby
5
- /vendor/gems/
6
- /vendor/cache/ruby/
7
-
1
+ *.gem
8
2
  *.rbc
9
3
  .bundle
10
4
  .config
@@ -17,6 +11,7 @@ spec/reports
17
11
  test/tmp
18
12
  test/version_tmp
19
13
  tmp
14
+ vendor/cache
20
15
 
21
16
  Gemfile.lock
22
17
  out/
@@ -28,5 +23,8 @@ docs/
28
23
  # YARD artifacts
29
24
  .yardoc
30
25
  _yardoc
31
- doc/
26
+
32
27
  .DS_Store
28
+ .idea
29
+ .byebug_history
30
+ .vscode
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ inherit_gem:
2
+ rubocop-standard:
3
+ - config/default.yml
4
+
5
+ Naming/FileName:
6
+ Enabled: false
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  gemspec
File without changes
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # ecma-re-validator
2
2
 
3
- [![Build Status](https://travis-ci.org/gjtorikian/ecma-re-validator.svg?branch=master)](https://travis-ci.org/gjtorikian/ecma-re-validator)
4
-
5
3
  Pass in a string to validate if it would work in ECMA-262, aka JavaScript.
6
4
 
7
5
  The information for what is valid and what isn't comes from <http://www.regular-expressions.info/javascript.html>.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -5,4 +7,8 @@ require 'rspec/core/rake_task'
5
7
 
6
8
  RSpec::Core::RakeTask.new(:spec)
7
9
 
8
- task :default => [:spec]
10
+ task default: [:spec]
11
+
12
+ require 'rubocop/rake_task'
13
+
14
+ RuboCop::RakeTask.new(:rubocop)
@@ -12,14 +12,19 @@ Gem::Specification.new do |gem|
12
12
  gem.summary = %(Validate a regular expression string against what ECMA-262 can actually do.)
13
13
  gem.homepage = 'https://github.com/gjtorikian/ecma-re-validator'
14
14
  gem.license = 'MIT'
15
- gem.files = `git ls-files -z`.split("\x0").reject { |f| f =~ %r{^vendor/.*} }
15
+ gem.files = `git ls-files -z`.split("\x0").grep_v(%r{^vendor/.*})
16
16
  gem.test_files = gem.files.grep(%r{^(spec)/})
17
17
  gem.require_paths = ['lib']
18
+ gem.required_ruby_version = ['>= 2.6.0', '< 4.0']
18
19
 
19
- gem.add_dependency 'regexp_parser', '~> 2.0'
20
+ gem.add_dependency 'regexp_parser', '~> 2.2'
20
21
 
21
- gem.add_development_dependency 'rspec', '~> 3.1'
22
- gem.add_development_dependency 'rake', '~> 13.0'
23
22
  gem.add_development_dependency 'awesome_print'
24
- gem.add_development_dependency 'pry', '~> 0.10'
23
+ gem.add_development_dependency 'rake', '~> 13.0'
24
+ gem.add_development_dependency 'rspec', '~> 3.1'
25
+
26
+ gem.add_development_dependency 'rubocop'
27
+ gem.add_development_dependency 'rubocop-rspec'
28
+ gem.add_development_dependency 'rubocop-standard'
29
+ gem.metadata['rubygems_mfa_required'] = 'true'
25
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EcmaReValidator
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -1,12 +1,8 @@
1
- begin
2
- require 'awesome_print'
3
- require 'pry'
4
- rescue LoadError; end
1
+ # frozen_string_literal: true
5
2
 
6
3
  require 'regexp_parser'
7
4
 
8
5
  module EcmaReValidator
9
-
10
6
  # JS doesn't have Unicode matching
11
7
  UNICODE_CHARACTERS = Regexp::Syntax::Token::UnicodeProperty::All
12
8
 
@@ -27,7 +23,7 @@ module EcmaReValidator
27
23
  :condition_open,
28
24
  # JS doesn't support comments
29
25
  :comment
30
- ]
26
+ ].freeze
31
27
 
32
28
  INVALID_TOKENS = INVALID_REGEXP + UNICODE_CHARACTERS
33
29
 
data/spec/anchors_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::Anchors' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::AtomicGrouping' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::Comments' do
@@ -8,15 +10,14 @@ describe 'EcmaReValidator::Comments' do
8
10
  end
9
11
 
10
12
  it 'should fail if regexp has inline comments across lines' do
11
- re = %r{
13
+ re = /
12
14
  start # some text
13
15
  \s # white space char
14
16
  (group) # first group
15
17
  (?:alt1|alt2) # some alternation
16
18
  end
17
- }x
19
+ /x
18
20
 
19
21
  expect(EcmaReValidator.valid?(re)).to eql(false)
20
22
  end
21
-
22
23
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::Conditionals' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::Lookbehind' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::ModeModifiers' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::NamedCaptureGroups' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::PossesiveQuantifiers' do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/setup'
2
- require_relative "../lib/ecma-re-validator"
4
+ require_relative '../lib/ecma-re-validator'
3
5
 
4
6
  RSpec.configure do |config|
5
7
  # Use color in STDOUT
data/spec/unicode_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaReValidator::Unicode' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'EcmaRe' do
@@ -14,7 +16,7 @@ describe 'EcmaRe' do
14
16
  end
15
17
 
16
18
  it 'passes for a valid regexp string' do
17
- re = "[Ss]mith\\\\b"
19
+ re = '[Ss]mith\\\\b'
18
20
 
19
21
  expect(EcmaReValidator.valid?(re)).to eql(true)
20
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecma-re-validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-03 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regexp_parser
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.2'
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: '2.0'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: awesome_print
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.1'
33
+ version: '0'
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: '3.1'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,21 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: awesome_print
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -67,19 +81,33 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: pry
84
+ name: rubocop-rspec
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '0.10'
89
+ version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '0.10'
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-standard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: Validate a regular expression string against what ECMA-262 can actually
84
112
  do.
85
113
  email:
@@ -88,10 +116,12 @@ executables: []
88
116
  extensions: []
89
117
  extra_rdoc_files: []
90
118
  files:
119
+ - ".github/workflows/ci.yml"
120
+ - ".github/workflows/lint.yml"
91
121
  - ".gitignore"
92
- - ".travis.yml"
122
+ - ".rubocop.yml"
93
123
  - Gemfile
94
- - LICENSE
124
+ - LICENSE.txt
95
125
  - README.md
96
126
  - Rakefile
97
127
  - ecma-re-validator.gemspec
@@ -113,7 +143,8 @@ files:
113
143
  homepage: https://github.com/gjtorikian/ecma-re-validator
114
144
  licenses:
115
145
  - MIT
116
- metadata: {}
146
+ metadata:
147
+ rubygems_mfa_required: 'true'
117
148
  post_install_message:
118
149
  rdoc_options: []
119
150
  require_paths:
@@ -122,14 +153,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
153
  requirements:
123
154
  - - ">="
124
155
  - !ruby/object:Gem::Version
125
- version: '0'
156
+ version: 2.6.0
157
+ - - "<"
158
+ - !ruby/object:Gem::Version
159
+ version: '4.0'
126
160
  required_rubygems_version: !ruby/object:Gem::Requirement
127
161
  requirements:
128
162
  - - ">="
129
163
  - !ruby/object:Gem::Version
130
164
  version: '0'
131
165
  requirements: []
132
- rubygems_version: 3.1.2
166
+ rubygems_version: 3.3.3
133
167
  signing_key:
134
168
  specification_version: 4
135
169
  summary: Validate a regular expression string against what ECMA-262 can actually do.
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- language: ruby
2
- script: "./script/cibuild"
3
- rvm:
4
- - 2.4
5
- - 2.5
6
- - 2.6
7
- - 2.7
8
-
9
- sudo: false
10
- cache: bundler
11
-
12
- notifications:
13
- email:
14
- on_success: never
15
- on_failure: never
16
-
17
- git:
18
- depth: 10