lib/git/semaphore.rb in git-semaphore-1.2.0 vs lib/git/semaphore.rb in git-semaphore-2.0.0

- old
+ new

@@ -1,13 +1,20 @@ require 'uri' +require 'date' require 'json' require 'openssl' require 'net/http' require 'fileutils' -require 'grit' +require 'rugged' +class Rugged::Repository + def owner() File.basename(File.dirname(workdir)) ; end + def name() File.basename(workdir) ; end + def full_name() "#{owner}/#{name}" ; end +end + module Git module Semaphore def self.home_dir @home_dir ||= begin @@ -42,13 +49,13 @@ end end end def self.git_repo - @git_repo ||= begin - Grit::Repo.new(Dir.pwd) - rescue Grit::InvalidGitRepositoryError + begin + Rugged::Repository.new(Dir.pwd) + rescue Rugged::RepositoryError nil end end def self.env_auth_token @@ -72,6 +79,6 @@ require 'git/semaphore/api' require 'git/semaphore/api_cache' require 'git/semaphore/api_enrich' -require 'git/semaphore/app' +require 'git/semaphore/project'