Skip to content

Commit

Permalink
Merge pull request CocoaPods#174 from CocoaPods/source-url
Browse files Browse the repository at this point in the history
Give Sources and SourceProviders a url attribute
  • Loading branch information
segiddins committed Sep 25, 2014
2 parents 03371e4 + 657a36e commit 5e63868
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 301 deletions.
9 changes: 6 additions & 3 deletions .rubocop_cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
AllCops:
Include:
- Rakefile
- Gemfile
- ./Rakefile
- ./Gemfile
- ./*.gemspec
Exclude:
- spec/fixtures/**/*
- ./spec/fixtures/**/*

# At the moment not ready to be used
# https://github.com/bbatsov/rubocop/issues/947
Expand Down Expand Up @@ -64,6 +64,9 @@ DotPosition:
EachWithObject:
Enabled: false

Style/SpecialGlobalVars:
Enabled: false

#- CocoaPods specs -----------------------------------------------------------#

# Allow for `should.match /regexp/`.
Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
[Fabio Pelosin](https://github.com/fabiopelosin)
[CocoaPods#2335](https://github.com/CocoaPods/CocoaPods/issues/2335)

* Removes the unused `Source::GitHubDataProvider` class.
[Samuel Giddins](https://github.com/segiddins)
[#174](https://github.com/CocoaPods/Core/pull/174)

* Adds a `url` attribute to `Source`.
Note that this attribute is currently only gathered from `git`.
[Samuel Giddins](https://github.com/segiddins)


## 0.34.0.rc2

Expand Down Expand Up @@ -111,7 +119,7 @@ This version only introduces changes in the CocoaPods gem.
[#69](https://github.com/CocoaPods/Core/issues/69)
[#100](https://github.com/CocoaPods/Core/pull/100)

* Added a check to the linter to ensure that the `social_media_url` has
* Added a check to the linter to ensure that the `social_media_url` has
been changed from the example value.
[Richard Lee](https://github.com/dlackty)
[#67](https://github.com/CocoaPods/Core/issues/67)
Expand Down Expand Up @@ -203,4 +211,3 @@ This version only introduces changes in the CocoaPods gem.
## 0.30.0

Introduction of the Changelog.

11 changes: 5 additions & 6 deletions lib/cocoapods-core/podfile/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,20 @@ def set_arc_compatibility_flag!
#
# -----
#
# By default, the github Cocoapods/specs repository is used. Use this
# method to specify (an) other(s) source(s). The order of the sources is
# By default, the GitHub Cocoapods/Specs repository is used. Use this
# method to specify sources. The order of the sources is
# relevant. CocoaPods will use the highest version of a Pod of the first
# source which includes the Pod (regardless whether other sources have a
# higher version).
#
# @param [String] source
# The name of a specs repo. Previously specified by user
# via pod repo add command
# The URL of a specs repo.
#
# @example Specifying to use first `my_private_repo` and then the
# CocoaPods Master Repo
#
# source 'my_private_repo'
# source 'master'
# source 'https://banana.com/corp/my_private_repo.git'
# source 'https://github.com/CocoaPods/Specs.git'
#
# @return [void]
#
Expand Down
7 changes: 6 additions & 1 deletion lib/cocoapods-core/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'cocoapods-core/source/health_reporter'
require 'cocoapods-core/source/abstract_data_provider'
require 'cocoapods-core/source/file_system_data_provider'
require 'cocoapods-core/source/github_data_provider'

module Pod
# The Source class is responsible to manage a collection of podspecs.
Expand Down Expand Up @@ -38,6 +37,12 @@ def name
data_provider.name
end

# @return [String] The URL of the source.
#
def url
data_provider.url
end

# @return [String] The type of the source.
#
def type
Expand Down
6 changes: 6 additions & 0 deletions lib/cocoapods-core/source/abstract_data_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def name
raise StandardError, 'Abstract method.'
end

# @return [String] The URL of the source.
#
def url
raise StandardError, 'Abstract method.'
end

# @return [String] The user friendly type of the source.
#
def type
Expand Down
9 changes: 9 additions & 0 deletions lib/cocoapods-core/source/file_system_data_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def name
repo.basename.to_s
end

# @return [String] The URL of the source.
#
def url
Dir.chdir(repo) do
remote = `git ls-remote --get-url`.chomp
remote if $?.success?
end
end

# @return [String] The user friendly type of the source.
#
def type
Expand Down
144 changes: 0 additions & 144 deletions lib/cocoapods-core/source/github_data_provider.rb

This file was deleted.

Loading

0 comments on commit 5e63868

Please sign in to comment.