Class: Pod::Specification
- Inherits:
-
Object
- Object
- Pod::Specification
- Defined in:
- lib/spec_extensions.rb
Instance Method Summary collapse
- #or_contributors_to_spec ⇒ Object
- #or_extensionless_homepage ⇒ Object
- #or_git_ref ⇒ Object
- #or_is_github? ⇒ Boolean
- #or_license ⇒ Object
- #or_repo ⇒ Object
- #or_user ⇒ Object
Instance Method Details
#or_contributors_to_spec ⇒ Object
27 28 29 30 31 |
# File 'lib/spec_extensions.rb', line 27 def or_contributors_to_spec return self. if self..is_a? String return self..listify if self..is_a? Array return self..keys.listify if self..is_a? Hash end |
#or_extensionless_homepage ⇒ Object
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_ref ⇒ Object
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
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_license ⇒ Object
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_repo ⇒ Object
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_user ⇒ Object
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 |