Skip to content

Commit d6bf367

Browse files
committed
Merge pull request #20 from guard/v2.0
v2.0
2 parents 1f86329 + 4ed9393 commit d6bf367

13 files changed

+39
-104
lines changed

.travis.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
language: ruby
22
bundler_args: --without development
33
rvm:
4-
- 1.8.7
5-
- 1.9.2
64
- 1.9.3
7-
- ruby-head
8-
- ree
9-
- jruby-18mode
5+
- 2.0.0
106
- jruby-19mode
11-
- jruby-head
12-
- rbx-18mode
137
- rbx-19mode
14-
matrix:
15-
allow_failures:
16-
- rvm: ruby-head
178
notifications:
189
recipients:
1910

Gemfile

+3-20
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,14 @@ gemspec
55
gem 'rake'
66

77
group :development do
8+
gem 'ruby_gntp'
89
gem 'guard-rspec'
9-
10-
# optional development dependencies
11-
require 'rbconfig'
12-
13-
if RbConfig::CONFIG['target_os'] =~ /darwin/i
14-
if `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip >= '10.8'
15-
gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
16-
else
17-
gem 'growl', :require => false
18-
end rescue Errno::ENOENT
19-
20-
elsif RbConfig::CONFIG['target_os'] =~ /linux/i
21-
gem 'libnotify', '~> 0.8.0', :require => false
22-
23-
elsif RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
24-
gem 'win32console', :require => false
25-
gem 'rb-notifu', '>= 0.0.4', :require => false
26-
end
2710
end
2811

2912
# The test group will be
3013
# installed on Travis CI
3114
#
3215
group :test do
33-
gem 'rspec', '>= 2.14.1'
34-
gem 'coveralls', :require => false
16+
gem 'rspec'
17+
gem 'coveralls', require: false
3518
end

Guardfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
guard 'bundler' do
1+
guard :bundler do
22
watch('Gemfile')
33
watch(%r{^.+\.gemspec$})
44
end
55

6-
guard 'rspec', :version => 2 do
6+
guard :rspec do
77
watch(%r{^spec/.+_spec\.rb$})
8-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
9-
watch('spec/spec_helper.rb') { 'spec' }
8+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
9+
watch('spec/spec_helper.rb') { 'spec' }
1010
end

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
# Guard::Bundler
2+
23
[![Gem Version](https://badge.fury.io/rb/guard-bundler.png)](http://badge.fury.io/rb/guard-bundler) [![Build Status](https://travis-ci.org/guard/guard-bundler.png?branch=master)](https://travis-ci.org/guard/guard-bundler) [![Dependency Status](https://gemnasium.com/guard/guard-bundler.png)](https://gemnasium.com/guard/guard-bundler) [![Code Climate](https://codeclimate.com/github/guard/guard-bundler.png)](https://codeclimate.com/github/guard/guard-bundler) [![Coverage Status](https://coveralls.io/repos/guard/guard-bundler/badge.png?branch=master)](https://coveralls.io/r/guard/guard-bundler)
34

45
Bundler guard allows to automatically & intelligently install/update bundle when needed.
56

67
* Compatible with Bundler 1.0.x
7-
* Tested against Ruby 1.8.7, 1.9.2, 1.9.3, REE and the latest versions of Rubinius.
8+
* Tested against Ruby 1.9.3, 2.0.0, Rubinius & JRuby (1.9 mode only).
89

910
## Install
1011

1112
Please be sure to have [Guard](https://github.com/guard/guard) installed before continue.
1213

1314
Install the gem:
1415

15-
```
16+
```bash
1617
$ gem install guard-bundler
1718
```
1819

19-
Add it to your Gemfile (inside development group):
20+
Add it to your `Gemfile`:
2021

21-
``` ruby
22+
```ruby
2223
group :development do
2324
gem 'guard-bundler'
2425
end
2526
```
2627

2728
Add guard definition to your Guardfile by running this command:
2829

29-
```
30+
```bash
3031
$ guard init bundler
3132
```
3233

@@ -41,7 +42,7 @@ Bundler guard can be really adapted to all kind of projects.
4142
### Standard RubyGem project
4243

4344
```ruby
44-
guard 'bundler' do
45+
guard :bundler do
4546
watch('Gemfile')
4647
# Uncomment next line if Gemfile contain `gemspec' command
4748
# watch(/^.+\.gemspec/)
@@ -58,6 +59,10 @@ Please read [Guard doc](https://github.com/guard/guard#readme) for more informat
5859
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
5960
you make.
6061

61-
## Authors
62+
## Author
6263

6364
[Yann Lugrin](https://github.com/yannlugrin)
65+
66+
## Contributors
67+
68+
[https://github.com/guard/guard-bundler/graphs/contributors](https://github.com/guard/guard-bundler/graphs/contributors)

Rakefile

+2-45
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,5 @@
1-
require 'bundler'
2-
Bundler::GemHelper.install_tasks
1+
require 'bundler/gem_tasks'
32

43
require 'rspec/core/rake_task'
54
RSpec::Core::RakeTask.new(:spec)
6-
task :default => :spec
7-
8-
require 'rbconfig'
9-
namespace(:spec) do
10-
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i
11-
desc "Run all specs on multiple ruby versions (requires pik)"
12-
task(:portability) do
13-
%w[187 192 161].each do |version|
14-
system "cmd /c echo -----------#{version}------------ & " +
15-
"pik use #{version} & " +
16-
"bundle install & " +
17-
"bundle exec rspec spec"
18-
end
19-
end
20-
else
21-
desc "Run all specs on multiple ruby versions (requires rvm)"
22-
task(:portability) do
23-
travis_config_file = File.expand_path("../.travis.yml", __FILE__)
24-
begin
25-
travis_options ||= YAML::load_file(travis_config_file)
26-
rescue => ex
27-
puts "Travis config file '#{travis_config_file}' could not be found: #{ex.message}"
28-
return
29-
end
30-
31-
travis_options['rvm'].each do |version|
32-
system <<-BASH
33-
bash -c 'source ~/.rvm/scripts/rvm;
34-
rvm #{version};
35-
ruby_version_string_size=`ruby -v | wc -m`
36-
echo;
37-
for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
38-
echo;
39-
echo "`ruby -v`";
40-
for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
41-
echo;
42-
bundle install;
43-
bundle exec rspec spec -f doc 2>&1;'
44-
BASH
45-
end
46-
end
47-
end
48-
end
5+
task default: :spec

guard-bundler.gemspec

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ Gem::Specification.new do |s|
99
s.license = 'MIT'
1010
s.authors = ['Yann Lugrin']
1111
s.email = ['[email protected]']
12-
s.homepage = 'http://rubygems.org/gems/guard-bundler'
12+
s.homepage = 'https://rubygems.org/gems/guard-bundler'
1313
s.summary = 'Guard gem for Bundler'
1414
s.description = 'Guard::Bundler automatically install/update your gem bundle when needed'
1515

16-
s.required_rubygems_version = '>= 1.3.6'
17-
s.rubyforge_project = 'guard-bundler'
16+
s.required_ruby_version = '>= 1.9.2'
1817

19-
s.add_dependency 'guard', '~> 1.1'
18+
s.add_dependency 'guard', '~> 2.2'
2019
s.add_dependency 'bundler', '~> 1.0'
2120

22-
s.add_development_dependency 'rspec', '>= 2.14.1'
21+
s.add_development_dependency 'rspec'
2322

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

lib/guard/bundler.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# encoding: utf-8
22
require 'guard'
3-
require 'guard/guard'
3+
require 'guard/plugin'
44
require 'bundler'
55

66
module Guard
7-
class Bundler < Guard
7+
class Bundler < Plugin
88
autoload :Notifier, 'guard/bundler/notifier'
99

1010
def start
@@ -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::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::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::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::UI.info "Bundle can't be installed -- Please check manually", reset: true
5151
Notifier.notify false, nil
5252
end
5353
result

lib/guard/bundler/notifier.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def self.notify(result, duration)
2929
message = guard_message(result, duration)
3030
image = guard_image(result)
3131

32-
::Guard::Notifier.notify(message, :title => 'bundle install', :image => image)
32+
::Guard::Notifier.notify(message, title: 'bundle install', image: image)
3333
end
3434

3535
end

lib/guard/bundler/templates/Guardfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
guard 'bundler' do
1+
guard :bundler do
22
watch('Gemfile')
33
# Uncomment next line if your Gemfile contains the `gemspec' command.
44
# watch(/^.+\.gemspec/)

lib/guard/bundler/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# encoding: utf-8
22
module Guard
33
module BundlerVersion
4-
VERSION = '1.0.0'
4+
VERSION = '2.0.0'
55
end
66
end

spec/guard/bundler/notifier_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
it 'should call Guard::Notifier' do
2626
::Guard::Notifier.should_receive(:notify).with(
2727
"Bundle has been installed\nin 10.1 seconds.",
28-
:title => 'bundle install',
29-
:image => :success
28+
title: 'bundle install',
29+
image: :success
3030
)
3131
subject.notify(true, 10.1)
3232
end

spec/guard/bundler_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
end
1919

2020
it 'should be set to true' do
21-
subject = Guard::Bundler.new([], {:cli => '--binstubs'})
21+
subject = Guard::Bundler.new(cli: '--binstubs')
2222
subject.options[:cli].should be_true
2323
end
2424

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
RSpec.configure do |config|
1515
config.color_enabled = true
16-
config.filter_run :focus => true
16+
config.filter_run focus: true
1717
config.run_all_when_everything_filtered = true
1818

1919
config.before(:each) do

0 commit comments

Comments
 (0)