obfuscatable 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 869c127a994e1b082fb9e6fde29dacf41586cef1
4
- data.tar.gz: 76217edbe7ac6c21664c65c72168a41a54e145aa
3
+ metadata.gz: 6a11262060d7dfacf58142a7fea4abac160d10cf
4
+ data.tar.gz: 06dec14883d5dcc68313a7b76453ccdd91679e1f
5
5
  SHA512:
6
- metadata.gz: aca135fad2c1f76d0f617d0b98a58bd9ea48c4256c4073a2affaec07a83fc8fbee1f95718bead64e91f146944f424cbb0314d79a059bee94f36f42988acc4c96
7
- data.tar.gz: bf75aa59b08b58832d806359f3ad74fd28cdd9d9dd83d9462b4d649411f96d9c9d1f21e8f11693eff36ca3cb38d6bb86fa3c732cc00ae5e7936e879fbf397f99
6
+ metadata.gz: 73171c997655ef182170f79ec2983f06bd0cf5455516b5aea00848060990b97f7e04a1f8ed1a78a9614be42af4c789d78cec5dd567df4e75cdebe290ca7494da
7
+ data.tar.gz: c6603111c3a008c50718d5a9fe106eed915c05a0efe55a27bc7807fdbb47b00e02e69803e02493fab34600dbf7893cbe05e626cf99e69797eda09e4232e65e82
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # obfuscatable
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/namick/obfuscatable.png)](http://travis-ci.org/namick/obfuscatable) [![Dependency Status](https://gemnasium.com/namick/obfuscatable.png)](https://gemnasium.com/namick/obfuscatable) [![Code Climate](https://codeclimate.com/github/namick/obfuscatable.png)](https://codeclimate.com/github/namick/obfuscatable)
3
+ [![Gem Version][gem-image]][gem-link]
4
+ [![Dependency Status][deps-image]][deps-link]
5
+ [![Build Status][build-image]][build-link]
6
+ [![Code Climate][gpa-image]][gpa-link]
4
7
 
5
8
  **Make your ActiveRecord ids non-obvious**
6
9
 
@@ -56,3 +59,16 @@ class Post < ActiveRecord::Base
56
59
  obfuscatable :spin => 89238723
57
60
  end
58
61
  ```
62
+
63
+
64
+
65
+
66
+ [gem-image]: https://badge.fury.io/rb/obfuscatable.svg
67
+ [gem-link]: http://badge.fury.io/rb/obfuscatable
68
+ [build-image]: https://travis-ci.org/dtaniwaki/obfuscatable.svg
69
+ [build-link]: http://travis-ci.org/dtaniwaki/obfuscatable
70
+ [deps-image]: https://gemnasium.com/dtaniwaki/obfuscatable.png
71
+ [deps-link]: https://gemnasium.com/dtaniwaki/obfuscatable
72
+ [gpa-image]: https://codeclimate.com/github/dtaniwaki/obfuscatable/badges/gpa.svg
73
+ [gpa-link]: https://codeclimate.com/github/dtaniwaki/obfuscatable
74
+
@@ -1,3 +1,3 @@
1
1
  module Obfuscatable
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/obfuscatable.rb CHANGED
@@ -3,7 +3,7 @@ module Obfuscatable
3
3
  def obfuscatable(options = {})
4
4
  require 'scatter_swap'
5
5
 
6
- extend ClassMethods
6
+ extend ClassMethods
7
7
  include InstanceMethods
8
8
  cattr_accessor :obfuscatable_spin
9
9
  self.obfuscatable_spin = (options[:spin] || obfuscatable_default_spin)
@@ -26,7 +26,7 @@ module Obfuscatable
26
26
  if scope.is_a?(Array)
27
27
  scope.map! {|a| deobfuscatable(a).to_i}
28
28
  else
29
- scope = deobfuscatable(scope)
29
+ scope = deobfuscatable(scope).to_i
30
30
  end
31
31
  end
32
32
  find(scope)
@@ -44,7 +44,7 @@ module Obfuscatable
44
44
  # This makes it easy to drop obfuscatable onto any model
45
45
  # and produce different obfuscated ids for different models
46
46
  def obfuscatable_default_spin
47
- alphabet = Array("a".."z")
47
+ alphabet = Array("a".."z")
48
48
  number = name.split("").collect do |char|
49
49
  alphabet.index(char)
50
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obfuscatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scatter_swap
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.2.2
157
+ rubygems_version: 2.4.3
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Mask ActiveRecord IDs