texsc 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.0pdd.yml +9 -0
- data/.gitattributes +7 -0
- data/.gitignore +8 -0
- data/.pdd +7 -0
- data/.rubocop.yml +32 -0
- data/.rultor.yml +23 -0
- data/.simplecov +38 -0
- data/.travis.yml +15 -0
- data/Gemfile +25 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +58 -0
- data/bin/texsc +101 -0
- data/cucumber.yml +3 -0
- data/features/cli.feature +8 -0
- data/features/gem_package.feature +24 -0
- data/features/step_definitions/steps.rb +85 -0
- data/features/support/env.rb +23 -0
- data/logo.svg +19 -0
- data/texsc.gemspec +55 -0
- metadata +182 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e32f01e9713f452e0ed430e1b86a0336b60c124493f97c3e85534c9ccb82ecb4
|
4
|
+
data.tar.gz: 969342bbe56d241096a82504328def1a22567779c1f6b97793da92c6c3b6691e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7ea846d38263b985dd1f4e8fc701848e7fba88a661852d1e5aaeb265ca55967544e6ccc1994fadec7e4f5c8542d3743fb8d05c5df1feef795a1b639c124d85d0
|
7
|
+
data.tar.gz: a0e9b64259720b8e39b321de67e99384865a7f2b7c0220e44b5d736b9beef1fe44aad56338177411d61799ad89359a701eda2f54d7550306955eb89ef024c481
|
data/.0pdd.yml
ADDED
data/.gitattributes
ADDED
data/.gitignore
ADDED
data/.pdd
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'assets/**/*'
|
4
|
+
DisplayCopNames: true
|
5
|
+
TargetRubyVersion: 2.3
|
6
|
+
|
7
|
+
Style/ClassAndModuleChildren:
|
8
|
+
Enabled: false
|
9
|
+
Metrics/LineLength:
|
10
|
+
Max: 100
|
11
|
+
Layout/EndOfLine:
|
12
|
+
EnforcedStyle: lf
|
13
|
+
Metrics/CyclomaticComplexity:
|
14
|
+
Max: 20
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Enabled: false
|
17
|
+
Layout/MultilineMethodCallIndentation:
|
18
|
+
Enabled: false
|
19
|
+
Metrics/ParameterLists:
|
20
|
+
Max: 6
|
21
|
+
Metrics/ClassLength:
|
22
|
+
Max: 250
|
23
|
+
Metrics/AbcSize:
|
24
|
+
Enabled: false
|
25
|
+
Metrics/BlockLength:
|
26
|
+
Max: 100
|
27
|
+
Metrics/PerceivedComplexity:
|
28
|
+
Max: 20
|
29
|
+
Style/MultilineTernaryOperator:
|
30
|
+
Enabled: false
|
31
|
+
Layout/EmptyLineAfterGuardClause:
|
32
|
+
Enabled: false
|
data/.rultor.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
assets:
|
2
|
+
rubygems.yml: yegor256/home#assets/rubygems.yml
|
3
|
+
install: |
|
4
|
+
pdd -f /dev/null
|
5
|
+
sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
6
|
+
release:
|
7
|
+
script: |-
|
8
|
+
bundle exec rake
|
9
|
+
sed -i "s/0\.0\.0/${tag}/g" bin/texsc
|
10
|
+
sed -i "s/0\.0\.0/${tag}/g" texsc.gemspec
|
11
|
+
git add bin/texsc
|
12
|
+
git add texsc.gemspec
|
13
|
+
git commit -m "version set to ${tag}"
|
14
|
+
gem build texsc.gemspec
|
15
|
+
chmod 0600 ../rubygems.yml
|
16
|
+
gem push *.gem --config-file ../rubygems.yml
|
17
|
+
merge:
|
18
|
+
script: |-
|
19
|
+
bundle exec rake
|
20
|
+
deploy:
|
21
|
+
script: |-
|
22
|
+
echo "There is nothing to deploy"
|
23
|
+
exit -1
|
data/.simplecov
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
|
21
|
+
if Gem.win_platform? then
|
22
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
23
|
+
SimpleCov::Formatter::HTMLFormatter
|
24
|
+
]
|
25
|
+
SimpleCov.start do
|
26
|
+
add_filter "/test/"
|
27
|
+
add_filter "/features/"
|
28
|
+
end
|
29
|
+
else
|
30
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
31
|
+
[SimpleCov::Formatter::HTMLFormatter]
|
32
|
+
)
|
33
|
+
SimpleCov.start do
|
34
|
+
add_filter "/test/"
|
35
|
+
add_filter "/features/"
|
36
|
+
minimum_coverage 60
|
37
|
+
end
|
38
|
+
end
|
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.6.0
|
4
|
+
cache: bundler
|
5
|
+
branches:
|
6
|
+
only:
|
7
|
+
- master
|
8
|
+
install:
|
9
|
+
- gem install pdd -v 0.20.5
|
10
|
+
- travis_retry bundle update
|
11
|
+
script:
|
12
|
+
- pdd -f /dev/null
|
13
|
+
- bundle exec rake
|
14
|
+
after_success:
|
15
|
+
- "bash <(curl -s https://codecov.io/bash)"
|
data/Gemfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
source 'https://rubygems.org'
|
24
|
+
ruby '~>2.3'
|
25
|
+
gemspec
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
<img src="/logo.svg" width="64px"/>
|
2
|
+
|
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
|
+
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/texsc)](http://www.rultor.com/p/yegor256/texsc)
|
6
|
+
[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
|
7
|
+
|
8
|
+
[![Build Status](https://travis-ci.org/yegor256/texsc.svg)](https://travis-ci.org/yegor256/texsc)
|
9
|
+
[![PDD status](http://www.0pdd.com/svg?name=yegor256/texsc)](http://www.0pdd.com/p?name=yegor256/texsc)
|
10
|
+
[![Gem Version](https://badge.fury.io/rb/texsc.svg)](http://badge.fury.io/rb/texsc)
|
11
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/74c909f06d4afa0d8001/maintainability)](https://codeclimate.com/github/yegor256/texsc/maintainability)
|
12
|
+
|
13
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/texsc/master/LICENSE.txt)
|
14
|
+
[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/texsc.svg)](https://codecov.io/github/yegor256/texsc?branch=master)
|
15
|
+
[![Hits-of-Code](https://hitsofcode.com/github/yegor256/texsc)](https://hitsofcode.com/view/github/yegor256/texsc)
|
16
|
+
|
17
|
+
Just run it like this for your LaTeX file:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
$ texsc article.tex
|
21
|
+
```
|
22
|
+
|
23
|
+
## How to contribute
|
24
|
+
|
25
|
+
Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
26
|
+
Make sure your build is green before you contribute
|
27
|
+
your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
28
|
+
[Bundler](https://bundler.io/) installed. Then:
|
29
|
+
|
30
|
+
```
|
31
|
+
$ bundle update
|
32
|
+
$ bundle exec rake
|
33
|
+
```
|
34
|
+
|
35
|
+
If it's clean and you don't see any error messages, submit your pull request.
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require 'rubygems'
|
24
|
+
require 'rake'
|
25
|
+
require 'rdoc'
|
26
|
+
require 'rake/clean'
|
27
|
+
|
28
|
+
def name
|
29
|
+
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
|
30
|
+
end
|
31
|
+
|
32
|
+
def version
|
33
|
+
Gem::Specification.load(Dir['*.gemspec'].first).version
|
34
|
+
end
|
35
|
+
|
36
|
+
task default: %i[clean features rubocop copyright]
|
37
|
+
|
38
|
+
require 'rubocop/rake_task'
|
39
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
40
|
+
task.fail_on_error = true
|
41
|
+
task.requires << 'rubocop-rspec'
|
42
|
+
end
|
43
|
+
|
44
|
+
require 'cucumber/rake/task'
|
45
|
+
Cucumber::Rake::Task.new(:features) do
|
46
|
+
Rake::Cleaner.cleanup_files(['coverage'])
|
47
|
+
end
|
48
|
+
Cucumber::Rake::Task.new(:'features:html') do |t|
|
49
|
+
t.profile = 'html_report'
|
50
|
+
end
|
51
|
+
|
52
|
+
task :copyright do
|
53
|
+
sh "grep -q -r '#{Date.today.strftime('%Y')}' \
|
54
|
+
--include '*.rb' \
|
55
|
+
--include '*.txt' \
|
56
|
+
--include 'Rakefile' \
|
57
|
+
."
|
58
|
+
end
|
data/bin/texsc
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
|
24
|
+
VERSION = '0.1.0'
|
25
|
+
|
26
|
+
STDOUT.sync = true
|
27
|
+
|
28
|
+
require 'backtrace'
|
29
|
+
require 'loog'
|
30
|
+
require 'open3'
|
31
|
+
require 'slop'
|
32
|
+
|
33
|
+
begin
|
34
|
+
log = Loog::REGULAR
|
35
|
+
begin
|
36
|
+
opts = Slop.parse(ARGV, strict: true, help: true) do |o|
|
37
|
+
o.banner = "Usage (#{VERSION}): texsc [options] files
|
38
|
+
Options are:"
|
39
|
+
o.string '--pws', 'The location of aspell.en.pws file'
|
40
|
+
o.array '--ignore', 'The name of the command or environment to ignore'
|
41
|
+
o.bool '--version', 'Print current version' do
|
42
|
+
puts VERSION
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
o.bool '--verbose', 'Make it more verbose than usual' do
|
46
|
+
log = Loog::VERBOSE
|
47
|
+
end
|
48
|
+
o.bool '--help', 'Read this: https://github.com/yegor256/texsc' do
|
49
|
+
puts o
|
50
|
+
exit
|
51
|
+
end
|
52
|
+
end
|
53
|
+
rescue Slop::Error => ex
|
54
|
+
raise ex.message
|
55
|
+
end
|
56
|
+
raise 'Try --help' if opts.arguments.empty?
|
57
|
+
if opts[:pws]
|
58
|
+
log.debug("PWS with an additional dictionary is here: #{opts[:pws]}")
|
59
|
+
opts[:pws] = File.expand_path(opts[:pws])
|
60
|
+
log.debug("The real path of PWS is: #{opts[:pws]}")
|
61
|
+
end
|
62
|
+
errors = 0
|
63
|
+
opts.arguments.each do |f|
|
64
|
+
tex = File.read(f)
|
65
|
+
opts[:ignore].each do |e|
|
66
|
+
tex = tex.gsub(/\\begin{#{e}}.+\\end{#{e}}/m, '')
|
67
|
+
end
|
68
|
+
log.info("Checking #{f} (#{tex.length} chars)...")
|
69
|
+
cmd = [
|
70
|
+
'aspell',
|
71
|
+
'--ignore=3',
|
72
|
+
'--dont-tex-check-comments',
|
73
|
+
'--lang=en',
|
74
|
+
'--mode=tex',
|
75
|
+
opts[:pws] ? "-p #{opts[:pws]}" : '',
|
76
|
+
opts[:ignore].map { |e| "--add-tex-command '#{e} p'" }.join(' '),
|
77
|
+
'pipe'
|
78
|
+
].join(' ')
|
79
|
+
log.debug(cmd)
|
80
|
+
Open3.popen3(cmd) do |stdin, stdout, _stderr, _thread|
|
81
|
+
stdin.print(tex)
|
82
|
+
stdin.close
|
83
|
+
stdout.read.split("\n").select { |t| t.start_with?('&') }.each do |t|
|
84
|
+
log.info(t)
|
85
|
+
errors += 1
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
unless errors.zero?
|
90
|
+
log.info("#{errors} spelling errors found")
|
91
|
+
exit 1
|
92
|
+
end
|
93
|
+
log.info('No spelling errors found, the text is clean')
|
94
|
+
rescue StandardError => ex
|
95
|
+
if opts[:verbose]
|
96
|
+
puts Backtrace.new(ex).to_s
|
97
|
+
else
|
98
|
+
puts "ERROR: #{ex.message}"
|
99
|
+
end
|
100
|
+
exit(255)
|
101
|
+
end
|
data/cucumber.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Gem Package
|
2
|
+
As a source code writer I want to be able to
|
3
|
+
package the Gem into .gem file
|
4
|
+
|
5
|
+
Scenario: Gem can be packaged
|
6
|
+
Given It is Unix
|
7
|
+
Given I have a "execs.rb" file with content:
|
8
|
+
"""
|
9
|
+
#!/usr/bin/env ruby
|
10
|
+
require 'rubygems'
|
11
|
+
spec = Gem::Specification::load('./spec.rb')
|
12
|
+
if spec.executables.empty?
|
13
|
+
fail 'no executables: ' + File.read('./spec.rb')
|
14
|
+
end
|
15
|
+
"""
|
16
|
+
When I run bash with:
|
17
|
+
"""
|
18
|
+
cd texsc
|
19
|
+
gem build texsc.gemspec
|
20
|
+
gem specification --ruby texsc-*.gem > ../spec.rb
|
21
|
+
cd ..
|
22
|
+
ruby execs.rb
|
23
|
+
"""
|
24
|
+
Then Exit code is zero
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require 'tmpdir'
|
24
|
+
require 'English'
|
25
|
+
|
26
|
+
Before do
|
27
|
+
@cwd = Dir.pwd
|
28
|
+
@dir = Dir.mktmpdir('test')
|
29
|
+
FileUtils.mkdir_p(@dir) unless File.exist?(@dir)
|
30
|
+
Dir.chdir(@dir)
|
31
|
+
end
|
32
|
+
|
33
|
+
After do
|
34
|
+
Dir.chdir(@cwd)
|
35
|
+
FileUtils.rm_rf(@dir) if File.exist?(@dir)
|
36
|
+
end
|
37
|
+
|
38
|
+
Given(/^I have a "([^"]*)" file with content:$/) do |file, text|
|
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
|
43
|
+
end
|
44
|
+
|
45
|
+
When(%r{^I run bin/texsc with "([^"]*)"$}) do |arg|
|
46
|
+
home = File.join(File.dirname(__FILE__), '../..')
|
47
|
+
@stdout = `ruby -I#{home}/lib #{home}/bin/texsc #{arg}`
|
48
|
+
@exitstatus = $CHILD_STATUS.exitstatus
|
49
|
+
end
|
50
|
+
|
51
|
+
Then(/^Stdout contains "([^"]*)"$/) do |txt|
|
52
|
+
raise "STDOUT doesn't contain '#{txt}':\n#{@stdout}" unless @stdout.include?(txt)
|
53
|
+
end
|
54
|
+
|
55
|
+
Then(/^Stdout is empty$/) do
|
56
|
+
raise "STDOUT is not empty:\n#{@stdout}" unless @stdout == ''
|
57
|
+
end
|
58
|
+
|
59
|
+
Then(/^Exit code is zero$/) do
|
60
|
+
raise "Non-zero exit #{@exitstatus}:\n#{@stdout}" unless @exitstatus.zero?
|
61
|
+
end
|
62
|
+
|
63
|
+
Then(/^Exit code is not zero$/) do
|
64
|
+
raise 'Zero exit code' if @exitstatus.zero?
|
65
|
+
end
|
66
|
+
|
67
|
+
When(/^I run bash with "([^"]*)"$/) do |text|
|
68
|
+
FileUtils.copy_entry(@cwd, File.join(@dir, 'texsc'))
|
69
|
+
@stdout = `#{text}`
|
70
|
+
@exitstatus = $CHILD_STATUS.exitstatus
|
71
|
+
end
|
72
|
+
|
73
|
+
When(/^I run bash with:$/) do |text|
|
74
|
+
FileUtils.copy_entry(@cwd, File.join(@dir, 'texsc'))
|
75
|
+
@stdout = `#{text}`
|
76
|
+
@exitstatus = $CHILD_STATUS.exitstatus
|
77
|
+
end
|
78
|
+
|
79
|
+
Given(/^It is Unix$/) do
|
80
|
+
pending if Gem.win_platform?
|
81
|
+
end
|
82
|
+
|
83
|
+
Given(/^It is Windows$/) do
|
84
|
+
pending unless Gem.win_platform?
|
85
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require 'simplecov'
|
data/logo.svg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="314px" height="314px" viewBox="0 0 314 314" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
4
|
+
<title>Group 2</title>
|
5
|
+
<desc>Created with Sketch.</desc>
|
6
|
+
<defs></defs>
|
7
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8
|
+
<g id="Group-2">
|
9
|
+
<g id="Group">
|
10
|
+
<circle id="Oval" fill="#053C5E" cx="157" cy="157" r="157"></circle>
|
11
|
+
<rect id="Rectangle" fill="#2B2B2B" x="0" y="234" width="212" height="68"></rect>
|
12
|
+
<text id="texsc" font-family="CourierNewPS-BoldMT, Courier New" font-size="50" font-weight="bold" fill="#FFFFFF">
|
13
|
+
<tspan x="28" y="282">texsc</tspan>
|
14
|
+
</text>
|
15
|
+
<path d="M135.676765,111.215287 C135.211714,113.540467 132.770932,120.688823 130.252813,127.100603 C127.734621,133.512383 125.2898,140.431445 124.819828,142.476214 C123.6868,147.405663 121.517836,147.185477 119.69487,141.95608 C116.899865,133.938362 105.171362,111.043501 103.859129,111.043501 C100.420089,111.043501 101.508757,114.986149 109.1771,130.30227 C113.739327,139.414532 118.032086,147.448041 118.716515,148.15443 C120.694817,150.196115 120.172626,154.319657 117.358599,158.877992 C113.567467,165.019055 107.570942,183.721189 108.054206,187.896804 C108.804956,194.383204 112.436054,192.210274 113.355359,184.724515 C114.48376,175.535577 120.945556,159.641154 124.897459,156.333653 C127.109021,154.482778 128.268636,151.905536 128.573284,148.163978 C128.818001,145.157747 131.906711,135.560972 135.437115,126.837819 C138.96752,118.114666 141.511492,110.079835 141.090434,108.982574 C139.755727,105.504315 136.554941,106.824333 135.676765,111.215287 M174.714659,126.841564 C169.37392,129.699438 169.197653,130.049915 167.452978,141.283475 C165.577352,153.360398 165.225112,168.513913 166.548289,180.203784 L167.566817,189.202501 L161.346213,191.9541 C154.601949,194.937416 150.91195,200.302465 153.156708,203.861146 C155.104824,206.949562 157.09025,206.70198 157.571826,203.310532 C158.083734,199.706169 166.097413,193.204052 170.29418,192.987978 C172.116999,192.894116 173.522874,191.717021 173.97823,189.903529 C174.383277,188.290613 177.740353,184.944554 181.438431,182.467858 C188.546172,177.707551 194.317883,170.450278 194.317883,166.273341 C194.317883,162.684548 189.493165,158.361603 185.487795,158.361603 C180.701636,158.361603 180.027195,155.239403 183.731222,150.229385 C188.308065,144.038966 188.284856,130.867646 183.690534,127.147387 C179.896537,124.075276 179.885006,124.074836 174.714659,126.841564 M182.67318,134.240439 C184.752542,140.153164 174.808961,161.185104 171.588639,157.68562 C169.868715,155.81653 172.863122,135.012708 175.266374,132.134564 C177.872553,129.013319 181.163896,129.949075 182.67318,134.240439 M184.854262,162.269586 C190.589839,163.855621 189.673839,167.881335 181.645765,176.371155 C177.281618,180.986262 173.904933,183.573859 173.371946,182.711474 C172.876636,181.91012 172.127869,176.711937 171.707987,171.159972 L170.944531,161.065463 L176.209475,161.200234 C179.105172,161.274339 182.995308,161.755548 184.854262,162.269586 M132.642184,172.492256 C131.593837,175.224098 133.152917,177.288844 136.264027,177.288844 C139.014965,177.288844 139.431396,176.221769 138.067531,172.667568 C137.039234,169.987871 133.645289,169.878218 132.642184,172.492256 M203.781503,185.840798 C203.781503,187.657595 209.264724,193.512152 210.966361,193.512152 C212.534035,193.512152 211.991059,187.391138 210.270768,185.670847 C208.092403,183.492409 203.781503,183.605293 203.781503,185.840798" id="Fill-6" fill="#427B8A" fill-rule="nonzero"></path>
|
16
|
+
</g>
|
17
|
+
</g>
|
18
|
+
</g>
|
19
|
+
</svg>
|
data/texsc.gemspec
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require 'English'
|
24
|
+
|
25
|
+
lib = File.expand_path('lib', __dir__)
|
26
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
27
|
+
Gem::Specification.new do |s|
|
28
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
29
|
+
if s.respond_to? :required_rubygems_version=
|
30
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0')
|
31
|
+
end
|
32
|
+
s.rubygems_version = '2.2'
|
33
|
+
s.required_ruby_version = '>= 2.3'
|
34
|
+
s.name = 'texsc'
|
35
|
+
s.version = '0.1.0'
|
36
|
+
s.license = 'MIT'
|
37
|
+
s.summary = 'Spell Checker for LaTeX'
|
38
|
+
s.description = 'Simple command-line spell checker for LaTeX documents'
|
39
|
+
s.authors = ['Yegor Bugayenko']
|
40
|
+
s.email = 'yegor256@gmail.com'
|
41
|
+
s.homepage = 'http://github.com/yegor256/texsc'
|
42
|
+
s.files = `git ls-files`.split($RS)
|
43
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
44
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
45
|
+
s.rdoc_options = ['--charset=UTF-8']
|
46
|
+
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
47
|
+
s.add_runtime_dependency 'backtrace', '~> 0.3'
|
48
|
+
s.add_runtime_dependency 'loog', '~> 0.2'
|
49
|
+
s.add_runtime_dependency 'slop', '~> 4.6'
|
50
|
+
s.add_development_dependency 'codecov', '0.1.10'
|
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'
|
55
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: texsc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yegor Bugayenko
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: backtrace
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: loog
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: slop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.6'
|
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.1.10
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.10
|
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
|
+
description: Simple command-line spell checker for LaTeX documents
|
126
|
+
email: yegor256@gmail.com
|
127
|
+
executables:
|
128
|
+
- texsc
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files:
|
131
|
+
- README.md
|
132
|
+
- LICENSE.txt
|
133
|
+
files:
|
134
|
+
- ".0pdd.yml"
|
135
|
+
- ".gitattributes"
|
136
|
+
- ".gitignore"
|
137
|
+
- ".pdd"
|
138
|
+
- ".rubocop.yml"
|
139
|
+
- ".rultor.yml"
|
140
|
+
- ".simplecov"
|
141
|
+
- ".travis.yml"
|
142
|
+
- Gemfile
|
143
|
+
- LICENSE.txt
|
144
|
+
- README.md
|
145
|
+
- Rakefile
|
146
|
+
- bin/texsc
|
147
|
+
- cucumber.yml
|
148
|
+
- features/cli.feature
|
149
|
+
- features/gem_package.feature
|
150
|
+
- features/step_definitions/steps.rb
|
151
|
+
- features/support/env.rb
|
152
|
+
- logo.svg
|
153
|
+
- texsc.gemspec
|
154
|
+
homepage: http://github.com/yegor256/texsc
|
155
|
+
licenses:
|
156
|
+
- MIT
|
157
|
+
metadata: {}
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options:
|
160
|
+
- "--charset=UTF-8"
|
161
|
+
require_paths:
|
162
|
+
- lib
|
163
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '2.3'
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
requirements: []
|
174
|
+
rubygems_version: 3.0.1
|
175
|
+
signing_key:
|
176
|
+
specification_version: 2
|
177
|
+
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
|