Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give Sources and SourceProviders a url attribute #174

Merged
merged 7 commits into from
Sep 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use # rubocop:disable Style/SpecialGlobalVars for the relevant line instead. This would allow the check to stay in place or the rest of the code which is preferable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That decision is left up to @alloy and @fabiopelosin

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit like an overreach to disable it globally for one infraction that's my only concern with it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we support Ruby 1.8.7 we are completely disabling it (because adding a comment to each line with $? would be inconvenient and style checks should not be inconvenient).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know if this config entry is about anything other than the use of the ‘English’ lib. If it’s only about that, then we can disable it globally, otherwise disabling it for just that line makes sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we support Ruby 1.8.7

@fabiopelosin Interesting. Are you saying that Ruby 2 has the English variants by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, they’re simply not available at all on 1.8. Gotcha 👍


#- 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