texsc 0.6.0 → 0.8.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: 1a0b900b5f83d63e4125937fd67a0ee1f633278fe34a5a38393057fa4a604019
4
- data.tar.gz: 2dc1b9b642e1789a7f4bdc0441c46f3bed2de18e4c59fefa93ae313ec19ed208
3
+ metadata.gz: 1370fff72b82dfb56e42b9c8e7e111735ed21f58d214d2101544d5cda8514466
4
+ data.tar.gz: b0cd81f682e776e73d6f66ef9ddec861d2d089d473fb38e44c9d7a4185baf590
5
5
  SHA512:
6
- metadata.gz: b943bf18daae7bbb2d1af521a6fc2c4e2477347b4c661a90a4a0cc1f97264fa776afadecf0a68422846b48bec9abdbb241f39ddc8df362067b53077ed56a11e3
7
- data.tar.gz: cc92c623781f8989dab859ebd07df50cd7c7757ca8f678ddc3be4c6da9065e1610fc8e29735d95a73fff715be3284e2065e897a3362b534ccc04f7c4618c529e
6
+ metadata.gz: b73fc19a1c1664bea682978392a1764fc82108bd47a6d1124e1d665ec6123d0d6ab748ef08d2109749978b2417eaff9665cc7398b933e59f01ea4b5b8280e847
7
+ data.tar.gz: b6a104819f7af40618c65427e35c57d2887689593226d658e68122c5a71447c81c88372fcf9343f8d8d005b402f2a93c78d9ccc58ca6a5d2c31a4318101405d6
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: codecov
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ jobs:
8
+ codecov:
9
+ runs-on: ubuntu-20.04
10
+ steps:
11
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.7
15
+ - run: sudo apt-get -y install aspell
16
+ - run: bundle update
17
+ - run: bundle exec rake
18
+ - uses: codecov/codecov-action@v4
19
+ with:
20
+ file: coverage/.resultset.json
21
+ fail_ci_if_error: true
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: rake
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test:
12
+ name: test
13
+ strategy:
14
+ matrix:
15
+ os: [ubuntu-20.04]
16
+ ruby: [2.7, 3.1]
17
+ runs-on: ${{ matrix.os }}
18
+ steps:
19
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ - run: sudo apt-get -y install aspell
24
+ - run: bundle update
25
+ - run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -3,6 +3,8 @@ AllCops:
3
3
  - 'assets/**/*'
4
4
  DisplayCopNames: true
5
5
  TargetRubyVersion: 2.3
6
+ SuggestExtensions: false
7
+ NewCops: enable
6
8
 
7
9
  Metrics/LineLength:
8
10
  Max: 100
@@ -12,7 +14,7 @@ Style/MultilineTernaryOperator:
12
14
  Enabled: false
13
15
  Metrics/BlockLength:
14
16
  Max: 60
15
- Layout/AlignParameters:
17
+ Layout/ParameterAlignment:
16
18
  Enabled: false
17
19
  Layout/EmptyLineAfterGuardClause:
18
20
  Enabled: false
data/.rultor.yml CHANGED
@@ -1,9 +1,11 @@
1
+ docker:
2
+ image: yegor256/rultor-image:1.22.0
1
3
  assets:
2
4
  rubygems.yml: yegor256/home#assets/rubygems.yml
3
5
  install: |
4
6
  sudo apt install -y aspell
5
7
  pdd -f /dev/null
6
- sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
8
+ bundle install --no-color "--gemfile=$(pwd)/Gemfile"
7
9
  release:
8
10
  script: |-
9
11
  bundle exec rake
@@ -18,7 +20,3 @@ release:
18
20
  merge:
19
21
  script: |-
20
22
  bundle exec rake
21
- deploy:
22
- script: |-
23
- echo "There is nothing to deploy"
24
- exit -1
data/.simplecov CHANGED
@@ -1,4 +1,6 @@
1
- # Copyright (c) 2020-2021 Yegor Bugayenko
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -18,21 +20,21 @@
18
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
21
  # SOFTWARE.
20
22
 
21
- if Gem.win_platform? then
23
+ if Gem.win_platform?
22
24
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
23
25
  SimpleCov::Formatter::HTMLFormatter
24
26
  ]
25
27
  SimpleCov.start do
26
- add_filter "/test/"
27
- add_filter "/features/"
28
+ add_filter '/test/'
29
+ add_filter '/features/'
28
30
  end
29
31
  else
30
32
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
31
33
  [SimpleCov::Formatter::HTMLFormatter]
32
34
  )
33
35
  SimpleCov.start do
34
- add_filter "/test/"
35
- add_filter "/features/"
36
+ add_filter '/test/'
37
+ add_filter '/features/'
36
38
  minimum_coverage 60
37
39
  end
38
40
  end
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2020-2021 Yegor Bugayenko
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -21,5 +21,10 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  source 'https://rubygems.org'
24
- ruby '~>2.3'
25
24
  gemspec
25
+
26
+ gem 'cucumber', '9.1.0', require: false
27
+ gem 'rake', '13.1.0', require: false
28
+ gem 'rubocop', '1.57.2', require: false
29
+ gem 'rubocop-rspec', '2.25.0', require: false
30
+ gem 'simplecov', '0.22.0', require: false
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
1
  <img src="/logo.svg" width="64px"/>
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
- [![Managed by Zerocracy](https://www.0crat.com/badge/C3RFVLU72.svg)](https://www.0crat.com/p/C3RFVLU72)
5
4
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/texsc)](http://www.rultor.com/p/yegor256/texsc)
6
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
7
6
 
8
- [![Build Status](https://travis-ci.org/yegor256/texsc.svg)](https://travis-ci.org/yegor256/texsc)
7
+ [![rake](https://github.com/yegor256/texsc/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/texsc/actions/workflows/rake.yml)
9
8
  [![PDD status](http://www.0pdd.com/svg?name=yegor256/texsc)](http://www.0pdd.com/p?name=yegor256/texsc)
10
9
  [![Gem Version](https://badge.fury.io/rb/texsc.svg)](http://badge.fury.io/rb/texsc)
11
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/7593273bfae71f87ea8c/maintainability)](https://codeclimate.com/github/yegor256/texsc/maintainability)
12
-
13
11
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/texsc/master/LICENSE.txt)
14
12
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/texsc.svg)](https://codecov.io/github/yegor256/texsc?branch=master)
15
13
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/texsc)](https://hitsofcode.com/view/github/yegor256/texsc)
@@ -57,6 +55,11 @@ this:
57
55
  personal_ws-1.1 en 1 utf-8
58
56
  ```
59
57
 
58
+ To make configuration easier, you can create `.texsc` file next to your
59
+ `.tex` file and place all your command line configuration options over there,
60
+ each one on its own line. You can also have a global configuration file
61
+ at `~/.texsc`, which will be read first.
62
+
60
63
  ## How to contribute
61
64
 
62
65
  Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2020-2021 Yegor Bugayenko
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
data/bin/texsc CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- # Copyright (c) 2020-2021 Yegor Bugayenko
4
+ # Copyright (c) 2020-2023 Yegor Bugayenko
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -21,9 +21,9 @@
21
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  # SOFTWARE.
23
23
 
24
- VERSION = '0.6.0'
24
+ VERSION = '0.8.0'
25
25
 
26
- STDOUT.sync = true
26
+ $stdout.sync = true
27
27
 
28
28
  require 'backtrace'
29
29
  require 'loog'
@@ -31,17 +31,20 @@ require 'open3'
31
31
  require 'shellwords'
32
32
  require 'slop'
33
33
 
34
- begin
35
- log = Loog::REGULAR
34
+ def config(path)
36
35
  args = []
37
- if File.exist?('.texsc')
38
- cfg = File.new('.texsc')
39
- body = File.read(cfg)
40
- extra = body.split(/\s+/).map(&:strip)
41
- args += extra
42
- puts "Found #{body.split(/\n/).length} lines in #{File.absolute_path(cfg)}"
36
+ f = File.expand_path(path)
37
+ if File.exist?(f)
38
+ body = File.read(f)
39
+ args += body.split(/\s+/).map(&:strip)
40
+ puts "Found #{args.length} lines in #{File.absolute_path(f)}"
43
41
  end
44
- args += ARGV
42
+ args
43
+ end
44
+
45
+ begin
46
+ log = Loog::REGULAR
47
+ args = config('~/.texsc') + config('.texsc') + ARGV
45
48
 
46
49
  begin
47
50
  opts = Slop.parse(args, strict: true, help: true) do |o|
@@ -50,7 +53,7 @@ Options are:"
50
53
  o.string '--pws', 'The location of aspell.en.pws file'
51
54
  o.array '--ignore', 'The name of the command or environment to ignore'
52
55
  o.integer '--min-word-length',
53
- 'The minimum length of the word to be checked', default: 3
56
+ 'The minimum length of the word to be checked', default: 3
54
57
  o.bool '--version', 'Print current version' do
55
58
  puts VERSION
56
59
  exit
@@ -63,8 +66,8 @@ Options are:"
63
66
  exit
64
67
  end
65
68
  end
66
- rescue Slop::Error => ex
67
- raise ex.message
69
+ rescue Slop::Error => e
70
+ raise e.message
68
71
  end
69
72
  candidates = opts.arguments
70
73
  candidates += Dir['*.tex'] if candidates.empty?
@@ -78,8 +81,8 @@ Options are:"
78
81
  files = 0
79
82
  candidates.each do |f|
80
83
  tex = File.read(f)
81
- ignores = opts[:ignore].map do |e|
82
- c, o = e.split(':')
84
+ ignores = opts[:ignore].map do |ee|
85
+ c, o = ee.split(':')
83
86
  { cmd: c, opts: o || 'p' }
84
87
  end
85
88
  ignores.each do |i|
@@ -136,11 +139,11 @@ Options are:"
136
139
  exit 1
137
140
  end
138
141
  log.info("No spelling errors found in #{files} file(s), the text is clean")
139
- rescue StandardError => ex
142
+ rescue StandardError => e
140
143
  if opts[:verbose]
141
- puts Backtrace.new(ex).to_s
144
+ puts Backtrace.new(e)
142
145
  else
143
- puts "ERROR: #{ex.message}"
146
+ puts "ERROR: #{e.message}"
144
147
  end
145
148
  exit(255)
146
149
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2020-2021 Yegor Bugayenko
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,20 +26,18 @@ require 'English'
26
26
  Before do
27
27
  @cwd = Dir.pwd
28
28
  @dir = Dir.mktmpdir('test')
29
- FileUtils.mkdir_p(@dir) unless File.exist?(@dir)
29
+ FileUtils.mkdir_p(@dir)
30
30
  Dir.chdir(@dir)
31
31
  end
32
32
 
33
33
  After do
34
34
  Dir.chdir(@cwd)
35
- FileUtils.rm_rf(@dir) if File.exist?(@dir)
35
+ FileUtils.rm_rf(@dir)
36
36
  end
37
37
 
38
38
  Given(/^I have a "([^"]*)" file with content:$/) do |file, text|
39
39
  FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(file)
40
- File.open(file, 'w') do |f|
41
- f.write(text.gsub(/\\xFF/, 0xFF.chr))
42
- end
40
+ File.write(file, text.gsub('\\xFF', 0xFF.chr))
43
41
  end
44
42
 
45
43
  When(%r{^I run bin/texsc with "([^"]*)"$}) do |arg|
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2020-2021 Yegor Bugayenko
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:base"
5
+ ]
6
+ }
data/texsc.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2020-2021 Yegor Bugayenko
3
+ # Copyright (c) 2020-2023 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -25,14 +25,12 @@ require 'English'
25
25
  lib = File.expand_path('lib', __dir__)
26
26
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
27
27
  Gem::Specification.new do |s|
28
- s.specification_version = 2 if s.respond_to? :specification_version=
29
28
  if s.respond_to? :required_rubygems_version=
30
29
  s.required_rubygems_version = Gem::Requirement.new('>= 0')
31
30
  end
32
- s.rubygems_version = '2.2'
33
31
  s.required_ruby_version = '>= 2.3'
34
32
  s.name = 'texsc'
35
- s.version = '0.6.0'
33
+ s.version = '0.8.0'
36
34
  s.license = 'MIT'
37
35
  s.summary = 'Spell Checker for LaTeX'
38
36
  s.description = 'Simple command-line spell checker for LaTeX documents'
@@ -41,15 +39,10 @@ Gem::Specification.new do |s|
41
39
  s.homepage = 'http://github.com/yegor256/texsc'
42
40
  s.files = `git ls-files`.split($RS)
43
41
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
44
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
45
42
  s.rdoc_options = ['--charset=UTF-8']
46
43
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
47
44
  s.add_runtime_dependency 'backtrace', '~> 0.3'
48
45
  s.add_runtime_dependency 'loog', '~> 0.2'
49
46
  s.add_runtime_dependency 'slop', '~> 4.8'
50
- s.add_development_dependency 'codecov', '0.2.8'
51
- s.add_development_dependency 'cucumber', '~> 1.3.17'
52
- s.add_development_dependency 'rake', '12.0.0'
53
- s.add_development_dependency 'rubocop', '0.61.0'
54
- s.add_development_dependency 'rubocop-rspec', '1.31.0'
47
+ s.metadata['rubygems_mfa_required'] = 'true'
55
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -52,76 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.8'
55
- - !ruby/object:Gem::Dependency
56
- name: codecov
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 0.2.8
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '='
67
- - !ruby/object:Gem::Version
68
- version: 0.2.8
69
- - !ruby/object:Gem::Dependency
70
- name: cucumber
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 1.3.17
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 1.3.17
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 12.0.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 12.0.0
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '='
102
- - !ruby/object:Gem::Version
103
- version: 0.61.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.61.0
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-rspec
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '='
116
- - !ruby/object:Gem::Version
117
- version: 1.31.0
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '='
123
- - !ruby/object:Gem::Version
124
- version: 1.31.0
125
55
  description: Simple command-line spell checker for LaTeX documents
126
56
  email: yegor256@gmail.com
127
57
  executables:
@@ -133,12 +63,13 @@ extra_rdoc_files:
133
63
  files:
134
64
  - ".0pdd.yml"
135
65
  - ".gitattributes"
66
+ - ".github/workflows/codecov.yml"
67
+ - ".github/workflows/rake.yml"
136
68
  - ".gitignore"
137
69
  - ".pdd"
138
70
  - ".rubocop.yml"
139
71
  - ".rultor.yml"
140
72
  - ".simplecov"
141
- - ".travis.yml"
142
73
  - Gemfile
143
74
  - LICENSE.txt
144
75
  - README.md
@@ -150,11 +81,13 @@ files:
150
81
  - features/step_definitions/steps.rb
151
82
  - features/support/env.rb
152
83
  - logo.svg
84
+ - renovate.json
153
85
  - texsc.gemspec
154
86
  homepage: http://github.com/yegor256/texsc
155
87
  licenses:
156
88
  - MIT
157
- metadata: {}
89
+ metadata:
90
+ rubygems_mfa_required: 'true'
158
91
  post_install_message:
159
92
  rdoc_options:
160
93
  - "--charset=UTF-8"
@@ -171,12 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
104
  - !ruby/object:Gem::Version
172
105
  version: '0'
173
106
  requirements: []
174
- rubygems_version: 3.1.2
107
+ rubygems_version: 3.4.10
175
108
  signing_key:
176
- specification_version: 2
109
+ specification_version: 4
177
110
  summary: Spell Checker for LaTeX
178
- test_files:
179
- - features/cli.feature
180
- - features/gem_package.feature
181
- - features/step_definitions/steps.rb
182
- - features/support/env.rb
111
+ test_files: []
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.0
4
- cache: bundler
5
- branches:
6
- only:
7
- - master
8
- addons:
9
- apt:
10
- packages:
11
- - aspell
12
- - aspell-en
13
- install:
14
- - gem install pdd -v 0.20.5
15
- - travis_retry bundle update
16
- script:
17
- - pdd -f /dev/null
18
- - bundle exec rake
19
- after_success:
20
- - "bash <(curl -s https://codecov.io/bash)"