cocoapods-plugins 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14678243474a173cc4c9714549f27d03e104a38f
4
- data.tar.gz: e5b77591185cfdd7816e7d2ada26c4853eab0b22
3
+ metadata.gz: e0818eab56cf8665d080a84433c07b08ddcb3974
4
+ data.tar.gz: 9f30417b4e31325d7af758da615e536ecf19486d
5
5
  SHA512:
6
- metadata.gz: a6aae3e33f18279b9a3185582774f00786f58fb1897867d0163b697f2cfd25f020854ba3ad6a1d190b210ad1547c527cda05c0d5f49155b5bdcbca9b1337d595
7
- data.tar.gz: deba725d9f094770bc90b6bbdfefedc0231cd736257e3e71ce903745a3da5ca23edaee4f0e6234359380985825fe470e0541f367b1cfa6b45150d05ee0ecbe44
6
+ metadata.gz: e24a012f47bfb958633a3b8dc71dcc0538f2f5181867986f3b259bbd10ae5e2f6a3ff09644f59df8429d9512d18bc23024697acefc19e5e430536f02b39695a8
7
+ data.tar.gz: 88d4422953d603c7dc70a63be4c24cbf0c64c436509cf224f6300912a9959d130c798b91b60011fb789c20a1f815f7c13b0a2226d13392e5d43987ce6873481f
@@ -58,6 +58,11 @@ Next:
58
58
  Metrics/ClassLength:
59
59
  Enabled: false
60
60
 
61
+ # Arbitrary max lengths for methods simply do not work and enabling this will
62
+ # lead to a never ending stream of annoyance and changes.
63
+ Metrics/MethodLength:
64
+ Enabled: false
65
+
61
66
  # No enforced convention here.
62
67
  Metrics/BlockNesting:
63
68
  Enabled: false
@@ -1,5 +1,10 @@
1
1
  # Cocoapods::Plugins Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ * Added the `pod plugins installed` subcommand.
6
+ [Olivier Halligon](https://github.com/AliSoftware)
7
+
3
8
  ## 0.4.0
4
9
 
5
10
  * Added the `pod plugins publish` subcommand.
@@ -1,36 +1,36 @@
1
1
  GIT
2
2
  remote: https://github.com/CocoaPods/CLAide.git
3
- revision: 9e8b9072fd66f69b91999cd3838a4bbba043a7e5
3
+ revision: 4cb13d48a907d8acf8d398f1104843df029def6d
4
4
  branch: master
5
5
  specs:
6
- claide (0.8.0)
6
+ claide (0.8.1)
7
7
 
8
8
  GIT
9
9
  remote: https://github.com/CocoaPods/CocoaPods.git
10
- revision: e64a60a621920aca53f57b70dfc0c4f6f2638a6f
10
+ revision: 0c5a0f0d264922a63f0a30f554c41cf2aa7bd43b
11
11
  branch: master
12
12
  specs:
13
- cocoapods (0.35.0)
13
+ cocoapods (0.36.0.beta.2)
14
14
  activesupport (>= 3.2.15)
15
- claide (~> 0.8.0)
16
- cocoapods-core (= 0.35.0)
17
- cocoapods-downloader (~> 0.8.0)
15
+ claide (~> 0.8.1)
16
+ cocoapods-core (= 0.36.0.beta.2)
17
+ cocoapods-downloader (~> 0.8.1)
18
18
  cocoapods-plugins (~> 0.4.0)
19
19
  cocoapods-trunk (~> 0.5.0)
20
20
  cocoapods-try (~> 0.4.3)
21
21
  colored (~> 1.2)
22
22
  escape (~> 0.0.4)
23
- molinillo (~> 0.2.0)
23
+ molinillo (~> 0.2.1)
24
24
  nap (~> 0.8)
25
25
  open4 (~> 1.3)
26
- xcodeproj (~> 0.21.0)
26
+ xcodeproj (~> 0.22.0)
27
27
 
28
28
  GIT
29
29
  remote: https://github.com/CocoaPods/Core.git
30
- revision: 7d2b3c0cba15d4c62639c5b390df306a30cc1d40
30
+ revision: ecb22ed9f829b0345e14c08da5294ee4078dfdbb
31
31
  branch: master
32
32
  specs:
33
- cocoapods-core (0.35.0)
33
+ cocoapods-core (0.36.0.beta.2)
34
34
  activesupport (>= 3.2.15)
35
35
  fuzzy_match (~> 2.0.4)
36
36
  nap (~> 0.8.0)
@@ -38,7 +38,7 @@ GIT
38
38
  PATH
39
39
  remote: .
40
40
  specs:
41
- cocoapods-plugins (0.4.0)
41
+ cocoapods-plugins (0.4.1)
42
42
  nap
43
43
 
44
44
  GEM
@@ -50,12 +50,12 @@ GEM
50
50
  minitest (~> 5.1)
51
51
  thread_safe (~> 0.3, >= 0.3.4)
52
52
  tzinfo (~> 1.1)
53
- addressable (2.3.6)
53
+ addressable (2.3.7)
54
54
  ast (2.0.0)
55
55
  astrolabe (1.3.0)
56
56
  parser (>= 2.2.0.pre.3, < 3.0)
57
57
  bacon (1.2.0)
58
- cocoapods-downloader (0.8.0)
58
+ cocoapods-downloader (0.8.1)
59
59
  cocoapods-trunk (0.5.0)
60
60
  nap (>= 0.8)
61
61
  netrc (= 0.7.8)
@@ -69,14 +69,14 @@ GEM
69
69
  escape (0.0.4)
70
70
  fuzzy_match (2.0.4)
71
71
  i18n (0.7.0)
72
- json (1.8.1)
72
+ json (1.8.2)
73
73
  metaclass (0.0.4)
74
- minitest (5.5.0)
74
+ minitest (5.5.1)
75
75
  mocha (1.1.0)
76
76
  metaclass (~> 0.0.1)
77
77
  mocha-on-bacon (0.2.2)
78
78
  mocha (>= 0.13.0)
79
- molinillo (0.2.0)
79
+ molinillo (0.2.1)
80
80
  multi_json (1.10.1)
81
81
  nap (0.8.0)
82
82
  netrc (0.7.8)
@@ -96,7 +96,7 @@ GEM
96
96
  rainbow (>= 1.99.1, < 3.0)
97
97
  ruby-progressbar (~> 1.4)
98
98
  ruby-progressbar (1.7.0)
99
- safe_yaml (1.0.3)
99
+ safe_yaml (1.0.4)
100
100
  simplecov (0.9.0)
101
101
  docile (~> 1.1.0)
102
102
  multi_json
@@ -107,10 +107,10 @@ GEM
107
107
  tzinfo (1.2.2)
108
108
  thread_safe (~> 0.1)
109
109
  vcr (2.9.3)
110
- webmock (1.18.0)
110
+ webmock (1.20.4)
111
111
  addressable (>= 2.3.6)
112
112
  crack (>= 0.3.2)
113
- xcodeproj (0.21.0)
113
+ xcodeproj (0.22.0)
114
114
  activesupport (>= 3)
115
115
  colored (~> 1.2)
116
116
 
data/README.md CHANGED
@@ -12,28 +12,33 @@ CocoaPods plugin which shows info about available CocoaPods plugins or helps you
12
12
 
13
13
  ## Usage
14
14
 
15
- #####List plugins
15
+ ##### List installed plugins
16
16
 
17
- $ pod plugins
17
+ $ pod plugins installed
18
18
 
19
- List all known plugins (according to the list hosted on github.com/CocoaPods/cocoapods-plugins)
19
+ List all installed CocoaPods plugins with their respective version (and pre_install/post_insall hooks if any)
20
20
 
21
- #####Search plugins
21
+ ##### List known plugins
22
+
23
+ $ pod plugins list
24
+
25
+ List all known CocoaPods plugins (according to the list hosted on `http://github.com/CocoaPods/cocoapods-plugins`)
26
+
27
+ ##### Search plugins
22
28
 
23
29
  $ pod plugins search QUERY
24
30
 
25
- Searches plugins whose name contains the given text (ignoring case). With --full, it searches by name but also by author and description.
31
+ Search plugins whose name contains the given text (ignoring case). With --full, it searches by name but also by author and description.
26
32
 
27
- #####Create a new plugin
33
+ ##### Create a new plugin
28
34
 
29
35
  $ pod plugins create NAME [TEMPLATE_URL]
30
36
 
31
- Creates a scaffold for the development of a new plugin according to the CocoaPods best practices.
37
+ Create a scaffold for the development of a new plugin according to the CocoaPods best practices.
32
38
  If a `TEMPLATE_URL`, pointing to a git repo containing a compatible template, is specified, it will be used in place of the default one.
33
39
 
34
40
  ## Get your plugin listed
35
41
 
36
- The list of plugins is in the cocoapods-plugins repository at [https://github.com/CocoaPods/cocoapods-plugins/blob/master/plugins.json](https://github.com/CocoaPods/cocoapods-plugins/blob/master/plugins.json).
37
-
38
- To have your plugin listed, submit a pull request that adds your plugin details.
42
+ $ pod plugins publish
39
43
 
44
+ Create an issue in the `cocoapods-plugins` GitHub repository to ask for your plugin to be added to the official list (with the proper JSON fragment to be added to `plugins.json` so we just have to copy/paste it).
@@ -2,5 +2,5 @@
2
2
  # The namespace of the Cocoapods plugins plugin.
3
3
  #
4
4
  module CocoapodsPlugins
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.1'
6
6
  end
@@ -12,6 +12,7 @@ module Pod
12
12
  require 'pod/command/plugins/search'
13
13
  require 'pod/command/plugins/create'
14
14
  require 'pod/command/plugins/publish'
15
+ require 'pod/command/plugins/installed'
15
16
 
16
17
  self.abstract_command = true
17
18
  self.default_subcommand = 'list'
@@ -0,0 +1,92 @@
1
+
2
+ module Pod
3
+ class Command
4
+ class Plugins
5
+ # The `installed` subcommand.
6
+ # Used to list all installed plugins.
7
+ #
8
+ class Installed < Plugins
9
+ self.summary = 'List plugins installed on your machine'
10
+ self.description = <<-DESC
11
+ List all installed plugins and their
12
+ respective version.
13
+ DESC
14
+
15
+ def self.options
16
+ # Silent mode is meaningless for this command as
17
+ # the command only purpose is to print information
18
+ super.reject { |option, _| option == '--silent' }
19
+ end
20
+
21
+ def run
22
+ plugins = CLAide::Command::PluginManager.specifications
23
+
24
+ UI.title 'Installed CocoaPods Plugins:' do
25
+ if verbose?
26
+ print_verbose_list(plugins)
27
+ else
28
+ print_compact_list(plugins)
29
+ end
30
+ end
31
+ end
32
+
33
+ private
34
+
35
+ # Print the given plugins as a compact list, one line
36
+ # per plugin with only its name & version
37
+ #
38
+ # @param [Array<Gem::Specification>] plugins
39
+ # The list of plugins to print
40
+ #
41
+ def print_compact_list(plugins)
42
+ max_length = plugins.map { |p| p.name.length }.max
43
+ plugins.each do |plugin|
44
+ name_just = plugin.name.ljust(max_length)
45
+ hooks = registered_hooks(plugin)
46
+ hooks_list = ''
47
+ unless hooks.empty?
48
+ suffix = 'hook'.pluralize(hooks.count)
49
+ hooks_list = " (#{hooks.to_sentence} #{suffix})"
50
+ end
51
+ UI.puts_indented " - #{name_just} : #{plugin.version}#{hooks_list}"
52
+ end
53
+ end
54
+
55
+ # Print the given plugins as a verbose list, with name, version,
56
+ # homepage and summary for each plugin.
57
+ #
58
+ # @param [Array<Gem::Specification>] plugins
59
+ # The list of plugins to print
60
+ #
61
+ def print_verbose_list(plugins)
62
+ plugins.each do |plugin|
63
+ hooks = registered_hooks(plugin)
64
+
65
+ UI.title(plugin.name)
66
+ UI.labeled('Version', plugin.version.to_s)
67
+ UI.labeled('Hooks', hooks) unless hooks.empty?
68
+ unless plugin.homepage.empty?
69
+ UI.labeled('Homepage', plugin.homepage)
70
+ end
71
+ UI.labeled('Summary', plugin.summary)
72
+ end
73
+ end
74
+
75
+ # Names of the registered hook(s) (if any) for the given plugin
76
+ #
77
+ # @return [Array<String>]
78
+ # Names of the hooks the given plugin did register for.
79
+ #
80
+ def registered_hooks(plugin)
81
+ registrations = Pod::HooksManager.registrations
82
+ return [] if registrations.nil?
83
+
84
+ registrations.reduce([]) do |list, (name, hooks)|
85
+ list.push(name) if hooks.any? { |h| h.plugin_name == plugin.name }
86
+ list
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -1,5 +1,5 @@
1
1
  require 'json'
2
- require 'CGI'
2
+ require 'cgi'
3
3
 
4
4
  module Pod
5
5
  class Command
@@ -144,6 +144,14 @@
144
144
  "author":"Kyle Fuller, Boris Bügling",
145
145
  "url":"https://github.com/CocoaPods/cocoapods-packager",
146
146
  "description":"Generate a framework or static library from a podspec."
147
+ },
148
+ {
149
+ "gem":"cocoapods-links",
150
+ "name":"CocoaPods Links",
151
+ "author":"Mike Owens",
152
+ "social_media_url":"https://twitter.com/mikejowens",
153
+ "url":"https://github.com/mowens/cocoapods-links",
154
+ "description":"A CocoaPods plugin to manage local development pods"
147
155
  }
148
156
  ]
149
157
  }
@@ -0,0 +1,142 @@
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
+
3
+ # The CocoaPods namespace
4
+ #
5
+ module Pod
6
+ describe Command::Plugins::Installed do
7
+ extend SpecHelper::PluginsStubs
8
+
9
+ def stub_plugins(plugins_and_hooks)
10
+ specs = []
11
+ registrations = {}
12
+ plugins_and_hooks.each do |(plugin_name, hooks)|
13
+ # Load Plugin GemSpec
14
+ fixture_path = fixture("#{plugin_name}.gemspec")
15
+ specs.push Gem::Specification.load(fixture_path.to_s)
16
+ # Fill hook registrations hash
17
+ Array(hooks).each do |hook_name|
18
+ registrations[hook_name] ||= []
19
+ hook = Pod::HooksManager::Hook.new(hook_name, plugin_name, {})
20
+ registrations[hook_name] << hook
21
+ end
22
+ end
23
+
24
+ Pod::HooksManager.stubs(:registrations).returns(registrations)
25
+ CLAide::Command::PluginManager.stubs(:specifications).returns(specs)
26
+ end
27
+
28
+ before do
29
+ UI.output = ''
30
+ end
31
+
32
+ it 'registers itself' do
33
+ Command.parse(%w(plugins installed)).
34
+ should.be.instance_of Command::Plugins::Installed
35
+ end
36
+
37
+ #--- Output printing
38
+
39
+ describe 'Compact List' do
40
+
41
+ before do
42
+ @command = Pod::Command::Plugins::Installed.new CLAide::ARGV.new([])
43
+ end
44
+
45
+ it 'no hooks' do
46
+ stub_plugins('cocoapods-foo1' => nil, 'cocoapods-foo2' => nil)
47
+
48
+ @command.run
49
+ UI.output.should.include(' - cocoapods-foo1 : 2.0.1')
50
+ UI.output.should.include(' - cocoapods-foo2 : 2.0.2')
51
+ UI.output.should.not.include('pre_install')
52
+ UI.output.should.not.include('post_install')
53
+ end
54
+
55
+ it 'one hook' do
56
+ stub_plugins(
57
+ 'cocoapods-foo1' => :pre_install,
58
+ 'cocoapods-foo2' => :post_install,
59
+ )
60
+
61
+ @command.run
62
+ UI.output.should.include(' - cocoapods-foo1 : 2.0.1 ' \
63
+ '(pre_install hook)')
64
+ UI.output.should.include(' - cocoapods-foo2 : 2.0.2 ' \
65
+ '(post_install hook)')
66
+ end
67
+
68
+ it 'two hooks' do
69
+ stub_plugins('cocoapods-foo1' => [:pre_install, :post_install])
70
+
71
+ @command.run
72
+ UI.output.should.include(' - cocoapods-foo1 : 2.0.1 ' \
73
+ '(pre_install and post_install hooks)')
74
+ end
75
+ end
76
+
77
+ describe 'Verbose List' do
78
+
79
+ before do
80
+ verbose_args = CLAide::ARGV.new(['--verbose'])
81
+ @command = Pod::Command::Plugins::Installed.new verbose_args
82
+ end
83
+
84
+ it 'no hooks' do
85
+ stub_plugins('cocoapods-foo1' => nil, 'cocoapods-foo2' => nil)
86
+
87
+ @command.run
88
+
89
+ UI.output.should.include <<FOO1
90
+ cocoapods-foo1\e[0m
91
+ - Version: 2.0.1
92
+ - Homepage: https://github.com/proper-man/cocoapods-foo1
93
+ - Summary: Gem Summary 1
94
+ FOO1
95
+ UI.output.should.include <<FOO2
96
+ cocoapods-foo2\e[0m
97
+ - Version: 2.0.2
98
+ - Homepage: https://github.com/proper-man/cocoapods-foo2
99
+ FOO2
100
+ end
101
+
102
+ it 'one hook' do
103
+ stub_plugins(
104
+ 'cocoapods-foo1' => :pre_install,
105
+ 'cocoapods-foo2' => :post_install,
106
+ )
107
+
108
+ @command.run
109
+ UI.output.should.include <<FOO1
110
+ cocoapods-foo1\e[0m
111
+ - Version: 2.0.1
112
+ - Hooks:
113
+ - pre_install
114
+ - Homepage: https://github.com/proper-man/cocoapods-foo1
115
+ - Summary: Gem Summary 1
116
+ FOO1
117
+ UI.output.should.include <<FOO2
118
+ cocoapods-foo2\e[0m
119
+ - Version: 2.0.2
120
+ - Hooks:
121
+ - post_install
122
+ - Homepage: https://github.com/proper-man/cocoapods-foo2
123
+ FOO2
124
+ end
125
+
126
+ it 'two hooks' do
127
+ stub_plugins('cocoapods-foo1' => [:pre_install, :post_install])
128
+
129
+ @command.run
130
+ UI.output.should.include <<FOO1
131
+ cocoapods-foo1\e[0m
132
+ - Version: 2.0.1
133
+ - Hooks:
134
+ - pre_install
135
+ - post_install
136
+ - Homepage: https://github.com/proper-man/cocoapods-foo1
137
+ - Summary: Gem Summary 1
138
+ FOO1
139
+ end
140
+ end
141
+ end
142
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Grandinetti
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-25 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nap
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.3'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.3'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  description: |2
@@ -63,10 +63,10 @@ executables: []
63
63
  extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
- - .gitignore
67
- - .rubocop.yml
68
- - .rubocop_cocoapods.yml
69
- - .travis.yml
66
+ - ".gitignore"
67
+ - ".rubocop.yml"
68
+ - ".rubocop_cocoapods.yml"
69
+ - ".travis.yml"
70
70
  - CHANGELOG.md
71
71
  - Gemfile
72
72
  - Gemfile.lock
@@ -80,6 +80,7 @@ files:
80
80
  - lib/pod/command/gem_index_cache.rb
81
81
  - lib/pod/command/plugins.rb
82
82
  - lib/pod/command/plugins/create.rb
83
+ - lib/pod/command/plugins/installed.rb
83
84
  - lib/pod/command/plugins/list.rb
84
85
  - lib/pod/command/plugins/publish.rb
85
86
  - lib/pod/command/plugins/search.rb
@@ -88,6 +89,7 @@ files:
88
89
  - spec/command/gem_helper_spec.rb
89
90
  - spec/command/gem_index_cache_spec.rb
90
91
  - spec/command/plugins/create_spec.rb
92
+ - spec/command/plugins/installed_spec.rb
91
93
  - spec/command/plugins/list_spec.rb
92
94
  - spec/command/plugins/publish_spec.rb
93
95
  - spec/command/plugins/search_spec.rb
@@ -108,17 +110,17 @@ require_paths:
108
110
  - lib
109
111
  required_ruby_version: !ruby/object:Gem::Requirement
110
112
  requirements:
111
- - - '>='
113
+ - - ">="
112
114
  - !ruby/object:Gem::Version
113
115
  version: 2.0.0
114
116
  required_rubygems_version: !ruby/object:Gem::Requirement
115
117
  requirements:
116
- - - '>='
118
+ - - ">="
117
119
  - !ruby/object:Gem::Version
118
120
  version: '0'
119
121
  requirements: []
120
122
  rubyforge_project:
121
- rubygems_version: 2.0.14
123
+ rubygems_version: 2.4.5
122
124
  signing_key:
123
125
  specification_version: 4
124
126
  summary: CocoaPods plugin which shows info about available CocoaPods plugins.
@@ -126,6 +128,7 @@ test_files:
126
128
  - spec/command/gem_helper_spec.rb
127
129
  - spec/command/gem_index_cache_spec.rb
128
130
  - spec/command/plugins/create_spec.rb
131
+ - spec/command/plugins/installed_spec.rb
129
132
  - spec/command/plugins/list_spec.rb
130
133
  - spec/command/plugins/publish_spec.rb
131
134
  - spec/command/plugins/search_spec.rb