inch_ci-worker 0.3.0.rc3 → 0.3.0.rc4
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 +4 -4
- data/lib/inch_ci/worker/build/task.rb +40 -2
- data/lib/inch_ci/worker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a85732486be0d5c447c9fb078256f42835987db
|
4
|
+
data.tar.gz: 66638ad85909bd3e34924b13ffabba8b341b2d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3523876700b66405767c4552c4fd3af2fb1e93df8c116f1bf9cc55c60fd8dbb7b26173629b78cc4db09adfd230967a98e3e73a5f628332c46d60865ee664da04
|
7
|
+
data.tar.gz: f81a4e19b0c47f5cb372102c61b1fa5437593016bbf6ff5db6e0280a57d6ff59d200e67a6f7304b4cfa48a885ef7b2136d13a0d635877e6b9a290179ba9e8e3e
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
require 'inch'
|
3
|
+
require 'inch/cli'
|
3
4
|
require 'repomen'
|
4
5
|
|
5
6
|
require 'inch_ci/worker/build/result'
|
@@ -57,10 +58,10 @@ module InchCI
|
|
57
58
|
|
58
59
|
def parse_codebase(path)
|
59
60
|
YARD::Config.options[:safe_mode] = true
|
61
|
+
|
60
62
|
begin
|
61
63
|
language = :ruby # TODO: make dynamic
|
62
|
-
|
63
|
-
::Inch::Codebase.parse(path, config.codebase)
|
64
|
+
::Inch::Codebase.parse(path, to_config(language, path))
|
64
65
|
rescue Exception => e
|
65
66
|
warn e.inspect
|
66
67
|
nil
|
@@ -75,6 +76,43 @@ module InchCI
|
|
75
76
|
def retrieve_repo
|
76
77
|
repo.retrieved? ? repo : nil
|
77
78
|
end
|
79
|
+
|
80
|
+
# Creates a Config::Codebase object and returns it
|
81
|
+
# (merges relevant values of a given +options+ object before).
|
82
|
+
#
|
83
|
+
# @param options [Options::Base]
|
84
|
+
# @return [Config::Codebase]
|
85
|
+
def to_config(language, path)
|
86
|
+
config = ::Inch::Config.for(language, path).codebase
|
87
|
+
|
88
|
+
if language == :ruby
|
89
|
+
helper = YardOptsWrapper.new(path)
|
90
|
+
config.included_files = helper.paths unless helper.paths.empty?
|
91
|
+
unless helper.excluded.empty?
|
92
|
+
config.excluded_files = helper.excluded
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
config
|
97
|
+
end
|
98
|
+
|
99
|
+
# Utility class to extract .yardopts from repo dir
|
100
|
+
class YardOptsWrapper
|
101
|
+
YARD_DEFAULT_FILES = ["{lib,app}/**/*.rb", "ext/**/*.c"]
|
102
|
+
|
103
|
+
attr_reader :paths, :excluded
|
104
|
+
|
105
|
+
def initialize(path)
|
106
|
+
old_path = Dir.pwd
|
107
|
+
Dir.chdir path
|
108
|
+
wrapper = ::Inch::CLI::YardoptsHelper::YardoptsWrapper.new
|
109
|
+
wrapper.parse_arguments()
|
110
|
+
@paths = wrapper.files == YARD_DEFAULT_FILES ? [] : wrapper.files
|
111
|
+
@excluded = wrapper.excluded
|
112
|
+
Dir.chdir old_path
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
78
116
|
end
|
79
117
|
end
|
80
118
|
end
|
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.3.0.
|
4
|
+
version: 0.3.0.rc4
|
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-09-
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|