Permalink
Browse files

Updated Rakefile, gemspec; Gibbler::VERSION

  • Loading branch information...
delano committed Dec 24, 2010
1 parent 9fcde0b commit fef830d848136aa82d2d8f02560960367265f6aa
Showing with 128 additions and 110 deletions.
  1. +43 −64 Rakefile
  2. +4 −0 VERSION.yml
  3. +70 −45 gibbler.gemspec
  4. +11 −1 lib/gibbler.rb
View
107 Rakefile
@@ -1,85 +1,64 @@
-require 'rubygems'
-require 'rake/clean'
-require 'rake/gempackagetask'
-require 'fileutils'
-include FileUtils
+require "rubygems"
+require "rake"
+require "rake/clean"
+require 'yaml'
begin
require 'hanna/rdoctask'
rescue LoadError
require 'rake/rdoctask'
end
-
-
-task :default => :package
-# CONFIG =============================================================
-
-# Change the following according to your needs
-README = "README.rdoc"
-CHANGES = "CHANGES.txt"
-LICENSE = "LICENSE.txt"
-
-# Files and directories to be deleted when you run "rake clean"
-CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
-
-name = 'gibbler'
-load "#{name}.gemspec"
-version = @spec.version
-
-# That's it! The following defaults should allow you to get started
-# on other things.
-
-
-# TESTS/SPECS =========================================================
-
-
-
-# INSTALL =============================================================
+config = YAML.load_file("VERSION.yml")
+task :default => ["build"]
+CLEAN.include [ 'pkg', 'doc' ]
+name = "gibbler"
-Rake::GemPackageTask.new(@spec) do |p|
- p.need_tar = true if RUBY_PLATFORM !~ /mswin/
+begin
+ require "jeweler"
+ Jeweler::Tasks.new do |gem|
+ gem.version = "#{config[:MAJOR]}.#{config[:MINOR]}.#{config[:PATCH]}"
+ gem.name = name
+ gem.rubyforge_project = gem.name
+ gem.summary = "Gibbler: Git-like hashes for Ruby objects"
+ gem.description = gem.summary
+ gem.email = "delano@solutious.com"
+ gem.homepage = "http://github.com/delano/gibbler"
+ gem.authors = ["Delano Mandelbaum"]
+ gem.add_dependency("attic", ">= 0.4.0")
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
-task :release => [ :rdoc, :package ]
-task :install => [ :rdoc, :package ] do
- sh %{sudo gem install pkg/#{name}-#{version}.gem}
-end
-task :uninstall => [ :clean ] do
- sh %{sudo gem uninstall #{name}}
+
+Rake::RDocTask.new do |rdoc|
+ version = "#{config[:MAJOR]}.#{config[:MINOR]}.#{config[:PATCH]}"
+ rdoc.rdoc_dir = "doc"
+ rdoc.title = "#{name} #{version}"
+ rdoc.rdoc_files.include("README*")
+ rdoc.rdoc_files.include("LICENSE.txt")
+ rdoc.rdoc_files.include("bin/*.rb")
+ rdoc.rdoc_files.include("lib/**/*.rb")
end
-# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
+# Rubyforge Release / Publish Tasks ==================================
-if @spec.rubyforge_project
- desc 'Publish website to rubyforge'
- task 'publish:rdoc' => 'doc/index.html' do
- sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
- end
+#about 'Publish website to rubyforge'
+task 'publish:rdoc' => 'doc/index.html' do
+ #sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
+end
- desc 'Public release to rubyforge'
- task 'publish:gem' => [:package] do |t|
- sh <<-end
- rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
- rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
- end
+#about 'Public release to rubyforge'
+task 'publish:gem' => [:package] do |t|
+ sh <<-end
+ rubyforge add_release -o Any -a CHANGES.txt -f -n README.md #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
+ rubyforge add_file -o Any -a CHANGES.txt -f -n README.md #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
end
end
-# RUBY DOCS TASK ==================================
-
-Rake::RDocTask.new do |t|
- t.rdoc_dir = 'doc'
- t.title = @spec.summary
- t.options << '--line-numbers'
- t.options << '--charset' << 'utf-8'
- t.rdoc_files.include(LICENSE)
- t.rdoc_files.include(README)
- t.rdoc_files.include(CHANGES)
- t.rdoc_files.include('lib/**/*.rb')
-end
-
View
@@ -0,0 +1,4 @@
+---
+:MAJOR: 0
+:MINOR: 8
+:PATCH: 5
View
@@ -1,45 +1,70 @@
-@spec = Gem::Specification.new do |s|
- s.name = "gibbler"
- s.rubyforge_project = "gibbler"
- s.version = "0.8.5"
- s.summary = "Gibbler: Git-like hashes for Ruby objects"
- s.description = s.summary
- s.author = "Delano Mandelbaum"
- s.email = "delano@solutious.com"
- s.homepage = "http://github.com/delano/gibbler"
-
- # = EXECUTABLES =
- # The list of executables in your project (if any). Don't include the path,
- # just the base filename.
- s.executables = %w[]
-
- # Directories to extract rdocs from
- s.require_paths = %w[lib]
-
- # Specific files to include rdocs from
- s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
- s.has_rdoc = true
-
- # Update --main to reflect the default page to display
- s.rdoc_options = ["--line-numbers", "--title", s.summary, "--main", "README.rdoc"]
-
- # = DEPENDENCIES =
- s.add_dependency 'attic', '>= 0.4.0'
-
- # = MANIFEST =
- s.files = %w(
- CHANGES.txt
- LICENSE.txt
- README.rdoc
- Rakefile
- gibbler.gemspec
- lib/gibbler.rb
- lib/gibbler/aliases.rb
- lib/gibbler/history.rb
- lib/gibbler/mixins.rb
- )
-
- s.has_rdoc = true
- s.rubygems_version = '1.3.0'
-
-end
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{gibbler}
+ s.version = "0.8.5"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Delano Mandelbaum"]
+ s.date = %q{2010-12-23}
+ s.description = %q{Gibbler: Git-like hashes for Ruby objects}
+ s.email = %q{delano@solutious.com}
+ s.extra_rdoc_files = [
+ "LICENSE.txt",
+ "README.rdoc"
+ ]
+ s.files = [
+ "CHANGES.txt",
+ "LICENSE.txt",
+ "README.rdoc",
+ "Rakefile",
+ "gibbler.gemspec",
+ "lib/gibbler.rb",
+ "lib/gibbler/aliases.rb",
+ "lib/gibbler/history.rb",
+ "lib/gibbler/mixins.rb",
+ "try/01_mixins_try.rb",
+ "try/02_compat_try.rb",
+ "try/05_gibbler_digest_try.rb",
+ "try/10_basic_try.rb",
+ "try/11_basic_sha256_try.rb",
+ "try/14_extended_try.rb",
+ "try/15_file_try.rb",
+ "try/16_uri_try.rb",
+ "try/17_complex_object_try.rb",
+ "try/18_proc_try.rb",
+ "try/20_time_try.rb",
+ "try/30_secret_try.rb",
+ "try/50_history_try.rb",
+ "try/51_hash_history_try.rb",
+ "try/52_array_history_try.rb",
+ "try/53_string_history_try.rb",
+ "try/57_arbitrary_history_try.rb",
+ "try/59_history_exceptions_try.rb",
+ "try/80_performance_try.rb",
+ "try/90_alias_try.rb"
+ ]
+ s.homepage = %q{http://github.com/delano/gibbler}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{gibbler}
+ s.rubygems_version = %q{1.3.7}
+ s.summary = %q{Gibbler: Git-like hashes for Ruby objects}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<attic>, [">= 0.4.0"])
+ else
+ s.add_dependency(%q<attic>, [">= 0.4.0"])
+ end
+ else
+ s.add_dependency(%q<attic>, [">= 0.4.0"])
+ end
+end
+
View
@@ -15,7 +15,17 @@
# "Hola, Tanneritos"
#
module Gibbler
- VERSION = "0.8.5"
+ module VERSION
+ def self.to_s
+ load_config
+ [@version[:MAJOR], @version[:MINOR], @version[:PATCH]].join('.')
+ end
+ alias_method :inspect, :to_s
+ def self.load_config
+ require 'yaml'
+ @version ||= YAML.load_file(File.join(GIBBLER_LIB_HOME, '..', 'VERSION.yml'))
+ end
+ end
@default_base = 16
@secret = nil

0 comments on commit fef830d

Please sign in to comment.