cocoapods-stats 0.5.3 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 916dc1c13da5182d79ae1b1d77220cb33ed57ed2
4
- data.tar.gz: 48980412214aa740775b0b50ff81b6a625755590
3
+ metadata.gz: 24bcdcf2ea427d3d5a77ac169243df6c79c8b059
4
+ data.tar.gz: 61ab9a5c68464a814bf1f4bf7851a41ec7e66b03
5
5
  SHA512:
6
- metadata.gz: 3c75c121cfe21d35eaf07ab28408116456463b2e4175d251d536c32e3e8ce2481004b54495ba581bda7b0ada09930daff720585307781e2a59179c932413a16e
7
- data.tar.gz: 5ea54b99f8db5ab2d88f3d4792286a380b98dc3e3a02398426c9f380335c77148a287efb5e280eb413de4b4f26a766b85dfacb73996a4063219283a0bb478f1a
6
+ metadata.gz: 05015d6c80db9ca3552b231e764d3ef5cbb7fd97537e663e956b790b59f58437ecd0a5e8b5975a0dbe3d8ce1793f4dcb35389593eb0c122a3ad6d279d925d801
7
+ data.tar.gz: dce2d9dde246b227b3d72be0a5ec20944b234d873e97332872382afc4289a2e6fcb29537c41167fb9bcb5ea9fe52d285f2e1c3b611b566e5508b29fb44304671
data/.rubocop.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  inherit_from:
2
2
  - .rubocop_cocoapods.yml
3
3
 
4
+ AllCops:
5
+ Exclude:
6
+ - ./vendor/**/*
7
+
4
8
  Metrics/LineLength:
5
9
  Max: 100
data/.travis.yml CHANGED
@@ -3,6 +3,10 @@
3
3
  #
4
4
  language: objective-c
5
5
 
6
+ branches:
7
+ only:
8
+ - master
9
+
6
10
  cache: bundler
7
11
  rvm:
8
12
  # OS X 10.9.5-10.10.0 (2.0.0-p481)
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  #CocoaPods Stats CHANGELOG
2
2
 
3
- ## 0.5.3
3
+ ## 0.6.0 (2015-08-26)
4
+
5
+ ##### Enhancements
6
+
7
+ * Send stats to the API asynchronously and out of process.
8
+ [Samuel Giddins](https://github.com/segiddins)
9
+
10
+ * Set maximum timeout of 30 seconds for asynchronous stats sending.
11
+ [Boris Bügling](https://github.com/neonichu)
12
+
13
+
14
+ ## 0.5.3 (2015-07-02)
4
15
 
5
16
  ##### Bug Fixes
6
17
 
@@ -8,14 +19,14 @@
8
19
  [Samuel Giddins](https://github.com/segiddins)
9
20
 
10
21
 
11
- ## 0.5.2
22
+ ## 0.5.2 (2015-07-01)
12
23
 
13
24
  ##### Bug Fixes
14
25
 
15
26
  * Don't raise an exception when attempting to opt out.
16
27
  [Samuel Giddins](https://github.com/segiddins)
17
28
 
18
- ## 0.5.1
29
+ ## 0.5.1 (2015-07-01)
19
30
 
20
31
  ##### Bug Fixes
21
32
 
@@ -23,7 +34,7 @@
23
34
  [Samuel Giddins](https://github.com/CocoaPods/cocoapods-stats/pull/15)
24
35
 
25
36
 
26
- ## 0.5.0
37
+ ## 0.5.0 (2015-06-24)
27
38
 
28
39
  * Initial implementation of stats uploading.
29
40
  [Orta](https://github.com/orta)
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-stats (0.5.3)
5
- nap (~> 0.8)
4
+ cocoapods-stats (0.6.0)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
@@ -88,4 +87,4 @@ DEPENDENCIES
88
87
  rubocop
89
88
 
90
89
  BUNDLED WITH
91
- 1.10.5
90
+ 1.10.6
@@ -19,8 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_runtime_dependency 'nap', '~> 0.8'
23
-
24
22
  spec.add_development_dependency 'bundler', '~> 1.3'
25
23
  spec.add_development_dependency 'rake', '~> 10.0'
26
24
  end
@@ -36,7 +36,8 @@ module CocoaPodsStats
36
36
  end
37
37
 
38
38
  is_pod_try = defined?(Pod::Command::Try::TRY_TMP_DIR) &&
39
- context.sandbox_root.start_with?(Pod::Command::Try::TRY_TMP_DIR.to_s)
39
+ Pod::Command::Try::TRY_TMP_DIR.exist? &&
40
+ context.sandbox_root.start_with?(Pod::Command::Try::TRY_TMP_DIR.realpath.to_s)
40
41
 
41
42
  # Send the analytics stuff up
42
43
  Sender.new.send(targets, :pod_try => is_pod_try)
@@ -1,3 +1,3 @@
1
1
  module CocoapodsStats
2
- VERSION = '0.5.3'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -5,18 +5,25 @@ module CocoaPodsStats
5
5
  API_URL = 'https://stats.cocoapods.org/api/v1/install'
6
6
 
7
7
  def send(targets, pod_try: false)
8
- REST.post(
9
- API_URL,
10
- {
11
- :targets => targets,
12
- :cocoapods_version => Pod::VERSION,
13
- :pod_try => pod_try,
14
- }.to_json,
8
+ body = {
9
+ :targets => targets,
10
+ :cocoapods_version => Pod::VERSION,
11
+ :pod_try => pod_try,
12
+ }
13
+ headers = {
15
14
  'Accept' => 'application/json',
16
15
  'Content-Type' => 'application/json',
17
- )
18
- rescue REST::Error => e
19
- Pod::UI.message "Failed to send stats:\n\n#{e}"
16
+ }
17
+ curl(API_URL, body, headers)
18
+ end
19
+
20
+ private
21
+
22
+ def curl(url, json, headers)
23
+ headers = headers.map { |k, v| ['-H', "#{k}: #{v}"] }.flatten
24
+ command = ['curl', *headers, '-X', 'POST', '-d', json.to_json, '-m', '30', url]
25
+ dev_null = '/dev/null'
26
+ Process.spawn(*command, :out => dev_null, :err => dev_null)
20
27
  end
21
28
  end
22
29
  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: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
@@ -9,48 +9,34 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-02 00:00:00.000000000 Z
12
+ date: 2015-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: nap
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '0.8'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '0.8'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: bundler
30
16
  requirement: !ruby/object:Gem::Requirement
31
17
  requirements:
32
- - - "~>"
18
+ - - ~>
33
19
  - !ruby/object:Gem::Version
34
20
  version: '1.3'
35
21
  type: :development
36
22
  prerelease: false
37
23
  version_requirements: !ruby/object:Gem::Requirement
38
24
  requirements:
39
- - - "~>"
25
+ - - ~>
40
26
  - !ruby/object:Gem::Version
41
27
  version: '1.3'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rake
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
- - - "~>"
32
+ - - ~>
47
33
  - !ruby/object:Gem::Version
48
34
  version: '10.0'
49
35
  type: :development
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
- - - "~>"
39
+ - - ~>
54
40
  - !ruby/object:Gem::Version
55
41
  version: '10.0'
56
42
  description: Uploads statistics for Pod Analytics.
@@ -61,10 +47,10 @@ executables: []
61
47
  extensions: []
62
48
  extra_rdoc_files: []
63
49
  files:
64
- - ".gitignore"
65
- - ".rubocop.yml"
66
- - ".rubocop_cocoapods.yml"
67
- - ".travis.yml"
50
+ - .gitignore
51
+ - .rubocop.yml
52
+ - .rubocop_cocoapods.yml
53
+ - .travis.yml
68
54
  - CHANGELOG.md
69
55
  - Gemfile
70
56
  - Gemfile.lock
@@ -92,17 +78,17 @@ require_paths:
92
78
  - lib
93
79
  required_ruby_version: !ruby/object:Gem::Requirement
94
80
  requirements:
95
- - - ">="
81
+ - - '>='
96
82
  - !ruby/object:Gem::Version
97
83
  version: '0'
98
84
  required_rubygems_version: !ruby/object:Gem::Requirement
99
85
  requirements:
100
- - - ">="
86
+ - - '>='
101
87
  - !ruby/object:Gem::Version
102
88
  version: '0'
103
89
  requirements: []
104
90
  rubyforge_project:
105
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.4.8
106
92
  signing_key:
107
93
  specification_version: 4
108
94
  summary: Uploads installation version data to stats.cocoapods.org to provide per-Pod