fix-command 0.5.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +42 -90
- data/VERSION.semver +1 -1
- data/exe/fix +12 -0
- data/lib/fix/command.rb +105 -191
- metadata +22 -125
- data/.gitignore +0 -10
- data/.rubocop.yml +0 -1
- data/.rubocop_todo.yml +0 -68
- data/.travis.yml +0 -28
- data/.yardopts +0 -1
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -5
- data/Rakefile +0 -23
- data/bin/console +0 -8
- data/bin/fix +0 -6
- data/bin/setup +0 -6
- data/checksum/fix-command-0.1.0.gem.sha512 +0 -1
- data/checksum/fix-command-0.1.1.gem.sha512 +0 -1
- data/checksum/fix-command-0.1.2.gem.sha512 +0 -1
- data/checksum/fix-command-0.1.3.gem.sha512 +0 -1
- data/checksum/fix-command-0.2.0.gem.sha512 +0 -1
- data/checksum/fix-command-0.3.0.gem.sha512 +0 -1
- data/checksum/fix-command-0.4.0.gem.sha512 +0 -1
- data/checksum/fix-command-0.5.0.gem.sha512 +0 -1
- data/checksum/fix-command-0.5.1.gem.sha512 +0 -1
- data/checksum/fix-command-0.5.2.gem.sha512 +0 -1
- data/checksum/fix-command-0.5.3.gem.sha512 +0 -1
- data/fix-command.gemspec +0 -27
- data/pkg_checksum +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35c9cffa84243aa629bbd6fbf4a7314577237c8cff1a4380c3b17a4bb793e848
|
|
4
|
+
data.tar.gz: 6545d070dede040f23c0502da1e2ba33e3f5fdd0b8c4afedbfcc03d93a8ecf84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a56c5d1e3a7c2fb2326c4fe9c2cd663dabc58fe58d03774fbae7ceaf58bb3f11afdab2979a8fd0eef569688ead6f2c1d93d2c8f1aafed11616c53267d3bce0fd
|
|
7
|
+
data.tar.gz: 6158dbba5da94b5b7d458a57610be93943235a910dc4190ab0dcbdddcf77bfa0104692afe10810c648c3c347542a31516ec3adf810bed2382dd6f90ee7c3bd15
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
|
@@ -1,115 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fix-command
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[][codeclimate]
|
|
5
|
-
[][gem]
|
|
6
|
-
[][inchpages]
|
|
7
|
-
[][rubydoc]
|
|
8
|
-
|
|
9
|
-
> Provides the `fix` command with several options.
|
|
10
|
-
|
|
11
|
-
## Contact
|
|
12
|
-
|
|
13
|
-
* Home page: https://github.com/fixrb/fix-command
|
|
14
|
-
* Bugs/issues: https://github.com/fixrb/fix-command/issues
|
|
15
|
-
* Support: https://stackoverflow.com/questions/tagged/fixrb
|
|
16
|
-
|
|
17
|
-
## Rubies
|
|
18
|
-
|
|
19
|
-
* [MRI](https://www.ruby-lang.org/)
|
|
20
|
-
* [Rubinius](http://rubini.us/)
|
|
21
|
-
* [JRuby](http://jruby.org/)
|
|
3
|
+
The `fix` command runs each specification file of [Fix](https://github.com/fixrb/fix) in a process of its own, lets their results through, and tells how many files were met: its status is 0 when every file is.
|
|
22
4
|
|
|
23
5
|
## Installation
|
|
24
6
|
|
|
25
|
-
Add
|
|
26
|
-
|
|
27
|
-
```ruby
|
|
28
|
-
gem 'fix-command'
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
And then execute:
|
|
32
|
-
|
|
33
|
-
$ bundle
|
|
34
|
-
|
|
35
|
-
Or install it yourself as:
|
|
36
|
-
|
|
37
|
-
$ gem install fix-command
|
|
7
|
+
Add `gem "fix-command"` to your Gemfile, or run `gem install fix-command`. It brings `fix` with it. Ruby 3.3 or later is required, with `fork(2)`, as Fix requires it.
|
|
38
8
|
|
|
39
9
|
## Usage
|
|
40
10
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Common options:
|
|
55
|
-
-h, --help Show this message
|
|
56
|
-
-v, --version Show the version
|
|
57
|
-
|
|
58
|
-
And second, let's run a test:
|
|
59
|
-
|
|
60
|
-
$ fix ./app/ --prefix test_ --suffix --diff
|
|
61
|
-
> fix /Users/bob/app/duck_fix.rb --diff --random 198142038504094374390860708229193114294 --prefix "test_" --suffix ""
|
|
62
|
-
|
|
63
|
-
/Users/bob/app/duck_fix.rb ..
|
|
11
|
+
A specification file ends with `exit(Fix[:Name].test { … })`, which makes the status of its process 0 when the specification is met and 1 otherwise. The command runs such files, with the Ruby that runs it, and reads that status, the one thing a subject cannot forge: it reads nothing else, and what the files write goes through as it is.
|
|
12
|
+
|
|
13
|
+
```console
|
|
14
|
+
$ fix
|
|
15
|
+
fix/account_fix.rb:6: Success: expected 100 to eq 100
|
|
16
|
+
fix/account_fix.rb:7: Failure: expected 100 to eq 200
|
|
17
|
+
fix/duck_fix.rb:5: Success: expected "Quack!" to eq "Quack!"
|
|
18
|
+
fix/lot/empty_fix.rb:5: Success: expected 0 to eq 0
|
|
19
|
+
3 files, 1 not met: fix/account_fix.rb
|
|
20
|
+
$ echo $?
|
|
21
|
+
1
|
|
22
|
+
```
|
|
64
23
|
|
|
65
|
-
|
|
66
|
-
100% compliant - 0 infos, 0 failures, 0 errors
|
|
24
|
+
Without an argument, `fix` runs the `*_fix.rb` files of the `fix` directory, at any depth: `fix/` is to Fix what `test/` is to minitest. With arguments, it runs the files given, whatever their names (one that starts with a dash is given with its directory, `./-x_fix.rb`), and the `*_fix.rb` files of the directories given, in the order of their names. As the `*` of the shell, the search leaves out the names that start with a dot, and it does not follow a symbolic link to a directory:
|
|
67
25
|
|
|
68
|
-
|
|
26
|
+
```console
|
|
27
|
+
$ fix fix/duck_fix.rb lib/
|
|
28
|
+
```
|
|
69
29
|
|
|
70
|
-
|
|
30
|
+
The files run one after the other, each in a new process: an `exit`, a global, a constant, the current directory or `ENV` changed by one file do not reach the next. Each file is on its own for what it needs too, a `require_relative "../lib/account"` for its subject, say. What the processes inherit is the environment of the command: `bundle exec fix` gives every file the gems of the Gemfile, `RUBYOPT=-Ilib fix` adds `lib` to their load path, and `RUBYOPT=-w fix` runs them with warnings.
|
|
71
31
|
|
|
72
|
-
|
|
73
|
-
* Global: "`~/.fix`" (i.e. in the user's home directory)
|
|
32
|
+
### Random order
|
|
74
33
|
|
|
75
|
-
|
|
34
|
+
A context runs in a child process, so the order of the contexts of a file cannot change a result, and neither can the order of the files, as far as the process goes. What a subject does outside the process can depend on it, though: a database or a file that one specification leaves changed for the next. `--random` runs the files in a random order, and writes first the command that runs them in the same order again:
|
|
76
35
|
|
|
77
|
-
|
|
36
|
+
```console
|
|
37
|
+
$ fix --random
|
|
38
|
+
fix --random=3
|
|
39
|
+
fix/duck_fix.rb:5: Success: expected "Quack!" to eq "Quack!"
|
|
40
|
+
fix/account_fix.rb:6: Success: expected 100 to eq 100
|
|
41
|
+
fix/account_fix.rb:7: Failure: expected 100 to eq 200
|
|
42
|
+
fix/lot/empty_fix.rb:5: Success: expected 0 to eq 0
|
|
43
|
+
3 files, 1 not met: fix/account_fix.rb
|
|
44
|
+
```
|
|
78
45
|
|
|
79
|
-
|
|
46
|
+
### Status
|
|
80
47
|
|
|
81
|
-
|
|
48
|
+
0 when every file was met, 1 when one was not: a specification not met, a file that raised when loaded, a process that died. 2 for a usage error, written on the standard error with the usage: an unknown option, a path that does not exist, or no file to run. `--help` writes the usage, `--version` the version.
|
|
82
49
|
|
|
83
|
-
|
|
50
|
+
## What the command does not do
|
|
84
51
|
|
|
85
|
-
|
|
86
|
-
|
|
52
|
+
- It does not read the results: no count of expectations, no colour, no letter per expectation. The lines are those of Fix, one per expectation, `LOCATION: OUTCOME: SUMMARY`, with the backtrace of an error below; `grep` counts them if needed.
|
|
53
|
+
- It has no timeout: a file that never ends holds the command, as it would hold `ruby`. Ctrl-C ends the command and, through the terminal, the file being run.
|
|
54
|
+
- It runs the files one at a time.
|
|
55
|
+
- It takes no option for `ruby`: `RUBYOPT` and `RUBYLIB` do that, and `bundle exec` the rest.
|
|
87
56
|
|
|
88
57
|
## Versioning
|
|
89
58
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## Contributing
|
|
93
|
-
|
|
94
|
-
1. [Fork it](https://github.com/fixrb/fix-command/fork)
|
|
95
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
96
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
97
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
98
|
-
5. Create a new Pull Request
|
|
59
|
+
fix-command follows [Semantic Versioning 2.0](https://semver.org/).
|
|
99
60
|
|
|
100
61
|
## License
|
|
101
62
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
[gem]: https://rubygems.org/gems/fix-command
|
|
105
|
-
[travis]: https://travis-ci.org/fixrb/fix-command
|
|
106
|
-
[codeclimate]: https://codeclimate.com/github/fixrb/fix-command
|
|
107
|
-
[gemnasium]: https://gemnasium.com/fixrb/fix-command
|
|
108
|
-
[inchpages]: http://inch-ci.org/github/fixrb/fix-command
|
|
109
|
-
[rubydoc]: http://rubydoc.info/gems/fix-command/frames
|
|
110
|
-
|
|
111
|
-
***
|
|
63
|
+
The [gem](https://rubygems.org/gems/fix-command) is available as open source under the terms of the [MIT License](https://github.com/fixrb/fix-command/raw/main/LICENSE.md).
|
|
112
64
|
|
|
113
|
-
|
|
65
|
+
## Sponsors
|
|
114
66
|
|
|
115
|
-
[
|
|
67
|
+
This project is sponsored by [Sashité](https://sashite.com/).
|
data/VERSION.semver
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
1.0.0
|
data/exe/fix
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative File.join("..", "lib", "fix", "command")
|
|
5
|
+
|
|
6
|
+
begin
|
|
7
|
+
exit(Fix::Command.run(ARGV))
|
|
8
|
+
rescue Interrupt
|
|
9
|
+
# Ctrl-C ended the file being run, through the terminal: leave as the
|
|
10
|
+
# shell expects, without a backtrace of the command.
|
|
11
|
+
exit(130)
|
|
12
|
+
end
|
data/lib/fix/command.rb
CHANGED
|
@@ -1,216 +1,130 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Namespace for the Fix framework.
|
|
8
|
-
#
|
|
9
|
-
# @api public
|
|
10
|
-
#
|
|
11
|
-
# @example Let's test a duck!
|
|
12
|
-
# Fix::Command.run('./duck/', '--warnings')
|
|
13
|
-
#
|
|
3
|
+
require "rbconfig"
|
|
4
|
+
require "shellwords"
|
|
5
|
+
|
|
6
|
+
# The namespace of Fix, which the command shares with the fix gem.
|
|
14
7
|
module Fix
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
# @api public
|
|
8
|
+
# The fix command: runs each specification file in a process of its own,
|
|
9
|
+
# lets its results through, and tells how many files were met.
|
|
18
10
|
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
11
|
+
# A file is met when its process exits with 0, which is what
|
|
12
|
+
# `exit(Fix[:Name].test { … })` gives at the end of a file. The status is
|
|
13
|
+
# the one thing a subject cannot forge, so the command reads nothing else.
|
|
21
14
|
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
# @example
|
|
16
|
+
# Fix::Command.run(["fix/"]) # => 0
|
|
17
|
+
module Command
|
|
18
|
+
# The version of the command, written by --version.
|
|
19
|
+
VERSION = File.read(File.join(__dir__, "..", "..", "VERSION.semver")).chomp
|
|
20
|
+
DIRECTORY = "fix"
|
|
21
|
+
PATTERN = "*_fix.rb"
|
|
22
|
+
SEARCH = File.join("**", PATTERN)
|
|
23
|
+
OPTION = /\A--(?:random(?:=\d+)?|help|version)\z/
|
|
24
|
+
# The text of --help, and of a usage error.
|
|
25
|
+
USAGE = <<~TEXT.freeze
|
|
26
|
+
Usage: fix [OPTION]... [FILE|DIRECTORY]...
|
|
27
|
+
|
|
28
|
+
Runs each file in a process of its own, with the Ruby that runs fix, and
|
|
29
|
+
writes how many files were met. A directory stands for the #{PATTERN} files
|
|
30
|
+
it holds, and no argument for the #{DIRECTORY} directory. The files run in the
|
|
31
|
+
order of the arguments, those of a directory in the order of their names,
|
|
32
|
+
or in a random order with --random, which writes first the command that
|
|
33
|
+
runs them in the same order again.
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--random Run the files in a random order
|
|
37
|
+
--random=SEED Run the files in the random order of this seed
|
|
38
|
+
--help Show this message
|
|
39
|
+
--version Show the version
|
|
40
|
+
|
|
41
|
+
Status: 0 when every file was met, 1 otherwise, 2 for a usage error.
|
|
42
|
+
TEXT
|
|
43
|
+
|
|
44
|
+
private_constant :DIRECTORY, :PATTERN, :SEARCH, :OPTION
|
|
45
|
+
|
|
46
|
+
# Runs the command and returns its status.
|
|
29
47
|
#
|
|
30
|
-
# @param
|
|
31
|
-
#
|
|
32
|
-
# @
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
config.fetch(:suffix),
|
|
44
|
-
(args.first || '.')
|
|
45
|
-
).to_a.sort.shuffle(random: Random.new(config.fetch(:random)))
|
|
46
|
-
|
|
47
|
-
puts report(config, *file_paths)
|
|
48
|
+
# @param argv [Array<String>] the arguments: options and paths, in any order
|
|
49
|
+
# @param out [IO] where the command and the files write
|
|
50
|
+
# @param err [IO] where the usage errors go, and what the files write on their standard error
|
|
51
|
+
# @return [Integer] 0 when every file was met, 1 otherwise, 2 for a usage error
|
|
52
|
+
def self.run(argv, out: $stdout, err: $stderr)
|
|
53
|
+
options, arguments = argv.partition { |argument| argument.start_with?("-") }
|
|
54
|
+
unknown = options.find { |option| !option.match?(OPTION) }
|
|
55
|
+
return usage(err, "unknown option: #{unknown}") if unknown
|
|
56
|
+
return write(out, USAGE) if options.include?("--help")
|
|
57
|
+
return write(out, VERSION) if options.include?("--version")
|
|
58
|
+
|
|
59
|
+
test(arguments, options.find { |option| option.start_with?("--random") }, out, err)
|
|
60
|
+
end
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
# Writes the usage error on `err` and returns the status of a usage error.
|
|
63
|
+
def self.usage(err, message)
|
|
64
|
+
err.puts("fix: #{message}", USAGE)
|
|
65
|
+
2
|
|
66
|
+
end
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
# Writes the text on `out` and returns the status of a run that had
|
|
69
|
+
# nothing to test.
|
|
70
|
+
def self.write(out, text)
|
|
71
|
+
out.puts(text)
|
|
72
|
+
0
|
|
73
|
+
end
|
|
55
74
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
status = false unless e.success?
|
|
63
|
-
end
|
|
64
|
-
end
|
|
75
|
+
# Runs the files of the arguments, in their order or in the random order
|
|
76
|
+
# of the option, and returns the status.
|
|
77
|
+
def self.test(arguments, random, out, err)
|
|
78
|
+
paths = arguments.empty? ? [DIRECTORY] : arguments
|
|
79
|
+
missing = paths.find { |path| !File.exist?(path) }
|
|
80
|
+
return usage(err, "no such file or directory: #{missing}") if missing
|
|
65
81
|
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
files = files(paths)
|
|
83
|
+
return usage(err, "no file to run") if files.empty?
|
|
68
84
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
# @return [String] Report the command-line.
|
|
72
|
-
def self.report(config, *file_paths)
|
|
73
|
-
str = '> fix ' + file_paths.join(' ')
|
|
74
|
-
str += ' --debug' if $DEBUG
|
|
75
|
-
str += ' --warnings' if $VERBOSE
|
|
76
|
-
str += ' --diff' if config.fetch(:diff)
|
|
77
|
-
str += " --random #{config.fetch(:random)}"
|
|
78
|
-
str += " --prefix #{config.fetch(:prefix).inspect}"
|
|
79
|
-
str += " --suffix #{config.fetch(:suffix).inspect}"
|
|
80
|
-
|
|
81
|
-
["\e[37m", str, "\e[0m"].join
|
|
85
|
+
files = shuffle(files, random, arguments, out) if random
|
|
86
|
+
report(files, files.reject { |file| met?(file, out, err) }, out)
|
|
82
87
|
end
|
|
83
88
|
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
diff: false,
|
|
93
|
-
random: Random.new_seed,
|
|
94
|
-
prefix: '',
|
|
95
|
-
suffix: '_fix'
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# rubocop:disable BlockLength
|
|
99
|
-
opt_parser = OptionParser.new do |opts|
|
|
100
|
-
opts.banner = 'Usage: fix <directory> [options]'
|
|
101
|
-
|
|
102
|
-
opts.separator ''
|
|
103
|
-
opts.separator 'Specific options:'
|
|
104
|
-
|
|
105
|
-
opts.on('--[no-]debug', 'Enable ruby debug') do |b|
|
|
106
|
-
options[:debug] = $DEBUG = b
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
opts.on('--[no-]warnings', 'Enable ruby warnings') do |b|
|
|
110
|
-
options[:warnings] = $VERBOSE = b
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
opts.on('--[no-]diff', 'Regression test selection') do |b|
|
|
114
|
-
options[:diff] = b
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
opts.on('--random [SEED]', Integer, 'Predictable randomization') do |i|
|
|
118
|
-
options[:random] = Integer(i)
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
opts.on('--prefix [PREFIX]', String, 'Prefix of the spec files') do |s|
|
|
122
|
-
options[:prefix] = s.to_s
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
opts.on('--suffix [SUFFIX]', String, 'Suffix of the spec files') do |s|
|
|
126
|
-
options[:suffix] = s.to_s
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
opts.separator ''
|
|
130
|
-
opts.separator 'Common options:'
|
|
131
|
-
|
|
132
|
-
opts.on_tail '-h', '--help', 'Show this message' do
|
|
133
|
-
puts opts
|
|
134
|
-
exit
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
opts.on_tail '-v', '--version', 'Show the version' do
|
|
138
|
-
puts File.read(File.join(File.expand_path(File.dirname(__FILE__)),
|
|
139
|
-
'..',
|
|
140
|
-
'..',
|
|
141
|
-
'VERSION.semver')).chomp
|
|
142
|
-
|
|
143
|
-
exit
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
# rubocop:enable BlockLength
|
|
89
|
+
# The files of the arguments, in their order: a directory stands for the
|
|
90
|
+
# files of the pattern it holds, at any depth, in the order of their names. The
|
|
91
|
+
# directory is the base of the search, not part of the pattern, so that
|
|
92
|
+
# its name is read as it is, however it is spelled; the pattern takes
|
|
93
|
+
# the encoding of the argument, so that the paths found share it.
|
|
94
|
+
def self.files(arguments)
|
|
95
|
+
arguments.flat_map do |argument|
|
|
96
|
+
next [argument] unless File.directory?(argument)
|
|
147
97
|
|
|
148
|
-
|
|
149
|
-
config_paths.each { |config_path| opt_parser.load(config_path) }
|
|
98
|
+
Dir.glob(SEARCH.encode(argument.encoding), base: argument).map { |path| File.join(argument, path) }
|
|
150
99
|
end
|
|
151
|
-
|
|
152
|
-
opt_parser.parse!(args)
|
|
153
|
-
|
|
154
|
-
options
|
|
155
100
|
end
|
|
156
101
|
|
|
157
|
-
#
|
|
158
|
-
|
|
159
|
-
|
|
102
|
+
# The files in the random order of the seed of the option, drawn when the
|
|
103
|
+
# option gives none, after writing the command that gives this order again.
|
|
104
|
+
def self.shuffle(files, option, arguments, out)
|
|
105
|
+
digits = option[/\A--random=(\d+)\z/, 1]
|
|
106
|
+
seed = digits ? Integer(digits, 10) : Random.rand(2**32)
|
|
107
|
+
out.puts(["fix", "--random=#{seed}", *arguments.map { |argument| Shellwords.escape(argument) }].join(" "))
|
|
108
|
+
files.shuffle(random: Random.new(seed))
|
|
160
109
|
end
|
|
161
110
|
|
|
162
|
-
#
|
|
163
|
-
|
|
164
|
-
|
|
111
|
+
# Runs the file in a process of its own, writing where the command
|
|
112
|
+
# writes, and tells whether it exited with 0. What the command wrote
|
|
113
|
+
# before is flushed first, so that it comes before what the file writes.
|
|
114
|
+
def self.met?(file, out, err)
|
|
115
|
+
out.flush
|
|
116
|
+
pid = Process.spawn(RbConfig.ruby, "--", file, out:, err:)
|
|
117
|
+
Process.wait2(pid).last.success?
|
|
165
118
|
end
|
|
166
119
|
|
|
167
|
-
#
|
|
168
|
-
#
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
exit false
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
path = File.absolute_path(path) unless path.start_with?(File::SEPARATOR)
|
|
177
|
-
|
|
178
|
-
spec_paths = Dir.glob(File.join(path, '**', "#{prefix}*#{suffix}.rb")).to_set
|
|
179
|
-
return spec_paths unless diff
|
|
180
|
-
|
|
181
|
-
Dir.chdir(path) do
|
|
182
|
-
modified_paths = git_diff_paths
|
|
183
|
-
|
|
184
|
-
# select only modified specs
|
|
185
|
-
modified_spec_paths = spec_paths & modified_paths
|
|
186
|
-
|
|
187
|
-
# select only unmodified specs
|
|
188
|
-
unmodified_spec_paths = spec_paths - modified_spec_paths
|
|
189
|
-
|
|
190
|
-
# select only modified code
|
|
191
|
-
modified_code_paths = modified_paths - spec_paths
|
|
192
|
-
modified_code_filenames = modified_code_paths.map do |p|
|
|
193
|
-
p.split(File::SEPARATOR).last.gsub(/\.rb\z/, '')
|
|
194
|
-
end.to_set
|
|
195
|
-
|
|
196
|
-
# select only specs of the modified code
|
|
197
|
-
additional_spec_paths = unmodified_spec_paths.select do |unmodified_spec_path|
|
|
198
|
-
unmodified_spec_filename = unmodified_spec_path.split(File::SEPARATOR).last.gsub(/\.rb\z/, '')
|
|
199
|
-
modified_code_filenames.any? do |modified_code_filename|
|
|
200
|
-
unmodified_spec_filename.include?(modified_code_filename)
|
|
201
|
-
end
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
modified_spec_paths + additional_spec_paths
|
|
205
|
-
end
|
|
120
|
+
# Writes how many files were met, and returns 0 when all were, 1
|
|
121
|
+
# otherwise.
|
|
122
|
+
def self.report(files, unmet, out)
|
|
123
|
+
count = "#{files.size} file#{"s" unless files.size == 1}"
|
|
124
|
+
out.puts(unmet.empty? ? "#{count} met" : "#{count}, #{unmet.size} not met: #{unmet.join(", ")}")
|
|
125
|
+
unmet.empty? ? 0 : 1
|
|
206
126
|
end
|
|
207
127
|
|
|
208
|
-
|
|
209
|
-
def self.git_diff_paths
|
|
210
|
-
`git status --porcelain`
|
|
211
|
-
.split("\n")
|
|
212
|
-
.map { |p| File.absolute_path(p.split.last) }
|
|
213
|
-
.to_set
|
|
214
|
-
end
|
|
128
|
+
private_class_method :usage, :write, :test, :files, :shuffle, :met?, :report
|
|
215
129
|
end
|
|
216
130
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fix-command
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cyril Kato
|
|
8
|
-
|
|
9
|
-
bindir: bin
|
|
8
|
+
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: fix
|
|
@@ -16,138 +15,36 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
18
|
+
version: '1.0'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
version: '2.0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2.0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: rake
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '12.3'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '12.3'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: rubocop
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0.67'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0.67'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: simplecov
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - "~>"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0.16'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - "~>"
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0.16'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: yard
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - "~>"
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0.9'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - "~>"
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0.9'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: spectus
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - "~>"
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '3.0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - "~>"
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '3.0'
|
|
111
|
-
description: Provides the fix command to run specs.
|
|
112
|
-
email:
|
|
113
|
-
- contact@cyril.email
|
|
114
|
-
executables: []
|
|
25
|
+
version: '1.0'
|
|
26
|
+
description: 'The fix command runs each specification file of Fix in a process of
|
|
27
|
+
its own, lets their results through, and tells how many files were met: its status
|
|
28
|
+
is 0 when every file is.'
|
|
29
|
+
email: contact@cyril.email
|
|
30
|
+
executables:
|
|
31
|
+
- fix
|
|
115
32
|
extensions: []
|
|
116
33
|
extra_rdoc_files: []
|
|
117
34
|
files:
|
|
118
|
-
- ".gitignore"
|
|
119
|
-
- ".rubocop.yml"
|
|
120
|
-
- ".rubocop_todo.yml"
|
|
121
|
-
- ".travis.yml"
|
|
122
|
-
- ".yardopts"
|
|
123
|
-
- CODE_OF_CONDUCT.md
|
|
124
|
-
- Gemfile
|
|
125
35
|
- LICENSE.md
|
|
126
36
|
- README.md
|
|
127
|
-
- Rakefile
|
|
128
37
|
- VERSION.semver
|
|
129
|
-
-
|
|
130
|
-
- bin/fix
|
|
131
|
-
- bin/setup
|
|
132
|
-
- checksum/fix-command-0.1.0.gem.sha512
|
|
133
|
-
- checksum/fix-command-0.1.1.gem.sha512
|
|
134
|
-
- checksum/fix-command-0.1.2.gem.sha512
|
|
135
|
-
- checksum/fix-command-0.1.3.gem.sha512
|
|
136
|
-
- checksum/fix-command-0.2.0.gem.sha512
|
|
137
|
-
- checksum/fix-command-0.3.0.gem.sha512
|
|
138
|
-
- checksum/fix-command-0.4.0.gem.sha512
|
|
139
|
-
- checksum/fix-command-0.5.0.gem.sha512
|
|
140
|
-
- checksum/fix-command-0.5.1.gem.sha512
|
|
141
|
-
- checksum/fix-command-0.5.2.gem.sha512
|
|
142
|
-
- checksum/fix-command-0.5.3.gem.sha512
|
|
143
|
-
- fix-command.gemspec
|
|
38
|
+
- exe/fix
|
|
144
39
|
- lib/fix/command.rb
|
|
145
|
-
-
|
|
146
|
-
homepage: https://github.com/fixrb/fix-command
|
|
40
|
+
homepage: https://fixrb.dev/gems/fix-command/
|
|
147
41
|
licenses:
|
|
148
42
|
- MIT
|
|
149
|
-
metadata:
|
|
150
|
-
|
|
43
|
+
metadata:
|
|
44
|
+
bug_tracker_uri: https://github.com/fixrb/fix-command/issues
|
|
45
|
+
documentation_uri: https://rubydoc.info/gems/fix-command
|
|
46
|
+
rubygems_mfa_required: 'true'
|
|
47
|
+
source_code_uri: https://github.com/fixrb/fix-command
|
|
151
48
|
rdoc_options: []
|
|
152
49
|
require_paths:
|
|
153
50
|
- lib
|
|
@@ -155,15 +52,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
155
52
|
requirements:
|
|
156
53
|
- - ">="
|
|
157
54
|
- !ruby/object:Gem::Version
|
|
158
|
-
version:
|
|
55
|
+
version: 3.3.0
|
|
159
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
57
|
requirements:
|
|
161
58
|
- - ">="
|
|
162
59
|
- !ruby/object:Gem::Version
|
|
163
60
|
version: '0'
|
|
164
61
|
requirements: []
|
|
165
|
-
rubygems_version:
|
|
166
|
-
signing_key:
|
|
62
|
+
rubygems_version: 4.0.23
|
|
167
63
|
specification_version: 4
|
|
168
|
-
summary: Fix
|
|
64
|
+
summary: 'The fix command: runs specification files of Fix, each in a process of its
|
|
65
|
+
own'
|
|
169
66
|
test_files: []
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2018-08-26 22:27:30 +0200 using RuboCop version 0.58.2.
|
|
4
|
-
# The point is for the user to remove these configuration records
|
|
5
|
-
# one by one as the offenses are removed from the code base.
|
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
-
|
|
9
|
-
# Offense count: 1
|
|
10
|
-
# Cop supports --auto-correct.
|
|
11
|
-
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
|
12
|
-
# Include: **/*.gemspec
|
|
13
|
-
Gemspec/OrderedDependencies:
|
|
14
|
-
Exclude:
|
|
15
|
-
- 'fix-command.gemspec'
|
|
16
|
-
|
|
17
|
-
# Offense count: 4
|
|
18
|
-
Metrics/AbcSize:
|
|
19
|
-
Max: 32
|
|
20
|
-
|
|
21
|
-
# Offense count: 1
|
|
22
|
-
# Configuration parameters: CountComments.
|
|
23
|
-
Metrics/ClassLength:
|
|
24
|
-
Max: 127
|
|
25
|
-
|
|
26
|
-
# Offense count: 3
|
|
27
|
-
# Configuration parameters: CountComments.
|
|
28
|
-
Metrics/MethodLength:
|
|
29
|
-
Max: 49
|
|
30
|
-
|
|
31
|
-
# Offense count: 1
|
|
32
|
-
# Cop supports --auto-correct.
|
|
33
|
-
Style/Dir:
|
|
34
|
-
Exclude:
|
|
35
|
-
- 'lib/fix/command.rb'
|
|
36
|
-
|
|
37
|
-
# Offense count: 2
|
|
38
|
-
# Cop supports --auto-correct.
|
|
39
|
-
Style/IfUnlessModifier:
|
|
40
|
-
Exclude:
|
|
41
|
-
- 'lib/fix/command.rb'
|
|
42
|
-
|
|
43
|
-
# Offense count: 3
|
|
44
|
-
Style/MixinUsage:
|
|
45
|
-
Exclude:
|
|
46
|
-
- 'test/command/test_help.rb'
|
|
47
|
-
- 'test/command/test_process_args.rb'
|
|
48
|
-
- 'test/command/test_version.rb'
|
|
49
|
-
|
|
50
|
-
# Offense count: 1
|
|
51
|
-
# Cop supports --auto-correct.
|
|
52
|
-
# Configuration parameters: Whitelist.
|
|
53
|
-
# Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
|
|
54
|
-
Style/NestedParenthesizedCalls:
|
|
55
|
-
Exclude:
|
|
56
|
-
- 'test/command/test_version.rb'
|
|
57
|
-
|
|
58
|
-
# Offense count: 1
|
|
59
|
-
# Cop supports --auto-correct.
|
|
60
|
-
Style/RedundantBegin:
|
|
61
|
-
Exclude:
|
|
62
|
-
- 'lib/fix/command.rb'
|
|
63
|
-
|
|
64
|
-
# Offense count: 12
|
|
65
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
66
|
-
# URISchemes: http, https
|
|
67
|
-
Metrics/LineLength:
|
|
68
|
-
Max: 104
|
data/.travis.yml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
sudo: false
|
|
3
|
-
cache: bundler
|
|
4
|
-
before_install:
|
|
5
|
-
- gem install bundler
|
|
6
|
-
script:
|
|
7
|
-
- bundle exec rubocop
|
|
8
|
-
- bundle exec rake test
|
|
9
|
-
rvm:
|
|
10
|
-
- 2.3.3
|
|
11
|
-
- 2.4.0
|
|
12
|
-
- 2.5.0
|
|
13
|
-
- 2.6.2
|
|
14
|
-
- ruby-head
|
|
15
|
-
- jruby-head
|
|
16
|
-
- rbx-3
|
|
17
|
-
matrix:
|
|
18
|
-
allow_failures:
|
|
19
|
-
- rvm: ruby-head
|
|
20
|
-
- rvm: jruby-head
|
|
21
|
-
- rvm: rbx-3
|
|
22
|
-
notifications:
|
|
23
|
-
webhooks:
|
|
24
|
-
urls:
|
|
25
|
-
- https://webhooks.gitter.im/e/a44b19cc5cf6db25fa87
|
|
26
|
-
on_success: change
|
|
27
|
-
on_failure: always
|
|
28
|
-
on_start: never
|
data/.yardopts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
- README.md
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Contributor Code of Conduct
|
|
2
|
-
|
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
|
4
|
-
|
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
|
6
|
-
|
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
|
8
|
-
|
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
|
10
|
-
|
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
|
12
|
-
|
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
require 'rake/testtask'
|
|
5
|
-
require 'rubocop/rake_task'
|
|
6
|
-
|
|
7
|
-
RuboCop::RakeTask.new
|
|
8
|
-
|
|
9
|
-
Rake::TestTask.new do |t|
|
|
10
|
-
t.verbose = true
|
|
11
|
-
t.warning = true
|
|
12
|
-
t.pattern = File.join('test', '**', 'test_*.rb')
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
namespace :test do
|
|
16
|
-
task :coverage do
|
|
17
|
-
ENV['COVERAGE'] = 'true'
|
|
18
|
-
Rake::Task['test'].invoke
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
task(:doc_stats) { ruby '-S yard stats' }
|
|
23
|
-
task default: %i[test doc_stats rubocop]
|
data/bin/console
DELETED
data/bin/fix
DELETED
data/bin/setup
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
98085fac8d39fac391db1f82b0256dee3c882a8f25dbb621d7be8335891c13d6748e79f6a98f418459e1b54ab0fbc206d1284ef9b202afc22cbf01999df9b25d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7fb0b3ebc41854ca98034f449e9fd58b52ad6b1702608401230e602a312886cd3bf1af872435efec42d47b92d4a6bc031028c66be68fed13096b8223700a9f5b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fbe3cb84ae974ad0891d60abc00b11d2f7f4f7e8579be81020fca9657a968fde02882d9b96ab5ad364d3b1c407a1679d198d07fb89abdeb36e28bdfd9868d275
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5e4e0c815b72d29177ff83792c236bf86aff3b8aec2703e0546de58b864ecd6df7c30570987440165db44247b19daeeafcc94906ce8f65b08a3cb5792aea596b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6a60fe6bd792789341a1cac5b370de34c26b3997bdc940dcadd4fe6416c214f01408cabf92dc12179b52756e3aeb5ff927d56cc0226df857aee590b18016026c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5f6c061dff557ef02771b4fc5c02f1cfe1399e5608abaaa8d2692409a75b2db44b964c34a41585ddfb49e4ae910291b00dffcf6a1401c8c388152ebfb1d84f7a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4abcd3dc61a08e4d20b80ab1605e607b4c87e24c96cd82447a00db1a65d590b7f68750a1a37d378de204891a79c36d0238b15676ad53288a458244b0e1c50b8b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b7de1f62eff93657cb038ebab7286722f71c1119f106a9af74cd9b13fdc2bb4182b642dc153f2192b1a657e65df52ee1f5d51dad4b663556b581f5516ff70e05
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2be431a0e46f1474347837760c944cc98f186b687b78cac5df3cf564d20e39199cd283541c32734e1455560a2e0f2559f27a1e276f979fb8690994074dfb20b8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f798a7003cf3df93b0c233832a004bc24a431a38c7b8bb6b42e86355f61220555df924ca7f8607fca9d4c0a936250fd086fc29e6e2e051690a422ea69f6f7469
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
424ebcda940bcf56c91d7727b9cb8967edf243fe09f2c23645584702952103a64d365555fa6b2bf2e80045fd8b02e09679a38e7923d7fb04819877eb6de90e89
|
data/fix-command.gemspec
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name = 'fix-command'
|
|
5
|
-
spec.version = File.read('VERSION.semver').chomp
|
|
6
|
-
spec.authors = ['Cyril Kato']
|
|
7
|
-
spec.email = ['contact@cyril.email']
|
|
8
|
-
|
|
9
|
-
spec.summary = 'Fix extension gem for the fix command.'
|
|
10
|
-
spec.description = 'Provides the fix command to run specs.'
|
|
11
|
-
spec.homepage = 'https://github.com/fixrb/fix-command'
|
|
12
|
-
spec.license = 'MIT'
|
|
13
|
-
|
|
14
|
-
spec.files =
|
|
15
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
|
16
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
17
|
-
spec.require_paths = ['lib']
|
|
18
|
-
|
|
19
|
-
spec.add_dependency 'fix', '~> 0.18.0'
|
|
20
|
-
|
|
21
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
22
|
-
spec.add_development_dependency 'rake', '~> 12.3'
|
|
23
|
-
spec.add_development_dependency 'rubocop', '~> 0.67'
|
|
24
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
|
25
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
|
26
|
-
spec.add_development_dependency 'spectus', '~> 3.0'
|
|
27
|
-
end
|
data/pkg_checksum
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require 'digest/sha2'
|
|
5
|
-
|
|
6
|
-
gemname = 'fix-command'.to_sym
|
|
7
|
-
ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
|
|
8
|
-
built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
|
|
9
|
-
checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
|
|
10
|
-
checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
|
|
11
|
-
|
|
12
|
-
File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }
|