зеркало из https://github.com/github/grit.git
merge d34d53 and fix whitespace conflicts
This commit is contained in:
Коммит
bc9fb8b75e
3
Rakefile
3
Rakefile
|
@ -3,6 +3,7 @@ require 'rake/testtask'
|
||||||
require 'rake/rdoctask'
|
require 'rake/rdoctask'
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
require 'rubygems'
|
||||||
require 'jeweler'
|
require 'jeweler'
|
||||||
Jeweler::Tasks.new do |s|
|
Jeweler::Tasks.new do |s|
|
||||||
s.name = "grit"
|
s.name = "grit"
|
||||||
|
@ -51,4 +52,4 @@ end
|
||||||
desc "Upload site to Rubyforge"
|
desc "Upload site to Rubyforge"
|
||||||
task :site do
|
task :site do
|
||||||
sh "scp -r doc/* mojombo@grit.rubyforge.org:/var/www/gforge-projects/grit"
|
sh "scp -r doc/* mojombo@grit.rubyforge.org:/var/www/gforge-projects/grit"
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,7 +104,7 @@ module Grit
|
||||||
info = nil
|
info = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
blames
|
blames
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -116,6 +116,11 @@ module Grit
|
||||||
def inspect
|
def inspect
|
||||||
%Q{#<Grit::Blob "#{@id}">}
|
%Q{#<Grit::Blob "#{@id}">}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Compares blobs by name
|
||||||
|
def <=>(other)
|
||||||
|
name <=> other.name
|
||||||
|
end
|
||||||
end # Blob
|
end # Blob
|
||||||
|
|
||||||
end # Grit
|
end # Grit
|
|
@ -103,6 +103,21 @@ module Grit
|
||||||
def inspect
|
def inspect
|
||||||
%Q{#<Grit::Tree "#{@id}">}
|
%Q{#<Grit::Tree "#{@id}">}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Find only Tree objects from contents
|
||||||
|
def trees
|
||||||
|
contents.select {|v| v.kind_of? Tree}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Find only Blob objects from contents
|
||||||
|
def blobs
|
||||||
|
contents.select {|v| v.kind_of? Blob}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Compares trees by name
|
||||||
|
def <=>(other)
|
||||||
|
name <=> other.name
|
||||||
|
end
|
||||||
end # Tree
|
end # Tree
|
||||||
|
|
||||||
end # Grit
|
end # Grit
|
||||||
|
|
Загрузка…
Ссылка в новой задаче