dyno_metadata 0.0.3 → 0.0.4

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: 309f09aeb086b0f119ca5f09277607b12028c9214f5b951993730df514d33542
4
- data.tar.gz: b17b2a139240bf299f97a53ea72f3d5d2e13c7e0d8be13a36b4e0749be53aa6d
3
+ metadata.gz: 9bb9817b8f7417819e84927dc01766be7f50e043fcfbce1d8cea2c322c1d6fcc
4
+ data.tar.gz: 9b0cab218061c7908ad522b6f32da5f7a97164d7fe8035eadfd323453f471f79
5
5
  SHA512:
6
- metadata.gz: e4c349ff70853f64509030d181eb2fe2edc75abff86538b8710a1e036b1b5e3571c12f0544dff5a5f41cb50c2719fd325c74d3684c94c9b8992d9d905643e80f
7
- data.tar.gz: 295b8cdb9d739f87997784c96305d70bff217f68a60b87de20eb18385b702cfe12cf9479b84ff67b2f2040bc5ed1ea55dcdeb356da9cdcf5b15bae1e2bd6a582
6
+ metadata.gz: 14a4dea0afb79c8002772fa6cc55006bb20a10de24b80d1467226732bedfaf471333570e512393e848c288cf83662c9c8a3f3e438099891aada2fbf1fb6bafb3
7
+ data.tar.gz: ba487f1f28ba2e6cf35119c741a5c0cd2b52a68c9368b49ccb558e70a12aafe0ddfb8d8a517e76158a35b4276200821efce324512b855a169265899c40dba585
data/README.md CHANGED
@@ -79,6 +79,4 @@ p DynoMetadata.short_commit(12)'
79
79
 
80
80
  * If you are not logged in as on the correct account, the rake task will fail and tell you to set credentials via `gem push`, do that and run the `release` task again. Use [keycutter](https://github.com/joshfrench/keycutter) to manage multiple RubyGems accounts.
81
81
 
82
- * Update the changelog with [GitHub Changelog Generator](https://github.com/skywinder/github-changelog-generator/) commit and push manually.
83
-
84
- github_changelog_generator
82
+ * Update the changelog manually, commit and push.
@@ -8,7 +8,7 @@ module DynoMetadata
8
8
  end
9
9
 
10
10
  def app_name
11
- fetch "HEROKU_APP_NAME", "example-app"
11
+ fetch "HEROKU_APP_NAME", "FLY_APP_NAME", "example-app"
12
12
  end
13
13
 
14
14
  def dyno
@@ -16,21 +16,42 @@ module DynoMetadata
16
16
  end
17
17
 
18
18
  def dyno_id
19
- fetch "HEROKU_DYNO_ID", "1vac4117-c29f-4312-521e-ba4d8638c1ac"
19
+ fetch "HEROKU_DYNO_ID", "FLY_ALLOC_ID", "1vac4117-c29f-4312-521e-ba4d8638c1ac"
20
+ end
21
+
22
+ def fly_alloc_id
23
+ fetch "FLY_ALLOC_ID", "b996131a-5bae-215b-d0f1-2d75d1a8812b"
24
+ end
25
+
26
+ def fly_region
27
+ fetch "FLY_REGION", "ams"
28
+ end
29
+
30
+ def fly_public_ip
31
+ fetch "FLY_PUBLIC_IP", "127.0.0.1"
32
+ end
33
+
34
+ def fly_vcpu_count
35
+ fetch "FLY_VCPU_COUNT", "99"
36
+ end
37
+
38
+ def fly_vm_memory_mb
39
+ fetch "FLY_VM_MEMORY_MB", "1337"
20
40
  end
21
41
 
22
42
  def release_created_at
23
- fetch "HEROKU_RELEASE_CREATED_AT", "2015-04-02T18:00:42Z"
43
+ fetch "HEROKU_RELEASE_CREATED_AT", "RELEASE_CREATED_AT", "2015-04-02T18:00:42Z"
24
44
  end
25
45
 
26
46
  def release_version
27
- fetch "HEROKU_RELEASE_VERSION", "v42"
47
+ fetch "HEROKU_RELEASE_VERSION", "RELEASE_VERSION", "v42"
28
48
  end
29
49
 
30
50
  def slug_commit
31
- fetch "HEROKU_SLUG_COMMIT", "2c3a0b24069af49b3de35b8e8c26765c1dba9ff0"
51
+ fetch "HEROKU_SLUG_COMMIT", "RELEASE_COMMIT", "2c3a0b24069af49b3de35b8e8c26765c1dba9ff0"
32
52
  end
33
53
  singleton_class.send(:alias_method, :commit, :slug_commit)
54
+ singleton_class.send(:alias_method, :release_commit, :slug_commit)
34
55
 
35
56
  def slug_description
36
57
  fetch "HEROKU_SLUG_DESCRIPTION", "Deploy 2c3a0b2"
@@ -54,7 +75,11 @@ module DynoMetadata
54
75
  }
55
76
  end
56
77
 
57
- private_class_method def fetch(variable_name, fallback)
58
- ENV.fetch(variable_name) { fallback }
78
+ private_class_method def fetch(*variable_names, fallback)
79
+ variable_names.each do |var_name|
80
+ return ENV[var_name] if ENV.key?(var_name)
81
+ end
82
+
83
+ fallback
59
84
  end
60
85
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynoMetadata
4
- VERSION = "0.0.3".freeze
4
+ VERSION = "0.0.4"
5
5
  end
data/lib/dyno_metadata.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "dyno_metadata/dyno_metadata"
2
4
  require_relative "dyno_metadata/version"
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyno_metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Ragnarsson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-20 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Gives easy access to details about the release, dyno size,
15
15
  application name as well as the unique identifier for the
16
- particular running dyno on Heroku.
16
+ particular running dyno on Heroku. Also supports Fly.io.
17
17
  email:
18
18
  - patrik@starkast.net
19
19
  executables: []
@@ -37,14 +37,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.10
40
+ version: 2.5.9
41
41
  required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
- rubygems_version: 3.2.22
47
+ rubygems_version: 3.3.22
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: Information about the app and environment on Heroku.