enumark 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 5ff7445e38a40b2f5e2e7196c9873833d1853c8994cf0ac13699c322174658ee
4
- data.tar.gz: 2d679d07bed90e0973701f6fd01a5a6b2c0c86bf61529a97d3ade1d57d68ca4c
3
+ metadata.gz: 24753e0838c8e355e1ddeec38ab241488f2cf71197dd4fe136dccb62a377b9dc
4
+ data.tar.gz: 5f5659f7fd18b5d21ac5f63a367cb778537d296f21ff4bcd90beda20667a4be2
5
5
  SHA512:
6
- metadata.gz: 6ab4b15cf7de8e56c3af1e681f369258e9806b34736e2ffb5df85c4195a9be354c272d46e2627c5f1bf8bd69b26f9144ac1f46736835926f481c2a5bc0204a92
7
- data.tar.gz: c86177d92d36168653a669d5f11ed2136549026760c042a89ad385aece50bcc1faf69e269c30fcf2ae57d53b9df839db200fe3a0a7cd5f335b28463fdfc2a255
6
+ metadata.gz: 9e72d815fde4bd327f34018d65dfd1407bca74b05cd119daf451e1a407644ee53a0e6c4ec205d50e923b6a43badc7d1a0c17d229669edae2d32f1292b81451e8
7
+ data.tar.gz: c2b795969b331004b1332100ba0827fcf0b41a511c7f358c345b4453db53db008a5fa607f73568d32dc82e374188c69f236f50e6a4f1eb90ad272eda0420f17b
data/README.md CHANGED
@@ -46,6 +46,11 @@ enum.each_dup_href do |href|
46
46
  href.name
47
47
  href.items
48
48
  end
49
+
50
+ enum.each_category do |cate|
51
+ cate.name
52
+ cate.items
53
+ end
49
54
  ```
50
55
 
51
56
  ## Development
@@ -56,7 +61,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
56
61
 
57
62
  ## Contributing
58
63
 
59
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/enumark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/enumark/blob/master/CODE_OF_CONDUCT.md).
64
+ Bug reports and pull requests are welcome on GitHub at https://github.com/turnon/enumark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/enumark/blob/master/CODE_OF_CONDUCT.md).
60
65
 
61
66
  ## License
62
67
 
data/lib/enumark.rb CHANGED
@@ -39,7 +39,11 @@ class Enumark
39
39
  end
40
40
 
41
41
  def inspect
42
- @inspect ||= "/#{categories.join('/')}> #{name}"
42
+ @inspect ||= "#{categories_str}> #{name}"
43
+ end
44
+
45
+ def categories_str
46
+ @categories_str ||= "/#{categories.join('/')}"
43
47
  end
44
48
 
45
49
  def to_s
@@ -106,6 +110,7 @@ class Enumark
106
110
  @hosts = Grouping.new(self, :host)
107
111
  @dup_titles = Grouping.new(self, :name){ |groups| groups.select{ |_, items| items.count > 1 } }
108
112
  @dup_hrefs = Grouping.new(self, :href){ |groups| groups.select{ |_, items| items.count > 1 } }
113
+ @cates = Grouping.new(self, :categories_str)
109
114
  end
110
115
 
111
116
  def each(&block)
@@ -125,6 +130,10 @@ class Enumark
125
130
  @dup_hrefs.each(&block)
126
131
  end
127
132
 
133
+ def each_category(&block)
134
+ @cates.each(&block)
135
+ end
136
+
128
137
  private
129
138
 
130
139
  def read_all_lines
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Enumark
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-13 00:00:00.000000000 Z
11
+ date: 2021-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry