Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 8 commits
  • 10 files changed
  • 0 commit comments
  • 4 contributors
View
2  .gitignore
@@ -5,3 +5,5 @@ doc/
tmp/
*.gem
coverage/
+spec/fixtures/git-repo
+spec/fixtures/git-submodule-repo
View
23 CHANGELOG.md
@@ -1,16 +1,31 @@
# Changelog
-## Master
+## 0.3.0
+
+###### Enhancements
+
+* Support LZMA2 compressed tarballs in the
+ [Kyle Fuller](https://github.com/kylef)
+ [#5](https://github.com/CocoaPods/cocoapods-downloader/pull/5)
+
+
+## 0.2.0
+
+###### Enhancements
+
+* Added support for Bazaar repositories.
+ [@fmccann](https://github.com/fmccann)
+ [#4](https://github.com/CocoaPods/cocoapods-downloader/pull/4)
+
## 0.1.2
###### Enhancements
-* Improved performance of sources which specify a tag.
+* Improved performance of sources which specify a tag.
[CocoaPods/CocoaPods#1077](https://github.com/CocoaPods/CocoaPods/issues/1077)
* Added support for specification of the cache path relative from the current
- working directory.
+ working directory.
[#1](https://github.com/CocoaPods/cocoapods-downloader/issues/1)
-<!------------------------------------------------------------------------ ->
View
14 Gemfile.lock
@@ -3,12 +3,11 @@ GEM
specs:
addressable (2.3.5)
bacon (1.2.0)
- colorize (0.5.8)
- coveralls (0.6.7)
- colorize
+ coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
+ term-ansicolor
thor
crack (0.4.1)
safe_yaml (~> 0.9.0)
@@ -18,21 +17,24 @@ GEM
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.2)
mocha (>= 0.13.0)
- multi_json (1.7.9)
+ multi_json (1.8.0)
rake (10.1.0)
rest-client (1.6.7)
mime-types (>= 1.16)
- safe_yaml (0.9.5)
+ safe_yaml (0.9.7)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
+ term-ansicolor (1.2.2)
+ tins (~> 0.8)
thor (0.18.1)
+ tins (0.10.0)
vcr (2.5.0)
webmock (1.8.11)
addressable (>= 2.2.7)
crack (>= 0.1.7)
- yard (0.8.7)
+ yard (0.8.7.2)
PLATFORMS
ruby
View
4 README.markdown
@@ -65,9 +65,9 @@ This gem was extracted from [CocoaPods](https://github.com/CocoaPods/CocoaPods).
## Collaborate
-All CocoaPods development happens on GitHub, there is a repository for [CocoaPods](https://github.com/CocoaPods/CocoaPods) and one for the [CocoaPods specs](https://github.com/CocoaPods/Specs). Contributing patches or Pods is really easy and gratifying. You even get push access when one of your specs or patches is accepted.
+All CocoaPods development happens on GitHub, there is a repository for [CocoaPods](https://github.com/CocoaPods/CocoaPods) and one for the [CocoaPods specs](https://github.com/CocoaPods/Specs). Contributing patches or Pods is really easy and gratifying and for a lot of people is their first time.
-Follow [@CocoaPodsOrg](http://twitter.com/CocoaPodsOrg) to get up to date information about what's going on in the CocoaPods world.
+Follow [@CocoaPods](http://twitter.com/CocoaPods) to get up to date information about what's going on in the CocoaPods world.
## License
View
2  lib/cocoapods-downloader/gem_version.rb
@@ -4,7 +4,7 @@ module Downloader
# @return [String] Downloader’s version, following
# [semver](http://semver.org).
#
- VERSION = '0.2.0'
+ VERSION = '0.3.0'
end
end
View
10 lib/cocoapods-downloader/git.rb
@@ -62,9 +62,11 @@ def clone_url
# @return [void] Convenience method to perform clones operations.
#
- def clone(from, to)
+ def clone(from, to, flags = '')
ui_sub_action("Cloning to Pods folder") do
- git! %Q|clone "#{from}" "#{to}"|
+ command = %Q|clone "#{from}" "#{to}"|
+ command << ' ' + flags if flags
+ git!(command)
end
end
@@ -91,7 +93,7 @@ def download_tag
Dir.chdir(target_path) do
if use_cache?
- git! "clone '#{clone_url}' '#{target_path}'"
+ clone(clone_url, target_path)
else
git! "init"
git! "remote add origin '#{clone_url}'"
@@ -210,7 +212,7 @@ def create_cache
ui_sub_action("Creating cache git repo (#{cache_path})") do
cache_path.rmtree if cache_path.exist?
cache_path.mkpath
- git! %Q|clone --mirror "#{url}" "#{cache_path}"|
+ clone(url, cache_path, '--mirror')
end
end
View
8 lib/cocoapods-downloader/http.rb
@@ -43,7 +43,7 @@ def type
def should_flatten?
if options.has_key?(:flatten)
true
- elsif [:tgz, :tar, :tbz].include?(type)
+ elsif [:tgz, :tar, :tbz, :txz].include?(type)
true # those archives flatten by default
else
false # all others (actually only .zip) default not to flatten
@@ -59,6 +59,8 @@ def type_with_url(url)
:tar
elsif url =~ /.(tbz|tar\.bz2)$/
:tbz
+ elsif url =~ /.(txz|tar\.xz)$/
+ :txz
else
nil
end
@@ -74,6 +76,8 @@ def filename_with_type(type=:zip)
"file.tar"
when :tbz
"file.tbz"
+ when :txz
+ "file.txz"
else
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end
@@ -93,6 +97,8 @@ def extract_with_type(full_filename, type=:zip)
tar! "xf '#{full_filename}' -C '#{target_path}'"
when :tbz
tar! "xfj '#{full_filename}' -C '#{target_path}'"
+ when :txz
+ tar! "xf '#{full_filename}' -C '#{target_path}'"
else
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end
View
6 spec/cocoapods-downloaders/http_spec.rb
@@ -79,6 +79,12 @@ module Downloader
downloader.send(:type).should == :tbz
end
+ it 'detects txz files' do
+ options = { :http => 'https://file.txz' }
+ downloader = Downloader.for_target(tmp_folder, options)
+ downloader.send(:type).should == :txz
+ end
+
it 'allows to specify the file type in the sources' do
options = { :http => 'https://file', :type => :zip }
downloader = Downloader.for_target(tmp_folder, options)
1  spec/fixtures/git-repo
@@ -1 +0,0 @@
-Subproject commit d7f410490dabf7a6bde665ba22da102c3acf1bd9
1  spec/fixtures/git-submodule-repo
@@ -1 +0,0 @@
-Subproject commit c7d372bec2fef7555197d59b606442682082e13e

No commit comments for this range

Something went wrong with that request. Please try again.