Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
205 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.bundle | ||
*.swp | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Coming soon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# stolen largely from defunkt/mustache | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
require 'rake/extensiontask' | ||
|
||
Rake::ExtensionTask.new('ribbit') | ||
|
||
# | ||
# Helpers | ||
# | ||
|
||
def command?(command) | ||
system("type #{command} > /dev/null") | ||
end | ||
|
||
|
||
# | ||
# Tests | ||
# | ||
|
||
task :default => :test | ||
|
||
if command? :turn | ||
desc "Run tests" | ||
task :test do | ||
suffix = "-n #{ENV['TEST']}" if ENV['TEST'] | ||
sh "turn test/*.rb #{suffix}" | ||
end | ||
else | ||
Rake::TestTask.new do |t| | ||
t.libs << 'lib' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = false | ||
end | ||
end | ||
|
||
if command? :kicker | ||
desc "Launch Kicker (like autotest)" | ||
task :kicker do | ||
puts "Kicking... (ctrl+c to cancel)" | ||
exec "kicker -e rake test lib examples" | ||
end | ||
end | ||
|
||
|
||
# | ||
# Ron | ||
# | ||
|
||
if command? :ronn | ||
desc "Show the manual" | ||
task :man => "man:build" do | ||
exec "man man/mustache.1" | ||
end | ||
|
||
desc "Build the manual" | ||
task "man:build" do | ||
sh "ronn -br5 --organization=SCHACON --manual='Ribbit Manual' man/*.ron" | ||
end | ||
end | ||
|
||
|
||
# | ||
# Gems | ||
# | ||
|
||
begin | ||
require 'mg' | ||
MG.new("ribbit.gemspec") | ||
|
||
desc "Push a new version to Gemcutter and publish docs." | ||
task :publish => "gem:publish" do | ||
require File.dirname(__FILE__) + '/lib/mustache/version' | ||
|
||
system "git tag v#{Ribbit::Version}" | ||
sh "git push origin master --tags" | ||
sh "git clean -fd" | ||
exec "rake pages" | ||
end | ||
rescue LoadError | ||
warn "mg not available." | ||
warn "Install it with: gem i mg" | ||
end | ||
|
||
# | ||
# Documentation | ||
# | ||
|
||
begin | ||
require 'sdoc_helpers' | ||
rescue LoadError | ||
warn "sdoc support not enabled. Please gem install sdoc-helpers." | ||
end | ||
|
||
desc "Publish to GitHub Pages" | ||
task :pages => [ "man:build" ] do | ||
Dir['man/*.html'].each do |f| | ||
cp f, File.basename(f).sub('.html', '.newhtml') | ||
end | ||
|
||
`git commit -am 'generated manual'` | ||
`git checkout site` | ||
|
||
Dir['*.newhtml'].each do |f| | ||
mv f, f.sub('.newhtml', '.html') | ||
end | ||
|
||
`git add .` | ||
`git commit -m updated` | ||
`git push site site:master` | ||
`git checkout master` | ||
puts :done | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "ruby.h" | ||
|
||
static VALUE rb_cRibbit; | ||
|
||
static VALUE | ||
compare_prefix(VALUE self, VALUE string1, VALUE string2) | ||
{ | ||
return git__prefixcmp(string1, string2); | ||
} | ||
|
||
void | ||
Init_ribbit() | ||
{ | ||
rb_cRibbit = rb_define_class("Ribbit", rb_cObject); | ||
|
||
rb_define_method(rb_cRibbit, "compare_prefix", compare_prefix, 2); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Ribbit | ||
Version = VERSION = '0.0.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'lib/ribbit/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "ribbit" | ||
s.version = Ribbit::Version | ||
s.date = Time.now.strftime('%Y-%m-%d') | ||
s.summary = "Ribbit is a Ruby binding to the libgit2 linkable library" | ||
s.homepage = "http://github.com/schacon/ribbit" | ||
s.email = "schacon@gmail.com" | ||
s.authors = [ "Scott Chacon" ] | ||
s.files = %w( README API Rakefile LICENSE ) | ||
s.files += Dir.glob("lib/**/*") | ||
s.files += Dir.glob("man/**/*") | ||
s.files += Dir.glob("test/**/*") | ||
s.extensions = ['ext/ribbit/extconf.rb'] | ||
s.description = <<desc | ||
Ribbit is a Ruby bindings to the libgit2 linkable C Git library. This is | ||
for testing and using the libgit2 library in a language that is awesome. | ||
desc | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require File.dirname(__FILE__) + '/test_helper' | ||
|
||
context "Ribbit strutils" do | ||
setup do | ||
@ribbit = Ribbit.new | ||
end | ||
|
||
test "can compare prefixes" do | ||
puts @ribbit.compare_prefix("aa", "ab") | ||
assert_equal 1, 1 | ||
end | ||
|
||
end |
Oops, something went wrong.