codacy-coverage 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDMzNTcyOWY3MjI4OTc0MDJhZmJmMDYzMTdjYmQ3NDYxNDk2ZjZhMw==
4
+ Nzc0MDdkYzZiYmRmMjhlMDI3MzhjZTEwNjhiNDUyZjgzYjg0YWMxMA==
5
5
  data.tar.gz: !binary |-
6
- OWUwMTc1NmE3NGFlYTUxNGVhMTE3MGQ3N2E0NGM5Y2ZjZDI1ZTJhZQ==
6
+ NWIxYzc5ZDZiYzI2ZWZhNDczNDFiZDE0NjRiYTAwNmIyNGFkMTJmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzNjM2ZiOTYxM2VhN2MxNTRmOTRkMmFjOTJiOTA4ZjlmZmU4MTYxM2NmZGVh
10
- MDI3MzE3MDEwZWM5MGZhNTVjNTlhYmFhOGQyODk4NGVlZWIyZTMwM2FmMTA1
11
- NDc0MmFhYzcyYzMyZTE1MjUwMGE3MjE1NjkwYTNhOTI1MjFkNzM=
9
+ M2U5M2I4ZDNkZTljODJjYjc4MDQwNjRkOTc3NzZlMjdjNmU2NjkzYThkYTkz
10
+ Mzk1YWQ2YTBmZTI2YjZlODJjZGE1YmFhZTkzOGEwNDgzMTczMDIwZGIzNWIx
11
+ MTcyODNmMDAzMjJmNmE2YTc3Yzc1MWE1OGUyY2NkMmM1MzAxMzU=
12
12
  data.tar.gz: !binary |-
13
- MjkxNzEyMjM3Y2QzY2ZlZjJiM2UyOWY3YzViOGIyZDI1OWZlODljZWI5YmE1
14
- ZjM5MWZkMDlkOGMzMDEwNjdmZTQ4MzAyNDhhMDBjMzAxMDM5ZDlhOGQzY2Y3
15
- NDZlNTc0NjQ4N2RiOWViOGM0NmY4ZWEyZjJhNzQxMTkwNGZjYWI=
13
+ NmY0ZWVkMWQzODZlZWQ1NmIyZTZmN2QxYzU2OGI0MjBkZDJiOTRhMzgyNTUy
14
+ ZDg4MDdjOWE5YzY0OTIwMDBkNzZmZDA0ZjA4YjFmZjBlZjAzOGFjOGQ2ZTAx
15
+ ZmNhYzMyZDY4MmVhMmExNjIxODhlMWU4ZWYzZmIzMTg0MzM3ZDY=
@@ -0,0 +1,47 @@
1
+ ### Are you looking for help?
2
+
3
+ This is an issue tracker, used to manage and track the development of this [Codacy](https://www.codacy.com/) project.
4
+
5
+ It is not a platform support system. If think your problem is related with our platform at https://www.codacy.com/, please contact us through our [contact form](https://www.codacy.com/contact) or our internal chat application, visible after you login on the bottom right corner.
6
+
7
+ Keep in mind that this issue tracker is for specific problems of this project.
8
+
9
+ ### Ruby Version
10
+
11
+
12
+
13
+ ### Test framework
14
+
15
+
16
+
17
+ ### Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
18
+
19
+ Use `uname -a` if on Linux.
20
+
21
+ ### Library Dependencies
22
+
23
+ If this is an issue that involves integration with another system, include the exact version and OS of the other system, including any intermediate drivers or APIs i.e. if you connect to a PostgreSQL database, include both the version / OS of PostgreSQL and the JDBC driver version used to connect to the database.
24
+
25
+ ### Expected Behavior
26
+
27
+ Please describe the expected behavior of the issue, starting from the first action.
28
+
29
+ 1.
30
+ 2.
31
+ 3.
32
+
33
+ ### Actual Behavior
34
+
35
+ Please provide a description of what actually happens, working from the same starting point.
36
+
37
+ Be descriptive: "it doesn't work" does not describe what the behavior actually is -- instead, say "when running this sequence of commands (...) it returns an error: (...)." Copy and paste logs, and include any URLs.
38
+
39
+ 1.
40
+ 2.
41
+ 3.
42
+
43
+ ### Reproducible Test Case
44
+
45
+ Please provide a some information on how to reproduce the bug. A PR with a failing test would be awesome, if possible.
46
+
47
+ If the issue is more complex or requires configuration, please provide a link to a project on Github/Codacy that reproduces the issue.
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ ruby "1.9.3"
6
6
  gem 'rake', :platforms => 'ruby_19'
7
7
  gem 'rspec', :platforms => 'ruby_19'
8
8
  gem 'simplecov', :require => false
9
+ gem 'json', '1.8.3'
@@ -21,11 +21,19 @@ module Codacy
21
21
  end
22
22
 
23
23
  def self.logger_to_file
24
- log_filename = self.temp_dir + 'codacy-coverage_' + Date.today.to_s + '.log'
25
- log_file = File.open(log_filename, 'a')
24
+ log_file_path = self.temp_dir + self.log_file_name
25
+ log_file = File.open(log_file_path, 'a')
26
26
  Logger.new(log_file)
27
27
  end
28
28
 
29
+ def self.log_file_name
30
+ today = Date.today
31
+ # rails overrides to_s method of Date class
32
+ # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/date/conversions.rb#L52
33
+ timestamp = today.respond_to?(:to_default_s) ? today.to_default_s : today.to_s
34
+ 'codacy-coverage_' + timestamp + '.log'
35
+ end
36
+
29
37
  def self.temp_dir
30
38
  directory_name = Dir.tmpdir + "/codacy-coverage/"
31
39
  Dir.mkdir(directory_name) unless File.exists?(directory_name)
data/lib/codacy/git.rb CHANGED
@@ -13,6 +13,11 @@ module Codacy
13
13
  commit
14
14
  end
15
15
 
16
+ def self.work_dir
17
+ work_dir = ENV['WORK_DIR'] || git_dir
18
+ work_dir
19
+ end
20
+
16
21
  def self.git_commit
17
22
  git("log -1 --pretty=format:'%H'")
18
23
  end
data/lib/codacy/parser.rb CHANGED
@@ -2,7 +2,7 @@ module Codacy
2
2
  module Parser
3
3
 
4
4
  def self.parse_file(simplecov_result)
5
- project_dir = Codacy::Git.git_dir
5
+ project_dir = Codacy::Git.work_dir
6
6
 
7
7
  logger.info("Parsing simplecov result to Codacy format...")
8
8
  logger.debug(simplecov_result.original_result)
@@ -36,4 +36,4 @@ module Codacy
36
36
  Codacy::Configuration.logger
37
37
  end
38
38
  end
39
- end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codacy-coverage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nuno Teixeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-04 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -45,6 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - .github/ISSUE_TEMPLATE.md
48
49
  - .gitignore
49
50
  - Gemfile
50
51
  - README.md