tasks/gem.rake in resumetools-0.2.7.0 vs tasks/gem.rake in resumetools-0.2.7.6

- old
+ new

@@ -1,8 +1,35 @@ require "rake/gempackagetask" + +PKG_DISPLAY_NAME = "resumetools" +PKG_NAME = PKG_DISPLAY_NAME.downcase +PKG_VERSION = ResumeTools::VERSION +PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" +RELEASE_NAME = "REL #{PKG_VERSION}" +PKG_SUMMARY = "Resume generation and writing tools" +PKG_DESCRIPTION = <<-DESC +Resume generation and writing tools +DESC + +PKG_FILES = FileList[ + "examples/**/*", + "lib/**/*", + "spec/**/*", + "vendor/**/*", + "tasks/**/*", + "fonts/**/*", + "[A-Z]*", + "README.md", + "Rakefile" +].exclude(/[_\.]git$/, 'TODO') +WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false +SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS']) + namespace :gem do + + # Gem specification GEM_SPEC = Gem::Specification.new do |s| unless s.respond_to?(:add_development_dependency) puts "The gem spec requires a newer version of RubyGems." exit(1) end @@ -20,14 +47,14 @@ s.add_development_dependency("rake", ">= 0.8.7") s.add_development_dependency("rspec", ">= 1.2.8") s.add_runtime_dependency("extlib") - s.add_runtime_dependency("prawn", ">= 0.5.1") + s.add_runtime_dependency("prawn", ">= 0.7.1") s.add_runtime_dependency("treetop", ">= 1.3.0") - s.add_runtime_dependency("text-format", ">=1.0.0") - s.add_runtime_dependency("json", ">=1.1.9") + s.add_runtime_dependency("json_pure") + s.add_runtime_dependency("uuidtools") s.require_path = "lib" s.author = "Virgil Dimaguila" s.email = "virgil@roundysoft.com" @@ -35,44 +62,33 @@ s.rubyforge_project = "resumetools" end Rake::GemPackageTask.new(GEM_SPEC) do |p| p.gem_spec = GEM_SPEC - p.need_tar = true - p.need_zip = true end + + # Generate gemspec desc "Generate gemspec file" task :gemspec do File.open(File.join(File.dirname(__FILE__), '..', 'resumetools.gemspec'), "w") do |f| f.write(GEM_SPEC.to_ruby) end end - desc "Show information about the gem" - task :debug do - puts GEM_SPEC.to_ruby - end - desc "Install the gem" - task :install => ["clobber", "gem:package"] do - sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}" + # Clean extended file attributes + desc "Clean Mac OS X extended file attributes" + task :clean_attributes do + puts "Cleaning Mac OS X extended file attributes..." + `for i in $(ls -Rl@ | grep '^\t' | awk '{print $1}' | sort -u); do + find . | xargs xattr -d $i 2>/dev/null; + done + ` + puts "...DONE" end - - desc "Uninstall the gem" - task :uninstall do - installed_list = Gem.source_index.find_name(PKG_NAME) - if installed_list && - (installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION)) - sh( - "#{SUDO} gem uninstall --version '#{PKG_VERSION}' " + - "--ignore-dependencies --executables #{PKG_NAME}" - ) - end - end - - desc "Reinstall the gem" - task :reinstall => [:uninstall, :install] + + task :package => :clean_attributes end desc "Alias to gem:package" task "gem" => "gem:package"