duffy 0.2.0 → 0.2.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: 22eec06727bd469b0ad0b944d080cacc680f09e3
4
- data.tar.gz: b43145ea1e3bafdba49d2c9f92aaa4213bcae121
3
+ metadata.gz: 556f360a813a6208929b57b096c67b4d4a894656
4
+ data.tar.gz: e07cab0f27b5af742661c17f722a992ce429ccc0
5
5
  SHA512:
6
- metadata.gz: c7d373ba7aa6d42ce1d7672fc8852a8033df5e9c0bb78ff5ab8aaa0711cf393afcca613f036b380bf88f7713e95312c42ec15dc2462d2b7a00b6094167712f5c
7
- data.tar.gz: 3d9d7c798a62c37357f5d6171b68d83a25696dd6c59c6b57f85cadb248105f6a4cf0511c65cfee5f607b9a759846390441d9a55b18f403f1064b8b270ecfee67
6
+ metadata.gz: 930cbb4a991c55836771a2053e0954ed589a0156ca54e6391efa2efcabe3a2449b350869cb88d1d0ef065f5dfde98603aff3a35f7a57a590142145a4829ee0e8
7
+ data.tar.gz: f3617f1249fc464384106a1ca2225171a45a6c53a5ad0d9bf97da7e144e7e5bce2589183f5e2472fd21f0eacc67373f0afbcdd51ede34b8cf4a5817f9f0207cc
data/lib/duffy/string.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # Monkey Patch String adding useful methods.
2
2
  class String
3
3
 
4
+ # Easier way to calculate the md5sum of a string.
5
+ def md5
6
+ Digest::MD5.hexdigest(self)
7
+ end
8
+ alias_method :md5sum, :md5
9
+
4
10
  def to_ssn
5
11
  ssn = "%09d" % self.to_numeric.to_i # strips string of non zeros, and pads leading zeros
6
12
  ssn[0..2] + "-" + ssn[3..4] + "-" + ssn[5..8] # now it's like 123-45-6789
data/lib/duffy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Duffy
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/duffy.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  require 'active_support'
3
3
  require 'active_support/core_ext/object/blank'
4
4
  require 'date'
5
+ require 'digest'
5
6
 
6
7
  # Rails Only Requirements
7
8
  if defined?(Rails)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duffy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Duffy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.4.6
134
+ rubygems_version: 2.4.5
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Library of things