Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add 'gemfile' option [fixes #23]

  • Loading branch information...
commit 618447c85955b061943cdaf3f2778933289e66ef 1 parent d452a57
@ivalkeen authored
View
1  README.md
@@ -43,6 +43,7 @@ Please, read [Guard usage doc](https://github.com/guard/guard#readme)
:stdlib_file => "stdlib.tags" # name of tags file for stdlib references (default stdlib.tags)
:bundler_tags_file => "gems.tags" # name of tags file for bundler gems references (default gems.tags)
:project_file => "tags" # name of tags file for project references (default tags)
+:gemfile => "Gemfil" # name of tags file for project references (default 'Gemfile')
```
For a typical Rails application, `Guardfile` can look like this (default):
View
4 lib/guard/ctags-bundler/ctags_generator.rb
@@ -20,12 +20,14 @@ def generate_bundler_tags
#runtime = ::Bundler::Runtime.new(Dir.pwd, definition)
#paths = runtime.requested_specs.map(&:full_gem_path)
+ gemfile = @opts.fetch(:gemfile, 'Gemfile')
+ lockfile = "#{gemfile}.lock"
# this is ugly, but should work with every bundler version
cmd = <<-CMD
require('bundler')
require('bundler/runtime')
::Bundler.configure
- definition = ::Bundler::Definition.build('Gemfile', 'Gemfile.lock', nil)
+ definition = ::Bundler::Definition.build('#{gemfile}', '#{lockfile}', nil)
runtime = ::Bundler::Runtime.new(Dir.pwd, definition)
paths = runtime.requested_specs.map(&:full_gem_path)
puts(paths.join(' '))
View
2  lib/guard/ctags-bundler/version.rb
@@ -1,7 +1,7 @@
module Guard
module Ctags
module Bundler
- VERSION = "1.3.1"
+ VERSION = "1.4.0"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.