tasks/gem/gem.rb in new-0.0.7 vs tasks/gem/gem.rb in new-0.0.8
- old
+ new
@@ -105,15 +105,23 @@
runtime = []
development = []
# loop through the required gems and find default and development gems
b.dependencies.each do |g|
- groups = g.groups
+
+ # loop through requirements and format them
+ requirements = g.requirements_list.map do |r|
+ # if no version is specified, convert the default open ended dependency to semantic friendly version
+ r.gsub! '>= 0', '~> 0'
+ "'#{r}'"
+ end.join(',')
+
data = {
name: g.name,
- requirements: g.requirements_list.map{ |r| "'#{r}'" }.join(',')
+ requirements: requirements
}
+ groups = g.groups
runtime << data if groups.include? :default
development << data if groups.include? :development
end
# create .gemspec friendly string of requirements