Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change project to use Bundler gem tools

* Add Gemfile and ruby-graphviz.gemspec files to be used by bundler
* Remove spec-related stuff from Rakefile
* Simplify spec file includes
  • Loading branch information...
commit 61d3fa69022c25e27c0a12f120b5fe3fdd2726de 1 parent 5824fe1
Daniel Zollinger dznz authored
Showing with 71 additions and 99 deletions.
  1. +4 −0 Gemfile
  2. +11 −99 Rakefile
  3. +56 −0 ruby-graphviz.gemspec
4 Gemfile
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in ruby-graphviz.gemspec
+gemspec
110 Rakefile
View
@@ -1,20 +1,17 @@
$:.unshift( "lib" )
require "graphviz/constants"
-require 'rake'
require 'rake/clean'
-require 'rake/gempackagetask'
-require 'rake/rdoctask'
+require 'bundler'
+require 'rubygems/package_task'
+require 'rdoc/task'
require 'rake/testtask'
require 'fileutils'
require 'json/pure'
require 'open-uri'
include FileUtils
-PKG_NAME = "ruby-graphviz"
-PKG_VERS = Constants::RGV_VERSION
-PKG_FILES = %w(COPYING README.rdoc AUTHORS setup.rb) +
- Dir.glob("{bin,examples,lib,test}/**/*")
+Bundler::GemHelper.install_tasks
CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log']
RDOC_OPTS = ['--quiet', '--title', "Ruby/GraphViz, the Documentation",
@@ -26,9 +23,9 @@ desc "Packages up Ruby/GraphViz."
task :default => [:test, :package]
task :package => [:clean]
-task :doc => [:rdoc, :after_doc]
+task :doc => :rdoc
-Rake::RDocTask.new do |rdoc|
+RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.options += RDOC_OPTS
rdoc.main = "README.rdoc"
@@ -47,101 +44,16 @@ Rake::RDocTask.new do |rdoc|
'lib/graphviz/family_tree/sibling.rb']
end
-task :after_doc do
- # sh %{scp -r doc/rdoc/* #{ENV['USER']}@rubyforge.org:/var/www/gforge-projects/ruby-asp/ruby-graphviz}
-end
-
-spec =
- Gem::Specification.new do |s|
- s.name = PKG_NAME
- s.version = PKG_VERS
- s.platform = Gem::Platform::RUBY
-
- s.authors = ["Gregoire Lejeune"]
- s.summary = %q{Interface to the GraphViz graphing tool}
- s.email = %q{gregoire.lejeune@free.fr}
- s.homepage = %q{http://github.com/glejeune/Ruby-Graphviz}
- s.description = %q{Ruby/Graphviz provides an interface to layout and generate images of directed graphs in a variety of formats (PostScript, PNG, etc.) using GraphViz.}
-
- s.files = PKG_FILES
- s.require_path = "lib"
- s.bindir = "bin"
- s.executables = ['ruby2gv', 'gem2gv', 'dot2ruby', 'git2gv', 'xml2gv']
-
- s.rubyforge_project = 'ruby-asp'
- s.has_rdoc = true
- s.extra_rdoc_files = ["README.rdoc", "COPYING", "AUTHORS"]
- s.rdoc_options = ["--title", "Ruby/GraphViz", "--main", "README.rdoc"]
-
- s.post_install_message = %{
-Since version 0.9.2, Ruby/GraphViz can use Open3.popen3 (or not)
-On Windows, you can install 'win32-open3'
-
-You need to install GraphViz (http://graphviz.org/) to use this Gem.
-
-For more information about Ruby-Graphviz :
-* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
-* Sources : http://github.com/glejeune/Ruby-Graphviz
-* NEW - Mailing List : http://groups.google.com/group/ruby-graphviz
-
-/!\\ Version 0.9.12 introduce a new solution to connect edges to node ports
-For more information, see http://github.com/glejeune/Ruby-Graphviz/issues/#issue/13
-So if you use node ports, maybe you need to change your code.
-
-/!\\ GraphViz::Node#name has been removed!
-
-/!\\ :output and :file options have been removed!
-
-/!\\ The html attribut has been removed!
-You can use the label attribut, as dot do it : :label => '<<html/>>'
-
-/!\\ Version 0.9.17 introduce GraphML (http://graphml.graphdrawing.org/) support and
-graph theory !
-}
- end
-
-Rake::GemPackageTask.new(spec) do |p|
- p.need_tar = true
- p.gem_spec = spec
-end
-
-task :install do
- sh %{rake package}
- sh %{sudo gem install pkg/#{PKG_NAME}-#{PKG_VERS}}
-end
-
-task :uninstall => [:clean] do
- sh %{sudo gem uninstall #{PKG_NAME}}
-end
-
Rake::TestTask.new(:test) do |t|
t.test_files = FileList['test/test_*.rb']
-# t.warning = true
-# t.verbose = true
-end
-
-class Rubygems
- def initialize
- url = "http://rubygems.org/api/v1/gems/#{PKG_NAME}.json"
- @version_at_rubygems = JSON.parse( open(url).read )["version"]
- end
-
- def status
- version == PKG_VERS
- end
- def self.status
- self.new.status
- end
-
- def version
- @version_at_rubygems
- end
- def self.version
- self.new.version
- end
end
namespace :gemcutter do
+ PKG_NAME = "ruby-graphviz"
+ PKG_VERS = Constants::RGV_VERSION
+ PKG_FILES = %w(COPYING README.rdoc AUTHORS setup.rb Rakefile) +
+ Dir.glob("{bin,examples,lib,test}/**/*")
+
desc "push to gemcutter and tag for github"
task :push => [:package] do
unless Rubygems.status
56 ruby-graphviz.gemspec
View
@@ -0,0 +1,56 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+
+require "graphviz/constants"
+
+Gem::Specification.new do |s|
+ s.name = "ruby-graphviz"
+ s.version = Constants::RGV_VERSION
+ s.platform = Gem::Platform::RUBY
+
+ s.authors = ["Gregoire Lejeune"]
+ s.summary = %q{Interface to the GraphViz graphing tool}
+ s.email = %q{gregoire.lejeune@free.fr}
+ s.homepage = %q{http://github.com/glejeune/Ruby-Graphviz}
+ s.description = %q{Ruby/Graphviz provides an interface to layout and generate images of directed graphs in a variety of formats (PostScript, PNG, etc.) using GraphViz.}
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.rubyforge_project = 'ruby-asp'
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README.rdoc", "COPYING", "AUTHORS"]
+ s.rdoc_options = ["--title", "Ruby/GraphViz", "--main", "README.rdoc"]
+ s.post_install_message = %{
+Since version 0.9.2, Ruby/GraphViz can use Open3.popen3 (or not)
+On Windows, you can install 'win32-open3'
+
+You need to install GraphViz (http://graphviz.org/) to use this Gem.
+
+For more information about Ruby-Graphviz :
+* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
+* Sources : http://github.com/glejeune/Ruby-Graphviz
+* NEW - Mailing List : http://groups.google.com/group/ruby-graphviz
+
+/!\\ Version 0.9.12 introduce a new solution to connect edges to node ports
+For more information, see http://github.com/glejeune/Ruby-Graphviz/issues/#issue/13
+So if you use node ports, maybe you need to change your code.
+
+/!\\ GraphViz::Node#name has been removed!
+
+/!\\ :output and :file options have been removed!
+
+/!\\ The html attribut has been removed!
+You can use the label attribut, as dot do it : :label => '<<html/>>'
+
+/!\\ Version 0.9.17 introduce GraphML (http://graphml.graphdrawing.org/) support and
+graph theory !
+ }
+
+ # s.add_runtime_dependency("middleman", "~>2.0.0.3")
+
+ s.add_development_dependency 'rake'
+ s.add_development_dependency 'json_pure'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.