cocoapods-label 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 62c4f6572d94fbf7983499950d92309c77d6d95c
4
+ data.tar.gz: 918ef2710b290bc20628e04e197765ee2b707e9f
5
+ SHA512:
6
+ metadata.gz: 10972f82c2e6aa679d4c8ebc432a13cd381b29f38909f538cfa40622b83d17a528b4cf75a9ac3f596ed58acc77c59fa12a5644c3f13af63aec504faeb1ec531f
7
+ data.tar.gz: e59dafd1fa3bca00d873369c9f8872a9130dadb3ef84345f9f5e843d5c355435a70a10a454fd2277262d5b5fbcc574bb7c58b7d126a5ca7925cc9a7c424f28d6
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ pkg
3
+ .idea/
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-label.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'cocoapods'
8
+ gem 'bacon'
9
+ end
10
+
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Karla-Sandoval-Sandoval <k.isabel.sandoval@gmail.com>
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ # cocoapods-label
2
+
3
+ annotate your podfile with descriptions for each pod.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-label
8
+
9
+ ## Usage
10
+
11
+ $ pod label
12
+
13
+
14
+ ## Made with love by
15
+ Boris Buegling, Karla Sandoval and Emma Koszinowski while participating in Rails Girls Summer of Code 2015
@@ -0,0 +1,13 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ def specs(dir)
4
+ FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5
+ end
6
+
7
+ desc 'Runs all the specs'
8
+ task :specs do
9
+ sh "bundle exec bacon #{specs('**')}"
10
+ end
11
+
12
+ task :default => :specs
13
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods-label/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-label'
8
+ spec.version = CocoapodsLabel::VERSION
9
+ spec.authors = ['Karla-Sandoval-Sandoval']
10
+ spec.email = ['k.isabel.sandoval@gmail.com']
11
+ spec.description = %q{A short description of cocoapods-label.}
12
+ spec.summary = %q{A longer description of cocoapods-label.}
13
+ spec.homepage = 'https://github.com/EXAMPLE/cocoapods-label'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-label/gem_version'
@@ -0,0 +1 @@
1
+ require 'cocoapods-label/command/label'
@@ -0,0 +1,48 @@
1
+ require 'yaml'
2
+
3
+ module Pod
4
+
5
+ class Command
6
+
7
+ class Label < Command
8
+ self.summary = 'annotate your podfile with descriptions for each pod .'
9
+
10
+
11
+ def initialize(argv)
12
+ super
13
+
14
+ @config = Pod::Config.instance
15
+ end
16
+
17
+ def podfile_path
18
+ @config.podfile_path_in_dir(Pathname.new(Dir.pwd))
19
+ end
20
+
21
+ def validate!
22
+ super
23
+
24
+ help! 'No Podfile found.' unless File.exist?(podfile_path)
25
+ end
26
+
27
+ def run
28
+
29
+ podfile = Pod::Podfile.from_file(podfile_path)
30
+ sources = podfile.sources.map { |src| Pod::SourcesManager.find_or_create_source_with_url(src) }
31
+ sources = Pod::SourcesManager.all if sources.empty?
32
+
33
+ File.unlink(podfile_path)
34
+ File.open('CocoaPods.podfile.yaml', 'w') { |file| file.write(podfile.to_yaml) }
35
+ content = File.read("CocoaPods.podfile.yaml")
36
+ podfile.dependencies.each do |dependency|
37
+ sources.each do |source|
38
+ next if source.versions(dependency.name).nil?
39
+ spec = source.set(dependency.name).specification
40
+ content = content.gsub(/(^.*)(- #{spec.name})/, "\\1# #{spec.summary}\n\\1\\2")
41
+
42
+ end
43
+ end
44
+ File.open('CocoaPods.podfile.yaml', 'w') { |file| file.write(content) }
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,3 @@
1
+ module CocoapodsLabel
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-label/command'
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Label do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ label }).should.be.instance_of Command::Label
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,45 @@
1
+ require 'pathname'
2
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
3
+ $:.unshift((ROOT + 'lib').to_s)
4
+ $:.unshift((ROOT + 'spec').to_s)
5
+
6
+ require 'bundler/setup'
7
+ require 'bacon'
8
+ require 'cocoapods'
9
+
10
+ require 'cocoapods_plugin'
11
+
12
+ #-----------------------------------------------------------------------------#
13
+
14
+ module Pod
15
+
16
+ # Disable the wrapping so the output is deterministic in the tests.
17
+ #
18
+ UI.disable_wrap = true
19
+
20
+ # Redirects the messages to an internal store.
21
+ #
22
+ module UI
23
+ @output = ''
24
+ @warnings = ''
25
+
26
+ class << self
27
+ attr_accessor :output
28
+ attr_accessor :warnings
29
+
30
+ def puts(message = '')
31
+ @output << "#{message}\n"
32
+ end
33
+
34
+ def warn(message = '', actions = [])
35
+ @warnings << "#{message}\n"
36
+ end
37
+
38
+ def print(message)
39
+ @output << message
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ #-----------------------------------------------------------------------------#
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-label
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Karla-Sandoval-Sandoval
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A short description of cocoapods-label.
42
+ email:
43
+ - k.isabel.sandoval@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - cocoapods-label.gemspec
54
+ - lib/cocoapods-label.rb
55
+ - lib/cocoapods-label/command.rb
56
+ - lib/cocoapods-label/command/label.rb
57
+ - lib/cocoapods-label/gem_version.rb
58
+ - lib/cocoapods_plugin.rb
59
+ - spec/command/label_spec.rb
60
+ - spec/spec_helper.rb
61
+ homepage: https://github.com/EXAMPLE/cocoapods-label
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.4.6
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: A longer description of cocoapods-label.
85
+ test_files:
86
+ - spec/command/label_spec.rb
87
+ - spec/spec_helper.rb