pastenum 0.3.0 → 0.3.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.
- data/Gemfile.lock +1 -1
- data/lib/pastenum/targets/gist.rb +4 -4
- data/lib/pastenum/targets/github.rb +1 -11
- data/lib/pastenum/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
|
@@ -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(
|
|
24
|
-
@results << link.href.match(
|
|
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(/(
|
|
31
|
-
@results << link.href.match(/(
|
|
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
|
data/lib/pastenum/version.rb
CHANGED
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.
|
|
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-
|
|
13
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
|
14
14
|
dependencies: []
|
|
15
15
|
description:
|
|
16
16
|
email:
|