anchors 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: 163b1b68541c2d11b9189be4a3acf89bc60529d1
4
- data.tar.gz: ccf418e7425255accf64119986a923b670236bbd
3
+ metadata.gz: 398ea7821db1532928334d44f8eb5075589c070d
4
+ data.tar.gz: 351f92ccb41311a7e2b1bf54e98585ab2f1d0f7d
5
5
  SHA512:
6
- metadata.gz: 55a35235e831d45f673385e2b880caccd648029e953e0aba1e4e2e07a9f338e69f3edc431f57a1d3144cba48e3e2c25ef3370893db25429b50035315fa88e88e
7
- data.tar.gz: 1e83423313f7de591ae85086bffc583233a808c3ecc17119d78c8e7a93488a420ec7a65e32c3341f0df49ea8dbbfd2811379d4c52475e3dd602f962d825917be
6
+ metadata.gz: 9e6eabbc2b80afb830db8b0d9df2944bdfaed9e29661aa7c0c528dd468739ef5b3b62113e9220e7911a1e0312b2dd48338d3f187278a34015076c66d7af134c6
7
+ data.tar.gz: d33392adafb8e31ed2b4768849d0f5c47aa9a40ebb36406f42e4e8076944a6fd9c61784e828b5e8f064e95b3e840c065496499e9e0adfadaded7a3cca37a994f
@@ -40,7 +40,14 @@ module Anchors
40
40
  end
41
41
 
42
42
  def dom_id(el)
43
- el.content.downcase.gsub(/[^\d\w\s_]/, '').gsub(' ', '_')
43
+ id = el.content.downcase.gsub(/[^\d\w\s_]/, '').gsub(' ', seperator)
44
+ [id, id_count(id)].compact.join(seperator)
45
+ end
46
+
47
+ def id_count(id)
48
+ @id_counts ||= Hash.new{ |h,k| h[k] = 0 }
49
+ @id_counts[id] += 1
50
+ @id_counts[id] if @id_counts[id] > 1
44
51
  end
45
52
  end
46
53
  end
@@ -1,3 +1,3 @@
1
1
  module Anchors
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anchors
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
  - Brad Gessler