pastenum 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pastenum (0.3.0)
4
+ pastenum (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -20,15 +20,15 @@ module Pastenum
20
20
  if @raw
21
21
  # Raw links do not use username only the code
22
22
  # "4556950"
23
- if link.href.match(/\w+\/([0-9]+)/)
24
- @results << link.href.match(/\w+\/([0-9]+)/)[1]
23
+ if link.href.match(/[a-zA-Z0-9\-_\.]+\/([0-9]+)/)
24
+ @results << link.href.match(/[a-zA-Z0-9\-_\.]+\/([0-9]+)/)[1]
25
25
  end
26
26
  else
27
27
  # Example Hits to find stad links need username
28
28
  # "/shadowbq/4556950"
29
29
  # "/shadowbq/2718948"
30
- if link.href.match(/(\w+\/[0-9]+)/)
31
- @results << link.href.match(/(\w+\/[0-9]+)/)[1]
30
+ if link.href.match(/([a-zA-Z0-9\-_\.]+\/[0-9]+)/)
31
+ @results << link.href.match(/([a-zA-Z0-9\-_\.]+\/[0-9]+)/)[1]
32
32
  end
33
33
  end
34
34
 
@@ -10,16 +10,6 @@
10
10
 
11
11
  # Raw url
12
12
  # https://raw.github.com/ryuzee/PHPMyScrum/71dc45c31220bfa04057f9c65a7dfbc046871fa6/.box
13
-
14
- # [8] pry(main)> b = "https://github.com/ryuzee/foo1/blob/71dc45c31220bfa04057f9c65a7dfbc046871fa6/.box"
15
- # [9] pry(main)> b.match(/(\w+\/\w+)\/(blob)\/([a-z0-9]+)/)
16
- # => #<MatchData
17
- # "ryuzee/foo1/blob/71dc45c31220bfa04057f9c65a7dfbc046871fa6"
18
- # 1:"ryuzee/foo1"
19
- # 2:"blob"
20
- # 3:"71dc45c31220bfa04057f9c65a7dfbc046871fa6">
21
-
22
-
23
13
  module Pastenum
24
14
  class Github < Target
25
15
 
@@ -40,7 +30,7 @@ module Pastenum
40
30
  page.links.each do |link|
41
31
  if link.href.match(/\/blob/)
42
32
  if @raw
43
- matchdata = link.href.match(/([a-zA-Z0-9\-_]+\/[a-zA-Z0-9\-_]+)\/(blob)\/([a-z0-9]+)/)
33
+ matchdata = link.href.match(/([a-zA-Z0-9\-_\.]+\/[a-zA-Z0-9\-_\.]+)\/(blob)\/([a-z0-9]+)/)
44
34
  address = "https://raw.github.com/#{matchdata[1]}/#{matchdata[3]}/"
45
35
  @results << address
46
36
  else
@@ -1,3 +1,3 @@
1
1
  module Pastenum
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pastenum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-20 00:00:00.000000000 Z
13
+ date: 2013-02-22 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description:
16
16
  email: