dyno_metadata 0.0.2 → 0.0.3

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: fddc4d55572d1a0fbc8ff38cbebaf1c13108ee83
4
- data.tar.gz: fb04c34c89a2509bd6fde2c17e33a0ee622fbb22
2
+ SHA256:
3
+ metadata.gz: 309f09aeb086b0f119ca5f09277607b12028c9214f5b951993730df514d33542
4
+ data.tar.gz: b17b2a139240bf299f97a53ea72f3d5d2e13c7e0d8be13a36b4e0749be53aa6d
5
5
  SHA512:
6
- metadata.gz: 1f77cfa2c195dec0dcbcdea3a92058f8953d94c719e7f1748df6977e0e7f445e8d4c021e6a312eea85d4c82d14ca627fe2571208b86de1b91ec6a2b6895e2117
7
- data.tar.gz: f1486d693cfdf992568f9f4b82f81821f618016bea2ec287dcb4d92c223fd3b8fc51b3e1a1b17ec422799dcd911c021e9fd2ac7b44c03ff559f15699b28da1a5
6
+ metadata.gz: e4c349ff70853f64509030d181eb2fe2edc75abff86538b8710a1e036b1b5e3571c12f0544dff5a5f41cb50c2719fd325c74d3684c94c9b8992d9d905643e80f
7
+ data.tar.gz: 295b8cdb9d739f87997784c96305d70bff217f68a60b87de20eb18385b702cfe12cf9479b84ff67b2f2040bc5ed1ea55dcdeb356da9cdcf5b15bae1e2bd6a582
data/README.md CHANGED
@@ -1,37 +1,68 @@
1
1
  # Dyno Metadata
2
2
 
3
+ [![GitHub Build Status](https://github.com/dentarg/dyno_metadata/workflows/Ruby/badge.svg)](https://github.com/dentarg/dyno_metadata/actions)
4
+
3
5
  Helpers to access [Heroku Dyno Metadata](https://devcenter.heroku.com/articles/dyno-metadata) from [`ENV`](https://ruby-doc.org/core-2.2.0/ENV.html). Graceful fallback to dummy values (useful in development).
4
6
 
5
7
  Installation
6
8
 
7
9
  gem install dyno_metadata
8
10
 
9
- Demonstration
11
+ Methods
10
12
 
11
13
  ```ruby
12
- $ ruby -I lib -r dyno_metadata.rb -e '(DynoMetadata.methods - \
13
- Object.methods).each { |method| puts \
14
- "DynoMetadata.#{method}\n=> #{DynoMetadata.public_send(method)}" }'
14
+ $ ruby -I lib -r dyno_metadata.rb -e ' \
15
+ (DynoMetadata.methods - Object.methods).each { |method| \
16
+ puts "DynoMetadata.#{method}\n" ; \
17
+ }'
15
18
  DynoMetadata.app_id
16
- => 9daa2797-e49b-4624-932f-ec3f9688e3da
17
19
  DynoMetadata.app_name
18
- => example-app
19
20
  DynoMetadata.dyno_id
20
- => 1vac4117-c29f-4312-521e-ba4d8638c1ac
21
21
  DynoMetadata.release_created_at
22
- => 2015-04-02T18:00:42Z
23
22
  DynoMetadata.release_version
24
- => v42
25
23
  DynoMetadata.slug_commit
26
- => 2c3a0b24069af49b3de35b8e8c26765c1dba9ff0
27
24
  DynoMetadata.commit
28
- => 2c3a0b24069af49b3de35b8e8c26765c1dba9ff0
29
25
  DynoMetadata.slug_description
30
- => Deploy 2c3a0b2
31
26
  DynoMetadata.short_commit
32
- => 2c3a0b2
33
27
  DynoMetadata.to_h
34
- => {:app_id=>"9daa2797-e49b-4624-932f-ec3f9688e3da", :app_name=>"example-app", :dyno_id=>"1vac4117-c29f-4312-521e-ba4d8638c1ac", :release_created_at=>"2015-04-02T18:00:42Z", :release_version=>"v42", :slug_commit=>"2c3a0b24069af49b3de35b8e8c26765c1dba9ff0", :slug_description=>"Deploy 2c3a0b2", :short_commit=>"2c3a0b2"}
28
+ ```
29
+
30
+ Demonstration
31
+
32
+ ```ruby
33
+ $ ruby -I lib -r dyno_metadata.rb -e ' \
34
+ (DynoMetadata.methods - Object.methods).each { |method| \
35
+ puts "> DynoMetadata.#{method}\n" ; \
36
+ print "=> " ; \
37
+ p DynoMetadata.public_send(method) \
38
+ } ; \
39
+ puts "> DynoMetadata.short_commit(12)\n" ; \
40
+ print "=> " ; \
41
+ p DynoMetadata.short_commit(12)'
42
+ > DynoMetadata.app_id
43
+ => "9daa2797-e49b-4624-932f-ec3f9688e3da"
44
+ > DynoMetadata.app_name
45
+ => "example-app"
46
+ > DynoMetadata.dyno
47
+ => "web.1"
48
+ > DynoMetadata.dyno_id
49
+ => "1vac4117-c29f-4312-521e-ba4d8638c1ac"
50
+ > DynoMetadata.release_created_at
51
+ => "2015-04-02T18:00:42Z"
52
+ > DynoMetadata.release_version
53
+ => "v42"
54
+ > DynoMetadata.slug_commit
55
+ => "2c3a0b24069af49b3de35b8e8c26765c1dba9ff0"
56
+ > DynoMetadata.commit
57
+ => "2c3a0b24069af49b3de35b8e8c26765c1dba9ff0"
58
+ > DynoMetadata.slug_description
59
+ => "Deploy 2c3a0b2"
60
+ > DynoMetadata.short_commit
61
+ => "2c3a0b2"
62
+ > DynoMetadata.to_h
63
+ => {:app_id=>"9daa2797-e49b-4624-932f-ec3f9688e3da", :app_name=>"example-app", :dyno=>"web.1", :dyno_id=>"1vac4117-c29f-4312-521e-ba4d8638c1ac", :release_created_at=>"2015-04-02T18:00:42Z", :release_version=>"v42", :slug_commit=>"2c3a0b24069af49b3de35b8e8c26765c1dba9ff0", :slug_description=>"Deploy 2c3a0b2", :short_commit=>"2c3a0b2"}
64
+ > DynoMetadata.short_commit(12)
65
+ => "2c3a0b24069a"
35
66
  ```
36
67
 
37
68
  ## Development
@@ -11,6 +11,10 @@ module DynoMetadata
11
11
  fetch "HEROKU_APP_NAME", "example-app"
12
12
  end
13
13
 
14
+ def dyno
15
+ fetch "DYNO", "web.1"
16
+ end
17
+
14
18
  def dyno_id
15
19
  fetch "HEROKU_DYNO_ID", "1vac4117-c29f-4312-521e-ba4d8638c1ac"
16
20
  end
@@ -32,14 +36,15 @@ module DynoMetadata
32
36
  fetch "HEROKU_SLUG_DESCRIPTION", "Deploy 2c3a0b2"
33
37
  end
34
38
 
35
- def short_commit
36
- slug_commit[0, 7]
39
+ def short_commit(length = 7)
40
+ slug_commit[0, length]
37
41
  end
38
42
 
39
- def to_h
43
+ def to_h # rubocop:disable Metrics/MethodLength
40
44
  {
41
45
  app_id: app_id,
42
46
  app_name: app_name,
47
+ dyno: dyno,
43
48
  dyno_id: dyno_id,
44
49
  release_created_at: release_created_at,
45
50
  release_version: release_version,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynoMetadata
4
- VERSION = "0.0.2".freeze
4
+ VERSION = "0.0.3".freeze
5
5
  end
metadata CHANGED
@@ -1,61 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyno_metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Ragnarsson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-08 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rake
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '11'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '11'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.46'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.46'
11
+ date: 2021-11-20 00:00:00.000000000 Z
12
+ dependencies: []
55
13
  description: |-
56
14
  Gives easy access to details about the release, dyno size,
57
- application name as well as the unique identifier for the
58
- particular running dyno on Heroku.
15
+ application name as well as the unique identifier for the
16
+ particular running dyno on Heroku.
59
17
  email:
60
18
  - patrik@starkast.net
61
19
  executables: []
@@ -66,11 +24,12 @@ files:
66
24
  - lib/dyno_metadata.rb
67
25
  - lib/dyno_metadata/dyno_metadata.rb
68
26
  - lib/dyno_metadata/version.rb
69
- homepage: http://github.com/dentarg/dyno_metadata
27
+ homepage: https://github.com/dentarg/dyno_metadata
70
28
  licenses:
71
29
  - MIT
72
- metadata: {}
73
- post_install_message:
30
+ metadata:
31
+ rubygems_mfa_required: 'true'
32
+ post_install_message:
74
33
  rdoc_options: []
75
34
  require_paths:
76
35
  - lib
@@ -85,9 +44,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
44
  - !ruby/object:Gem::Version
86
45
  version: '0'
87
46
  requirements: []
88
- rubyforge_project:
89
- rubygems_version: 2.2.5
90
- signing_key:
47
+ rubygems_version: 3.2.22
48
+ signing_key:
91
49
  specification_version: 4
92
50
  summary: Information about the app and environment on Heroku.
93
51
  test_files: []