specss 1.1.0 → 1.2.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: 807d34a8a021ac192de59b356c9dbdef66deb0c4c68e7fe2a8f438a6ace5f447
4
- data.tar.gz: 16151a2a5832a54c94a150b02f3aee8382e1b382f7ae015a53c13ade76058336
3
+ metadata.gz: e8d96ff13427174f85b01a562760b6af9082f3467de5699e00132749d99f820c
4
+ data.tar.gz: eeb8d631042aa60a6df69155b8ac762cdd6e1a7ff260116896c62b82f7f0f18b
5
5
  SHA512:
6
- metadata.gz: 1ea1e318618d1e9617652b7b95d53fa6048053447337875b8ddcfea8e1bb8761a7971e7cb66b9fb30bd6375fa05049ce02c9e01b31f21a7f6e00e0f781d30716
7
- data.tar.gz: a24965b50e8f6567149e28e27239ac8146332ba2ebb3dd0f9eda595f41a4607211b09efd85847381a91d3af032265e3ba4b333791c1615a51de41a162b64010b
6
+ metadata.gz: 102e3b850ac56e126864c99f9a5980a54b67228f03903d670ed4fe40c051497418e1f875b47a4539aef9dd8ea37e5ea14163f419ef100d4ebe0b70936ff41862
7
+ data.tar.gz: 3b45397775b0d3e8769fe090f26a1e9382df54f3d89f176bc3ed9c801fb577fd24cbbdcc40dd531434abebc6d7f60ead00aa46bc0bf1a3e8d86a0d3f25c16109
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  Gemfile.lock
3
3
  /builds
4
4
  *.gem
5
+ .ruby-version
data/bin/specss CHANGED
@@ -1,47 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'optparse'
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
@@ -8,11 +8,7 @@ module Executor
8
8
  def main(opt)
9
9
  $changed_files = Files::Perforce.get_changelist_files
10
10
 
11
- if $changed_files.include? 'p4: command not found'
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Specss
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
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.1.0
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-04 00:00:00.000000000 Z
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