specss 1.1.0 → 1.2.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/.gitignore +1 -0
- data/bin/specss +1 -39
- data/lib/specss/executor.rb +1 -5
- data/lib/specss/files.rb +7 -0
- data/lib/specss/parser.rb +37 -0
- data/lib/specss/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8d96ff13427174f85b01a562760b6af9082f3467de5699e00132749d99f820c
|
4
|
+
data.tar.gz: eeb8d631042aa60a6df69155b8ac762cdd6e1a7ff260116896c62b82f7f0f18b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102e3b850ac56e126864c99f9a5980a54b67228f03903d670ed4fe40c051497418e1f875b47a4539aef9dd8ea37e5ea14163f419ef100d4ebe0b70936ff41862
|
7
|
+
data.tar.gz: 3b45397775b0d3e8769fe090f26a1e9382df54f3d89f176bc3ed9c801fb577fd24cbbdcc40dd531434abebc6d7f60ead00aa46bc0bf1a3e8d86a0d3f25c16109
|
data/.gitignore
CHANGED
data/bin/specss
CHANGED
@@ -1,47 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'specss'
|
5
|
-
require 'specss/executor'
|
3
|
+
require 'specss/parser'
|
6
4
|
|
7
5
|
ARGV << '-c' if ARGV.empty? # Default to lite if no arguments are passed
|
8
6
|
|
9
|
-
Options = Struct.new(:name)
|
10
|
-
|
11
|
-
##
|
12
|
-
# Parse arguments that are passed when running specs
|
13
|
-
class Parser
|
14
|
-
def self.parse(options)
|
15
|
-
|
16
|
-
opt_parser = OptionParser.new do |opts|
|
17
|
-
opts.banner = "Usage: specss [option]"
|
18
|
-
|
19
|
-
opts.on("-c", "--condensed", "Run specs of files opened for edit only") do |n|
|
20
|
-
Executor.main('condensed')
|
21
|
-
end
|
22
|
-
|
23
|
-
opts.on("-e", "--extended", "Run specs of files opened for edit and dependents") do |n|
|
24
|
-
Executor.main('extended')
|
25
|
-
end
|
26
|
-
|
27
|
-
opts.on("-l", "--list", "Prints a list of specs for files opened for edit") do |n|
|
28
|
-
Executor.main('list')
|
29
|
-
end
|
30
|
-
|
31
|
-
opts.on("-v", "--version", "Smarter Specs Version") do |n|
|
32
|
-
puts "Specss #{Specss::VERSION}"
|
33
|
-
end
|
34
|
-
|
35
|
-
opts.on("-h", "--help", "Prints this help") do
|
36
|
-
puts opts
|
37
|
-
exit
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
opt_parser.parse!(options)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
7
|
begin
|
46
8
|
Parser.parse(ARGV)
|
47
9
|
rescue OptionParser::InvalidOption
|
data/lib/specss/executor.rb
CHANGED
@@ -8,11 +8,7 @@ module Executor
|
|
8
8
|
def main(opt)
|
9
9
|
$changed_files = Files::Perforce.get_changelist_files
|
10
10
|
|
11
|
-
|
12
|
-
puts 'Please install perforce command line client: '\
|
13
|
-
'https://www.perforce.com/perforce/r14.2/manuals/p4guide/chapter.install.html'
|
14
|
-
return false
|
15
|
-
end
|
11
|
+
return false unless $changed_files
|
16
12
|
|
17
13
|
# Pass in options from ARGV on whether to run lite or extended
|
18
14
|
case opt
|
data/lib/specss/files.rb
CHANGED
@@ -7,6 +7,13 @@ module Files
|
|
7
7
|
def self.get_changelist_files
|
8
8
|
changed_files = []
|
9
9
|
p4_status = %x|p4 status &|
|
10
|
+
|
11
|
+
if p4_status.empty?
|
12
|
+
puts 'Please install perforce command line client: '\
|
13
|
+
'https://www.perforce.com/perforce/r14.2/manuals/p4guide/chapter.install.html'
|
14
|
+
return false
|
15
|
+
end
|
16
|
+
|
10
17
|
p4_array = p4_status.split("\n")
|
11
18
|
|
12
19
|
# Add all ruby files ready to be submitted to changed file array
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'specss'
|
3
|
+
require 'specss/executor'
|
4
|
+
|
5
|
+
##
|
6
|
+
# Parse arguments that are passed when running specs
|
7
|
+
class Parser
|
8
|
+
def self.parse(options)
|
9
|
+
|
10
|
+
opt_parser = OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: specss [option]"
|
12
|
+
|
13
|
+
opts.on("-c", "--condensed", "Run specs of files opened for edit only") do |n|
|
14
|
+
Executor.main('condensed')
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-e", "--extended", "Run specs of files opened for edit and dependents") do |n|
|
18
|
+
Executor.main('extended')
|
19
|
+
end
|
20
|
+
|
21
|
+
opts.on("-l", "--list", "Prints a list of specs for files opened for edit") do |n|
|
22
|
+
Executor.main('list')
|
23
|
+
end
|
24
|
+
|
25
|
+
opts.on("-v", "--version", "Smarter Specs Version") do |n|
|
26
|
+
puts "Specss #{Specss::VERSION}"
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on("-h", "--help", "Prints this help") do
|
30
|
+
puts opts
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
opt_parser.parse!(options)
|
36
|
+
end
|
37
|
+
end
|
data/lib/specss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Bonan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubrowser
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/specss.rb
|
41
41
|
- lib/specss/executor.rb
|
42
42
|
- lib/specss/files.rb
|
43
|
+
- lib/specss/parser.rb
|
43
44
|
- lib/specss/version.rb
|
44
45
|
- specss.gemspec
|
45
46
|
homepage: https://github.com/tombonan/smarter-specs
|