cocoapods-stats 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +4 -22
- data/CHANGELOG.md +12 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +53 -44
- data/lib/cocoapods_plugin.rb +39 -16
- data/lib/cocoapods_stats/gem_version.rb +1 -1
- data/spec/stats_spec.rb +36 -0
- metadata +15 -14
- data/LICENSE +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 149410bded61b9f1f88f7ba24387023e9e090e951ba761d59a251f949d7ec2f5
|
4
|
+
data.tar.gz: 04df8e5d403c346fc6f5f1090a4d8f6160dc30edb96f43f817c0a173d43bb2fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7fb50bbfd822168359948a0d1e3504cb955aedb982a1817e6a69bbf21b2535e23609d7a3456a73644790768404e0339196c38fb8e5fedb9a19b52be82e5faf
|
7
|
+
data.tar.gz: bf3d66a0fb97e4659f68487f3c4c2d22dc79311ac1d0d68e938b44fc2d212d12d643702d1e5525b0c773b5800e7652e3b2a0c267417b53b60d0fdf5bc3d6c1a8
|
data/.travis.yml
CHANGED
@@ -1,26 +1,8 @@
|
|
1
|
-
# Sets Travis to run the Ruby specs on OS X machines to be as close as possible
|
2
|
-
# to the user environment.
|
3
|
-
#
|
4
|
-
language: objective-c
|
5
|
-
|
6
|
-
branches:
|
7
|
-
only:
|
8
|
-
- master
|
9
|
-
|
10
1
|
cache: bundler
|
11
2
|
rvm:
|
12
|
-
#
|
13
|
-
-
|
14
|
-
|
15
|
-
- 2.
|
16
|
-
# OS X 10.9.0-10.9.2
|
17
|
-
# TODO currently unavailable: https://github.com/travis-ci/travis-ci/issues/2918
|
18
|
-
# - 2.0.0-p247
|
19
|
-
- 2.1
|
20
|
-
|
21
|
-
before_install:
|
22
|
-
# There is a bug in travis. When using system ruby, bundler is not installed
|
23
|
-
# and causes the default install action to fail.
|
24
|
-
- sudo gem install bundler
|
3
|
+
# Same rubies as CP
|
4
|
+
- 2.0.0-p647
|
5
|
+
- 2.3.4
|
6
|
+
- 2.4.1
|
25
7
|
|
26
8
|
script: bundle exec rake spec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CocoaPods Stats CHANGELOG
|
2
2
|
|
3
|
+
## 1.1.0 (2019-01-24)
|
4
|
+
|
5
|
+
##### Enhancements
|
6
|
+
|
7
|
+
* Networking requests are sent on a forked process.
|
8
|
+
[Eric Amorde](https://github.com/amorde)
|
9
|
+
|
10
|
+
##### Bug Fixes
|
11
|
+
|
12
|
+
* None.
|
13
|
+
|
14
|
+
|
3
15
|
## 1.0.0 (2016-05-10)
|
4
16
|
|
5
17
|
##### Enhancements
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,65 +1,71 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocoapods-stats (1.
|
4
|
+
cocoapods-stats (1.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
9
|
+
CFPropertyList (3.0.0)
|
10
|
+
activesupport (4.2.11)
|
10
11
|
i18n (~> 0.7)
|
11
|
-
json (~> 1.7, >= 1.7.7)
|
12
12
|
minitest (~> 5.1)
|
13
13
|
thread_safe (~> 0.3, >= 0.3.4)
|
14
14
|
tzinfo (~> 1.1)
|
15
15
|
ast (2.2.0)
|
16
|
+
atomos (0.1.3)
|
16
17
|
bacon (1.2.0)
|
17
|
-
claide (1.0.
|
18
|
-
cocoapods (1.
|
19
|
-
activesupport (>= 4.0.2)
|
20
|
-
claide (>= 1.0.
|
21
|
-
cocoapods-core (= 1.
|
22
|
-
cocoapods-deintegrate (>= 1.0.
|
23
|
-
cocoapods-downloader (>= 1.
|
24
|
-
cocoapods-plugins (>= 1.0.0
|
25
|
-
cocoapods-search (>= 1.0.0
|
26
|
-
cocoapods-stats (
|
27
|
-
cocoapods-trunk (>= 1.
|
28
|
-
cocoapods-try (>= 1.
|
29
|
-
|
18
|
+
claide (1.0.2)
|
19
|
+
cocoapods (1.5.3)
|
20
|
+
activesupport (>= 4.0.2, < 5)
|
21
|
+
claide (>= 1.0.2, < 2.0)
|
22
|
+
cocoapods-core (= 1.5.3)
|
23
|
+
cocoapods-deintegrate (>= 1.0.2, < 2.0)
|
24
|
+
cocoapods-downloader (>= 1.2.0, < 2.0)
|
25
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
26
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
27
|
+
cocoapods-stats (>= 1.0.0, < 2.0)
|
28
|
+
cocoapods-trunk (>= 1.3.0, < 2.0)
|
29
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
30
|
+
colored2 (~> 3.1)
|
30
31
|
escape (~> 0.0.4)
|
31
|
-
fourflusher (~> 0.
|
32
|
-
|
32
|
+
fourflusher (~> 2.0.1)
|
33
|
+
gh_inspector (~> 1.0)
|
34
|
+
molinillo (~> 0.6.5)
|
33
35
|
nap (~> 1.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
ruby-macho (~> 1.1)
|
37
|
+
xcodeproj (>= 1.5.7, < 2.0)
|
38
|
+
cocoapods-core (1.5.3)
|
39
|
+
activesupport (>= 4.0.2, < 6)
|
37
40
|
fuzzy_match (~> 2.0.4)
|
38
41
|
nap (~> 1.0)
|
39
|
-
cocoapods-deintegrate (1.0.
|
40
|
-
cocoapods-downloader (1.
|
41
|
-
cocoapods-plugins (1.0.0
|
42
|
+
cocoapods-deintegrate (1.0.2)
|
43
|
+
cocoapods-downloader (1.2.2)
|
44
|
+
cocoapods-plugins (1.0.0)
|
42
45
|
nap
|
43
|
-
cocoapods-search (1.0.0
|
44
|
-
cocoapods-trunk (1.
|
46
|
+
cocoapods-search (1.0.0)
|
47
|
+
cocoapods-trunk (1.3.1)
|
45
48
|
nap (>= 0.8, < 2.0)
|
46
|
-
netrc (
|
47
|
-
cocoapods-try (1.
|
48
|
-
|
49
|
+
netrc (~> 0.11)
|
50
|
+
cocoapods-try (1.1.0)
|
51
|
+
colored2 (3.1.2)
|
52
|
+
concurrent-ruby (1.1.4)
|
49
53
|
escape (0.0.4)
|
50
|
-
fourflusher (0.
|
54
|
+
fourflusher (2.0.1)
|
51
55
|
fuzzy_match (2.0.4)
|
52
|
-
|
53
|
-
|
56
|
+
gh_inspector (1.1.3)
|
57
|
+
i18n (0.9.5)
|
58
|
+
concurrent-ruby (~> 1.0)
|
54
59
|
metaclass (0.0.4)
|
55
|
-
minitest (5.
|
60
|
+
minitest (5.11.3)
|
56
61
|
mocha (1.1.0)
|
57
62
|
metaclass (~> 0.0.1)
|
58
63
|
mocha-on-bacon (0.2.2)
|
59
64
|
mocha (>= 0.13.0)
|
60
|
-
molinillo (0.
|
61
|
-
|
62
|
-
|
65
|
+
molinillo (0.6.6)
|
66
|
+
nanaimo (0.2.6)
|
67
|
+
nap (1.1.0)
|
68
|
+
netrc (0.11.0)
|
63
69
|
parser (2.3.0.7)
|
64
70
|
ast (~> 2.2)
|
65
71
|
powerpack (0.1.1)
|
@@ -73,15 +79,18 @@ GEM
|
|
73
79
|
rainbow (>= 1.99.1, < 3.0)
|
74
80
|
ruby-progressbar (~> 1.7)
|
75
81
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
82
|
+
ruby-macho (1.3.1)
|
76
83
|
ruby-progressbar (1.7.5)
|
77
|
-
thread_safe (0.3.
|
78
|
-
tzinfo (1.2.
|
84
|
+
thread_safe (0.3.6)
|
85
|
+
tzinfo (1.2.5)
|
79
86
|
thread_safe (~> 0.1)
|
80
87
|
unicode-display_width (1.0.3)
|
81
|
-
xcodeproj (1.
|
82
|
-
|
83
|
-
|
84
|
-
|
88
|
+
xcodeproj (1.7.0)
|
89
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
90
|
+
atomos (~> 0.1.3)
|
91
|
+
claide (>= 1.0.2, < 2.0)
|
92
|
+
colored2 (~> 3.1)
|
93
|
+
nanaimo (~> 0.2.6)
|
85
94
|
|
86
95
|
PLATFORMS
|
87
96
|
ruby
|
@@ -89,7 +98,7 @@ PLATFORMS
|
|
89
98
|
DEPENDENCIES
|
90
99
|
bacon
|
91
100
|
bundler (~> 1.3)
|
92
|
-
cocoapods (>= 0.
|
101
|
+
cocoapods (>= 1.0.0)
|
93
102
|
cocoapods-stats!
|
94
103
|
mocha-on-bacon
|
95
104
|
prettybacon
|
@@ -97,4 +106,4 @@ DEPENDENCIES
|
|
97
106
|
rubocop
|
98
107
|
|
99
108
|
BUNDLED WITH
|
100
|
-
1.
|
109
|
+
1.16.3
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -11,25 +11,24 @@ module CocoaPodsStats
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
class Stats
|
15
|
+
def send_stats(master_source, context)
|
16
|
+
if fork_available?
|
17
|
+
Process.fork do
|
18
|
+
compute_and_send_stats(master_source, context)
|
19
|
+
end
|
20
|
+
else
|
21
|
+
compute_and_send_stats(master_source, context)
|
22
|
+
end
|
23
|
+
end
|
19
24
|
|
20
|
-
|
21
|
-
|
25
|
+
def fork_available?
|
26
|
+
!Gem.win_platform?
|
27
|
+
end
|
22
28
|
|
23
|
-
|
24
|
-
Pod::SourcesManager
|
25
|
-
else
|
26
|
-
Pod::Config.instance.sources_manager
|
27
|
-
end
|
28
|
-
master_source = sources_manager.master.first
|
29
|
-
validator = SpecsRepoValidator.new
|
30
|
-
next unless validator.validates?(master_source)
|
29
|
+
private
|
31
30
|
|
32
|
-
|
31
|
+
def compute_and_send_stats(master_source, context)
|
33
32
|
master_pods = Set.new(master_source.pods)
|
34
33
|
|
35
34
|
mapper = TargetMapper.new
|
@@ -48,4 +47,28 @@ module CocoaPodsStats
|
|
48
47
|
Sender.new.send(targets, :pod_try => is_pod_try)
|
49
48
|
end
|
50
49
|
end
|
50
|
+
|
51
|
+
Pod::HooksManager.register('cocoapods-stats', :post_install) do |context, _|
|
52
|
+
require 'set'
|
53
|
+
require 'cocoapods'
|
54
|
+
require 'cocoapods_stats/target_mapper'
|
55
|
+
require 'cocoapods_stats/sender'
|
56
|
+
|
57
|
+
validator = OptOutValidator.new
|
58
|
+
next unless validator.validates?
|
59
|
+
|
60
|
+
sources_manager = if defined?(Pod::SourcesManager)
|
61
|
+
Pod::SourcesManager
|
62
|
+
else
|
63
|
+
Pod::Config.instance.sources_manager
|
64
|
+
end
|
65
|
+
master_source = sources_manager.master.first
|
66
|
+
validator = SpecsRepoValidator.new
|
67
|
+
next unless validator.validates?(master_source)
|
68
|
+
|
69
|
+
Pod::UI.titled_section 'Sending stats' do
|
70
|
+
stats = Stats.new
|
71
|
+
stats.send_stats(master_source, context)
|
72
|
+
end
|
73
|
+
end
|
51
74
|
end
|
data/spec/stats_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
describe Stats = CocoaPodsStats::Stats do
|
5
|
+
describe 'in general' do
|
6
|
+
before do
|
7
|
+
@stats = Stats.new
|
8
|
+
end
|
9
|
+
|
10
|
+
describe 'fork_available?' do
|
11
|
+
it 'returns false on Windows' do
|
12
|
+
Gem.stubs(:win_platform?).returns(true)
|
13
|
+
@stats.fork_available?.should.be.false
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns true on non-Windows platforms' do
|
17
|
+
Gem.stubs(:win_platform?).returns(false)
|
18
|
+
@stats.fork_available?.should.be.true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'does not fork unless available' do
|
23
|
+
@stats.stubs(:fork_available?).returns(false)
|
24
|
+
@stats.expects(:compute_and_send_stats).once
|
25
|
+
Process.expects(:fork).never
|
26
|
+
@stats.send_stats(nil, nil)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'forks if available' do
|
30
|
+
@stats.stubs(:fork_available?).returns(true)
|
31
|
+
@stats.stubs(:compute_and_send_stats)
|
32
|
+
Process.expects(:fork).once
|
33
|
+
@stats.send_stats(nil, nil)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,34 +9,34 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.3'
|
21
21
|
type: :development
|
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: '1.3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - ~>
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '10.0'
|
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: '10.0'
|
42
42
|
description: Uploads statistics for Pod Analytics.
|
@@ -47,14 +47,13 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- .gitignore
|
51
|
-
- .rubocop.yml
|
52
|
-
- .rubocop_cocoapods.yml
|
53
|
-
- .travis.yml
|
50
|
+
- ".gitignore"
|
51
|
+
- ".rubocop.yml"
|
52
|
+
- ".rubocop_cocoapods.yml"
|
53
|
+
- ".travis.yml"
|
54
54
|
- CHANGELOG.md
|
55
55
|
- Gemfile
|
56
56
|
- Gemfile.lock
|
57
|
-
- LICENSE
|
58
57
|
- LICENSE.txt
|
59
58
|
- README.md
|
60
59
|
- Rakefile
|
@@ -66,6 +65,7 @@ files:
|
|
66
65
|
- lib/cocoapods_stats/target_mapper.rb
|
67
66
|
- spec/env_validator_spec.rb
|
68
67
|
- spec/spec_helper.rb
|
68
|
+
- spec/stats_spec.rb
|
69
69
|
- spec/target_mapper_spec.rb
|
70
70
|
- spec/validator_spec.rb
|
71
71
|
homepage: https://github.com/cocoapods/cocoapods-stats
|
@@ -78,17 +78,17 @@ require_paths:
|
|
78
78
|
- lib
|
79
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.6
|
91
|
+
rubygems_version: 2.7.6
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Uploads installation version data to stats.cocoapods.org to provide per-Pod
|
@@ -96,5 +96,6 @@ summary: Uploads installation version data to stats.cocoapods.org to provide per
|
|
96
96
|
test_files:
|
97
97
|
- spec/env_validator_spec.rb
|
98
98
|
- spec/spec_helper.rb
|
99
|
+
- spec/stats_spec.rb
|
99
100
|
- spec/target_mapper_spec.rb
|
100
101
|
- spec/validator_spec.rb
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
22
|
-
|