structish 0.2.3 → 0.2.4

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: 66df6db1a6ad52b3c1c358bebca0618e8956005b37e474ec0c3955921c873b35
4
- data.tar.gz: e55ffd865eba7a0e876e840e115a947ba6e14bfc930cd129575a906577a73446
3
+ metadata.gz: fe83835231060abe23b9427547d10a67fb5f6c5575f1f0ba3650346902dd5385
4
+ data.tar.gz: 9fdb570ed7d576fea0b453b1f3c81c08285c75493816e8dc689e8949b4b6ec4c
5
5
  SHA512:
6
- metadata.gz: f14a2c0dcd6f3cca909c0b04d42dace1c21ba34b33d913bbb16ab3683c1567e212553c8b6eaff1300fb8ed5d060fa78467009928b72cebcc79ffc94711ece3fe
7
- data.tar.gz: afefd79a3bbf2efbd4cbdd1ed1368b205c22141e19083773964f9a9fdfd0c885afb48acba531d4e46ec78f940fdbded374d11199177e47b688a292876949a1cf
6
+ metadata.gz: 2877855214b7f57d302f3c8c3fd6f4594b49e35077c00a48108c948f6ba2b0be0ad40e332a6766978bf511c6a3bb71c58969e762506ed7dd31f7c015de9c5007
7
+ data.tar.gz: 4076538cb93f7fe0aeaf39a94f84da386023a40060a936bd13cdbf75848580e94ecc6925f2d1f66430658d50556e7b4e3888de08d43b57097fd45c9ecc5e715d
data/lib/structish.rb CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'active_support/core_ext/hash'
3
3
 
4
+ require 'structish/config'
5
+
4
6
  require "structish/version"
5
7
  require "structish_object_extensions"
6
8
  require "structish/validation_error"
@@ -0,0 +1,21 @@
1
+ module Structish
2
+ class Config
3
+
4
+ def self.config
5
+ @config ||= {}.with_indifferent_access
6
+ end
7
+
8
+ def self.config=(config_hash)
9
+ @config = config_hash.with_indifferent_access
10
+ end
11
+
12
+ def self.show_full_trace=(show_full)
13
+ config["show_full_trace"] = show_full
14
+ end
15
+
16
+ def self.show_full_trace?
17
+ config["show_full_trace"]
18
+ end
19
+
20
+ end
21
+ end
@@ -3,6 +3,9 @@ module Structish
3
3
  def initialize(message, klass)
4
4
  super("#{message} in class #{klass.to_s}")
5
5
  set_backtrace(caller)
6
+ if Config.show_full_trace?
7
+ puts self.backtrace
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module Structish
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Blakemore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-05 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -71,6 +71,7 @@ files:
71
71
  - bin/setup
72
72
  - lib/structish.rb
73
73
  - lib/structish/array.rb
74
+ - lib/structish/config.rb
74
75
  - lib/structish/hash.rb
75
76
  - lib/structish/validation.rb
76
77
  - lib/structish/validation_error.rb