guard-bundler 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -30,6 +30,8 @@ Please read {guard usage doc}[http://github.com/guard/guard#readme]
30
30
  Bundler guard can be really be adapated to all kind of projects.
31
31
  Please read {guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
32
32
 
33
+ Attention place bundler guard before other is recommended.
34
+
33
35
  === Standard ruby gems
34
36
 
35
37
  guard 'bundler' do
@@ -38,6 +40,14 @@ Please read {guard doc}[http://github.com/guard/guard#readme] for more info abou
38
40
  # watch('^.+\.gemspec')
39
41
  end
40
42
 
43
+ == Options
44
+
45
+ You can disable desktop notification with:
46
+
47
+ guard 'bundler', :notify => false do
48
+ ...
49
+ end
50
+
41
51
  == Development
42
52
 
43
53
  - Source hosted at {GitHub}[http://github.com/guard/guard-bundler]
data/lib/guard/bundler.rb CHANGED
@@ -7,6 +7,12 @@ module Guard
7
7
 
8
8
  autoload :Notifier, 'guard/bundler/notifier'
9
9
 
10
+ def initialize(watchers = [], options = {})
11
+ super
12
+
13
+ @notify = options[:notify].nil? ? true : options[:notify]
14
+ end
15
+
10
16
  def start
11
17
  return refresh_bundle if bundle_need_refresh?
12
18
  true
@@ -21,6 +27,10 @@ module Guard
21
27
  true
22
28
  end
23
29
 
30
+ def notify?
31
+ !!@notify
32
+ end
33
+
24
34
  private
25
35
 
26
36
  def bundle_need_refresh?
@@ -30,7 +40,10 @@ module Guard
30
40
 
31
41
  def refresh_bundle
32
42
  UI.info 'Refresh bundle', :reset => true
33
- system('bundle install')
43
+ start_at = Time.now
44
+ result = system('bundle install')
45
+ Notifier::notify(true, Time.now - start_at) if notify?
46
+ result
34
47
  end
35
48
 
36
49
  end
@@ -8,7 +8,7 @@ module Guard
8
8
  if result
9
9
  message << "Bundle has been updated\nin %.1f seconds." % [duration]
10
10
  else
11
- message << 'Bundle can\t be updated,\nplease check manually.'
11
+ message << "Bundle can't be updated,\nplease check manually."
12
12
  end
13
13
  message
14
14
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
3
  module BundlerVersion
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-bundler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yann Lugrin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-24 00:00:00 +02:00
18
+ date: 2010-10-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 21
29
+ hash: 19
30
30
  segments:
31
31
  - 0
32
32
  - 2
33
- - 1
34
- version: 0.2.1
33
+ - 2
34
+ version: 0.2.2
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -87,8 +87,10 @@ homepage: http://rubygems.org/gems/guard-bundler
87
87
  licenses: []
88
88
 
89
89
  post_install_message:
90
- rdoc_options: []
91
-
90
+ rdoc_options:
91
+ - --charset=UTF-8
92
+ - --main=README.rdoc
93
+ - --exclude='(lib|test|spec)|(Gem|Guard|Rake)file'
92
94
  require_paths:
93
95
  - lib
94
96
  required_ruby_version: !ruby/object:Gem::Requirement