From 7c25768beff172d864c82b7052b30f3529046467 Mon Sep 17 00:00:00 2001 From: Fabio Pelosin Date: Sat, 9 Nov 2013 19:26:22 +0100 Subject: [PATCH] [Specifiction::DSL] Add social_media_url attribute --- lib/cocoapods-core/specification/dsl.rb | 18 ++++++++++++++++++ spec/specification/dsl_spec.rb | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/lib/cocoapods-core/specification/dsl.rb b/lib/cocoapods-core/specification/dsl.rb index 8c3aa83d1..108af295a 100644 --- a/lib/cocoapods-core/specification/dsl.rb +++ b/lib/cocoapods-core/specification/dsl.rb @@ -132,6 +132,24 @@ module DSL #------------------# + # @!method social_media_url=(social_media_url) + # + # The URL for the social media contact of the library. CocoaPods web + # services can use it, for example the Twitter notifications will + # include the twitter handle (shortening the description) if the URL is + # relative to Twitter. + # + # @example + # + # spec.social_media_url = 'https://twitter.com/cocoapods' + # + # @param [String] social_media_url + # the social media URL. + # + root_attribute :social_media_url + + #------------------# + # The keys accepted by the license attribute. # LICENSE_KEYS = [:type, :file, :text].freeze diff --git a/spec/specification/dsl_spec.rb b/spec/specification/dsl_spec.rb index 9849c4569..f5b65cc67 100644 --- a/spec/specification/dsl_spec.rb +++ b/spec/specification/dsl_spec.rb @@ -32,6 +32,11 @@ module Pod @spec.attributes_hash["authors"].should == { 'orta' => 'orta.therox@gmail.com' } end + it "allows to specify the social media contact" do + @spec.social_media_url = "https://twitter.com/cocoapods" + @spec.attributes_hash["social_media_url"].should == "https://twitter.com/cocoapods" + end + it "allows to specify the license" do @spec.license = { :type => 'MIT', :file => 'MIT-LICENSE' } @spec.attributes_hash["license"].should == { "type" => 'MIT', "file" => 'MIT-LICENSE' }