cased-ruby 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +2 -2
  3. data/.github/workflows/ruby.yml +14 -3
  4. data/.rubocop.yml +2 -0
  5. data/.ruby-version +1 -1
  6. data/Gemfile.lock +76 -63
  7. data/README.md +12 -0
  8. data/cased-ruby.gemspec +20 -19
  9. data/gemfile-locks/Gemfile-activesupport-7.lock +143 -0
  10. data/gemfile-locks/Gemfile.lock +145 -0
  11. data/lib/cased/cli/asciinema/file.rb +2 -12
  12. data/lib/cased/cli/asciinema/writer.rb +2 -6
  13. data/lib/cased/cli/authentication.rb +1 -2
  14. data/lib/cased/cli/log.rb +2 -2
  15. data/lib/cased/cli/recorder.rb +2 -7
  16. data/lib/cased/cli/session.rb +1 -1
  17. data/lib/cased/http/error.rb +1 -2
  18. data/lib/cased/policy.rb +1 -2
  19. data/lib/cased/publishers/active_support_publisher.rb +6 -0
  20. data/lib/cased/publishers/test_publisher.rb +1 -0
  21. data/lib/cased/response.rb +1 -2
  22. data/lib/cased/sensitive/processor.rb +1 -2
  23. data/lib/cased/sensitive/range.rb +1 -1
  24. data/lib/cased/sensitive/string.rb +1 -2
  25. data/lib/cased/version.rb +1 -1
  26. data/lib/cased.rb +1 -1
  27. data/vendor/cache/activesupport-7.0.2.3.gem +0 -0
  28. data/vendor/cache/addressable-2.8.0.gem +0 -0
  29. data/vendor/cache/ast-2.4.2.gem +0 -0
  30. data/vendor/cache/byebug-11.1.3.gem +0 -0
  31. data/vendor/cache/concurrent-ruby-1.1.9.gem +0 -0
  32. data/vendor/cache/connection_pool-2.2.5.gem +0 -0
  33. data/vendor/cache/crack-0.4.5.gem +0 -0
  34. data/vendor/cache/docile-1.4.0.gem +0 -0
  35. data/vendor/cache/faraday-1.7.2.gem +0 -0
  36. data/vendor/cache/faraday-em_http-1.0.0.gem +0 -0
  37. data/vendor/cache/faraday-em_synchrony-1.0.0.gem +0 -0
  38. data/vendor/cache/faraday-httpclient-1.0.1.gem +0 -0
  39. data/vendor/cache/faraday-net_http_persistent-1.2.0.gem +0 -0
  40. data/vendor/cache/faraday-patron-1.0.0.gem +0 -0
  41. data/vendor/cache/faraday-rack-1.0.0.gem +0 -0
  42. data/vendor/cache/faraday_middleware-1.1.0.gem +0 -0
  43. data/vendor/cache/i18n-1.10.0.gem +0 -0
  44. data/vendor/cache/minitest-5.14.4.gem +0 -0
  45. data/vendor/cache/mocha-1.13.0.gem +0 -0
  46. data/vendor/cache/net-http-persistent-4.0.1.gem +0 -0
  47. data/vendor/cache/parallel-1.20.1.gem +0 -0
  48. data/vendor/cache/parser-3.0.2.0.gem +0 -0
  49. data/vendor/cache/public_suffix-4.0.6.gem +0 -0
  50. data/vendor/cache/rack-2.2.3.gem +0 -0
  51. data/vendor/cache/rack-protection-2.1.0.gem +0 -0
  52. data/vendor/cache/rake-13.0.6.gem +0 -0
  53. data/vendor/cache/redis-4.4.0.gem +0 -0
  54. data/vendor/cache/regexp_parser-2.1.1.gem +0 -0
  55. data/vendor/cache/rexml-3.2.5.gem +0 -0
  56. data/vendor/cache/rubocop-1.20.0.gem +0 -0
  57. data/vendor/cache/rubocop-ast-1.11.0.gem +0 -0
  58. data/vendor/cache/rubocop-performance-1.11.5.gem +0 -0
  59. data/vendor/cache/ruby-progressbar-1.11.0.gem +0 -0
  60. data/vendor/cache/ruby2_keywords-0.0.5.gem +0 -0
  61. data/vendor/cache/simplecov-html-0.12.3.gem +0 -0
  62. data/vendor/cache/subprocess-1.5.5.gem +0 -0
  63. data/vendor/cache/unicode-display_width-2.0.0.gem +0 -0
  64. data/vendor/cache/webmock-3.14.0.gem +0 -0
  65. data/vendor/cache/yard-0.9.26.gem +0 -0
  66. metadata +112 -99
  67. data/vendor/cache/activesupport-6.1.3.2.gem +0 -0
  68. data/vendor/cache/addressable-2.7.0.gem +0 -0
  69. data/vendor/cache/ast-2.4.0.gem +0 -0
  70. data/vendor/cache/byebug-11.0.1.gem +0 -0
  71. data/vendor/cache/concurrent-ruby-1.1.8.gem +0 -0
  72. data/vendor/cache/connection_pool-2.2.2.gem +0 -0
  73. data/vendor/cache/crack-0.4.3.gem +0 -0
  74. data/vendor/cache/docile-1.3.2.gem +0 -0
  75. data/vendor/cache/faraday-1.4.1.gem +0 -0
  76. data/vendor/cache/faraday-net_http_persistent-1.1.0.gem +0 -0
  77. data/vendor/cache/faraday_middleware-1.0.0.gem +0 -0
  78. data/vendor/cache/i18n-1.8.10.gem +0 -0
  79. data/vendor/cache/jaro_winkler-1.5.4.gem +0 -0
  80. data/vendor/cache/minitest-5.13.0.gem +0 -0
  81. data/vendor/cache/mocha-1.11.2.gem +0 -0
  82. data/vendor/cache/net-http-persistent-3.1.0.gem +0 -0
  83. data/vendor/cache/parallel-1.19.1.gem +0 -0
  84. data/vendor/cache/parser-2.7.1.3.gem +0 -0
  85. data/vendor/cache/public_suffix-4.0.5.gem +0 -0
  86. data/vendor/cache/rack-2.2.2.gem +0 -0
  87. data/vendor/cache/rack-protection-2.0.8.1.gem +0 -0
  88. data/vendor/cache/rake-10.5.0.gem +0 -0
  89. data/vendor/cache/redis-4.1.4.gem +0 -0
  90. data/vendor/cache/rubocop-0.78.0.gem +0 -0
  91. data/vendor/cache/rubocop-performance-1.5.2.gem +0 -0
  92. data/vendor/cache/ruby-progressbar-1.10.1.gem +0 -0
  93. data/vendor/cache/ruby2_keywords-0.0.4.gem +0 -0
  94. data/vendor/cache/safe_yaml-1.0.5.gem +0 -0
  95. data/vendor/cache/simplecov-html-0.12.2.gem +0 -0
  96. data/vendor/cache/subprocess-1.5.4.gem +0 -0
  97. data/vendor/cache/unicode-display_width-1.6.1.gem +0 -0
  98. data/vendor/cache/webmock-3.8.3.gem +0 -0
  99. data/vendor/cache/yard-0.9.24.gem +0 -0
  100. data/vendor/cache/zeitwerk-2.4.2.gem +0 -0
data/lib/cased/cli/log.rb CHANGED
@@ -14,10 +14,10 @@ module Cased
14
14
  def self.log(text)
15
15
  puts string(text)
16
16
  ensure
17
- STDOUT.flush
17
+ $stdout.flush
18
18
  end
19
19
 
20
- def self.color(text, color, bold = false)
20
+ def self.color(text, color, bold = false) # rubocop:disable Style/OptionalBooleanParameter
21
21
  color = self.class.const_get(color.upcase) if color.is_a?(Symbol)
22
22
  bold = bold ? BOLD : ''
23
23
  "#{bold}#{color}#{text}#{CLEAR}"
@@ -8,12 +8,7 @@ module Cased
8
8
  KEY = 'CASED_CLI_RECORDING'
9
9
  TRUE = '1'
10
10
 
11
- attr_reader :command
12
- attr_reader :events
13
- attr_reader :started_at
14
- attr_reader :width
15
- attr_reader :height
16
- attr_reader :options
11
+ attr_reader :command, :events, :started_at, :width, :height, :options
17
12
  attr_accessor :writer
18
13
 
19
14
  # @return [Boolean] if CLI session is being recorded.
@@ -46,7 +41,7 @@ module Cased
46
41
  writer.time do
47
42
  Subprocess.check_call(command, options) do |t|
48
43
  t.communicate do |stdout, _stderr|
49
- STDOUT.write(stdout)
44
+ $stdout.write(stdout)
50
45
 
51
46
  writer << stdout.gsub("\n", "\r\n")
52
47
  end
@@ -288,7 +288,7 @@ module Cased
288
288
  end
289
289
 
290
290
  def recordable?
291
- STDOUT.isatty
291
+ $stdout.isatty
292
292
  end
293
293
 
294
294
  private
@@ -6,8 +6,7 @@ require 'json'
6
6
  module Cased
7
7
  module HTTP
8
8
  class Error < Cased::Error
9
- attr_reader :code
10
- attr_reader :json
9
+ attr_reader :code, :json
11
10
 
12
11
  def initialize(json = {}, code = nil)
13
12
  @json = json
data/lib/cased/policy.rb CHANGED
@@ -4,8 +4,7 @@ require 'cased/query'
4
4
 
5
5
  module Cased
6
6
  class Policy
7
- attr_reader :api_key
8
- attr_reader :client
7
+ attr_reader :api_key, :client
9
8
 
10
9
  def initialize(api_key:)
11
10
  @api_key = api_key
@@ -5,6 +5,12 @@ require 'concurrent'
5
5
  require 'active_support/notifications'
6
6
  require 'cased/publishers/base'
7
7
 
8
+ begin
9
+ require 'active_support/isolated_execution_state'
10
+ rescue LoadError
11
+ # This is required for ActiveSupport 7.0 but not present in 6.1
12
+ end
13
+
8
14
  module Cased
9
15
  module Publishers
10
16
  class ActiveSupportPublisher < Base
@@ -8,6 +8,7 @@ module Cased
8
8
  attr_reader :events
9
9
 
10
10
  def initialize
11
+ super
11
12
  @events = []
12
13
  end
13
14
 
@@ -2,8 +2,7 @@
2
2
 
3
3
  module Cased
4
4
  class Response
5
- attr_reader :body
6
- attr_reader :exception
5
+ attr_reader :body, :exception
7
6
 
8
7
  def initialize(response: nil, exception: nil)
9
8
  @response = response
@@ -21,8 +21,7 @@ module Cased
21
21
  }
22
22
  end
23
23
 
24
- attr_reader :audit_event
25
- attr_reader :handlers
24
+ attr_reader :audit_event, :handlers
26
25
 
27
26
  def initialize(audit_event, handlers)
28
27
  @audit_event = audit_event.dup.freeze
@@ -20,7 +20,7 @@ module Cased
20
20
  # Public: The end offset of the sensitive value in the original value.
21
21
  attr_reader :end_offset
22
22
 
23
- def initialize(label: nil, key:, begin_offset:, end_offset:, identifier: nil)
23
+ def initialize(key:, begin_offset:, end_offset:, label: nil, identifier: nil)
24
24
  raise ArgumentError, 'missing key' if key.nil?
25
25
  raise ArgumentError, 'missing begin_offset' if begin_offset.nil?
26
26
  raise ArgumentError, 'missing end_offset' if end_offset.nil?
@@ -5,8 +5,7 @@ require 'cased/sensitive/range'
5
5
  module Cased
6
6
  module Sensitive
7
7
  class String < String
8
- attr_reader :label
9
- attr_reader :string
8
+ attr_reader :label, :string
10
9
 
11
10
  def initialize(string, label: nil)
12
11
  super(string)
data/lib/cased/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cased
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.1'
5
5
  end
data/lib/cased.rb CHANGED
@@ -20,7 +20,7 @@ require 'cased/cli'
20
20
  # Integrations
21
21
  begin
22
22
  require 'cased/integrations/sidekiq'
23
- rescue LoadError # rubocop:disable Lint/SuppressedException
23
+ rescue LoadError
24
24
  # Sidekiq is not installed in host application
25
25
  end
26
26
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file