inch_ci-worker 0.2.6 → 0.2.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2d0b436c7e8623dffd27df2c5964ce72bbd5b1a
|
4
|
+
data.tar.gz: e466709de16607c68d949c749a9f2956fa422e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d86c389c02ee8ee5b9033ad2ae1521fd3973cc30db7690b470704f5fe447d334af9fc0b62d1acb8a7acde8c1a575778c9e710ab3e834a3c07f9b80eda364502
|
7
|
+
data.tar.gz: ccd73a0a0e9298b407b34bb7fa9a60ae714da200d63b3cbb5fad1ce7786005d37554c2ef22aa9226f049924cc1ceb3b8fbb8b4c870f2db0ecddcba4ea55072f4
|
@@ -22,6 +22,7 @@ module InchCI
|
|
22
22
|
data['service_name'] = build.service_name.to_s if build.service_name
|
23
23
|
data['user_name'] = build.user_name if build.user_name
|
24
24
|
data['repo_name'] = build.repo_name if build.repo_name
|
25
|
+
data['badge_in_readme'] = build.badge_in_readme
|
25
26
|
if build.revision_uid
|
26
27
|
data['revision_uid'] = build.revision_uid
|
27
28
|
data['revision_message'] = build.revision_message
|
@@ -32,7 +32,9 @@ module InchCI
|
|
32
32
|
if repo.change_branch(branch_name, true)
|
33
33
|
if repo.checkout_revision(revision)
|
34
34
|
if @codebase = parse_codebase(repo.path)
|
35
|
-
ResultSuccess.new(repo, branch_name, latest_revision, @codebase.objects)
|
35
|
+
result = ResultSuccess.new(repo, branch_name, latest_revision, @codebase.objects)
|
36
|
+
result.badge_in_readme = badge_in_readme?(result)
|
37
|
+
result
|
36
38
|
else
|
37
39
|
ResultParserFailed.new(repo, branch_name, latest_revision, nil)
|
38
40
|
end
|
@@ -47,6 +49,20 @@ module InchCI
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
52
|
+
# @param info [#service_name,#user_name,#repo_name]
|
53
|
+
def badge_in_readme?(info)
|
54
|
+
filename = Dir[repo.path, '*.*'].detect do |f|
|
55
|
+
File.basename(f) =~ /\Areadme\./i
|
56
|
+
end
|
57
|
+
if filename
|
58
|
+
contents = File.read(File.join(repo.path, filename))
|
59
|
+
pattern = Regexp.escape("inch-ci.org/#{info.service_name}/#{info.user_name}/#{info.repo_name}")
|
60
|
+
!!( contents =~ /#{pattern}/mi )
|
61
|
+
else
|
62
|
+
false
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
50
66
|
def parse_codebase(path)
|
51
67
|
YARD::Config.options[:safe_mode] = true
|
52
68
|
begin
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inch_ci-worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Föhring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|