public
Description: A gitweb clone using Sinatra and Grit
Homepage: http://lenary.github.com/ginatra
Clone URL: git://github.com/lenary/ginatra.git
ginatra / Rakefile
100644 87 lines (68 sloc) 2.309 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
require 'rubygems'
require 'cucumber/rake/task'
require 'spec/rake/spectask'
 
current_path = File.expand_path(File.dirname(__FILE__))
require "#{current_path}/lib/ginatra"
 
task :default => ['rake:spec', 'rake:features']
 
desc "Runs the Cucumber Feature Suite"
Cucumber::Rake::Task.new(:features) do |t|
  t.cucumber_opts = "--format pretty"
end
 
namespace :features do
 
  desc "Runs the `@current` feature(s) or scenario(s)"
  Cucumber::Rake::Task.new(:current) do |c|
    c.cucumber_opts = "--format pretty -t current"
  end
 
end
 
desc "Runs the RSpec Test Suite"
Spec::Rake::SpecTask.new(:spec) do |r|
  r.spec_files = FileList['spec/*_spec.rb']
  r.spec_opts = ['--color']
end
 
namespace :spec do
 
  desc "RSpec Test Suite with pretty output"
  Spec::Rake::SpecTask.new(:long) do |r|
    r.spec_files = FileList['spec/*_spec.rb']
    r.spec_opts = ['--color', '--format specdoc']
  end
 
  desc "RSpec Test Suite with html output"
  Spec::Rake::SpecTask.new(:html) do |r|
    r.spec_files = FileList['spec/*_spec.rb']
    r.spec_opts = ['--color', '--format html:spec/html_spec.html']
  end
 
end
 
namespace :setup do
 
  desc "Clones the Test Repository"
  task :repo do |t|
    FileUtils.cd(File.join(current_path, "repos")) do
      puts `git clone git://github.com/atmos/hancock-client.git test`
    end
  end
 
  desc "Installs the Required Gems"
  task :gems do |t|
    gems = %w(grit kematzy-sinatra-cache vegas)
    puts %x(gem install #{gems.join(" ")})
  end
 
  desc "Installs the Test Gems"
  task :test do |t|
    gems = %w(rspec webrat rack-test cucumber)
    puts %x(gem install #{gems.join(" ")})
  end
 
end
 
begin
  require 'jeweler'
  Jeweler::Tasks.new do |gemspec|
    gemspec.name = "ginatra"
    gemspec.summary = "A Gitweb Clone in Sinatra and Grit"
    gemspec.description = "Host your own git repository browser through the power of Sinatra and Grit"
    gemspec.email = "sam@lenary.co.uk"
    gemspec.homepage = "http://lenary.github.com/ginatra"
    gemspec.authors = ["Sam Elliott", "Ryan Bigg"]
    gemspec.add_dependency('sinatra', '>=0.9.4')
    gemspec.add_dependency('grit', '>=1.1.1')
    gemspec.add_dependency('coderay', '>=0.8.0')
    gemspec.files.include 'vendor/**/*'
  end
rescue LoadError
  puts "Jeweler not available. Install it with: sudo gem install jeweler"
end