safer_initialize 0.2.0 → 0.3.0
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 +4 -4
- data/.github/workflows/rspec.yml +45 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/gemfiles/6.1.gemfile +8 -0
- data/lib/safer_initialize/active_record/extensions.rb +2 -1
- data/lib/safer_initialize/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 694a0d7be3f9f98f8aa73266721d365569df168a2dcbbbe57c981a719fdcc866
|
4
|
+
data.tar.gz: f86b2ed4f9acac56500add6d1ec4d9e9b3795a04fba216534037798d4186fb93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95419eb57f195b3a3c146a63ecfcf7600034303349f3050db3645a5ce179ccd9a5a69d16322532e15606d521f0a438c1d6d1a4089bedcee03a9a0c1da7a5420e
|
7
|
+
data.tar.gz: 6352804808c5fef2698531550aff7c8adbdf0c5b20879d2e3ae2a5430bda081c3249c986ac9d4e3b8be929747608c607ff157791804de255c88298bf1ea8f0a1
|
@@ -0,0 +1,45 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rspec:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
env:
|
12
|
+
BUNDLE_JOBS: 4
|
13
|
+
BUNDLE_RETRY: 3
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby: [2.6, 2.7]
|
18
|
+
gemfile: [
|
19
|
+
"gemfiles/6.1.gemfile",
|
20
|
+
]
|
21
|
+
steps:
|
22
|
+
- name: Install packages
|
23
|
+
run: |
|
24
|
+
sudo apt update -y
|
25
|
+
sudo apt install -y libsqlite3-dev
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- uses: actions/cache@v2
|
28
|
+
with:
|
29
|
+
path: /home/runner/bundle
|
30
|
+
key: bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }}
|
31
|
+
restore-keys: |
|
32
|
+
bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-
|
33
|
+
- name: Set up Ruby
|
34
|
+
uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: ${{ matrix.ruby }}
|
37
|
+
- name: Install dependencies
|
38
|
+
run: |
|
39
|
+
bundle config path /home/runner/bundle
|
40
|
+
bundle config --global gemfile ${{ matrix.gemfile }}
|
41
|
+
bundle install
|
42
|
+
bundle update
|
43
|
+
bundle clean
|
44
|
+
- name: Run rspec
|
45
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -26,7 +26,7 @@ In `config/initializers/safer_initialize.rb`:
|
|
26
26
|
SaferInitialize::Globals.attribute :tenant
|
27
27
|
|
28
28
|
SaferInitialize.configure do |config|
|
29
|
-
config.error_handle = -> (e) { Rails.env.production? ? Bugsnag.notify(e) : raise
|
29
|
+
config.error_handle = -> (e) { Rails.env.production? ? Bugsnag.notify(e) : raise(e) } # default: -> (e) { raise e }
|
30
30
|
end
|
31
31
|
```
|
32
32
|
|
@@ -9,7 +9,8 @@ module SaferInitialize
|
|
9
9
|
unless SaferInitialize::Globals.safe?
|
10
10
|
result = filter ? object.send(filter) : object.instance_exec(object, &block)
|
11
11
|
unless result
|
12
|
-
|
12
|
+
message_text = message.respond_to?(:call) ? message.call(object) : message
|
13
|
+
SaferInitialize.configuration.error_handle.call(SaferInitialize::Error.new(message_text))
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safer_initialize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -31,6 +31,7 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".github/workflows/rspec.yml"
|
34
35
|
- ".gitignore"
|
35
36
|
- ".rspec"
|
36
37
|
- ".travis.yml"
|
@@ -42,6 +43,7 @@ files:
|
|
42
43
|
- Rakefile
|
43
44
|
- bin/console
|
44
45
|
- bin/setup
|
46
|
+
- gemfiles/6.1.gemfile
|
45
47
|
- lib/safer_initialize.rb
|
46
48
|
- lib/safer_initialize/active_record/extensions.rb
|
47
49
|
- lib/safer_initialize/configuration.rb
|