active_object 5.5.1 → 5.5.2

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: 94f5b38280d0486f1ce369c73d4f38fb58b61c7373caefd451d8872102e15d00
4
- data.tar.gz: 14188f319710ac37c6506114f4f2ca380d087951cd2beef6fbe5597bad898bdb
3
+ metadata.gz: 6e68b06677e6f56a8dc0b2880b43a90af33e99d3edb112f15b73399a31997f77
4
+ data.tar.gz: a526d022fa347e6c95db3305aa7880a8925cb64b471c62be2f9d03b16c8c3cab
5
5
  SHA512:
6
- metadata.gz: d8b96c82b7425b6f8c22b23740966083aae8f429a1c64d3e4339329bc999a3320d771a800ab06e6e1d05a592e60041879b491c8e86969af1cd4038f3803e603c
7
- data.tar.gz: 44c472063253d027601f92e1c293733320de20671c44838df17e728430dd48416b7b7333e287c993b0850cf3db99d10c32a468c40f98e529abbeaeb45403b01b
6
+ metadata.gz: 5cf53342de20a6a01610770290edff9d5523807b1a0558b41aafad3acf628ca4b6be6051a9fb311a325a2ea331e77f127abe0f0b207a744013c8ed0a1c3f0760
7
+ data.tar.gz: f7968d7254c38b78217fcb1674931c834643c8c2c50d7d0ed0fb3ba679fab3fa0703a950be3b20138cb49c6422f1b62973175bfac2610b5509f36b30b4deb916
data/README.md CHANGED
@@ -75,19 +75,19 @@ end
75
75
  ```
76
76
 
77
77
  **safe_eval:**
78
- `safe_eval` try to evalute or return it's nil.
78
+ `safe_eval` try to evalute or return it's self.
79
79
 
80
80
  ```ruby
81
81
  '[1,2,3]'.safe_eval #=> [1,2,3]
82
- '[#1,2,3]'.safe_eval #=> nil
82
+ '[#1,2,3]'.safe_eval #=> '[#1,2,3]'
83
83
  ```
84
84
 
85
85
  **try_eval:**
86
- `try_eval` try to evalute or return it's self.
86
+ `try_eval` try to evalute or return it's nil.
87
87
 
88
88
  ```ruby
89
89
  '[1,2,3]'.try_eval #=> [1,2,3]
90
- '[#1,2,3]'.try_eval #=> '[#1,2,3]'
90
+ '[#1,2,3]'.try_eval #=> nil
91
91
  ```
92
92
 
93
93
  ## Array
@@ -7,17 +7,17 @@ if ActiveObject.configuration.autoload_kernel
7
7
 
8
8
  # rubocop:disable Lint/RescueException, Security/Eval
9
9
  def safe_eval
10
+ eval(self)
11
+ rescue Exception
12
+ self
13
+ end
14
+
15
+ def try_eval
10
16
  val = SANITIZE_EVAL_REGEX.match(to_s).to_s
11
17
  return if val.nil?
12
18
 
13
19
  eval(val)
14
20
  end
15
-
16
- def try_eval
17
- eval(self)
18
- rescue Exception
19
- self
20
- end
21
21
  # rubocop:enable Lint/RescueException, Security/Eval
22
22
 
23
23
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveObject
4
- VERSION ||= '5.5.1'
4
+ VERSION ||= '5.5.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.1
4
+ version: 5.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez