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 +4 -4
- data/README.md +6 -1
- data/lib/enumark.rb +10 -1
- data/lib/enumark/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24753e0838c8e355e1ddeec38ab241488f2cf71197dd4fe136dccb62a377b9dc
|
4
|
+
data.tar.gz: 5f5659f7fd18b5d21ac5f63a367cb778537d296f21ff4bcd90beda20667a4be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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 ||= "
|
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
|
data/lib/enumark/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|