guard-bundler 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86c9c5fc2381cc2a3b980bc0b5418e2f1da50d60
4
- data.tar.gz: f0cefc476c0549a53f303e98aff50911a375a05d
3
+ metadata.gz: 374242e51e101d39f466f2304e42db3bb9e3327f
4
+ data.tar.gz: a915124e35854bb879515c332309d7107cfa3fa6
5
5
  SHA512:
6
- metadata.gz: aa20ac664ef4d9b9c282c43275b3e4ca41ab513ed6ce196c93b6ea0323e1542e13d7d0c81507a11a88ceb4c89cce237116b6008cee33a461ae26d0448c003ea1
7
- data.tar.gz: 09b3dcbf73326a7841c238ac8199b793dcc8069feda7f2b14386156127e3a873444180847352df033acb506897feccb66028640def0a705978e9f9b054bab483
6
+ metadata.gz: 48fd0897ccd12f95e134e646758a2ba0cf0c03ef4857a019acba3c09b6746fc46e14fc863cf5dcdf18dd767aeee1783d75cf6d1ff843284400c06fc6388b09cd
7
+ data.tar.gz: 027e90d2a3b52932db54a83e69de9fc55262c1227ca2c9cbaed8137da4b8d89baf7e647c2cd96403e00268f0dad6c0631c31a656d2ae9fb9d210c6a658f432c5
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Yann Lugrin
1
+ Copyright (c) 2010-2014 Yann Lugrin, Rémy Coutable
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -5,27 +5,19 @@
5
5
  Bundler guard allows to automatically & intelligently install/update bundle when needed.
6
6
 
7
7
  * Compatible with Bundler 1.0.x
8
- * Tested against Ruby 1.9.3, 2.0.0, Rubinius & JRuby (1.9 mode only).
8
+ * Tested against Ruby 1.9.3, 2.0.0, 2.1.0, JRuby & Rubinius.
9
9
 
10
10
  ## Install
11
11
 
12
- Please be sure to have [Guard](https://github.com/guard/guard) installed before continue.
13
-
14
- Install the gem:
15
-
16
- ```bash
17
- $ gem install guard-bundler
18
- ```
19
-
20
- Add it to your `Gemfile`:
12
+ Add the gem to your `Gemfile`:
21
13
 
22
14
  ```ruby
23
15
  group :development do
24
- gem 'guard-bundler'
16
+ gem 'guard-bundler', require: false
25
17
  end
26
18
  ```
27
19
 
28
- Add guard definition to your Guardfile by running this command:
20
+ Add the plugin definition to your Guardfile by running this command:
29
21
 
30
22
  ```bash
31
23
  $ guard init bundler
@@ -33,11 +25,11 @@ $ guard init bundler
33
25
 
34
26
  ## Usage
35
27
 
36
- Please read [Guard usage doc](https://github.com/guard/guard#readme)
28
+ Please read the [Guard usage doc](https://github.com/guard/guard#readme)
37
29
 
38
30
  ## Guardfile
39
31
 
40
- Bundler guard can be really adapted to all kind of projects.
32
+ Guard::Bundler plugin can be really adapted to all kind of projects.
41
33
 
42
34
  ### Standard RubyGem project
43
35
 
@@ -49,20 +41,30 @@ guard :bundler do
49
41
  end
50
42
  ```
51
43
 
52
- Please read [Guard doc](https://github.com/guard/guard#readme) for more information about the Guardfile DSL.
44
+ Please read the [Guard usage doc](https://github.com/guard/guard#readme) for more information about the Guardfile DSL.
53
45
 
54
46
  ## Development
55
47
 
56
- * Source hosted at [GitHub](https://github.com/guard/guard-bundler)
57
- * Report issues/Questions/Feature requests on [GitHub Issues](https://github.com/guard/guard-bundler/issues)
48
+ * Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/guard-bundler/master/frames).
49
+ * Source hosted at [GitHub](https://github.com/guard/guard-bundler).
58
50
 
59
- Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
60
- you make.
51
+ Pull requests are very welcome! Please try to follow these simple rules if applicable:
52
+
53
+ * Please create a topic branch for every separate change you make.
54
+ * Update the [README](https://github.com/guard/guard-bundler/blob/master/README.md).
55
+ * Please **do not change** the version number.
56
+
57
+ For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
58
+ `#guard` (irc.freenode.net).
61
59
 
62
60
  ## Author
63
61
 
64
62
  [Yann Lugrin](https://github.com/yannlugrin)
65
63
 
64
+ ## Maintainer
65
+
66
+ [Rémy Coutable](https://github.com/rymai) ([@rymai](https://twitter.com/rymai))
67
+
66
68
  ## Contributors
67
69
 
68
70
  [https://github.com/guard/guard-bundler/graphs/contributors](https://github.com/guard/guard-bundler/graphs/contributors)
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
- require 'guard'
3
- require 'guard/plugin'
4
2
  require 'bundler'
5
3
 
4
+ require "guard/compat/plugin"
5
+
6
6
  module Guard
7
7
  class Bundler < Plugin
8
8
  autoload :Notifier, 'guard/bundler/notifier'
@@ -39,15 +39,15 @@ module Guard
39
39
  duration = Time.now - start_at
40
40
  case result
41
41
  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
43
43
  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
45
45
  Notifier.notify 'bundle_check_install', nil
46
46
  when :bundle_installed
47
- ::Guard::UI.info 'Bundle installed', reset: true
47
+ Guard::Compat::UI.info 'Bundle installed', reset: true
48
48
  Notifier.notify true, duration
49
49
  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
51
51
  Notifier.notify false, nil
52
52
  end
53
53
  result
@@ -67,6 +67,7 @@ module Guard
67
67
  end
68
68
 
69
69
  def bundle_install
70
+ Guard::Compat::UI.info 'Bundling...', reset: true
70
71
  ::Bundler.with_clean_env do
71
72
  system("bundle install#{" #{options[:cli]}" if options[:cli]}")
72
73
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
- class Bundler
3
+ class Bundler < Plugin
4
4
  class Notifier
5
5
 
6
6
  def self.guard_message(result, duration)
@@ -18,18 +18,14 @@ module Guard
18
18
 
19
19
  # failed | success
20
20
  def self.guard_image(result)
21
- icon = if result
22
- :success
23
- else
24
- :failed
25
- end
21
+ result ? :success : :failed
26
22
  end
27
23
 
28
24
  def self.notify(result, duration)
29
25
  message = guard_message(result, duration)
30
26
  image = guard_image(result)
31
27
 
32
- ::Guard::Notifier.notify(message, title: 'bundle install', image: image)
28
+ Guard::Compat::UI.notify(message, title: 'bundle install', image: image)
33
29
  end
34
30
 
35
31
  end
@@ -1,5 +1,11 @@
1
1
  guard :bundler do
2
- watch('Gemfile')
3
- # Uncomment next line if your Gemfile contains the `gemspec' command.
4
- # watch(/^.+\.gemspec/)
2
+ require 'guard/bundler'
3
+ require 'guard/bundler/verify'
4
+ helper = Guard::Bundler::Verify.new
5
+
6
+ files = ['Gemfile']
7
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
8
+
9
+ # Assume files are symlinked from somewhere
10
+ files.each { |file| watch(helper.real_path(file)) }
5
11
  end
@@ -0,0 +1,54 @@
1
+ require 'pathname'
2
+
3
+ module Guard
4
+ class Bundler < Plugin
5
+ class Verify
6
+ if Gem.win_platform?
7
+ SYMLINK_NEEDED = <<-EOS
8
+ Error: Guard will not detect changes to your Gemfile!
9
+
10
+ Solution: move the Gemfile to a watched directory and symlink it, so that
11
+ 'Gemfile' is symlinked e.g. to config/Gemfile.
12
+
13
+ (See: https://github.com/guard/guard/wiki/Optimizing-for-large-projects)
14
+
15
+ EOS
16
+ else
17
+ SYMLINK_NEEDED = <<-EOS
18
+ Error: Guard will not detect changes to your Gemfile!
19
+
20
+ Solution: move the Gemfile to a watched directory and symlink it back.
21
+
22
+ Example:
23
+
24
+ $ mkdir config
25
+ $ git mv Gemfile config # use just 'mv' if this doesn't work
26
+ $ ln -s config/Gemfile .
27
+
28
+ and add config to the `directories` statement in your Guardfile.
29
+
30
+ (See: https://github.com/guard/guard/wiki/Optimizing-for-large-projects)
31
+ EOS
32
+ end
33
+
34
+ def verify!(file)
35
+ watchdirs = Guard::Compat.watched_directories
36
+
37
+ gemfile = Pathname.new(file)
38
+ config_dir = gemfile.realpath.dirname
39
+ return if watchdirs.include?(config_dir)
40
+
41
+ Compat::UI.error SYMLINK_NEEDED
42
+ end
43
+
44
+ def real_path(file)
45
+ verify!(file)
46
+ Pathname.new(file).realpath.relative_path_from(Pathname.pwd).to_s
47
+ end
48
+
49
+ def uses_gemspec?(file)
50
+ IO.read(file).lines.map(&:strip).grep(/^gemspec$/).any?
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
3
  module BundlerVersion
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yann Lugrin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-30 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: guard-compat
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '1.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
47
+ version: '1.0'
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.0'
55
55
  description: Guard::Bundler automatically install/update your gem bundle when needed
56
56
  email:
57
57
  - yann.lugrin@sans-savoir.net
@@ -59,12 +59,13 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - LICENSE
63
+ - README.md
64
+ - lib/guard/bundler.rb
62
65
  - lib/guard/bundler/notifier.rb
63
66
  - lib/guard/bundler/templates/Guardfile
67
+ - lib/guard/bundler/verify.rb
64
68
  - lib/guard/bundler/version.rb
65
- - lib/guard/bundler.rb
66
- - LICENSE
67
- - README.md
68
69
  homepage: https://rubygems.org/gems/guard-bundler
69
70
  licenses:
70
71
  - MIT
@@ -75,17 +76,17 @@ require_paths:
75
76
  - lib
76
77
  required_ruby_version: !ruby/object:Gem::Requirement
77
78
  requirements:
78
- - - '>='
79
+ - - ">="
79
80
  - !ruby/object:Gem::Version
80
81
  version: 1.9.2
81
82
  required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  requirements:
83
- - - '>='
84
+ - - ">="
84
85
  - !ruby/object:Gem::Version
85
86
  version: '0'
86
87
  requirements: []
87
88
  rubyforge_project:
88
- rubygems_version: 2.1.10
89
+ rubygems_version: 2.4.2
89
90
  signing_key:
90
91
  specification_version: 4
91
92
  summary: Guard gem for Bundler