twiglet 3.3.5 → 3.4.1

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: 6a6e0f89632bda9d5aa1a85ec784033f5d08745e50fd3b0b1ac45b7c95714e57
4
- data.tar.gz: 6dacb5a111cdbcc3cc9fd2def6a9bf40e395c4a4d016bce8b69882bee4bb9fb9
3
+ metadata.gz: 26e0c2b2d2ceb68f403a79aad11b9aabd469734872b5a231f00310fd4e520b91
4
+ data.tar.gz: ebb0cbf84cacf79f0381dfc1eb459a60affdb6472b863ac75e469f7a1981c1fc
5
5
  SHA512:
6
- metadata.gz: b083b70902556ec1ec25e97671739e9b8e296500b470a221d7d911634d5d3f0514a578631c8570850e057e9af0e12431b664fb2eef856c414e685da2b9e61a06
7
- data.tar.gz: 724a3e2b364d6f64f840c3c1bfbb3a2d6a202ce1a4c9c532fb9b5326f6ce5dd1e17228379a6358e9ce137a89e5d2ee39180dbd3948582724ee410de1e5b9c987
6
+ metadata.gz: 617424453d9504e2e17cba08aa13811fa2be58753666ce73b49274248a6392a82383fc066109fb80078872d26ab1e563ba0a5ae3a4af935acc79765dc2d68f5e
7
+ data.tar.gz: efab2195b9f7bacb70697b7e851f82652bc4e1d1cb0ad7d25492792f8726e78a83b22b4be492345a4392a4d1ca7219ded8f0a031630c8da37cc4229eee523958
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '42 8 * * 0'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v2
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v1
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v1
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v1
@@ -24,3 +24,20 @@ jobs:
24
24
  gem push *.gem
25
25
  env:
26
26
  GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
27
+ - name: Get Gem Version
28
+ id: get-gem-version
29
+ run: echo "::set-output name=GEM_VERSION::$(bundle exec ruby -e 'puts Twiglet::VERSION')"
30
+ - name: Create Release
31
+ uses: actions/github-script@v5
32
+ env:
33
+ GEM_VERSION: ${{ steps.get-gem-version.outputs.GEM_VERSION }}
34
+ with:
35
+ result-encoding: string
36
+ script: |
37
+ const { GEM_VERSION } = process.env
38
+ github.rest.repos.createRelease({
39
+ owner: context.repo.owner,
40
+ repo: context.repo.repo,
41
+ tag_name: GEM_VERSION,
42
+ generate_release_notes: true,
43
+ })
@@ -46,7 +46,7 @@ module Twiglet
46
46
  if error
47
47
  error_fields = {
48
48
  error: {
49
- type: error.class,
49
+ type: error.class.to_s,
50
50
  message: error.message
51
51
  }
52
52
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Twiglet
4
- VERSION = '3.3.5'
4
+ VERSION = '3.4.1'
5
5
  end
data/test/logger_test.rb CHANGED
@@ -242,6 +242,16 @@ describe Twiglet::Logger do
242
242
  assert_equal 'StandardError', actual_log[:error][:type]
243
243
  assert_equal 'Unknown error', actual_log[:error][:message]
244
244
  end
245
+
246
+ it 'should log error type properly even when active_support/json is required' do
247
+ require 'active_support/json'
248
+ e = StandardError.new('Unknown error')
249
+ @logger.error('Artificially raised exception with string message', e)
250
+
251
+ actual_log = read_json(@buffer)
252
+
253
+ assert_equal 'StandardError', actual_log[:error][:type]
254
+ end
245
255
  end
246
256
 
247
257
  describe 'text logging' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twiglet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.5
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-07 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -89,6 +89,7 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - ".github/CODEOWNERS"
91
91
  - ".github/dependabot.yml"
92
+ - ".github/workflows/codeql-analysis.yml"
92
93
  - ".github/workflows/dobby-actions.yml"
93
94
  - ".github/workflows/gem-publish.yml"
94
95
  - ".github/workflows/ruby.yml"