inch_ci-worker 0.3.0.rc3 → 0.3.0.rc4

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: 51c74ada23e00fa9b6a2d014fdb61aea74b0b25e
4
- data.tar.gz: 890c524b12afbf383457dd4d23e5cddcfe464b40
3
+ metadata.gz: 7a85732486be0d5c447c9fb078256f42835987db
4
+ data.tar.gz: 66638ad85909bd3e34924b13ffabba8b341b2d85
5
5
  SHA512:
6
- metadata.gz: 8be45a0185fe27e6de9bddba05f84823d65f09a1b5b2c4212ece1f85403ff7e0f8bb3ebae152e4dc68804c53700180209192ce676c6c429971c33988e640d5e3
7
- data.tar.gz: 93a580a841e947a1579fd7dd56847886ec67c8dd13597fe391336999c1af2415992e2c3d7fd5c6352ce3f5f80652c69f1821a8c7f27f178cc8136a8899d5d434
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
- config = ::Inch::Config.for(language, path)
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
@@ -1,5 +1,5 @@
1
1
  module InchCI
2
2
  module Worker
3
- VERSION = "0.3.0.rc3"
3
+ VERSION = "0.3.0.rc4"
4
4
  end
5
5
  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.rc3
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-05 00:00:00.000000000 Z
11
+ date: 2014-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler