Rakefile in redcarpet-2.1.1 vs Rakefile in redcarpet-2.2.0
- old
+ new
@@ -1,18 +1,25 @@
require 'date'
require 'rake/clean'
require 'rake/extensiontask'
require 'digest/md5'
-task :default => :test
+task :default => [:checkout, :test]
# ==========================================================
# Ruby Extension
# ==========================================================
Rake::ExtensionTask.new('redcarpet')
+task :checkout do |t|
+ unless File.exists?('sundown/src/markdown.h')
+ sh 'git submodule init'
+ sh 'git submodule update'
+ end
+end
+
# ==========================================================
# Testing
# ==========================================================
require 'rake/testtask'
@@ -106,25 +113,6 @@
manifest = " s.files = %w[\n#{files}\n ]\n"
spec = [head,manifest,tail].join(" # = MANIFEST =\n")
File.open(GEMFILE, 'w') { |io| io.write(spec) }
puts "updated #{GEMFILE}"
end
-
-desc 'Gather required Sundown sources into extension directory'
-task :gather => 'sundown/src/markdown.h' do |t|
- files =
- FileList[
- 'sundown/src/{markdown,buffer,stack,autolink,html_blocks}.h',
- 'sundown/src/{markdown,buffer,stack,autolink}.c',
- 'sundown/html/{html,html_smartypants,houdini_html_e,houdini_href_e}.c',
- 'sundown/html/{html,houdini}.h',
- ]
- cp files, 'ext/redcarpet/',
- :preserve => true,
- :verbose => true
-end
-
-file 'sundown/src/markdown.h' do |t|
- abort "The Sundown submodule is required."
-end
-