runfile-tasks 0.4.4 → 0.4.5

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
  SHA1:
3
- metadata.gz: 03b9a718c4694e682d3dede4cca46cd2d148ca64
4
- data.tar.gz: 189e04d3ee9237a399ef190afe32ea92dd9fbcc3
3
+ metadata.gz: 24fa844b5d7e0e75ec185e910b064432e83d11bf
4
+ data.tar.gz: 4414ec39abbe15fe863084ada9917356f0916fce
5
5
  SHA512:
6
- metadata.gz: ef5adf9cd9143ee551e5c646dbfcb678974ed4a77628e3a978f0ce75889171acdec6975604be4441dbdaf651d6273f75cd5f28697cba7e92686ce8ab59d1055c
7
- data.tar.gz: 25f0d97958f6ce31d2bd18d1a1ab9eabc72cc56cf74fcf829d2082f4ef5e4c362777588a922436c4bc5f3c60d7497eda522982518b4dee0ebd23b56d4c2125be
6
+ metadata.gz: 9d9ff290fc5d693b1f537dbf1eb2fb53d69bb805fec5f6981941cee0b08bb41167afa354633156cf62320d2871fe6a9a1cc121c41cbf39f7567a755f05e9aeed
7
+ data.tar.gz: 29846065b3b70554a0141b9c66e13f9d87f6b3b57961afdb804bfeeccd9176d0081d8446e48d29f10bb6532484b23ef00987ee368ba6403315bb61f59f56c80f
data/README.md CHANGED
@@ -25,7 +25,7 @@ require 'runfile-tasks/testing'
25
25
  ```
26
26
 
27
27
 
28
- Requiring the task packs does not make the available in your Runfile
28
+ Requiring the task packs does not make them available in your Runfile
29
29
  immediately. You need to activate any of the tasks you want as described
30
30
  below.
31
31
 
@@ -12,18 +12,30 @@ module RunfileTasks
12
12
  }.merge opts
13
13
 
14
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."
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
16
  action opts[:action].to_sym do |args|
17
- if args['<name>']
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
18
30
  files = Dir[opts[:pattern]]
19
- files.select! { |file| file =~ /#{args['<name>']}/i }
31
+ files.select! { |f| f =~ /#{file}/i }
20
32
  abort "Cannot find a matching spec file with #{opts[:pattern]}" if files.empty?
21
33
  file = files.first
22
34
  cmd = "#{opts[:command]} \"#{file}\""
23
35
  else
24
36
  cmd = "#{opts[:command]}"
25
37
  end
26
- cmd = "#{cmd} --tag #{args['<tag>']}" if args['<tag>']
38
+ cmd = "#{cmd} --tag #{tag}" if tag
27
39
  say "!txtgrn!Running: !txtpur!#{cmd}"
28
40
  system cmd
29
41
  end
@@ -1,3 +1,3 @@
1
1
  module RunfileTasks
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
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.4
4
+ version: 0.4.5
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: 2016-09-09 00:00:00.000000000 Z
11
+ date: 2017-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile