Commit 8de8b8c7 authored by Fabio Pelosin's avatar Fabio Pelosin

[Specification] Adopt the JSON format

parent 458aed5e
...@@ -4,6 +4,20 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -4,6 +4,20 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
## Master ## Master
###### Breaking
* The command `podfile_info` is now a plugin offered by CocoaPods.
As a result, the command has been removed from CocoaPods.
[Joshua Kalpin](https://github.com/Kapin)
[#1589](https://github.com/CocoaPods/CocoaPods/issues/1589)
* JSON has been adopted as the format to store specifications. As a result
the `pod ipc spec` command returns a JSON representation and the YAML
specifications are not supported anymore. JSON specifications adopt the
`.podspec.json` extension.
[Fabio Pelosin](https://github.com/irrationalfab)
[#1568](https://github.com/CocoaPods/CocoaPods/pull/1568)
###### Enhancements ###### Enhancements
* Introduced `pod try` the easiest way to test the example project of a pod. * Introduced `pod try` the easiest way to test the example project of a pod.
...@@ -50,13 +64,6 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -50,13 +64,6 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Florian Hanke](https://github.com/floere) [Florian Hanke](https://github.com/floere)
[#1643][https://github.com/CocoaPods/CocoaPods/pull/1682] [#1643][https://github.com/CocoaPods/CocoaPods/pull/1682]
###### Refactor
* The command `podfile_info` is now a plugin offered by CocoaPods.
As a result, the command has been removed from CocoaPods.
[Joshua Kalpin](https://github.com/Kapin)
[#1589](https://github.com/CocoaPods/CocoaPods/issues/1589)
###### Bug Fixes ###### Bug Fixes
* Fixed a bug which resulted in `pod lib lint` not being able to find the * Fixed a bug which resulted in `pod lib lint` not being able to find the
......
...@@ -13,8 +13,8 @@ module Pod ...@@ -13,8 +13,8 @@ module Pod
class Spec < IPC class Spec < IPC
self.summary = 'Converts a podspec to YAML.' self.summary = 'Converts a podspec to JSON.'
self.description = 'Converts a podspec to YAML and prints it to STDOUT.' self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
self.arguments = 'PATH' self.arguments = 'PATH'
def initialize(argv) def initialize(argv)
...@@ -29,7 +29,7 @@ module Pod ...@@ -29,7 +29,7 @@ module Pod
def run def run
spec = Specification.from_file(@path) spec = Specification.from_file(@path)
output_pipe.puts spec.to_yaml output_pipe.puts spec.to_json
end end
end end
......
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
base_url = 'https://trunk.cocoapods.org/api/v1' base_url = 'https://trunk.cocoapods.org/api/v1'
podspec_files.each do |spec_file| podspec_files.each do |spec_file|
spec = Pod::Specification.from_file(spec_file) spec = Pod::Specification.from_file(spec_file)
REST.post("#{base_url}/pods", spec.to_yaml, 'Content-Type' => 'text/yaml', 'Authorization' => "Token #{tokens.sample}") REST.post("#{base_url}/pods", spec.to_json, 'Content-Type' => 'text/yaml', 'Authorization' => "Token #{tokens.sample}")
end end
rescue Exception rescue Exception
# Nothing # Nothing
......
...@@ -13,12 +13,11 @@ module Pod ...@@ -13,12 +13,11 @@ module Pod
describe Command::IPC::Spec do describe Command::IPC::Spec do
it "converts a podspec to yaml and prints it to STDOUT" do it "converts a podspec to JSON and prints it to STDOUT" do
out = run_command('ipc', 'spec', fixture('banana-lib/BananaLib.podspec')) out = run_command('ipc', 'spec', fixture('banana-lib/BananaLib.podspec'))
out.should.include('---') out.should.match /"name": "BananaLib"/
out.should.match /name: BananaLib/ out.should.match /"version": "1.0"/
out.should.match /version: .1\.0./ out.should.match /"description": "Full of chunky bananas."/
out.should.match /description: Full of chunky bananas./
end end
end end
...@@ -41,7 +40,7 @@ module Pod ...@@ -41,7 +40,7 @@ module Pod
describe Command::IPC::List do describe Command::IPC::List do
it "converts a podspec to yaml and prints it to STDOUT" do it "prints a list of podspecs in the yaml format and prints it to STDOUT" do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
set = Specification.new('BananaLib') set = Specification.new('BananaLib')
set.stubs(:specification).returns(spec) set.stubs(:specification).returns(spec)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment