idy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b9e139f9dd8d185f4c523382f5a7e10e2ab0f8f
4
- data.tar.gz: 1f99aa90fa690f9d926d063df79c55a9f775faee
3
+ metadata.gz: 6349ce9069910d1380b20fc75f10ac110a18abb1
4
+ data.tar.gz: af38de63a88d7dd6ba36b8c872f9e195eea5f0fc
5
5
  SHA512:
6
- metadata.gz: 7c742d70263a6f7579cfb4e9782ee28307831b07a5400ff01e2c251262d0ab66f6ed391a46f87b66d364c5704b3b167883a4839a1df21a0cad5fb1e544007c27
7
- data.tar.gz: 850388e0499f9030b2ac4b8daa203eec2bb973c8587e7d8d3330292d74490c8df15a58369c405fac13e5bf40cc08ad3184fdda793c4c8fc932ebe6e2739ebb4c
6
+ metadata.gz: 44256a6ec3fd85dfbac624cbd9c25ab87963e737db3fc503a7dfd1b446fb6aa035c7cad59c64954159de273d6ad154e9cadfa5902779b7b0e3cb2951efb6cbd9
7
+ data.tar.gz: f774c785912c30529bea0961ed8e347f8002da7f63c3547cce19d5c1ff651c2757ac33e3a3cad9249d74c5587198fc9ae7d6a3529a1d15bb547765f7778b83d1
@@ -1,7 +1,17 @@
1
+ ## v0.1.2
2
+
3
+ #### Fix
4
+
5
+ - set options on a prefixed var to avoid conflict.
6
+
1
7
  ## v0.1.1
2
8
 
9
+ #### Fix
10
+
3
11
  - v0.1.0 had problem on `push`.
4
12
 
5
13
  ## v0.1.0
6
14
 
15
+ #### Feature
16
+
7
17
  - First release.
@@ -9,10 +9,6 @@ module Idy
9
9
  self.class.idy_encode id
10
10
  end
11
11
 
12
- def idy_options
13
- self.class.idy_options
14
- end
15
-
16
12
  def salt
17
13
  self.class.salt
18
14
  end
@@ -40,7 +36,7 @@ module Idy
40
36
  end
41
37
 
42
38
  def idy(options = {})
43
- @options = options.reverse_merge(salt: idy_default_salt)
39
+ @idy_options = options.reverse_merge(salt: idy_default_salt)
44
40
 
45
41
  define_singleton_method(:idy?) { true }
46
42
  end
@@ -66,7 +62,7 @@ module Idy
66
62
  end
67
63
 
68
64
  def idy_options
69
- @options || { salt: idy_default_salt }
65
+ @idy_options || { salt: idy_default_salt }
70
66
  end
71
67
 
72
68
  def salt
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Idy
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'.freeze
5
5
  end
@@ -3,12 +3,6 @@
3
3
  require 'rails_helper'
4
4
 
5
5
  RSpec.describe '.idy_options' do
6
- context 'when callback is not given' do
7
- it 'returns a default options with a salt generated based on model name' do
8
- expect(Clean.new.idy_options).to eq(salt: clean_default_salt)
9
- end
10
- end
11
-
12
6
  context 'when options is not given' do
13
7
  it 'returns a default options with a salt generated based on model name' do
14
8
  expect(Article.idy_options).to eq(salt: article_default_salt)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Washington Botelho
@@ -159,7 +159,6 @@ files:
159
159
  - spec/lib/idy/extension/idy_decode_spec.rb
160
160
  - spec/lib/idy/extension/idy_default_salt_spec.rb
161
161
  - spec/lib/idy/extension/idy_encode_spec.rb
162
- - spec/lib/idy/extension/idy_options_spec.rb
163
162
  - spec/lib/idy/extension/idy_spec.rb
164
163
  - spec/lib/idy/extension/lock_spec.rb
165
164
  - spec/lib/idy/extension/options_spec.rb
@@ -206,7 +205,6 @@ test_files:
206
205
  - spec/lib/idy/extension/idy_decode_spec.rb
207
206
  - spec/lib/idy/extension/idy_default_salt_spec.rb
208
207
  - spec/lib/idy/extension/idy_encode_spec.rb
209
- - spec/lib/idy/extension/idy_options_spec.rb
210
208
  - spec/lib/idy/extension/idy_spec.rb
211
209
  - spec/lib/idy/extension/lock_spec.rb
212
210
  - spec/lib/idy/extension/options_spec.rb
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe ':idy_options' do
6
- describe '.idy_options' do
7
- context 'when has options' do
8
- it 'returns the options' do
9
- expect(Comment.new.idy_options).to eq(salt: 'salt')
10
- end
11
- end
12
-
13
- context 'when has no options' do
14
- it 'returns an default one' do
15
- expect(Clean.new.idy_options).to eq(salt: clean_default_salt)
16
- end
17
- end
18
- end
19
-
20
- describe '#idy_options' do
21
- before do
22
- allow(Clean).to receive(:idy_options) { :idy_options }
23
- end
24
-
25
- it 'delegates to class method' do
26
- expect(Clean.new.idy_options).to eq :idy_options
27
- end
28
- end
29
- end