runfile-tasks 0.4.8 → 0.4.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8aef7820d14db9860e4c39edebd2d9ec93ce6e499e70715e7b91973278f5eef
4
- data.tar.gz: 2d38de90135227ebb7ac28aec14d7fe558c2d4177b19838c7798a310c800a0e8
3
+ metadata.gz: b2a4bcc6d9df171a074aa70c2ec1c820a217872b2df3f50a19dac55737402499
4
+ data.tar.gz: 23f351be635729cd26708da82b4beeb3e8a710e9742a00932e8fd6ac510b7fc6
5
5
  SHA512:
6
- metadata.gz: 45073b116d3ca788b9c34c0410c18e96dd48f448538a8831ba20c9b9bc1607f5e1be039d6de186a3a7fbb3eaac0bc9a5ed03aba9a25d34d9ca5593befa0fa399
7
- data.tar.gz: d6e5bf5551d9634d5837b45c0b598b48e65f9a79b0895f11bfebd5b92d75684cb83d771b99d5e89557fb91a150632298f2275532f31571c81ab9d8178f7ed670
6
+ metadata.gz: 6fd11271922627823e6e306281d41ad8a4239f38378ccc31615cadf35607f1902634d97f95a5e8828fcdcb4b699013b79fb1720e1a4d710b7b74752d1a143638
7
+ data.tar.gz: 4cde89841935252c75bbea34cee09e381b57aeff2fc634aa4528109522f2c652017f1d14da731e4ddb07b163588b1874a088dd142080ca607e688d0f4d5c7507
@@ -1,45 +1,45 @@
1
- module RunfileTasks
2
- module Testing
3
- extend self
4
-
5
- def rspec(opts={})
6
- opts = { action: opts } if opts.is_a? String
7
-
8
- opts = {
9
- action: 'spec',
10
- pattern: './spec/**/*_spec.rb',
11
- command: 'rspec'
12
- }.merge opts
13
-
14
- usage "#{opts[:action]} [NAME] [TAG]"
15
- help "Run all specs or a single spec file matching a regex. You can provide a tag to run only specific tests. If you wish to provide a tag only, without a file pattern, simply prefix the tag with a colon, like 'run spec :focus'"
16
- action opts[:action].to_sym do |args|
17
- file = args['NAME']
18
- tag = args['TAG']
19
-
20
- if file and file[0] == ':'
21
- tag = file
22
- file = nil
23
- end
24
-
25
- if tag and tag[0] == ':'
26
- tag = tag[1..-1]
27
- end
28
-
29
- if file
30
- files = Dir[opts[:pattern]]
31
- files.select! { |f| f =~ /#{file}/i }
32
- abort "Cannot find a matching spec file with #{opts[:pattern]}" if files.empty?
33
- file = files.first
34
- cmd = "#{opts[:command]} \"#{file}\""
35
- else
36
- cmd = "#{opts[:command]}"
37
- end
38
- cmd = "#{cmd} --tag #{tag}" if tag
39
- say "!txtgrn!Running: !txtpur!#{cmd}"
40
- system cmd
41
- end
42
- end
43
- end
44
-
45
- end
1
+ module RunfileTasks
2
+ module Testing
3
+ extend self
4
+
5
+ def rspec(opts={})
6
+ opts = { action: opts } if opts.is_a? String
7
+
8
+ opts = {
9
+ action: 'spec',
10
+ pattern: './spec/**/*_spec.rb',
11
+ command: 'rspec'
12
+ }.merge opts
13
+
14
+ usage "#{opts[:action]} [NAME] [TAG]"
15
+ help "Run all specs or a single spec file matching a regex. You can provide a tag to run only specific tests. If you wish to provide a tag only, without a file pattern, simply prefix the tag with a colon, like 'run spec :focus'"
16
+ action opts[:action].to_sym do |args|
17
+ file = args['NAME']
18
+ tag = args['TAG']
19
+
20
+ if file and file[0] == ':'
21
+ tag = file
22
+ file = nil
23
+ end
24
+
25
+ if tag and tag[0] == ':'
26
+ tag = tag[1..-1]
27
+ end
28
+
29
+ if file
30
+ files = Dir[opts[:pattern]]
31
+ files.select! { |f| f =~ /#{file}/i }
32
+ abort "Cannot find a matching spec file with #{opts[:pattern]}" if files.empty?
33
+ file = files.first
34
+ cmd = "#{opts[:command]} \"#{file}\""
35
+ else
36
+ cmd = "#{opts[:command]}"
37
+ end
38
+ cmd = "#{cmd} --tag #{tag}" if tag
39
+ say "!txtgrn!Running: !txtpur!#{cmd}"
40
+ exec cmd
41
+ end
42
+ end
43
+ end
44
+
45
+ end
@@ -1,3 +1,3 @@
1
1
  module RunfileTasks
2
- VERSION = "0.4.8"
2
+ VERSION = "0.4.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runfile-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-26 00:00:00.000000000 Z
11
+ date: 2020-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile