cocoapods-stats 1.0.0 → 1.1.0

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
- SHA1:
3
- metadata.gz: acc68ec94b024048557c744a861c884d3e767e1a
4
- data.tar.gz: f5a4e32a72c69a190a78c4b9565e18dc0d11c139
2
+ SHA256:
3
+ metadata.gz: 149410bded61b9f1f88f7ba24387023e9e090e951ba761d59a251f949d7ec2f5
4
+ data.tar.gz: 04df8e5d403c346fc6f5f1090a4d8f6160dc30edb96f43f817c0a173d43bb2fc
5
5
  SHA512:
6
- metadata.gz: a8e617664135b1467bfd03670fcea759e293f36808fc3ccc62fe03c1d124b11c8858c1639cf3f68e41a4ee9054964641d82f481efbaa6fea3c7afb0a26988859
7
- data.tar.gz: 00467a9c3f2b0ba79d666a8fb6e20f5e1696a6f8a2280df3f450f8cb67c6e0fa3286167435b70a74f8cfea2f2b535adda861d12a29128c9047c27be8c4cb286d
6
+ metadata.gz: 1b7fb50bbfd822168359948a0d1e3504cb955aedb982a1817e6a69bbf21b2535e23609d7a3456a73644790768404e0339196c38fb8e5fedb9a19b52be82e5faf
7
+ data.tar.gz: bf3d66a0fb97e4659f68487f3c4c2d22dc79311ac1d0d68e938b44fc2d212d12d643702d1e5525b0c773b5800e7652e3b2a0c267417b53b60d0fdf5bc3d6c1a8
@@ -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
- # OS X 10.9.5-10.10.0 (2.0.0-p481)
13
- - system
14
- # OS X 10.9.3-10.9.4
15
- - 2.0.0-p451
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
@@ -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
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development do
7
- gem 'cocoapods', '>= 0.a'
7
+ gem 'cocoapods', '>= 1.0.0'
8
8
 
9
9
  gem 'bacon'
10
10
  gem 'prettybacon'
@@ -1,65 +1,71 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-stats (1.0.0)
4
+ cocoapods-stats (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activesupport (4.2.5)
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.0.beta.1)
18
- cocoapods (1.0.0.beta.2)
19
- activesupport (>= 4.0.2)
20
- claide (>= 1.0.0.beta.1, < 2.0)
21
- cocoapods-core (= 1.0.0.beta.2)
22
- cocoapods-deintegrate (>= 1.0.0.beta.1, < 2.0)
23
- cocoapods-downloader (>= 1.0.0.beta.1, < 2.0)
24
- cocoapods-plugins (>= 1.0.0.beta.1, < 2.0)
25
- cocoapods-search (>= 1.0.0.beta.1, < 2.0)
26
- cocoapods-stats (= 1.0.0)
27
- cocoapods-trunk (>= 1.0.0.beta.1, < 2.0)
28
- cocoapods-try (>= 1.0.0.beta.2, < 2.0)
29
- colored (~> 1.2)
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.3.0)
32
- molinillo (~> 0.4.1)
32
+ fourflusher (~> 2.0.1)
33
+ gh_inspector (~> 1.0)
34
+ molinillo (~> 0.6.5)
33
35
  nap (~> 1.0)
34
- xcodeproj (>= 1.0.0.beta.1, < 2.0)
35
- cocoapods-core (1.0.0.beta.2)
36
- activesupport (>= 4.0.2)
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.0.beta.1)
40
- cocoapods-downloader (1.0.0.beta.1)
41
- cocoapods-plugins (1.0.0.beta.1)
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.beta.1)
44
- cocoapods-trunk (1.0.0.beta.1)
46
+ cocoapods-search (1.0.0)
47
+ cocoapods-trunk (1.3.1)
45
48
  nap (>= 0.8, < 2.0)
46
- netrc (= 0.7.8)
47
- cocoapods-try (1.0.0.beta.2)
48
- colored (1.2)
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.3.0)
54
+ fourflusher (2.0.1)
51
55
  fuzzy_match (2.0.4)
52
- i18n (0.7.0)
53
- json (1.8.3)
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.8.3)
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.4.1)
61
- nap (1.0.0)
62
- netrc (0.7.8)
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.5)
78
- tzinfo (1.2.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.0.0.beta.2)
82
- activesupport (>= 3)
83
- claide (>= 1.0.0.beta.1, < 2.0)
84
- colored (~> 1.2)
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.a)
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.11.2
109
+ 1.16.3
@@ -11,25 +11,24 @@ module CocoaPodsStats
11
11
  end
12
12
  end
13
13
 
14
- Pod::HooksManager.register('cocoapods-stats', :post_install) do |context, _|
15
- require 'set'
16
- require 'cocoapods'
17
- require 'cocoapods_stats/target_mapper'
18
- require 'cocoapods_stats/sender'
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
- validator = OptOutValidator.new
21
- next unless validator.validates?
25
+ def fork_available?
26
+ !Gem.win_platform?
27
+ end
22
28
 
23
- sources_manager = if defined?(Pod::SourcesManager)
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
- Pod::UI.titled_section 'Sending stats' do
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
@@ -1,3 +1,3 @@
1
1
  module CocoapodsStats
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -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.0.0
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: 2016-05-10 00:00:00.000000000 Z
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.3
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
-