Class: Shard

Inherits:
Object
  • Object
show all
Defined in:
lib/shard.rb,
lib/shard/ref.rb,
lib/shard/gist.rb,
lib/shard/saver.rb,
lib/shard/lister.rb,
lib/shard/loader.rb,
lib/shard/credentials.rb,
lib/shard/shard_directory.rb

Defined Under Namespace

Modules: CLI, ShardDirectory Classes: Credentials, Gist, Lister, Loader, Ref, Saver

Class Method Summary collapse

Class Method Details

.apiObject



3
4
5
# File 'lib/shard.rb', line 3

def self.api
  @api ||= Octokit::Client.new netrc: (Credentials.saved? && Credentials.valid?)
end

.Ref(shard_line) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/shard.rb', line 7

def self.Ref(shard_line)
  case shard_line
  when String     then Shard::Ref.parse(shard_line)
  when Shard::Ref then shard_line
                  else raise ArgumentError
  end
end