guard-konacha 1.0.1 → 1.0.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWVkNWQ5NDg1NDU0YmE3OTRjZWEwMzJiN2EyOGNjZGM4OTYxZDUyZQ==
4
+ MDFlMDY1NjAxZjliMTcxZWZkM2RhNDkzMWE3ZWNmMjQxMDQ0ZGYyZA==
5
5
  data.tar.gz: !binary |-
6
- NDYwMjYwM2Y1OWYwYWNiNjcyMjg4YmQ5NzUwZDM2M2MzMWRlYWJmNA==
6
+ N2UyYmQ5NTY3YjJmZjg3OWQzYWU2NjlmZjJlYmExNTgyMDBjMTE1YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Yjk0MTk1YWZhMmY3ZTdlNzhjNDAzYWMyMDg0ZTAxYTYwY2I2ZTg0YjI5ZWQ0
10
- ZTdmNTI4ODVlZWVhNzY4MDhjYzVhZTdiMGI4M2IyN2JmNzNlNjA2Y2UxNTUx
11
- NWIzNWViMmJjNDlmZGQ1ZmRhNTFiMDlkMTg0YzdjNWMxM2M5YTg=
9
+ MjhkY2M1MzMyYjJkMDJlZThjOGI0NTZjNmVlMmI5ZWM3ZGNhM2VjMzZiYTA3
10
+ MmYwYmZhMTBjNmJjY2RiZmM4NmNiMjkzMGUzZjBiNGI1NmNjMDgxZGM0ZjBk
11
+ ZjU2ZGQ4MjhiZjc4MDJmMmJjM2U0ZTNjMDExZDBlYTcwMmQ2Yjg=
12
12
  data.tar.gz: !binary |-
13
- MmM4OTE2ZGZiMDc0NzcxMDYwMDMxNDE0ODI2NzU3OGQ4MmVjNGE1NWNmOWMx
14
- ZWQ2ZWNiYTlmNGZiMGI2ZjM5MTQ4YjY2ZDIyYWMwNmEzNzM3ZTU4NjZmMGYw
15
- YTYyYjdjZDc5YmQ5ZjZjMzlmMGQ0Y2NiMDBhYzA0OGRiYmM3ZmY=
13
+ YTI0NzRmZGUwOTMyOWVhYzYzZTJjNzc3NGE0YjYzOTdmZWFhMWQ0ZmU3MjE5
14
+ MjIyYWE1ODc4MmRhM2FhYjlkYzllMGI5ZmIzZTE0NWI5NDk0NmNhYTg3MGFj
15
+ NTA4YmU3N2JjNjE2OTAzNjNjNTlkMzU0NGUyYWY2NzY2ZmY2M2Y=
@@ -20,7 +20,14 @@ module Guard
20
20
  failed_examples.empty?
21
21
  end
22
22
 
23
+ def any?
24
+ @examples.any?
25
+ end
26
+
23
27
  def write_summary
28
+ #don't write a summary if no tests have been run
29
+ return if not any?
30
+
24
31
  io.puts ""
25
32
  io.puts [
26
33
  failed_examples_message,
@@ -64,4 +71,4 @@ module Guard
64
71
 
65
72
  end
66
73
  end
67
- end
74
+ end
@@ -13,7 +13,7 @@ module Guard
13
13
  def initialize(options={})
14
14
  @options = DEFAULT_OPTIONS.merge(options)
15
15
 
16
- # Require project's rails environment file to load Konacha
16
+ # Require project's rails environment file to load Konacha
17
17
  # configuration
18
18
  require_rails_environment
19
19
  raise "Konacha not loaded" unless defined? ::Konacha
@@ -38,7 +38,9 @@ module Guard
38
38
  formatter.reset
39
39
 
40
40
  paths.each do |path|
41
- runner.run konacha_path(path)
41
+ if path.empty? or File.exists? real_path path
42
+ runner.run konacha_path(path)
43
+ end
42
44
  end
43
45
 
44
46
  formatter.write_summary
@@ -75,6 +77,10 @@ module Guard
75
77
  '/' + path.gsub(/^#{::Konacha.config[:spec_dir]}\/?/, '').gsub(/\.coffee$/, '').gsub(/\.js$/, '')
76
78
  end
77
79
 
80
+ def real_path(path)
81
+ ::Konacha.config[:spec_dir] + konacha_path(path) + (path[/\.js(\.coffee)?$/] || '')
82
+ end
83
+
78
84
  def unique_id
79
85
  "#{Time.now.to_i}#{rand(100)}"
80
86
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module KonachaVersion
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-konacha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Gibbons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 2013-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard