stackdriver-core 1.3.1 → 1.5.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
2
  SHA256:
3
- metadata.gz: 0ca3e89369f51c4d2d815943888e068953d9bed387ab4576f05b307e3f344df4
4
- data.tar.gz: 28f34466ca670a0e3bc7984986f88794ea281ca19d6ee5d8c247ca803ba54ff2
3
+ metadata.gz: 8f81fa2a5e8d9aba8eb544fcc103f6f1799cbf1a7d5a5025200012f0aeb5475e
4
+ data.tar.gz: ad2b549b3200b8dfa0ef9579f3d99fbb75511511891142b58f33e0f4b453c11f
5
5
  SHA512:
6
- metadata.gz: c4db8f3e2f2d26836ee16daa11455fdf5298ba742aa138fd9a45776245ef028b94e502dddc36d9986b2c74a489f7cb27bae7a8a6bf942d2b601fac4e5e927871
7
- data.tar.gz: ae5314aa0a31b88f4dce10502928416d2600cd2136b75b81ba6b162ffe49ca5ff68eec3f5156b396ee0ad014905df266de94429e53049f67f2488121324f9043
6
+ metadata.gz: 248825ab9ac8dfc4b6978c8f88d4899a73776ec0fbd286149f9ba920356090d8979e4742e51f4ff6fbdaa90a8b8de5bc94eced98b6eb49b2bfccb1aba2220026
7
+ data.tar.gz: ed997287c5c14b88b6be4e304afba83553c8066c937620a05ea0bf308c02c9f2b9b129e04143afd7aca4bdc4f092e97ec395f24ba95f47653d78aa6c0b8107f8
data/CHANGELOG.md ADDED
@@ -0,0 +1,51 @@
1
+ # Release History
2
+
3
+ ### 1.5.0 / 2021-03-10
4
+
5
+ #### Features
6
+
7
+ * Drop support for Ruby 2.4 and add support for Ruby 3.0
8
+
9
+ ### 1.4.0 / 2019-10-23
10
+
11
+ Now requires Ruby 2.4 or later.
12
+
13
+ ### 1.3.4 / 2019-08-23
14
+
15
+ #### Documentation
16
+
17
+ * Update documentation
18
+
19
+ ### 1.3.3 / 2018-09-20
20
+
21
+ * Update documentation.
22
+ * Change documentation URL to googleapis GitHub org.
23
+
24
+ ### 1.3.2 / 2018-09-12
25
+
26
+ * Add missing documentation files to package.
27
+
28
+ ### 1.3.1 / 2018-09-10
29
+
30
+ * Update documentation.
31
+
32
+ ### 1.3.0 / 2018-02-27
33
+
34
+ * Use Google Cloud Shared Configuration.
35
+
36
+ ### 1.2.0 / 2017-07-11
37
+
38
+ * Introduce `Stackdriver::Core::AsyncActor` module, used by stackdriver gems to perform asynchronous jobs.
39
+
40
+ ### 1.1.0 / 2017-05-25
41
+
42
+ * Introduce new Stackdriver instrumentation configuration interface.
43
+
44
+ ### 1.0.0 / 2017-03-31
45
+
46
+ * Release 1.0
47
+
48
+ ### 0.21.0 / 2016-12-22
49
+
50
+ * Initial release of shared code for Stackdriver related client libraries.
51
+ * Provided trace context management code.
@@ -0,0 +1,40 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct.
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or reject
24
+ comments, commits, code, wiki edits, issues, and other contributions that are
25
+ not aligned to this Code of Conduct. By adopting this Code of Conduct, project
26
+ maintainers commit themselves to fairly and consistently applying these
27
+ principles to every aspect of managing this project. Project maintainers who do
28
+ not follow or enforce the Code of Conduct may be permanently removed from the
29
+ project team.
30
+
31
+ This code of conduct applies both within project spaces and in public spaces
32
+ when an individual is representing the project or its community.
33
+
34
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
35
+ reported by opening an issue or contacting one or more of the project
36
+ maintainers.
37
+
38
+ This Code of Conduct is adapted from the [Contributor
39
+ Covenant](http://contributor-covenant.org), version 1.2.0, available at
40
+ [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,128 @@
1
+ # Contributing to Google Cloud Stackdriver
2
+
3
+ 1. **Sign one of the contributor license agreements below.**
4
+ 2. Fork the repo, develop and test your code changes.
5
+ 3. Send a pull request.
6
+
7
+ ## Contributor License Agreements
8
+
9
+ Before we can accept your pull requests you'll need to sign a Contributor
10
+ License Agreement (CLA):
11
+
12
+ - **If you are an individual writing original source code** and **you own the
13
+ intellectual property**, then you'll need to sign an [individual
14
+ CLA](https://developers.google.com/open-source/cla/individual).
15
+ - **If you work for a company that wants to allow you to contribute your work**,
16
+ then you'll need to sign a [corporate
17
+ CLA](https://developers.google.com/open-source/cla/corporate).
18
+
19
+ You can sign these electronically (just scroll to the bottom). After that, we'll
20
+ be able to accept your pull requests.
21
+
22
+ ## Setup
23
+
24
+ In order to use the stackdriver console and run the project's tests,
25
+ there is a small amount of setup:
26
+
27
+ 1. Install Ruby. stackdriver requires Ruby 2.5+. You may choose to
28
+ manage your Ruby and gem installations with [RVM](https://rvm.io/),
29
+ [rbenv](https://github.com/rbenv/rbenv), or
30
+ [chruby](https://github.com/postmodern/chruby).
31
+
32
+ 2. Install [Bundler](http://bundler.io/).
33
+
34
+ ```sh
35
+ $ gem install bundler
36
+ ```
37
+
38
+ 3. Install the top-level project dependencies.
39
+
40
+ ```sh
41
+ $ bundle install
42
+ ```
43
+
44
+ 4. Install the Stackdriver dependencies.
45
+
46
+ ```sh
47
+ $ cd stackdriver-core/
48
+ $ bundle install
49
+ ```
50
+
51
+ ## Stackdriver Tests
52
+
53
+ Tests are very important part of stackdriver. All contributions
54
+ should include tests that ensure the contributed code behaves as expected.
55
+
56
+ To run the unit tests, documentation tests, and code style checks together for a
57
+ package:
58
+
59
+ ``` sh
60
+ $ cd stackdriver-core/
61
+ $ bundle exec rake ci
62
+ ```
63
+
64
+ To run the command above, plus all acceptance tests, use `rake ci:acceptance` or
65
+ its handy alias, `rake ci:a`.
66
+
67
+ ### Stackdriver Unit Tests
68
+
69
+
70
+ The project uses the [minitest](https://github.com/seattlerb/minitest) library,
71
+ including [specs](https://github.com/seattlerb/minitest#specs),
72
+ [mocks](https://github.com/seattlerb/minitest#mocks) and
73
+ [minitest-autotest](https://github.com/seattlerb/minitest-autotest).
74
+
75
+ To run the Stackdriver unit tests:
76
+
77
+ ``` sh
78
+ $ cd stackdriver-core/
79
+ $ bundle exec rake test
80
+ ```
81
+
82
+ ### Stackdriver Documentation Tests
83
+
84
+ The project tests the code examples in the gem's
85
+ [YARD](https://github.com/lsegal/yard)-based documentation.
86
+
87
+ The example testing functions in a way that is very similar to unit testing, and
88
+ in fact the library providing it,
89
+ [yard-doctest](https://github.com/p0deje/yard-doctest), is based on the
90
+ project's unit test library, [minitest](https://github.com/seattlerb/minitest).
91
+
92
+ To run the Stackdriver documentation tests:
93
+
94
+ ``` sh
95
+ $ cd stackdriver-core/
96
+ $ bundle exec rake doctest
97
+ ```
98
+
99
+ If you add, remove or modify documentation examples when working on a pull
100
+ request, you may need to update the setup for the tests. The stubs and mocks
101
+ required to run the tests are located in `support/doctest_helper.rb`. Please
102
+ note that much of the setup is matched by the title of the
103
+ [`@example`](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#example) tag.
104
+ If you alter an example's title, you may encounter breaking tests.
105
+
106
+ ## Coding Style
107
+
108
+ Please follow the established coding style in the library. The style is is
109
+ largely based on [The Ruby Style
110
+ Guide](https://github.com/bbatsov/ruby-style-guide) with a few exceptions based
111
+ on seattle-style:
112
+
113
+ * Avoid parenthesis when possible, including in method definitions.
114
+ * Always use double quotes strings. ([Option
115
+ B](https://github.com/bbatsov/ruby-style-guide#strings))
116
+
117
+ You can check your code against these rules by running Rubocop like so:
118
+
119
+ ```sh
120
+ $ cd stackdriver-core/
121
+ $ bundle exec rake rubocop
122
+ ```
123
+
124
+ ## Code of Conduct
125
+
126
+ Please note that this project is released with a Contributor Code of Conduct. By
127
+ participating in this project you agree to abide by its terms. See
128
+ {file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
data/OVERVIEW.md ADDED
@@ -0,0 +1,5 @@
1
+ # Stackdriver Core
2
+
3
+ The {Stackdriver::Core} module is a namespace for common types and shared
4
+ utilities used by the Google Stackdriver libraries. Most applications will not
5
+ need to use these classes directly.
@@ -15,7 +15,6 @@
15
15
 
16
16
  require "stackdriver/core/configuration"
17
17
  require "stackdriver/core/async_actor"
18
- require "stackdriver/core/configuration"
19
18
  require "stackdriver/core/trace_context"
20
19
  require "stackdriver/core/version"
21
20
 
@@ -74,12 +74,12 @@ module Stackdriver
74
74
  def async_stop
75
75
  ensure_thread
76
76
  synchronize do
77
- if async_state != :stopped
77
+ if async_state == :stopped
78
+ false
79
+ else
78
80
  @async_state = :stopping
79
81
  async_state_change
80
82
  true
81
- else
82
- false
83
83
  end
84
84
  end
85
85
  end
@@ -189,7 +189,7 @@ module Stackdriver
189
189
 
190
190
  return :stopped unless async_stop
191
191
 
192
- return :waited if timeout.to_f > 0 && wait_until_async_stopped(timeout)
192
+ return :waited if timeout.to_f.positive? && wait_until_async_stopped(timeout)
193
193
 
194
194
  return :timeout unless force
195
195
 
@@ -249,7 +249,7 @@ module Stackdriver
249
249
  #
250
250
  def self.unregister_for_cleanup actor
251
251
  @exit_lock.synchronize do
252
- @cleanup_list.delete actor if @cleanup_list
252
+ @cleanup_list&.delete actor
253
253
  end
254
254
  end
255
255
 
@@ -258,9 +258,8 @@ module Stackdriver
258
258
  #
259
259
  def self.run_cleanup
260
260
  @exit_lock.synchronize do
261
- if @cleanup_list
262
- @cleanup_list.shift.async_stop! until @cleanup_list.empty?
263
- end
261
+ return unless @cleanup_list
262
+ @cleanup_list.shift.async_stop! until @cleanup_list.empty?
264
263
  end
265
264
  end
266
265
 
@@ -276,8 +275,8 @@ module Stackdriver
276
275
  @startup_lock = Mutex.new
277
276
  @cleanup_options = {
278
277
  wait_interval: WAIT_INTERVAL,
279
- timeout: CLEANUP_TIMEOUT,
280
- force: true
278
+ timeout: CLEANUP_TIMEOUT,
279
+ force: true
281
280
  }
282
281
  end
283
282
 
@@ -352,7 +351,8 @@ module Stackdriver
352
351
  # @private Default abstract definition of this function that's a no-op.
353
352
  # The extending classes can override this method to handle state changing
354
353
  # logic.
355
- def on_async_state_change; end
354
+ def on_async_state_change
355
+ end
356
356
  end
357
357
  end
358
358
  end
@@ -335,7 +335,7 @@ module Stackdriver
335
335
  val = rand 0x100000000000000000000000000000000
336
336
  val &= 0xffffffffffff0fffcfffffffffffffff
337
337
  val |= 0x00000000000040008000000000000000
338
- format("%032x", val)
338
+ format "%032x", val
339
339
  end
340
340
  end
341
341
  end
@@ -15,6 +15,6 @@
15
15
 
16
16
  module Stackdriver
17
17
  module Core
18
- VERSION = "1.3.1".freeze
18
+ VERSION = "1.5.0".freeze
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackdriver-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-10 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -25,63 +25,63 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: autotest-suffix
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.10'
33
+ version: '1.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.10'
40
+ version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest-autotest
42
+ name: google-style
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: 1.25.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: 1.25.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: minitest-focus
56
+ name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: '5.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.1'
68
+ version: '5.14'
69
69
  - !ruby/object:Gem::Dependency
70
- name: minitest-rg
70
+ name: minitest-autotest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '5.2'
75
+ version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '5.2'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: autotest-suffix
84
+ name: minitest-focus
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.1'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
98
+ name: minitest-rg
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.50.0
103
+ version: '5.2'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.50.0
110
+ version: '5.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: redcarpet
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -173,15 +173,18 @@ extensions: []
173
173
  extra_rdoc_files: []
174
174
  files:
175
175
  - ".yardopts"
176
+ - CHANGELOG.md
177
+ - CODE_OF_CONDUCT.md
178
+ - CONTRIBUTING.md
176
179
  - LICENSE
177
- - README.md
180
+ - OVERVIEW.md
178
181
  - lib/stackdriver-core.rb
179
182
  - lib/stackdriver/core.rb
180
183
  - lib/stackdriver/core/async_actor.rb
181
184
  - lib/stackdriver/core/configuration.rb
182
185
  - lib/stackdriver/core/trace_context.rb
183
186
  - lib/stackdriver/core/version.rb
184
- homepage: https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/stackdriver-core
187
+ homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/stackdriver-core
185
188
  licenses:
186
189
  - Apache-2.0
187
190
  metadata: {}
@@ -193,15 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
196
  requirements:
194
197
  - - ">="
195
198
  - !ruby/object:Gem::Version
196
- version: 2.0.0
199
+ version: '2.5'
197
200
  required_rubygems_version: !ruby/object:Gem::Requirement
198
201
  requirements:
199
202
  - - ">="
200
203
  - !ruby/object:Gem::Version
201
204
  version: '0'
202
205
  requirements: []
203
- rubyforge_project:
204
- rubygems_version: 2.7.7
206
+ rubygems_version: 3.2.13
205
207
  signing_key:
206
208
  specification_version: 4
207
209
  summary: Internal shared library for Ruby Stackdriver integration
data/README.md DELETED
@@ -1,52 +0,0 @@
1
- # stackdriver-core
2
-
3
- This library contains shared types and utilities for Stackdriver-related
4
- libraries. Please see the [GitHub
5
- repository](https://github.com/GoogleCloudPlatform/google-cloud-ruby) for more
6
- information about the individual google-cloud gems.
7
-
8
- - [stackdriver-core API documentation](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver-core/latest)
9
-
10
- ## Supported Ruby Versions
11
-
12
- This library is supported on Ruby 2.3+.
13
-
14
- Google provides official support for Ruby versions that are actively supported
15
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or in
16
- security maintenance, and not end of life. Currently, this means Ruby 2.3 and
17
- later. Older versions of Ruby _may_ still work, but are unsupported and not
18
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
19
- about the Ruby support schedule.
20
-
21
- ## Versioning
22
-
23
- This library follows [Semantic Versioning](http://semver.org/).
24
-
25
- It is currently in major version zero (0.y.z), which means that anything may
26
- change at any time and the public API should not be considered stable.
27
-
28
- ## Contributing
29
-
30
- Contributions to this library are always welcome and highly encouraged.
31
-
32
- See the [Contributing
33
- Guide](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver-core/latest/file.CONTRIBUTING)
34
- for more information on how to get started.
35
-
36
- Please note that this project is released with a Contributor Code of Conduct. By
37
- participating in this project you agree to abide by its terms. See [Code of
38
- Conduct](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver-core/latest/file.CODE_OF_CONDUCT)
39
- for more information.
40
-
41
- ## License
42
-
43
- This library is licensed under Apache 2.0. Full license text is available in
44
- [LICENSE](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver-core/latest/file.LICENSE).
45
-
46
- ## Support
47
-
48
- Please [report bugs at the project on
49
- Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues). Don't
50
- hesitate to [ask
51
- questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby)
52
- about the client or APIs on [StackOverflow](http://stackoverflow.com).