Sha256: bfb143367d11d39e555278cf62f6bda2847e1c54fdfa747d64c0fede2f96bffa

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

bad_files       = %q{s.files         = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }}
bad_test_files  = %q{s.test_files    = `find spec/*`.split("\n")}
good_files      = %q{s.files         = `git ls-files`.split("\n").uniq.sort.select{|f| !f.empty? }}
good_test_files = %q{s.test_files    = `git ls-files spec test`.split("\n")}

development_dependency_marker = %q{  s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'}
development_dependency_marker_plus_injection =
"  s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'

  # added by script/fix_gemspec.rb.
  s.add_development_dependency 'rake', '~>11.2', '>= 11.2.2'
  s.add_development_dependency 'pry', '~>0.10', '>= 0.10.4'
  # </added> : if the above lines are missing in the gemspec, then
  # the matcher for autotest is probably broken"

filename = "docraptor.gemspec"
content = File.read(filename)
[bad_files, bad_test_files, development_dependency_marker].each do |bad_content_to_check|
  unless content.include?(bad_content_to_check)
    raise "Couldn't find content in docraptor.gemspec. Check matchers in there for: “#{bad_content_to_check}”"
  end
end
updated_content = content.dup
updated_content.sub!(bad_files, good_files)
updated_content.sub!(bad_test_files, good_test_files)
updated_content.sub!(development_dependency_marker,
                     development_dependency_marker_plus_injection)

File.open(filename, "w") do |file|
  file.write(updated_content)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
docraptor-1.3.0 script/fix_gemspec.rb
docraptor-1.2.0 script/fix_gemspec.rb
docraptor-1.2.0beta1 script/fix_gemspec.rb