public
Description: A Ruby interface to the Open Calais API (http://opencalais.com)
Homepage: http://calais.rubyforge.org/
Clone URL: git://github.com/abhay/calais.git
calais / Rakefile
100644 98 lines (79 sloc) 2.58 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- ruby -*-
 
require 'rake'
require 'rake/clean'
 
require './lib/calais.rb'
 
begin
  gem 'jeweler', '>= 1.0.1'
  require 'jeweler'
 
  Jeweler::Tasks.new do |s|
    s.name = 'calais'
    s.summary = 'A Ruby interface to the Calais Web Service'
    s.email = 'info@opensynapse.net'
    s.homepage = 'http://github.com/abhay/calais'
    s.description = 'A Ruby interface to the Calais Web Service'
    s.authors = ['Abhay Kumar']
    s.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*"]
    s.rubyforge_project = 'calais'
    s.add_dependency 'nokogiri', '>= 1.3.3'
    s.add_dependency 'json', '>= 1.1.3'
    s.add_dependency 'curb', '>= 0.1.4'
  end
rescue LoadError
  puts "Jeweler, or one of its dependencies, is not available. Please install it."
  exit(1)
end
 
begin
  require 'spec/rake/spectask'
 
  desc "Run all specs"
  Spec::Rake::SpecTask.new do |t|
    t.spec_files = FileList["spec/**/*_spec.rb"].sort
    t.spec_opts = ["--options", "spec/spec.opts"]
  end
 
  desc "Run all specs and get coverage statistics"
  Spec::Rake::SpecTask.new('coverage') do |t|
    t.spec_opts = ["--options", "spec/spec.opts"]
    t.spec_files = FileList["spec/*_spec.rb"].sort
    t.rcov_opts = ["--exclude", "spec", "--exclude", "gems"]
    t.rcov = true
  end
 
  task :default => :spec
rescue LoadError
  puts "RSpec, or one of its dependencies, is not available. Please install it."
  exit(1)
end
 
begin
  require 'yard'
  require 'yard/rake/yardoc_task'
 
  YARD::Rake::YardocTask.new do |t|
    t.options = ["--verbose", "--markup=markdown", "--files=CHANGELOG.markdown,MIT-LICENSE"]
  end
  
  task :rdoc => :yardoc
  
  CLOBBER.include 'doc'
  CLOBBER.include '.yardoc'
rescue LoadError
  puts "Yard, or one of its dependencies is not available. Please install it."
  exit(1)
end
 
begin
  require 'rake/contrib/sshpublisher'
  namespace :rubyforge do
 
    desc "Release gem and RDoc documentation to RubyForge"
    task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
 
    namespace :release do
      desc "Publish RDoc to RubyForge."
      task :docs => [:yardoc] do
        config = YAML.load(
            File.read(File.expand_path('~/.rubyforge/user-config.yml'))
        )
 
        host = "#{config['username']}@rubyforge.org"
        remote_dir = "/var/www/gforge-projects/calais/"
        local_dir = 'doc'
 
        Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
      end
    end
  end
rescue LoadError
  puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
  exit(1)
end
 
# vim: syntax=Ruby