runfile-tasks 0.4.5 → 0.4.6

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: 24fa844b5d7e0e75ec185e910b064432e83d11bf
4
- data.tar.gz: 4414ec39abbe15fe863084ada9917356f0916fce
3
+ metadata.gz: 080bcca159673d76ef9021befb30c2a6946ba144
4
+ data.tar.gz: e1e420951bdd8697751d50414f4a8baf9de6d0a0
5
5
  SHA512:
6
- metadata.gz: 9d9ff290fc5d693b1f537dbf1eb2fb53d69bb805fec5f6981941cee0b08bb41167afa354633156cf62320d2871fe6a9a1cc121c41cbf39f7567a755f05e9aeed
7
- data.tar.gz: 29846065b3b70554a0141b9c66e13f9d87f6b3b57961afdb804bfeeccd9176d0081d8446e48d29f10bb6532484b23ef00987ee368ba6403315bb61f59f56c80f
6
+ metadata.gz: 05ab7e50d71a2705d6c55f7e97359ae6bbaee8afff8e70963ea19db64012d5714abf51f4ce826c7cd3ff7a098ca4670e69efb14516e41ed714c250f37e7742cf
7
+ data.tar.gz: 9d0ace9a5265aebc9eb78a8a6b1a66df52c00029cfdcf31470215ecbab9ac4c829d3d753051beb3cab9e04deb1f585033e0d92ece49e7500be2a9d23db23dc13
@@ -3,21 +3,15 @@ module RunfileTasks
3
3
  extend self
4
4
 
5
5
  def cucumber
6
- usage "(feature|features) [<tag_or_file>]"
6
+ usage "(feature|features) [<tag_or_file> --list]"
7
7
  help "Run cucumber feature tests. Optionally, specify a tag or a filename to run. Tags should be prefixed with @."
8
+ option "--list", "Show list of available features"
8
9
  action :feature, :features do |args|
9
- cmd = "cucumber"
10
- single = args['<tag_or_file>']
11
- if single
12
- if single[0] == '@'
13
- say "!txtgrn!Running features tagged #{single}"
14
- cmd = "#{cmd} --tags #{single}"
15
- else
16
- say "!txtgrn!Running #{single} features"
17
- cmd = "#{cmd} 'features/#{single}.feature'"
18
- end
10
+ if args['--list']
11
+ show_cucumber_features
12
+ else
13
+ run_cucumber_features args['<tag_or_file>']
19
14
  end
20
- exec cmd
21
15
  end
22
16
  end
23
17
 
@@ -52,8 +46,28 @@ module RunfileTasks
52
46
  File.write filename, doc
53
47
  say "Generated #{filename}"
54
48
  end
49
+ end
50
+
51
+ def show_cucumber_features
52
+ say "!txtgrn!Available Features:"
53
+ Dir['features/**/*.feature'].each do |file|
54
+ say "- " + File.basename("#{file}", '.feature')
55
+ end
56
+ end
55
57
 
58
+ def run_cucumber_features(tag_or_file)
59
+ cmd = "cucumber"
60
+ if tag_or_file
61
+ if tag_or_file[0] == '@'
62
+ say "!txtgrn!Running features tagged #{tag_or_file}"
63
+ cmd = "#{cmd} --tags #{tag_or_file}"
64
+ else
65
+ say "!txtgrn!Running #{tag_or_file} features"
66
+ cmd = "#{cmd} 'features/#{tag_or_file}.feature'"
67
+ end
68
+ end
69
+ exec cmd
56
70
  end
57
-
71
+
58
72
  end
59
73
  end
@@ -12,7 +12,7 @@ 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. If you wish to provide a tag only, without a file pattern, simply prefix the tag with a colon (like 'run spec :focus')"
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
17
  file = args['<name>']
18
18
  tag = args['<tag>']
@@ -1,3 +1,3 @@
1
1
  module RunfileTasks
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
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.5
4
+ version: 0.4.6
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: 2017-01-28 00:00:00.000000000 Z
11
+ date: 2017-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project:
68
- rubygems_version: 2.6.6
68
+ rubygems_version: 2.5.1
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Runfile tasks collection