Skip to content

Commit 4ecf4a7

Browse files
committed
Merge pull request #27 from guard/bump_guard_compat_dep
bump guard-compat dep to 1.0
2 parents d7ecbcb + da95c5e commit 4ecf4a7

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

guard-bundler.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
1616
s.required_ruby_version = '>= 1.9.2'
1717

1818
s.add_dependency 'guard', '~> 2.2'
19-
s.add_dependency 'guard-compat', '~> 0.2'
19+
s.add_dependency 'guard-compat', '~> 1.0'
2020
s.add_dependency 'bundler', '~> 1.0'
2121

2222
s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.md]

lib/guard/bundler.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ def refresh_bundle
3939
duration = Time.now - start_at
4040
case result
4141
when :bundle_already_up_to_date
42-
::Guard::UI.info 'Bundle already up-to-date', reset: true
42+
Guard::Compat::UI.info 'Bundle already up-to-date', reset: true
4343
when :bundle_installed_using_local_gems
44-
::Guard::UI.info 'Bundle installed using local gems', reset: true
44+
Guard::Compat::UI.info 'Bundle installed using local gems', reset: true
4545
Notifier.notify 'bundle_check_install', nil
4646
when :bundle_installed
47-
::Guard::UI.info 'Bundle installed', reset: true
47+
Guard::Compat::UI.info 'Bundle installed', reset: true
4848
Notifier.notify true, duration
4949
else
50-
::Guard::UI.info "Bundle can't be installed -- Please check manually", reset: true
50+
Guard::Compat::UI.info "Bundle can't be installed -- Please check manually", reset: true
5151
Notifier.notify false, nil
5252
end
5353
result
@@ -67,7 +67,7 @@ def bundle_check
6767
end
6868

6969
def bundle_install
70-
::Guard::UI.info 'Bundling...', reset: true
70+
Guard::Compat::UI.info 'Bundling...', reset: true
7171
::Bundler.with_clean_env do
7272
system("bundle install#{" #{options[:cli]}" if options[:cli]}")
7373
end

lib/guard/bundler/notifier.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@ def self.guard_message(result, duration)
1818

1919
# failed | success
2020
def self.guard_image(result)
21-
icon = if result
22-
:success
23-
else
24-
:failed
25-
end
21+
result ? :success : :failed
2622
end
2723

2824
def self.notify(result, duration)
2925
message = guard_message(result, duration)
3026
image = guard_image(result)
3127

32-
::Guard::Notifier.notify(message, title: 'bundle install', image: image)
28+
Guard::Compat::UI.notify(message, title: 'bundle install', image: image)
3329
end
3430

3531
end

spec/guard/bundler/notifier_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
end
2323

2424
it 'should call Guard::Notifier' do
25-
expect(::Guard::Notifier).to receive(:notify).with(
25+
expect(Guard::Compat::UI).to receive(:notify).with(
2626
"Bundle has been installed\nin 10.1 seconds.",
2727
title: 'bundle install',
2828
image: :success

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
Kernel.srand config.seed
3636

3737
config.before(:each) do
38-
allow(Guard::Notifier).to receive(:notify)
39-
allow(Guard::UI).to receive(:info)
38+
allow(Guard::Compat::UI).to receive(:notify)
39+
allow(Guard::Compat::UI).to receive(:info)
4040
@fixture_path = Pathname.new(File.expand_path('../fixtures/', __FILE__))
4141
end
4242
end

0 commit comments

Comments
 (0)