console1984 0.1.26 → 0.1.28

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: ae616ba0dfd26e12332979ccfc257574e793b642eac5200dc8843bddef9ea93b
4
- data.tar.gz: 0053d020cc2fbabf8a23abea84a782b1ccb56259d0d5311f14c3df6213c4a1cb
3
+ metadata.gz: 1dec1a2f85d270490c4fe77d24da5e585853091518178d62c7913918635095c8
4
+ data.tar.gz: bf2d29345953a97aee5a738a3b190df832f36f75aa1815f125ae28da78e027e5
5
5
  SHA512:
6
- metadata.gz: cd28b4796bc61df05d5181c290369dd2dceb1e39a69800e8ff8a102d0c766a09d769ebfa3ac007aaada02182432db20cf4b15dbc3a460d698cbb7724b432a1a4
7
- data.tar.gz: 2915547dca0d396e2186998c337c5af983447992b637f80803e99c25f917bdf55794c9b635f4616f6150aa8b3c6dcea2e591df5b2099886811683ef8d4192425
6
+ metadata.gz: fb45296dc92dc31e81ebf71117eb4e409b89f60bf7030e5084362c2a3927a70d55780e77dddb5b93363661892a4db4421e5ac8e4c413206d80e66125e65e926a
7
+ data.tar.gz: bfab360df792a88bbebb762f1406575e96dd7565ca5e38ed2b006e285e9bf0e26ac1b8f6fd99bb32f5ca6e88932a16684de8afb6940167bc19d4b56103eb0e4f
data/README.md CHANGED
@@ -156,6 +156,7 @@ These config options are namespaced in `config.console1984`:
156
156
  | `incinerate` | Whether incinerate sessions automatically after a period of time or not. Default to `true`. |
157
157
  | `incinerate_after` | The period to keep sessions around before incinerate them. Default `30.days`. |
158
158
  | `incineration_queue` | The name of the queue for session incineration jobs. Default `console1984_incineration`. |
159
+ | `base_record_class` | The host application base class that will be the parent of `console1984` records. By default it's `::ApplicationRecord`. |
159
160
 
160
161
  ### SSH Config
161
162
 
@@ -1,5 +1,5 @@
1
1
  module Console1984
2
- class Base < ApplicationRecord
2
+ class Base < Console1984.config.base_record_class.constantize
3
3
  self.abstract_class = true
4
4
  end
5
5
  end
@@ -12,6 +12,7 @@ class Console1984::Config
12
12
  production_data_warning enter_unprotected_encryption_mode_warning enter_protected_mode_warning
13
13
  incinerate incinerate_after incineration_queue
14
14
  protections_config
15
+ base_record_class
15
16
  debug test_mode
16
17
  ]
17
18
 
@@ -56,6 +57,8 @@ class Console1984::Config
56
57
  self.incineration_queue = "console1984_incineration"
57
58
  self.ask_for_username_if_empty = false
58
59
 
60
+ self.base_record_class = "::ApplicationRecord"
61
+
59
62
  self.debug = false
60
63
  self.test_mode = false
61
64
  end
@@ -20,17 +20,17 @@ module Console1984::InputOutput
20
20
 
21
21
  Commands:
22
22
 
23
- #{COMMANDS.collect { |command, help_line| "* #{ColorizedString.new(command.to_s).light_blue}: #{help_line}" }.join("\n")}
23
+ #{COMMANDS.collect { |command, help_line| "* #{Rainbow(command.to_s).blue}: #{help_line}" }.join("\n")}
24
24
 
25
25
  TXT
26
26
  end
27
27
 
28
28
  def show_warning(message)
29
- puts ColorizedString.new("\n#{message}\n").yellow
29
+ puts Rainbow("\n#{message}\n").yellow
30
30
  end
31
31
 
32
32
  def ask_for_value(message)
33
- puts ColorizedString.new("#{message}").green
33
+ puts Rainbow("#{message}").green
34
34
  reason = $stdin.gets.strip until reason.present?
35
35
  reason
36
36
  end
@@ -44,7 +44,7 @@ class Console1984::Supervisor
44
44
  Kernel.silence_warnings do
45
45
  require 'parser/current'
46
46
  end
47
- require 'colorized_string'
47
+ require 'rainbow'
48
48
 
49
49
  # Explicit lazy loading because it depends on +parser+, which we want to only load
50
50
  # in console sessions.
@@ -1,3 +1,3 @@
1
1
  module Console1984
2
- VERSION = '0.1.26'
2
+ VERSION = "0.1.28"
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console1984
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Manrubia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: colorize
14
+ name: rainbow
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="