cocoapods 0.16.4 → 0.17.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +108 -0
  3. data/README.md +3 -3
  4. data/bin/pod +1 -1
  5. data/lib/cocoapods.rb +31 -31
  6. data/lib/cocoapods/command.rb +62 -107
  7. data/lib/cocoapods/command/inter_process_communication.rb +103 -0
  8. data/lib/cocoapods/command/list.rb +45 -44
  9. data/lib/cocoapods/command/outdated.rb +28 -25
  10. data/lib/cocoapods/command/project.rb +90 -0
  11. data/lib/cocoapods/command/push.rb +50 -32
  12. data/lib/cocoapods/command/repo.rb +125 -155
  13. data/lib/cocoapods/command/search.rb +23 -12
  14. data/lib/cocoapods/command/setup.rb +103 -64
  15. data/lib/cocoapods/command/spec.rb +329 -90
  16. data/lib/cocoapods/config.rb +197 -44
  17. data/lib/cocoapods/downloader.rb +47 -34
  18. data/lib/cocoapods/executable.rb +98 -41
  19. data/lib/cocoapods/external_sources.rb +325 -0
  20. data/lib/cocoapods/file_list.rb +8 -1
  21. data/lib/cocoapods/gem_version.rb +7 -0
  22. data/lib/cocoapods/generator/acknowledgements.rb +71 -7
  23. data/lib/cocoapods/generator/acknowledgements/markdown.rb +10 -9
  24. data/lib/cocoapods/generator/acknowledgements/plist.rb +9 -8
  25. data/lib/cocoapods/generator/copy_resources_script.rb +2 -2
  26. data/lib/cocoapods/generator/documentation.rb +153 -37
  27. data/lib/cocoapods/generator/prefix_header.rb +82 -0
  28. data/lib/cocoapods/generator/target_header.rb +58 -0
  29. data/lib/cocoapods/generator/xcconfig.rb +130 -0
  30. data/lib/cocoapods/hooks/installer_representation.rb +123 -0
  31. data/lib/cocoapods/hooks/library_representation.rb +79 -0
  32. data/lib/cocoapods/hooks/pod_representation.rb +74 -0
  33. data/lib/cocoapods/installer.rb +398 -147
  34. data/lib/cocoapods/installer/analyzer.rb +556 -0
  35. data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +253 -0
  36. data/lib/cocoapods/installer/file_references_installer.rb +179 -0
  37. data/lib/cocoapods/installer/pod_source_installer.rb +289 -0
  38. data/lib/cocoapods/installer/target_installer.rb +307 -112
  39. data/lib/cocoapods/installer/user_project_integrator.rb +140 -176
  40. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +193 -0
  41. data/lib/cocoapods/library.rb +195 -0
  42. data/lib/cocoapods/open_uri.rb +16 -14
  43. data/lib/cocoapods/project.rb +175 -52
  44. data/lib/cocoapods/resolver.rb +151 -164
  45. data/lib/cocoapods/sandbox.rb +276 -54
  46. data/lib/cocoapods/sandbox/file_accessor.rb +210 -0
  47. data/lib/cocoapods/sandbox/headers_store.rb +96 -0
  48. data/lib/cocoapods/sandbox/path_list.rb +178 -0
  49. data/lib/cocoapods/sources_manager.rb +218 -0
  50. data/lib/cocoapods/user_interface.rb +82 -18
  51. data/lib/cocoapods/{command → user_interface}/error_report.rb +5 -5
  52. data/lib/cocoapods/validator.rb +379 -0
  53. metadata +74 -55
  54. data/lib/cocoapods/command/install.rb +0 -55
  55. data/lib/cocoapods/command/linter.rb +0 -317
  56. data/lib/cocoapods/command/update.rb +0 -25
  57. data/lib/cocoapods/dependency.rb +0 -285
  58. data/lib/cocoapods/downloader/git.rb +0 -276
  59. data/lib/cocoapods/downloader/http.rb +0 -99
  60. data/lib/cocoapods/downloader/mercurial.rb +0 -26
  61. data/lib/cocoapods/downloader/subversion.rb +0 -42
  62. data/lib/cocoapods/local_pod.rb +0 -620
  63. data/lib/cocoapods/lockfile.rb +0 -274
  64. data/lib/cocoapods/platform.rb +0 -127
  65. data/lib/cocoapods/podfile.rb +0 -551
  66. data/lib/cocoapods/source.rb +0 -223
  67. data/lib/cocoapods/specification.rb +0 -579
  68. data/lib/cocoapods/specification/set.rb +0 -175
  69. data/lib/cocoapods/specification/statistics.rb +0 -112
  70. data/lib/cocoapods/user_interface/ui_pod.rb +0 -130
  71. data/lib/cocoapods/version.rb +0 -26
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6013129b296437d543853413a5ee6e835811f6e1
4
+ data.tar.gz: dd3f63d981dbd29df23b124c6002730de9c71745
5
+ SHA512:
6
+ metadata.gz: 2c7de94a11c4a79a00f46ff265e2a281058142511d671c5b284c504d8162a666bbcd2b39e807193e9dc57a36574a9e3a4d96f2650d3415e2e3a6939e50382046
7
+ data.tar.gz: 8c18695b3ad7b32d16f6fc4d0ae95d6295b46e7e8309c8511222560d3dfa8e0e7e1d0314243f00e7d7381641731243321b02cac727d5f56d7f6080c1b1a04173
@@ -1,3 +1,110 @@
1
+ ## 0.17.0.rc1
2
+ [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/master...0.17)
3
+ • [Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.5.0...master)
4
+ • [cocoapods-core](https://github.com/CocoaPods/Core)
5
+ • [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader)
6
+
7
+ ###### __Notice__
8
+
9
+ At some point in future the master repo will be switched to the YAML format of
10
+ specifications. This means that specifications with hooks (or any other kind of
11
+ dynamic logic) will not be accepted. Please let us know if there is need for
12
+ other DSL attributes or any other kind of support.
13
+
14
+ Currently the following specifications fail to load as they depended on the
15
+ CocoaPods internals and need to be updated:
16
+
17
+ - LibComponentLogging-pods/0.0.1/LibComponentLogging-pods.podspec
18
+ - RestKit/0.9.3/RestKit.podspec
19
+ - Three20/1.0.11/Three20.podspec
20
+
21
+ Other specifications, might present compatibility issues for the reasons
22
+ presented below.
23
+
24
+ ###### __Breaking__
25
+
26
+ - Subspecs do **not** inherit the files patterns from the parent spec anymore.
27
+ This feature made the implementation more complicated and was not easy to
28
+ explain to podspecs maintainers. Compatibility can be easily fixed by adding
29
+ a 'Core' subspec.
30
+ - Support for inline podspecs has been removed.
31
+ - The support for Rake::FileList is being deprecated, in favor of a more
32
+ consistent DSL. Rake::FileList also presented issues because it would access
33
+ the file system as soon as it was converted to an array.
34
+ - The hooks architecture has been re-factored and might present
35
+ incompatibilities (please open an issue if appropriate).
36
+ - The `requires_arc` attribute default value is transitioning from `false` to
37
+ `true`. In the meanwhile a value is needed to pass the lint.
38
+ - Deprecated `copy_header_mapping` hook.
39
+ - Deprecated `exclude_header_search_paths` attribute.
40
+ - External sources are not supported in the dependencies of specifications
41
+ anymore. Actually they never have been supported, they just happened to work.
42
+
43
+ ###### DSL
44
+
45
+ - Podfile:
46
+ - It is not needed to specify the platform anymore (unless not integrating)
47
+ as CocoaPods now can infer the platform from the integrated targets.
48
+ - Specification:
49
+ - `preferred_dependency` has been renamed to `default_subspec`.
50
+ - Added `exclude_files` attribute.
51
+ - Added `screenshots` attribute.
52
+ - Added default values for attributes like `source_files`.
53
+
54
+ ###### Enhancements
55
+
56
+ - Released preview [documentation](docs.cocoapods.org).
57
+ - CocoaPods now has support for working in teams and not committing the Pods
58
+ folder, as it will keep track of the status of the Pods folder.
59
+ [#552](https://github.com/CocoaPods/CocoaPods/issues/552)
60
+ - Simplified installation: no specific version of ruby gems is required anymore.
61
+ - The workspace is written only if needed greatly reducing the occasions in
62
+ which Xcode asks to revert.
63
+ - The Lockfile is sorted reducing the SCM noise.
64
+ [#591](https://github.com/CocoaPods/CocoaPods/issues/591)
65
+ - Added Podfile, Frameworks, and Resources to the Pods project.
66
+ [#647](https://github.com/CocoaPods/CocoaPods/issues/647)
67
+ [#588](https://github.com/CocoaPods/CocoaPods/issues/588)
68
+ - Adds new subcommand `pod spec cat NAME` to print a spec file to standard output.
69
+ - Specification hooks are only called when the specification is installed.
70
+ - The `--no-clean` option of the `pod spec lint` command now displays the Pods
71
+ project for inspection.
72
+ - It is now possible to specify default values for the configuration in
73
+ `~/.cocoapods/config.yaml` ([default values](https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/config.rb#L17)).
74
+ - CocoaPods now checks the checksums of the installed specifications and
75
+ reinstalls them if needed.
76
+ - Support for YAML formats of the Podfile and the Specification.
77
+ - Added new command `pod ipc` to provide support for inter process
78
+ communication through YAML formats.
79
+ - CocoaPods now detects if the folder of a Pod is empty and reinstalls it.
80
+ [#534](https://github.com/CocoaPods/CocoaPods/issues/534)
81
+ - Install hooks and the `prefix_header_contents` attribute are supported in subspecs.
82
+ [#617](https://github.com/CocoaPods/CocoaPods/issues/617)
83
+ - Dashes are now supported in the versions of the Pods.
84
+ [#293](https://github.com/CocoaPods/CocoaPods/issues/293)
85
+
86
+ ###### Bug fixes
87
+
88
+ - CocoaPods is not confused anymore by target definitions with different activated subspec.
89
+ [#535](https://github.com/CocoaPods/CocoaPods/issues/535)
90
+ - CocoaPods is not confused anymore by to dependencies from external sources.
91
+ [#548](https://github.com/CocoaPods/CocoaPods/issues/548)
92
+ - The git cache will always update against the remote if a tag is requested,
93
+ resolving issues where library maintainers where updating the tag after a
94
+ lint and would be confused by CocoaPods using the cached commit for the tag.
95
+ [#407](https://github.com/CocoaPods/CocoaPods/issues/407)
96
+ [#596](https://github.com/CocoaPods/CocoaPods/issues/596)
97
+
98
+ ###### Codebase
99
+
100
+ - Major clean up and refactor of the whole code base.
101
+ - Extracted the core classes into
102
+ [cocoapods-core](https://github.com/CocoaPods/Core) gem.
103
+ - Extracted downloader into
104
+ [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader).
105
+ - Extracted command-line command & option handling into
106
+ [CLAide](https://github.com/CocoaPods/CLAide).
107
+
1
108
  ## 0.16.4
2
109
  [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.16.3...0.16.4)
3
110
 
@@ -317,6 +424,7 @@
317
424
  - The subversion downloader now does an export instead of a checkout, which
318
425
  makes it play nicer with SCMs that store metadata in each directory.
319
426
  [#245](https://github.com/CocoaPods/CocoaPods/issues/245)
427
+ - Now the Podfile is added to the Pods project for convenient editing.
320
428
 
321
429
  ###### Bug fixes
322
430
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # CocoaPods – an Objective-C library manager
2
2
 
3
- | CocoaPods | Xcodeproj | Specs |
4
- | :---: | :---: | :---: |
5
- [![Master Build Status](https://secure.travis-ci.org/CocoaPods/CocoaPods.png?branch=master)](https://secure.travis-ci.org/CocoaPods/CocoaPods)|[![Build Status](https://secure.travis-ci.org/CocoaPods/Xcodeproj.png?branch=master)](http://travis-ci.org/CocoaPods/Xcodeproj)|[![Build Status](https://secure.travis-ci.org/CocoaPods/Specs.png?branch=master)](http://travis-ci.org/CocoaPods/Specs)
3
+ | CocoaPods | Xcodeproj | Specs | Dependencies |
4
+ | :---: | :---: | :---: | :---: |
5
+ [![Build Status](https://travis-ci.org/CocoaPods/CocoaPods.png)](https://travis-ci.org/CocoaPods/CocoaPods)|[![Build Status](https://secure.travis-ci.org/CocoaPods/Xcodeproj.png?branch=master)](http://travis-ci.org/CocoaPods/Xcodeproj)|[![Build Status](https://secure.travis-ci.org/CocoaPods/Specs.png?branch=master)](http://travis-ci.org/CocoaPods/Specs)|[![Dependency Status](https://gemnasium.com/CocoaPods/CocoaPods.png)](https://gemnasium.com/CocoaPods/CocoaPods)
6
6
 
7
7
 
8
8
  CocoaPods manages library dependencies for your Xcode project.
data/bin/pod CHANGED
@@ -13,4 +13,4 @@ end
13
13
 
14
14
  require 'cocoapods'
15
15
 
16
- Pod::Command.run(*ARGV)
16
+ Pod::Command.run(ARGV)
@@ -1,60 +1,60 @@
1
1
  require 'rubygems'
2
2
 
3
- # Better to fail early and clear then during installation of pods.
4
- #
5
- # RubyGems 1.3.6 (which ships with OS X >= 10.7) up to 1.4.0 have a couple of
6
- # bugs related to comparing prerelease versions.
7
- #
8
- # E.g. https://github.com/CocoaPods/CocoaPods/issues/398
9
- unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(Gem::VERSION))
10
- STDERR.puts "\e[1;31m" + "Your RubyGems version (#{Gem::VERSION}) is too old, please update with: `gem update --system`" + "\e[0m"
11
- exit 1
12
- end
13
-
14
3
  module Pod
15
- VERSION = '0.16.4'
4
+ require 'cocoapods/gem_version'
16
5
 
17
- class PlainInformative < StandardError
18
- end
6
+ # Indicates a runtime error **not** caused by a bug.
7
+ #
8
+ class PlainInformative < StandardError; end
19
9
 
10
+ # Indicates a runtime error **not** caused by a bug which should be
11
+ # highlighted to the user.
12
+ #
20
13
  class Informative < PlainInformative
21
14
  def message
22
- # TODO: remove formatting from raise calls and remove conditional
23
- super !~ /\[!\]/ ? "[!] #{super}\n".red : super
15
+ "[!] #{super}".red
24
16
  end
25
17
  end
26
18
 
19
+ require 'cocoapods-core'
20
+ require 'xcodeproj'
21
+ require 'cocoapods/downloader'
22
+ require 'cocoapods/file_list'
23
+ require 'cocoapods/config'
24
+
27
25
  autoload :Command, 'cocoapods/command'
28
- autoload :Config, 'cocoapods/config'
29
- autoload :Dependency, 'cocoapods/dependency'
30
- autoload :Downloader, 'cocoapods/downloader'
31
26
  autoload :Executable, 'cocoapods/executable'
27
+ autoload :ExternalSources, 'cocoapods/external_sources'
32
28
  autoload :Installer, 'cocoapods/installer'
33
- autoload :LocalPod, 'cocoapods/local_pod'
34
- autoload :Lockfile, 'cocoapods/lockfile'
35
- autoload :Platform, 'cocoapods/platform'
36
- autoload :Podfile, 'cocoapods/podfile'
29
+ autoload :SourcesManager, 'cocoapods/sources_manager'
30
+ autoload :Library, 'cocoapods/library'
37
31
  autoload :Project, 'cocoapods/project'
38
32
  autoload :Resolver, 'cocoapods/resolver'
39
33
  autoload :Sandbox, 'cocoapods/sandbox'
40
- autoload :Source, 'cocoapods/source'
41
- autoload :Spec, 'cocoapods/specification'
42
- autoload :Specification, 'cocoapods/specification'
43
34
  autoload :UI, 'cocoapods/user_interface'
44
- autoload :Version, 'cocoapods/version'
35
+ autoload :Validator, 'cocoapods/validator'
45
36
 
46
37
  autoload :Pathname, 'pathname'
47
- autoload :FileList, 'cocoapods/file_list'
48
38
 
49
39
  module Generator
40
+ autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
50
41
  autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
51
42
  autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
52
43
  autoload :Documentation, 'cocoapods/generator/documentation'
53
- autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
54
- autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
55
- autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
56
44
  autoload :DummySource, 'cocoapods/generator/dummy_source'
45
+ autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
46
+ autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
47
+ autoload :PrefixHeader, 'cocoapods/generator/prefix_header'
48
+ autoload :TargetHeader, 'cocoapods/generator/target_header'
49
+ autoload :XCConfig, 'cocoapods/generator/xcconfig'
57
50
  end
51
+
52
+ module Hooks
53
+ autoload :InstallerRepresentation, 'cocoapods/hooks/installer_representation'
54
+ autoload :LibraryRepresentation, 'cocoapods/hooks/library_representation'
55
+ autoload :PodRepresentation, 'cocoapods/hooks/pod_representation'
56
+ end
57
+
58
58
  end
59
59
 
60
60
  if ENV['COCOA_PODS_ENV'] == 'development'
@@ -1,142 +1,88 @@
1
1
  require 'colored'
2
+ require 'claide'
2
3
 
3
4
  module Pod
4
- class Command
5
- autoload :ErrorReport, 'cocoapods/command/error_report'
6
- autoload :Install, 'cocoapods/command/install'
7
- autoload :List, 'cocoapods/command/list'
8
- autoload :Linter, 'cocoapods/command/linter'
9
- autoload :Outdated, 'cocoapods/command/outdated'
10
- autoload :Push, 'cocoapods/command/push'
11
- autoload :Repo, 'cocoapods/command/repo'
12
- autoload :Search, 'cocoapods/command/search'
13
- autoload :Setup, 'cocoapods/command/setup'
14
- autoload :Spec, 'cocoapods/command/spec'
15
- autoload :Update, 'cocoapods/command/update'
16
-
17
- class Help < Informative
18
- def initialize(command_class, argv, unrecognized_command = nil)
19
- @command_class, @argv, @unrecognized_command = command_class, argv, unrecognized_command
20
- end
21
-
22
- def message
23
- message = [
24
- '',
25
- @command_class.banner.gsub(/\$ pod (.*)/, '$ pod \1'.green),
26
- '',
27
- 'Options:',
28
- '',
29
- options,
30
- "\n",
31
- ].join("\n")
32
- message << "[!] Unrecognized command: `#{@unrecognized_command}'\n".red if @unrecognized_command
33
- message << "[!] Unrecognized argument#{@argv.count > 1 ? 's' : ''}: `#{@argv.join(' - ')}'\n".red unless @argv.empty?
34
- message
35
- end
36
-
37
- private
38
-
39
- def options
40
- options = @command_class.options
41
- keys = options.map(&:first)
42
- key_size = keys.inject(0) { |size, key| key.size > size ? key.size : size }
43
- options.map { |key, desc| " #{key.ljust(key_size)} #{desc}" }.join("\n")
44
- end
45
- end
5
+ class PlainInformative
6
+ include CLAide::InformativeError
7
+ end
46
8
 
47
- class ARGV < Array
48
- def options; select { |x| x.to_s[0,1] == '-' }; end
49
- def arguments; self - options; end
50
- def option(name); !!delete(name); end
51
- def shift_argument; (arg = arguments[0]) && delete(arg); end
52
- end
9
+ class Command < CLAide::Command
53
10
 
54
- def self.banner
55
- commands = ['install', 'update', 'outdated', 'list', 'push', 'repo', 'search', 'setup', 'spec'].sort
56
- banner = "To see help for the available commands run:\n\n"
57
- banner + commands.map { |cmd| " * $ pod #{cmd.green} --help" }.join("\n")
58
- end
11
+ self.abstract_command = true
12
+ self.command = 'pod'
13
+ self.description = 'CocoaPods, the Objective-C library package manager.'
59
14
 
60
15
  def self.options
61
16
  [
62
- ['--help', 'Show help information'],
63
- ['--silent', 'Print nothing'],
64
- ['--no-color', 'Print output without color'],
65
- ['--verbose', 'Print more information while working'],
66
- ['--version', 'Prints the version of CocoaPods'],
67
- ]
17
+ ['--silent', 'Show nothing'],
18
+ ['--version', 'Show the version of CocoaPods'],
19
+ ].concat(super)
68
20
  end
69
21
 
70
- def self.run(*argv)
71
- sub_command = parse(*argv)
72
- unless sub_command.is_a?(Setup) || ENV['SKIP_SETUP']
73
- Setup.new(ARGV.new).run_if_needed
22
+ def self.parse(argv)
23
+ command = super
24
+ unless SourcesManager.master_repo_functional? || command.is_a?(Setup) || ENV['SKIP_SETUP']
25
+ Setup.new(CLAide::ARGV.new([])).run
74
26
  end
75
- sub_command.run
76
- UI.puts
77
-
78
- rescue Interrupt
79
- puts "[!] Cancelled".red
80
- Config.instance.verbose? ? raise : exit(1)
81
-
82
- rescue Exception => e
83
- if e.is_a?(PlainInformative) || ENV['COCOA_PODS_ENV'] == 'development' # also catches Informative
84
- puts e.message
85
- puts *e.backtrace if Config.instance.verbose? || ENV['COCOA_PODS_ENV'] == 'development'
86
- else
87
- puts ErrorReport.report(e)
88
- end
89
- exit 1
27
+ command
90
28
  end
91
29
 
92
- def self.parse(*argv)
93
- argv = ARGV.new(argv)
94
- if argv.option('--version')
30
+ def self.run(argv)
31
+ argv = CLAide::ARGV.new(argv)
32
+ if argv.flag?('version')
95
33
  puts VERSION
96
34
  exit!(0)
97
35
  end
36
+ super(argv)
37
+ UI.print_warnings
38
+ end
98
39
 
99
- show_help = argv.option('--help')
100
- Config.instance.silent = argv.option('--silent')
101
- Config.instance.verbose = argv.option('--verbose')
102
-
103
- String.send(:define_method, :colorize) { |string , _| string } if argv.option( '--no-color' )
104
-
105
- command_class = case command_argument = argv.shift_argument
106
- when 'install' then Install
107
- when 'list' then List
108
- when 'outdated' then Outdated
109
- when 'push' then Push
110
- when 'repo' then Repo
111
- when 'search' then Search
112
- when 'setup' then Setup
113
- when 'spec' then Spec
114
- when 'update' then Update
115
- end
116
-
117
- if command_class.nil?
118
- raise Help.new(self, argv, command_argument)
119
- elsif show_help
120
- raise Help.new(command_class, argv)
40
+ def self.report_error(error)
41
+ if error.is_a?(Interrupt)
42
+ puts "[!] Cancelled".red
43
+ Config.instance.verbose? ? raise : exit(1)
121
44
  else
122
- command_class.new(argv)
45
+ puts UI::ErrorReport.report(error)
46
+ exit 1
123
47
  end
124
48
  end
125
49
 
126
- include Config::Mixin
127
-
50
+ # @todo If a command is run inside another one some settings which where
51
+ # true might return false.
52
+ #
53
+ # @todo We should probably not even load colored unless needed.
54
+ #
128
55
  def initialize(argv)
129
- raise Help.new(self.class, argv)
56
+ config.silent = argv.flag?('silent', config.silent)
57
+ config.verbose = argv.flag?('verbose', config.verbose?)
58
+ String.send(:define_method, :colorize) { |string , _| string } unless self.colorize_output?
59
+ super
130
60
  end
131
61
 
62
+ #-------------------------------------------------------------------------#
63
+
64
+ include Config::Mixin
65
+
132
66
  private
133
67
 
68
+ # Checks that the podfile exists.
69
+ #
70
+ # @raise If the podfile does not exists.
71
+ #
72
+ # @return [void]
73
+ #
134
74
  def verify_podfile_exists!
135
75
  unless config.podfile
136
76
  raise Informative, "No `Podfile' found in the current working directory."
137
77
  end
138
78
  end
139
79
 
80
+ # Checks that the lockfile exists.
81
+ #
82
+ # @raise If the lockfile does not exists.
83
+ #
84
+ # @return [void]
85
+ #
140
86
  def verify_lockfile_exists!
141
87
  unless config.lockfile
142
88
  raise Informative, "No `Podfile.lock' found in the current working directory, run `pod install'."
@@ -145,3 +91,12 @@ module Pod
145
91
  end
146
92
  end
147
93
 
94
+ require 'cocoapods/command/list'
95
+ require 'cocoapods/command/outdated'
96
+ require 'cocoapods/command/project'
97
+ require 'cocoapods/command/push'
98
+ require 'cocoapods/command/repo'
99
+ require 'cocoapods/command/search'
100
+ require 'cocoapods/command/setup'
101
+ require 'cocoapods/command/spec'
102
+ require 'cocoapods/command/inter_process_communication'
@@ -0,0 +1,103 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+
5
+ self.abstract_command = true
6
+ self.summary = 'Inter-process communication'
7
+
8
+ #-----------------------------------------------------------------------#
9
+
10
+ class Spec < IPC
11
+
12
+ self.summary = 'Converts a podspec to YAML.'
13
+ self.description = 'Converts a podspec to YAML and prints it to STDOUT.'
14
+ self.arguments = 'PATH'
15
+
16
+ def initialize(argv)
17
+ @path = argv.shift_argument
18
+ super
19
+ end
20
+
21
+ def validate!
22
+ super
23
+ help! "A specification path is required." unless @path
24
+ end
25
+
26
+ def run
27
+ spec = Specification.from_file(@path)
28
+ UI.puts spec.to_yaml
29
+ end
30
+
31
+ end
32
+
33
+ #-----------------------------------------------------------------------#
34
+
35
+ class Podfile < IPC
36
+
37
+ self.summary = 'Converts a Podfile to YAML.'
38
+ self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
39
+ self.arguments = 'PATH'
40
+
41
+ def initialize(argv)
42
+ @path = argv.shift_argument
43
+ super
44
+ end
45
+
46
+ def validate!
47
+ super
48
+ help! "A Podfile path is required." unless @path
49
+ end
50
+
51
+ def run
52
+ podfile = Pod::Podfile.from_file(@path)
53
+ UI.puts podfile.to_yaml
54
+ end
55
+
56
+ end
57
+
58
+ #-----------------------------------------------------------------------#
59
+
60
+ class List < IPC
61
+
62
+ self.summary = 'Lists the specifications know to CocoaPods.'
63
+ self.description = <<-DESC
64
+ Prints to STDOUT a YAML dictionary where the keys are the name of the
65
+ specifications and the values are a dictionary with the following
66
+ keys.
67
+
68
+ - defined_in_file
69
+ - version
70
+ - authors
71
+ - summary
72
+ - description
73
+ - platforms
74
+ DESC
75
+
76
+ def run
77
+ sets = SourcesManager.all_sets
78
+ result = {}
79
+ sets.each do |set|
80
+ begin
81
+ spec = set.specification
82
+ result[spec.name] = {
83
+ 'defined_in_file' => spec.defined_in_file.to_s,
84
+ 'version' => spec.version,
85
+ 'authors' => spec.authors,
86
+ 'summary' => spec.summary,
87
+ 'description' => spec.description,
88
+ 'platforms' => spec.available_platforms.map { |p| p.name.to_s },
89
+ }
90
+ rescue DSLError
91
+ next
92
+ end
93
+ end
94
+ UI.puts result.to_yaml
95
+ end
96
+
97
+ end
98
+
99
+ #-----------------------------------------------------------------------#
100
+
101
+ end
102
+ end
103
+ end