method
gemspec

v2_6_3 -
Show latest stable
-
0 notes -
Class: Dsl
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
gemspec(opts = nil)
public
Hide source
# File lib/bundler/dsl.rb, line 58 def gemspec(opts = nil) opts ||= {} path = opts[:path] || "." glob = opts[:glob] name = opts[:name] development_group = opts[:development_group] || :development expanded_path = gemfile_root.join(path) gemspecs = Dir[File.join(expanded_path, "{,*}.gemspec")].map {|g| Bundler.load_gemspec(g) }.compact gemspecs.reject! {|s| s.name != name } if name Index.sort_specs(gemspecs) specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] } case specs_by_name_and_version.size when 1 specs = specs_by_name_and_version.values.first spec = specs.find {|s| s.match_platform(Bundler.local_platform) } || specs.first @gemspecs << spec gem_platforms = Bundler::Dependency::REVERSE_PLATFORM_MAP[Bundler::GemHelpers.generic_local_platform] gem spec.name, :name => spec.name, :path => path, :glob => glob, :platforms => gem_platforms group(development_group) do spec.development_dependencies.each do |dep| gem dep.name, *(dep.requirement.as_list + [:type => :development]) end end when 0 raise InvalidOption, "There are no gemspecs at #{expanded_path}" else raise InvalidOption, "There are multiple gemspecs at #{expanded_path}. " "Please use the :name option to specify which one should be used" end end