Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3464 from pjump/gemspec_options
Browse files Browse the repository at this point in the history
gemspec should accept a glob option in its argument hash
  • Loading branch information
indirect committed Apr 1, 2015
2 parents b35eafd + 228b449 commit 58948d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/bundler/dsl.rb
Expand Up @@ -37,6 +37,7 @@ def eval_gemfile(gemfile, contents = nil)

def gemspec(opts = nil)
path = opts && opts[:path] || '.'
glob = opts && opts[:glob]
name = opts && opts[:name] || '{,*}'
development_group = opts && opts[:development_group] || :development
expanded_path = File.expand_path(path, Bundler.default_gemfile.dirname)
Expand All @@ -47,7 +48,7 @@ def gemspec(opts = nil)
when 1
spec = Bundler.load_gemspec(gemspecs.first)
raise InvalidOption, "There was an error loading the gemspec at #{gemspecs.first}." unless spec
gem spec.name, :path => path
gem spec.name, :path => path, :glob => glob
group(development_group) do
spec.development_dependencies.each do |dep|
gem dep.name, *(dep.requirement.as_list + [:type => :development])
Expand Down Expand Up @@ -217,7 +218,7 @@ def normalize_hash(opts)
end

def valid_keys
@valid_keys ||= %w(group groups git path name branch ref tag require submodules platform platforms type source)
@valid_keys ||= %w(group groups git path glob name branch ref tag require submodules platform platforms type source)
end

def normalize_options(name, version, opts)
Expand Down Expand Up @@ -422,4 +423,5 @@ def parse_line_number_from_description
end

end

end
8 changes: 4 additions & 4 deletions man/gemfile.5.ronn
Expand Up @@ -453,10 +453,10 @@ files in your test code as you would if the project were installed as a gem; you
need not manipulate the load path manually or require project files via relative
paths.

The `gemspec` method supports optional `:path`, `:name`, and `:development_group`
options, which control where bundler looks for the `.gemspec`, what named
`.gemspec` it uses (if more than one is present), and which group development
dependencies are included in.
The `gemspec` method supports optional `:path`, `:glob`, `:name`, and `:development_group`
options, which control where bundler looks for the `.gemspec`, the glob it uses to look
for the gemspec (defaults to: "{,*,*/*}.gemspec"), what named `.gemspec` it uses
(if more than one is present), and which group development dependencies are included in.

## SOURCE PRIORITY

Expand Down

0 comments on commit 58948d2

Please sign in to comment.