adamantite 0.0.12 → 0.0.14

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
  SHA256:
3
- metadata.gz: 6ad70c4e3eaae15d88f12b94ea91ede1a0710aaee9089f4c7aac4ec83410b63b
4
- data.tar.gz: a2168814dc00987f060a6217c6dce9894a52d9cf6f7cfd8701d12bc5ae679991
3
+ metadata.gz: 9f7cf1f6c53600d5d0c68d944098a7a98d3ae2715ed7aa48f54df72516c3722b
4
+ data.tar.gz: df595ee6fba2497f98ce2ac8446133207475861e6ea9681992e6e36f6b125fb8
5
5
  SHA512:
6
- metadata.gz: e3d37de14a8f78a437d1dc94e530810b7efb7fb0f8313161720da7b70f9aba82febf324a48da06798e6e32387fcec8700dd43180d0e0dd2d364e3894e4adacb1
7
- data.tar.gz: 919b7b1266be6e3b9a81ad643b2453434d1888d79f33a7e7296b80d8f3ada2950d8fa3b80eaf8d2c97aef67ee42be81879636d550a3e1e8c4375e75ccbd69d59
6
+ metadata.gz: 52b8593789453bbbcfa7a5fc9e75a166a0da8e14dbb6f639d08d5438b8acd7a977f7ca1929245f2a0ad5a31f7c10462f7d1b4f76b46bf551053c91c23a257eb9
7
+ data.tar.gz: 897783faaf123f26f8076b7cd25deb1c37e41138f53b0e660252077e433e22dcaae75d0487d4deccdffcf571cc7b79f3bf74278c7157f1bd8f34a2b20b493070
data/lib/adamantite.rb CHANGED
@@ -51,7 +51,7 @@ module Adamantite
51
51
  menu('About') do
52
52
  menu_item('Software Information') do
53
53
  on_clicked do
54
- msg_box('For more information please visit https://jakebruemmer.github.io/adamantite-info/')
54
+ msg_box('For more information please visit https://jakebruemmer.github.io/adamantite/')
55
55
  end
56
56
  end
57
57
  menu_item('Author') do
@@ -147,15 +147,18 @@ module Adamantite
147
147
  end
148
148
  horizontal_box do
149
149
  stretchy false
150
-
151
- label('This is valid Adamantite installation.')
150
+ free_or_paid = @adamantite.free_tier ? 'free' : 'paid'
151
+ label_text = <<-TEXT
152
+ This is valid Adamantite installation on a #{free_or_paid} license.
153
+ TEXT
154
+ label(label_text)
152
155
  end
153
156
  end
154
157
  else
155
158
  vertical_box do
156
159
  license_label = <<-TEXT
157
160
  No license detected. Please add one to start using Adamantite.
158
- If you need one, visit https://jakebruemmer.github.io/adamantite-info/
161
+ If you need one, visit https://jakebruemmer.github.io/adamantite/
159
162
  for more information.
160
163
  TEXT
161
164
  label(license_label)
@@ -12,7 +12,7 @@ module Adamantite
12
12
  include AdamantiteFileUtils
13
13
 
14
14
  attr_reader :authenticated, :master_password, :master_password_salt, :stored_passwords,
15
- :master_license_key
15
+ :master_license_key, :free_tier
16
16
 
17
17
  OPSLIMIT = 2**20
18
18
  MEMLIMIT = 2**24
@@ -50,22 +50,11 @@ module Adamantite
50
50
  def activate_license!(master_license_key)
51
51
  return unless authenticated?
52
52
 
53
- headers = {
54
- 'Content-Type': 'application/vnd.api+json',
55
- 'Accept': 'application/vnd.api+json'
56
- }
57
- body = {
58
- 'meta': {
59
- 'key': master_license_key,
60
- 'scope': {
61
- 'product': 'bb6542ab-7d74-44d0-b4f5-1fbc39cdeb99'
62
- }
63
- }
64
- }
65
- res = HTTParty.post(LICENSE_ACTIVATION_URL, headers: headers, body: body.to_json)
53
+ res = get_license_info(master_license_key)
66
54
 
67
55
  if res['meta']['valid']
68
56
  @master_license_key = master_license_key
57
+ @free_tier = res['data']['attributes']['name'] == 'Adamantite Free'
69
58
  write_to_file(password_file('master_license_key'), @vault.encrypt(@master_license_key), true)
70
59
  true
71
60
  end
@@ -192,6 +181,24 @@ module Adamantite
192
181
  return unless authenticated?
193
182
 
194
183
  @master_license_key = @vault.decrypt(get_license_key)
184
+ res = get_license_info(@master_license_key)
185
+ @free_tier = res['data']['attributes']['name'] == 'Adamantite Free'
186
+ end
187
+
188
+ def get_license_info(license_key)
189
+ headers = {
190
+ 'Content-Type': 'application/vnd.api+json',
191
+ 'Accept': 'application/vnd.api+json'
192
+ }
193
+ body = {
194
+ 'meta': {
195
+ 'key': license_key,
196
+ 'scope': {
197
+ 'product': 'bb6542ab-7d74-44d0-b4f5-1fbc39cdeb99'
198
+ }
199
+ }
200
+ }
201
+ HTTParty.post(LICENSE_ACTIVATION_URL, headers: headers, body: body.to_json)
195
202
  end
196
203
  end
197
204
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adamantite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bruemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-18 00:00:00.000000000 Z
11
+ date: 2023-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer-dsl-libui
@@ -77,13 +77,13 @@ files:
77
77
  - lib/gui/screen/set_master_password_screen.rb
78
78
  - lib/gui/screen/show_screen.rb
79
79
  - lib/gui/screen/update_master_password_screen.rb
80
- homepage: https://jakebruemmer.github.io/adamantite-info/
80
+ homepage: https://jakebruemmer.github.io/adamantite/
81
81
  licenses:
82
82
  - MIT
83
83
  metadata: {}
84
84
  post_install_message: |2
85
85
  Thank you for installing Adamantite. Please visit the project's
86
- homepage https://jakebruemmer.github.io/adamantite-info/ if you
86
+ homepage https://jakebruemmer.github.io/adamantite/ if you
87
87
  run into any issues when installing or running the gem.
88
88
 
89
89
  You can run the gem by running 'adamantite' in your terminal.