Class: Pod::Specification

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_extensions.rb

Instance Method Summary collapse

Instance Method Details

#or_contributors_to_specObject



27
28
29
30
31
# File 'lib/spec_extensions.rb', line 27

def or_contributors_to_spec
  return self.authors if self.authors.is_a? String
  return self.authors.listify if self.authors.is_a? Array
  return self.authors.keys.listify if self.authors.is_a? Hash
end

#or_extensionless_homepageObject



22
23
24
25
# File 'lib/spec_extensions.rb', line 22

def or_extensionless_homepage
  return nil unless self.homepage
  self.homepage.sub('http://', '').sub('https://', '').sub('www.', '').split("/")[0]
end

#or_git_refObject



8
9
10
# File 'lib/spec_extensions.rb', line 8

def or_git_ref
  self.source[:tag] || self.source[:commit] || self.source[:branch] || 'master'
end

#or_is_github?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/spec_extensions.rb', line 4

def or_is_github?
  self.homepage.include?("github.com") || (self.source[:git] && self.source[:git].include?("github.com"))
end

#or_licenseObject



33
34
35
36
37
# File 'lib/spec_extensions.rb', line 33

def or_license
  return self.license if self.license.is_a? String
  return self.license[:type] if self.license.is_a? Hash
  return "Unknown License"
end

#or_repoObject



17
18
19
20
# File 'lib/spec_extensions.rb', line 17

def or_repo
  return nil unless self.or_is_github?
  self.homepage.split("/")[-1]
end

#or_userObject



12
13
14
15
# File 'lib/spec_extensions.rb', line 12

def or_user
  return nil unless self.or_is_github?
  self.homepage.split("/")[-2]
end