Sha256: 36af15ce996a1e7e173141a6f7fec8320f504ac64726b9c7382c27a0c005d2f9
Contents?: true
Size: 849 Bytes
Versions: 16
Compression:
Stored size: 849 Bytes
Contents
require 'bundler' Bundler::GemHelper.install_tasks # remove this task, when this gem is distributed as a `real` gem (and not included in Gemfile through `:path =>` ) task :update_gemspec_for_distribution do fn = Dir[File.expand_path('../*.gemspec', __FILE__)].first source_gemspec = File.read(fn) source_gemspec.gsub!(/^([\t ]*)((s.files\s*=)[^\n]+\n)/m) {|s| "#{$1}##{$2}#{$1}#{$3} #{`git ls-files`.split("\n").inspect}\n"} source_gemspec.gsub!(/^([\t ]*)((s.test_files\s*=)[^\n]+\n)/m) {|s| "#{$1}##{$2}#{$1}#{$3} #{`git ls-files -- {test,spec,features}/*`.split("\n").inspect}\n"} source_gemspec.gsub!(/^([\t ]*)((s.executables\s*=)[^\n]+\n)/m) {|s| "#{$1}##{$2}#{$1}#{$3} #{`git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }.inspect}\n"} File.open("#{fn}.resolved", 'w') do |f| f.write source_gemspec end end
Version data entries
16 entries across 16 versions & 1 rubygems