pendaxes 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -217,26 +217,35 @@ Usage:
217
217
  end
218
218
  end.parse!(@args)
219
219
 
220
- files = @args.map { |pattern|
221
- Dir[pattern].map do |file_or_directory|
222
- if FileTest.file?(file_or_directory)
223
- file_or_directory
224
- elsif FileTest.directory?(file_or_directory)
225
- Dir[File.join(file_or_directory, '**', '*_spec.rb')]
226
- else
227
- abort "#{$0}: #{file_or_directory}: No such file or directory"
228
- end
229
- end
230
- }.flatten
220
+ if @args.empty?
221
+ return usage
222
+ end
231
223
 
232
224
  workspace = Workspace.new(path: path)
225
+
226
+ files = workspace.dive do
227
+ @args.map { |pattern|
228
+ sub_files = Dir[pattern].map do |file_or_directory|
229
+ if FileTest.file?(file_or_directory)
230
+ file_or_directory
231
+ elsif FileTest.directory?(file_or_directory)
232
+ Dir[File.join(file_or_directory, '**', '*_spec.rb')]
233
+ end
234
+ end
235
+ if sub_files.empty?
236
+ abort "#{$0}: #{pattern}: No such file or directory"
237
+ end
238
+ sub_files
239
+ }.flatten.map { |_| File.expand_path(_) }
240
+ end
241
+
233
242
  $stderr.puts '=> Detecting...' unless quiet
234
- pendings = Detector.find(:rspec).new(workspace, out: quiet ? nil : $stderr).detect
243
+ pendings = Detector.find(:rspec).new(workspace, out: quiet ? nil : $stderr, pattern: files).detect
235
244
  $stderr.puts '=> Total Result:' unless quiet
236
245
 
237
246
  notificator = Notificator.find(:terminal).new(
238
- out: $stdout,
239
- reporter: {use: reporter}
247
+ out: $stdout, include_allowed: true,
248
+ reporter: {use: reporter, include_allowed: true}
240
249
  )
241
250
  notificator.add pendings
242
251
  notificator.notify
@@ -4,7 +4,7 @@ module Pendaxes
4
4
  class Config < Hashr
5
5
  define detection: {use: :rspec},
6
6
  workspace: nil,
7
- report: {use: :text, to: "report.txt"},
8
- notifications: [{use: :terminal}]
7
+ reporter: {use: :text, to: "report.txt", include_allowed: false},
8
+ notifications: [{use: :terminal, include_allowed: true}]
9
9
  end
10
10
  end
@@ -9,7 +9,7 @@ module Pendaxes
9
9
  extend Defaults
10
10
  extend Finder
11
11
  find_in 'pendaxes/notificators'
12
- defaults reporter: {use: :text}
12
+ defaults reporter: {use: :text}, include_allowed: true
13
13
 
14
14
  def initialize(config={})
15
15
  @config = Hashr.new(self.class.defaults.merge(config))
@@ -1,3 +1,3 @@
1
1
  module Pendaxes
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pendaxes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -174,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  segments:
176
176
  - 0
177
- hash: -175182318362856480
177
+ hash: 1019969460774756584
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  none: false
180
180
  requirements:
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: -175182318362856480
186
+ hash: 1019969460774756584
187
187
  requirements: []
188
188
  rubyforge_project:
189
189
  rubygems_version: 1.8.24