onebox 1.8.12 → 1.8.13
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 881354a49c26f3ff8f7f96286bfda2f1fe313cf5
|
4
|
+
data.tar.gz: ff63ab334806ad83ba234af67d29eff74a40c0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7ce9b381f54dfa5c1ae033ee67c7c824a026b2eedb91e7569668e105745dc0e1158a683baeb5582850c79016c0d0f3178c17d155fa3eea3d2b9334f8fc70e5e
|
7
|
+
data.tar.gz: 4099701a95bc9eb0c7a5d39df03f062f794f81c63aeb69ec96b489f193d3034e4d270dabeedbcc00972cbfd919b05f703fdb1f5b3303707a49cc80da7e24e7a4
|
@@ -5,7 +5,7 @@ module Onebox
|
|
5
5
|
include LayoutSupport
|
6
6
|
include JSON
|
7
7
|
|
8
|
-
matches_regexp Regexp.new("^https?://(?:www\.)?(?:(?:\w)+\.)?(github)\.com(?:/)?(?:.)*/
|
8
|
+
matches_regexp Regexp.new("^https?://(?:www\.)?(?:(?:\w)+\.)?(github)\.com(?:/)?(?:.)*/commits?/")
|
9
9
|
always_https
|
10
10
|
|
11
11
|
def url
|
@@ -15,7 +15,13 @@ module Onebox
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def match
|
18
|
-
@match
|
18
|
+
return @match if @match
|
19
|
+
|
20
|
+
@match = @url.match(%{github\.com/(?<owner>[^/]+)/(?<repository>[^/]+)/commits?/(?<sha>[^/]+)})
|
21
|
+
|
22
|
+
@match = @url.match(%{github\.com/(?<owner>[^/]+)/(?<repository>[^/]+)/pull/(?<pr>[^/]+)/commits?/(?<sha>[^/]+)}) if @match.nil?
|
23
|
+
|
24
|
+
@match
|
19
25
|
end
|
20
26
|
|
21
27
|
def data
|
data/lib/onebox/version.rb
CHANGED
@@ -1,53 +1,108 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Onebox::Engine::GithubCommitOnebox do
|
4
|
-
before(:all) do
|
5
|
-
@link = "https://github.com/discourse/discourse/commit/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
6
|
-
@uri = "https://api.github.com/repos/discourse/discourse/commits/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
7
|
-
end
|
8
|
-
|
9
|
-
include_context "engines"
|
10
|
-
it_behaves_like "an engine"
|
11
4
|
|
12
|
-
describe "
|
13
|
-
|
14
|
-
|
5
|
+
describe "regular commit url" do
|
6
|
+
before(:all) do
|
7
|
+
@link = "https://github.com/discourse/discourse/commit/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
8
|
+
@uri = "https://api.github.com/repos/discourse/discourse/commits/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
15
9
|
end
|
16
10
|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
11
|
+
include_context "engines"
|
12
|
+
it_behaves_like "an engine"
|
20
13
|
|
21
|
-
|
22
|
-
|
23
|
-
|
14
|
+
describe "#to_html" do
|
15
|
+
it "includes owner" do
|
16
|
+
expect(html).to include("discourse")
|
17
|
+
end
|
24
18
|
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
it "includes repository name" do
|
20
|
+
expect(html).to include("discourse")
|
21
|
+
end
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
it "includes commit sha" do
|
24
|
+
expect(html).to include("803d023e2307309f8b776ab3b8b7e38ba91c0919")
|
25
|
+
end
|
32
26
|
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
it "includes commit author gravatar" do
|
28
|
+
expect(html).to include("2F7d3010c11d08cf990b7614d2c2ca9098.png")
|
29
|
+
end
|
36
30
|
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
it "includes commit message" do
|
32
|
+
expect(html).to include("Fixed GitHub auth")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "includes commit author" do
|
36
|
+
expect(html).to include("SamSaffron")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "includes commit time and date" do
|
40
|
+
expect(html).to include("02:03AM - 02 Aug 13")
|
41
|
+
end
|
42
|
+
|
43
|
+
it "includes number of files changed" do
|
44
|
+
expect(html).to include("1 file")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "includes number of additions" do
|
48
|
+
expect(html).to include("18 additions")
|
49
|
+
end
|
40
50
|
|
41
|
-
|
42
|
-
|
51
|
+
it "includes number of deletions" do
|
52
|
+
expect(html).to include("2 deletions")
|
53
|
+
end
|
43
54
|
end
|
55
|
+
end
|
44
56
|
|
45
|
-
|
46
|
-
|
57
|
+
describe "PR with commit URL" do
|
58
|
+
before(:all) do
|
59
|
+
@link = "https://github.com/discourse/discourse/pull/4662/commits/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
60
|
+
@uri = "https://api.github.com/repos/discourse/discourse/commits/803d023e2307309f8b776ab3b8b7e38ba91c0919"
|
47
61
|
end
|
48
62
|
|
49
|
-
|
50
|
-
|
63
|
+
include_context "engines"
|
64
|
+
it_behaves_like "an engine"
|
65
|
+
|
66
|
+
describe "#to_html" do
|
67
|
+
it "includes owner" do
|
68
|
+
expect(html).to include("discourse")
|
69
|
+
end
|
70
|
+
|
71
|
+
it "includes repository name" do
|
72
|
+
expect(html).to include("discourse")
|
73
|
+
end
|
74
|
+
|
75
|
+
it "includes commit sha" do
|
76
|
+
expect(html).to include("803d023e2307309f8b776ab3b8b7e38ba91c0919")
|
77
|
+
end
|
78
|
+
|
79
|
+
it "includes commit author gravatar" do
|
80
|
+
expect(html).to include("2F7d3010c11d08cf990b7614d2c2ca9098.png")
|
81
|
+
end
|
82
|
+
|
83
|
+
it "includes commit message" do
|
84
|
+
expect(html).to include("Fixed GitHub auth")
|
85
|
+
end
|
86
|
+
|
87
|
+
it "includes commit author" do
|
88
|
+
expect(html).to include("SamSaffron")
|
89
|
+
end
|
90
|
+
|
91
|
+
it "includes commit time and date" do
|
92
|
+
expect(html).to include("02:03AM - 02 Aug 13")
|
93
|
+
end
|
94
|
+
|
95
|
+
it "includes number of files changed" do
|
96
|
+
expect(html).to include("1 file")
|
97
|
+
end
|
98
|
+
|
99
|
+
it "includes number of additions" do
|
100
|
+
expect(html).to include("18 additions")
|
101
|
+
end
|
102
|
+
|
103
|
+
it "includes number of deletions" do
|
104
|
+
expect(html).to include("2 deletions")
|
105
|
+
end
|
51
106
|
end
|
52
107
|
end
|
53
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-06-
|
13
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|