dynarex-tags 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 92ec37b4d0fb55fd91f3b4b3fd12c4216a3b65b2
4
- data.tar.gz: 644ef5af0c91917c91dc1604b316e3b9ec63b425
3
+ metadata.gz: faa70765a553da07aa18756370684a2c756c3420
4
+ data.tar.gz: 15692dc51f858cb37e95cdf4a484e01e4feda63b
5
5
  SHA512:
6
- metadata.gz: 1382872a8a750e25dfe41b02634214e654030cf4b399552f49faa6183758a1713d784bb919a4abc28fa52614d151a24318f3177272d59b4ef77fed2290391ebf
7
- data.tar.gz: 5fe3a583b44ddde6a9c4223ab27ce23e815de7b67293b9f8dbb28373f702270a2346553cce860320e9912c9817efc29e2eb7ae1a199e8b8cd5fa70c45153ed81
6
+ metadata.gz: 461e9b5d71c89604bda16aef7cf93de8dfb65e35fc9b1191ac6e1862677b4138c6ed21a52ff8a0fe38dff989a2bd8190f9f8967d12c5bfcd0303ff0d575f99bb
7
+ data.tar.gz: a6085b6dbff1831f3e62b303a0924cfc0580758e6d863bd20c7ddfa7dacdcab84503ca6d115a70feb46360698ad5483c40fe7a2d2e016c6b7db23c14e926a9f1
checksums.yaml.gz.sig CHANGED
@@ -1 +1,3 @@
1
- S�́��gbq@�)�PW 0���U�χ��<��QسЮ��� 4�n���������C��w6Ix�������9���L$v_�(�s������DY�Y�ʪh�w�_>�WD-���gcX��$`3TB���B�����..r�l��kR=�v9��P��$;�n^���Q��bJ8`����TDY� N���I\�8���y�u)�t���hpr&�6�ȸ��={ä^��K����`:���
1
+ e*�SGpڙ�f
2
+ �K}�k//Է�.�.��s`��J���%��s�4����K������{�7$
3
+ ��1���R��e�YZ�_��JF)��D��%�����Tg�m�{�[�1{�x��vR�6Ӱ�]���}�}hp�<B)�k3��)/(����`�B� *I1�'���p�~s�B�{�%�<2k���u���(j����-�`�aK��]_�U��Ƅ��TX�e�!�\�}��m���H�$���/w���
data.tar.gz.sig CHANGED
Binary file
data/lib/dynarex-tags.rb CHANGED
@@ -14,15 +14,21 @@ class DynarexTags
14
14
  @index_filename = File.join(tags_parent_path, 'dxtags.xml')
15
15
  end
16
16
 
17
- def generate(category_url)
17
+ def generate(category_url, &blk)
18
18
 
19
19
  h = {}
20
20
  dx = Dynarex.new category_url
21
21
 
22
22
  dx.all.each do |x|
23
23
 
24
- x.title.scan(/\B#(\w+)/).map(&:first).uniq\
25
- .each {|tag| save_tag(h, tag, x.title, x.url)}
24
+ a = if block_given? then
25
+ blk.call(x)
26
+ else
27
+ x.title.scan(/\B#(\w+)/).map(&:first).uniq\
28
+ .map{|tag| [tag, x.title, x.url]}
29
+ end
30
+
31
+ a.each {|tag, title, url| save_tag(h, tag, title, url)}
26
32
  end
27
33
 
28
34
  save_dynarex_index(h)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex-tags
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
  - James Robertson
metadata.gz.sig CHANGED
Binary file