guard-haskell 2.0.0 → 2.0.1

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
- Y2MzNjQ5MjQ2NjNmMzU0ODQxZWIwMDU4MTZhZTA3OTE4NmFkNDc2NA==
4
+ MjAyNGMwYTUxMDQ4NzQ0ZmUyYTZjODQ4MDVjMzhiMTdmMWM1ZmRlZA==
5
5
  data.tar.gz: !binary |-
6
- YWRkOThmYzYxOWE1ZmQ3ZmQ4YmFhNGVkN2JiNTJmNTM2NTE1YWZmZg==
6
+ N2QyMDM3OGJhMWMzNDllZjk5OGY5NDNiZWFjY2NiNTZlYmVhNjMxZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjYyNTMxYzVkNjM1YjljMDZkNTg5Mzc1ZjFhZWMwNTQ1OTUwNjI0MTc5OTk2
10
- ZjY5OGQ1YjY3NjVmNTQzOTMzMDE5MzNlYjNjNjJkNDNkOTE5MDIyYzkyMTlh
11
- ZmVmY2ZmNWFhMTI0NzA0NGRiMzk0ZWIxYjUwY2I2YzQzMWVhNTI=
9
+ NzI3MDVlZmZiM2Y0ZDFjYzMxYjAyMTY0ZjY0YTczMjgyOTE5MTcyNzYzMjFh
10
+ OTVjNjU0ZjNiZDU4ODRiMTQ1NzBhMDIyMzhhMDc2OTczNThlODg3OTM5ZDk3
11
+ ZTQ0ZTBmYzM5MmYwN2I2MTM2ZDEzNmJkNDg1NWVkMzJkZTFmNzI=
12
12
  data.tar.gz: !binary |-
13
- MjgyMGZlYTcwMjMxMTU5ZDc0MDM3N2Q2ZTQ1NGNjMDM1MGQ4NTZkNWRkNDli
14
- MWVlOWM5ZTc2NjEzMmM3NjI2ZGIyMzk3OGZhYmJjYWUzNWEyNWZlZmU3ZDAw
15
- MmFkNjA0ZGNiOGIwYThiYmIxYmFkY2FkZDIxNjNkYmZkOWRkZDY=
13
+ MzNkMjE1ZGQ4Y2M4ZjZmNTE1OTExN2JmNTkzNGMyZjg0YjczZjU3ZWIyNmM3
14
+ ZWNiOGZiNDQ0ODI5OTRlYjJlNTIzNDcxNWUxYTA3Mzg4MWQ2MjAxZTI0OWU4
15
+ MzEwN2M3ODNjYmNhYjI0NjY3YmQ4ZmYwZGIzOWZmMmE2Yzc4YTE=
@@ -1,3 +1,10 @@
1
+ 2.0.1
2
+ =====
3
+
4
+ * Reload the REPL on `.cabal` file modifications
5
+
6
+ * Refuse to load without a cabal file in the current directory
7
+
1
8
  2.0.0
2
9
  =====
3
10
 
data/README.md CHANGED
@@ -4,7 +4,6 @@ guard-haskell
4
4
  [![Build Status](https://secure.travis-ci.org/supki/guard-haskell.png?branch=master)](http://travis-ci.org/supki/guard-haskell)
5
5
  [![Dependencies Status](https://gemnasium.com/supki/guard-haskell.png)](https://gemnasium.com/supki/guard-haskell)
6
6
 
7
-
8
7
  `Guard::Haskell` automatically runs your specs
9
8
 
10
9
  Install
@@ -46,6 +45,7 @@ A typical haskell project:
46
45
  guard :haskell do
47
46
  watch(%r{test/.+Spec\.l?hs$})
48
47
  watch(%r{src/.+\.l?hs$})
48
+ watch(%r{\.cabal$})
49
49
  end
50
50
  ```
51
51
 
@@ -58,6 +58,7 @@ guard :haskell, all_on_start: true, repl_options: options do
58
58
  watch(%r{test/.+Spec\.l?hs$})
59
59
  watch(%r{lib/.+\.l?hs$})
60
60
  watch(%r{bin/.+\.l?hs$})
61
+ watch(%r{\.cabal$})
61
62
  end
62
63
  ```
63
64
 
@@ -68,6 +69,7 @@ guard :haskell, all_on_start: true, all_on_pass: true, cabal_target: "not-spec"
68
69
  watch(%r{test/.+Spec\.l?hs$})
69
70
  watch(%r{lib/.+\.l?hs$})
70
71
  watch(%r{bin/.+\.l?hs$})
72
+ watch(%r{\.cabal$})
71
73
  end
72
74
  ```
73
75
 
@@ -107,8 +107,8 @@ module ::Guard
107
107
 
108
108
  def run_on_modifications(paths)
109
109
  case paths.first
110
- when /(.+)Spec\.l?hs$/, /(.+)\.l?hs$/
111
- run($1.to_module_name)
110
+ when /(.+)Spec\.l?hs$/, /(.+)\.l?hs$/ then run($1.to_module_name)
111
+ when /\.cabal$/ then reload
112
112
  end
113
113
  end
114
114
  end
@@ -1,6 +1,12 @@
1
1
  require 'open3'
2
2
 
3
3
  class ::Guard::Haskell::Repl
4
+ class NoCabalFile < ::StandardError
5
+ def initialize(msg = "No cabal file found. Please create a package description file <pkgname>.cabal")
6
+ super
7
+ end
8
+ end
9
+
4
10
  attr_reader :stdin, :listener, :inferior, :status
5
11
 
6
12
  def self.finished_with(str)
@@ -26,6 +32,7 @@ class ::Guard::Haskell::Repl
26
32
  def initialize(cabal_target, repl_options)
27
33
  @listening = false
28
34
  @status = :success
35
+ raise NoCabalFile if Dir.glob('*.cabal').empty?
29
36
  start("cabal", "repl", cabal_target, *repl_options)
30
37
  end
31
38
 
@@ -5,4 +5,5 @@ repl_options =
5
5
  guard :haskell, repl_options: repl_options do
6
6
  watch(%r{test/.+Spec\.l?hs$})
7
7
  watch(%r{src/.+\.l?hs$})
8
+ watch(%r{\.cabal$})
8
9
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module HaskellVersion
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-haskell
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matvey Aksenov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard