Permalink
Browse files

use gem_hadar for Rakefile

  • Loading branch information...
1 parent 80d7bd5 commit f06f0aea722abc242aa1613b97852713d65a27da @flori flori committed Jul 21, 2011
Showing with 85 additions and 111 deletions.
  1. +2 −2 .gitignore
  2. +5 −0 Gemfile
  3. +7 −7 README → README.rdoc
  4. +28 −86 Rakefile
  5. +1 −1 VERSION
  6. +2 −2 lib/term/ansicolor.rb
  7. +7 −9 lib/term/ansicolor/version.rb
  8. +0 −4 make_doc.rb
  9. +33 −0 term-ansicolor.gemspec
View
@@ -1,3 +1,3 @@
-*.sw[pon]
-coverage
+.*.sw[pon]
+Gemfile.lock
pkg
View
@@ -0,0 +1,5 @@
+# vim: set filetype=ruby et sw=2 ts=2:
+
+source :rubygems
+
+gemspec
View
@@ -1,10 +1,10 @@
-== ANSI escape sequences in Ruby
+= Term::ANSIColor - ANSI escape sequences in Ruby
-=== Description
+== Description
This library can be used to color/decolor strings using ANSI escape sequences.
-=== Installation
+== Installation
Just type into the command line as root:
@@ -19,7 +19,7 @@ installs it for you:
# gem install term-ansicolor
-=== Download
+== Download
The latest version of this library can be downloaded at
@@ -29,7 +29,7 @@ The homepage of this library is located at
* http://flori.github.com/term-ansicolor
-=== Examples
+== Examples
Additional to the two executables cdiff and decolor, the file
examples/example.rb in the source/gem-distribution shows how this library can
@@ -126,11 +126,11 @@ be used:
uncolored("not red anymore".red)
].map { |x| x + "\n" }
-=== Author
+== Author
Florian Frank mailto:flori@ping.de
-=== License
+== License
This is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License Version 2 as published by the Free
View
114 Rakefile
@@ -1,88 +1,30 @@
-begin
- require 'rake/gempackagetask'
-rescue LoadError
-end
-require 'rake/clean'
-require 'rbconfig'
-include Config
-
-PKG_NAME = 'term-ansicolor'
-PKG_VERSION = File.read('VERSION').chomp
-PKG_FILES = FileList['**/*'].exclude(/(CVS|\.svn|pkg|coverage|doc)/)
-CLEAN.include 'coverage', 'doc'
-
-desc "Installing library"
-task :install do
- ruby 'install.rb'
-end
-
-desc "Creating documentation"
-task :doc do
- ruby 'make_doc.rb'
-end
-
-
-if defined? Gem
- spec = Gem::Specification.new do |s|
- s.name = PKG_NAME
- s.version = PKG_VERSION
- s.summary = "Ruby library that colors strings using ANSI escape sequences"
- s.description = ""
-
- s.files = PKG_FILES.to_a.sort
-
- s.require_path = 'lib'
-
- s.has_rdoc = true
- s.extra_rdoc_files << 'README'
- s.executables << 'cdiff' << 'decolor'
- s.rdoc_options << '--main' << 'README' << '--title' << 'Term::ANSIColor'
- s.test_files = Dir['tests/*.rb']
-
- s.author = "Florian Frank"
- s.email = "flori@ping.de"
- s.homepage = "http://flori.github.com/#{PKG_NAME}"
- s.rubyforge_project = PKG_NAME
- end
-
- Rake::GemPackageTask.new(spec) do |pkg|
- pkg.need_tar = true
- pkg.package_files += PKG_FILES
- end
-end
-
-desc m = "Writing version information for #{PKG_VERSION}"
-task :version do
- puts m
- File.open(File.join('lib', 'term', 'ansicolor', 'version.rb'), 'w') do |v|
- v.puts <<EOT
-module Term
- module ANSIColor
- # Term::ANSIColor version
- VERSION = '#{PKG_VERSION}'
- VERSION_ARRAY = VERSION.split(/\\./).map { |x| x.to_i } # :nodoc:
- VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
- VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
- VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
- end
-end
-EOT
+# vim: set filetype=ruby et sw=2 ts=2:
+
+require 'gem_hadar'
+
+GemHadar do
+ name 'term-ansicolor'
+ path_name 'term/ansicolor'
+ path_module 'Term::ANSIColor'
+ author 'Florian Frank'
+ email 'flori@ping.de'
+ homepage "http://flori.github.com/#{name}"
+ summary 'Ruby library that colors strings using ANSI escape sequences'
+ description ''
+ test_dir 'tests'
+ ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock'
+ readme 'README.rdoc'
+ executables << 'cdiff' << 'decolor'
+
+ install_library do
+ destdir = "#{ENV['DESTDIR']}"
+ libdir = CONFIG["sitelibdir"]
+ cd 'lib' do
+ for file in Dir['**/*.rb']
+ dest = destdir + File.join(libdir, File.dirname(file))
+ mkdir_p dest
+ install file, dest
+ end
+ end
end
end
-
-desc "Run tests"
-task :tests do
- sh 'testrb -Ilib tests/*.rb'
-end
-task :test => :tests
-
-desc "Run tests with coverage"
-task :coverage do
- sh 'rcov -Ilib tests/*.rb'
-end
-
-desc "Default"
-task :default => [ :version ]
-
-desc "Prepare a release"
-task :release => [ :clean, :version, :package ]
View
@@ -1 +1 @@
-1.0.5
+1.0.6
View
@@ -1,6 +1,6 @@
-require 'term/ansicolor/version'
-
module Term
+ require 'term/ansicolor/version'
+
# The ANSIColor module can be used for namespacing and mixed into your own
# classes.
module ANSIColor
@@ -1,10 +1,8 @@
-module Term
- module ANSIColor
- # Term::ANSIColor version
- VERSION = '1.0.5'
- VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
- VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
- VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
- VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
- end
+module Term::ANSIColor
+ # Term::ANSIColor version
+ VERSION = '1.0.6'
+ VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
+ VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
+ VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
+ VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
end
View
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-
-puts "Creating documentation."
-system "rdoc --title 'Term::ANSIColor' --main README -d README #{Dir['lib/**/*.rb'] * ' '}"
View
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{term-ansicolor}
+ s.version = "1.0.6"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = [%q{Florian Frank}]
+ s.date = %q{2011-07-21}
+ s.description = %q{}
+ s.email = %q{flori@ping.de}
+ s.executables = [%q{decolor}, %q{cdiff}]
+ s.extra_rdoc_files = [%q{README.rdoc}, %q{lib/term/ansicolor/version.rb}, %q{lib/term/ansicolor.rb}]
+ s.files = [%q{.gitignore}, %q{CHANGES}, %q{COPYING}, %q{Gemfile}, %q{README.rdoc}, %q{Rakefile}, %q{VERSION}, %q{bin/cdiff}, %q{bin/decolor}, %q{doc-main.txt}, %q{examples/example.rb}, %q{install.rb}, %q{lib/term/ansicolor.rb}, %q{lib/term/ansicolor/.keep}, %q{lib/term/ansicolor/version.rb}, %q{term-ansicolor.gemspec}, %q{tests/ansicolor_test.rb}]
+ s.homepage = %q{http://flori.github.com/term-ansicolor}
+ s.rdoc_options = [%q{--title}, %q{Term-ansicolor - Ruby library that colors strings using ANSI escape sequences}, %q{--main}, %q{README.rdoc}]
+ s.require_paths = [%q{lib}]
+ s.rubygems_version = %q{1.8.5}
+ s.summary = %q{Ruby library that colors strings using ANSI escape sequences}
+ s.test_files = [%q{tests/ansicolor_test.rb}]
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<gem_hadar>, ["~> 0.0.8"])
+ else
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.8"])
+ end
+ else
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.8"])
+ end
+end

0 comments on commit f06f0ae

Please sign in to comment.