simple-hasher 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ module SimpleHasher
2
+ class SimpleHasherRailtie < Rails::Railtie
3
+ config.simple_hasher = ActiveSupport::OrderedOptions.new
4
+
5
+ initializer 'simple_hasher.allowed_chars' do |app|
6
+ SimpleHasher.configure do |config|
7
+ config.allowed_chars = app.config.simple_hasher[:allowed_chars]
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  class SimpleHasher
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/simplehasher.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  class SimpleHasher
2
2
 
3
+ require File.dirname(__FILE__) + 'simplehasher/railtie' if defined?(Rails)
4
+
3
5
  def self.encode(id)
4
6
  length = self.config.allowed_chars.length
5
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-hasher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -41,6 +41,7 @@ files:
41
41
  - README.md
42
42
  - Rakefile
43
43
  - lib/simplehasher.rb
44
+ - lib/simplehasher/railtie.rb
44
45
  - lib/simplehasher/version.rb
45
46
  - simple-hasher.gemspec
46
47
  - spec/simple-hasher_spec.rb