diggit-developers_activity 0.0.1 → 0.1.0

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: 1edbd6db19ea1f6e92927be44f6fc51100f0a5a3
4
- data.tar.gz: 080b18b468e0f011fd09631bd19160585a98db7e
3
+ metadata.gz: f85e1a7d1ec600d5204923bd5cd5eeb81832308d
4
+ data.tar.gz: ec8e3b59112b7d3772d2be4d0340237959eb0e69
5
5
  SHA512:
6
- metadata.gz: bb5086afe6dc38508ed69f5471c826254f0390e3661febc76c4bdbb8b16508e33a2e396481130a1699b22001af4c7204d19b7780ec27ba447cf2fcb92d9ae7fd
7
- data.tar.gz: 82d212f17b36e2009d54ec2f1e9c9726855e16c4e8d2be8cfc8c384f8095f99bf57b3dabf20b866c70050698ff7f20a33ce49b6d656d35326bcbd6b3064fa1d5
6
+ metadata.gz: e32ba1864deb2a497fae1e075a414758bf30b331dac565bf8521138de55165d9aaef4541a5d0d07dc70f580a90c5ef66816f5c93aa8830d2caf47907112cd7b9
7
+ data.tar.gz: 563c18803b17388f0e95249593ae93aa572070d4defbcfe810a34286f733d8c9cae7fa5e7ae639fac6d59edda511fc22a81605124715d94a694eb9c777940d4a
@@ -50,11 +50,11 @@ module Diggit
50
50
  diff.each do |patch|
51
51
  next unless patch.delta.renamed?
52
52
  if walk_backwards
53
- renamed_path = patch.delta.new_file[:path]
54
- new_path = patch.delta.old_file[:path]
55
- else
56
53
  new_path = patch.delta.new_file[:path]
57
54
  renamed_path = patch.delta.old_file[:path]
55
+ else
56
+ renamed_path = patch.delta.new_file[:path]
57
+ new_path = patch.delta.old_file[:path]
58
58
  end
59
59
  add(renamed_path, new_path)
60
60
  end
@@ -42,7 +42,7 @@ module Diggit
42
42
  # compute metrics and write to result
43
43
  developer_metrics = []
44
44
  contributions.each do |key, value|
45
- developer_metrics << { project: source, developer: key[:author], 'module' => key[:module],
45
+ developer_metrics << { project: source, developer: key[:author], 'module' => key['module'],
46
46
  touches: value[:touches], churn: value[:churn], releaseDate: fist_commit_date,
47
47
  commits_group_id: commits_group_id }
48
48
  end
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+
3
+ require 'fileutils'
4
+
5
+ module Diggit
6
+ module DevelopersActivity
7
+ module Analyses
8
+ class DeveloperTurnoverJoin < Join
9
+ WORKING_DIR = './turnover/working_dir'
10
+ WEB_WORKING_DIR = './turnover/web_working_dir'
11
+ def run
12
+ @addons[:R].database_host = '127.0.0.1'
13
+ @addons[:R].working_dir = WORKING_DIR
14
+ FileUtils.mkdir_p(WORKING_DIR)
15
+ @addons[:R].web_working_dir = WEB_WORKING_DIR
16
+ FileUtils.mkdir_p(WEB_WORKING_DIR)
17
+ puts('Running R sript...')
18
+
19
+ @addons[:R].eval <<-EOS
20
+ if (require(developerTurnover) == FALSE) {
21
+ if (require(devtools) == FALSE) {
22
+ install.packages("devtools")
23
+ library(devtools)
24
+ }
25
+ install_github("matthieu-foucault/RdeveloperTurnover")
26
+ library(devtools)
27
+ }
28
+
29
+ developer_turnover(database_host, working_dir, web_working_dir)
30
+ print("R script finished")
31
+ EOS
32
+ end
33
+
34
+ def clean
35
+ FileUtils.rm_rf(WORKING_DIR)
36
+ FileUtils.rm_rf(WEB_WORKING_DIR)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -8,7 +8,7 @@ module Diggit
8
8
  #
9
9
  # @since 0.0.1
10
10
  class ReleasesActivityAnalysis < ActivityAnalysis
11
- COL_DEVELOPERS_RELEASE_ACTIVITY ||= "developers_release_activity"
11
+ COL_DEVELOPERS_RELEASE_ACTIVITY ||= "developer_activity_release"
12
12
 
13
13
  def commits_between(new_commit, old_commit)
14
14
  walker = Rugged::Walker.new(@repo)
@@ -1,14 +1,23 @@
1
1
  {
2
2
  ":addons": [
3
3
  "Db",
4
- "SourcesOptions"
4
+ "SourcesOptions",
5
+ "RWrapper"
6
+ ],
7
+ ":analyses": [
8
+ "ClocPerFileAnalysis",
9
+ "Diggit::DevelopersActivity::Analyses::ProjectDevelopersAnalysis",
10
+ "Diggit::DevelopersActivity::Analyses::ModuleMetricsAnalysis",
11
+ "Diggit::DevelopersActivity::Analyses::MonthsActivityAnalysis",
12
+ "Diggit::DevelopersActivity::Analyses::ReleasesActivityAnalysis"
13
+ ],
14
+ ":joins": [
15
+ "Diggit::DevelopersActivity::Analyses::DeveloperTurnoverJoin"
5
16
  ],
6
- ":analyses": [],
7
- ":joins": [],
8
17
  ":options": {
9
18
  "modules_metrics": true,
10
- "months-to-extract":":both",
11
- "num-months-to-extract":"12",
19
+ "months-to-extract": ":both",
20
+ "num-months-to-extract": "12",
12
21
  ":mongo": {
13
22
  ":database": "developers_activity"
14
23
  }
@@ -1,5 +1,5 @@
1
1
  module Diggit
2
2
  module DevelopersActivity
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -27,6 +27,7 @@ module Diggit
27
27
 
28
28
  analyses_dir = File.expand_path('analyses', File.dirname(__FILE__))
29
29
  home = File.expand_path(INCLUDES_FOLDER, File.expand_path(DIGGIT_FOLDER, Dir.home))
30
+ FileUtils.mkdir_p(home)
30
31
  FileUtils.ln_s(analyses_dir, File.expand_path('developers_activity', home))
31
32
  end
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diggit-developers_activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Foucault
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,6 +77,7 @@ files:
77
77
  - lib/diggit/developers_activity/activity_extractor/renames.rb
78
78
  - lib/diggit/developers_activity/analyses.rb
79
79
  - lib/diggit/developers_activity/analyses/activity_analysis.rb
80
+ - lib/diggit/developers_activity/analyses/developer_turnover_join.rb
80
81
  - lib/diggit/developers_activity/analyses/module_metrics_analysis.rb
81
82
  - lib/diggit/developers_activity/analyses/months_activity_analysis.rb
82
83
  - lib/diggit/developers_activity/analyses/project_developers_analysis.rb