codespicuous 0.0.1

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.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +29 -0
  4. data/README.md +2 -0
  5. data/Rakefile +6 -0
  6. data/bin/codespicuous +4 -0
  7. data/bin/filezilla/codespicuous.yaml +23 -0
  8. data/bin/filezilla/committers.csv +4 -0
  9. data/bin/filezilla/svnlog/filezilla.log +3939 -0
  10. data/bin/filezilla/svnlog/python.log +3 -0
  11. data/bin/filezilla/svnlog/xiph.log +265 -0
  12. data/codespicuous.gemspec +22 -0
  13. data/lib/codespicuous.rb +38 -0
  14. data/lib/codespicuous/codespicuous.rb +55 -0
  15. data/lib/codespicuous/codespicuous_config.rb +35 -0
  16. data/lib/codespicuous/codespicuousconfigurator.rb +136 -0
  17. data/lib/codespicuous/commandrunner.rb +13 -0
  18. data/lib/codespicuous/commithistory.rb +71 -0
  19. data/lib/codespicuous/commithistory_builder.rb +49 -0
  20. data/lib/codespicuous/commits.rb +147 -0
  21. data/lib/codespicuous/commitstatistics.rb +245 -0
  22. data/lib/codespicuous/committer.rb +105 -0
  23. data/lib/codespicuous/danielparser.rb +31 -0
  24. data/lib/codespicuous/dateutil.rb +18 -0
  25. data/lib/codespicuous/metrics_generator.rb +22 -0
  26. data/lib/codespicuous/metrics_generator_csv.rb +67 -0
  27. data/lib/codespicuous/metrics_generator_daniel.rb +13 -0
  28. data/lib/codespicuous/participantsparser_from_csv.rb +37 -0
  29. data/lib/codespicuous/repositories.rb +80 -0
  30. data/lib/codespicuous/repository_lister.rb +8 -0
  31. data/lib/codespicuous/svn_client.rb +14 -0
  32. data/lib/codespicuous/svn_data_collector.rb +50 -0
  33. data/lib/codespicuous/svn_log_parser.rb +100 -0
  34. data/lib/codespicuous/teams.rb +99 -0
  35. data/lib/codespicuous/version.rb +4 -0
  36. data/spec/codespicuous_spec.rb +81 -0
  37. data/spec/codespicuousconfigurator_spec.rb +202 -0
  38. data/spec/commithistories_data.rb +46 -0
  39. data/spec/commithistory_spec.rb +57 -0
  40. data/spec/commits_spec.rb +93 -0
  41. data/spec/committers_spec.rb +66 -0
  42. data/spec/danielparser_spec.rb +12 -0
  43. data/spec/integration_filezilla_spec.rb +41 -0
  44. data/spec/metrics_generator_csv_spec.rb +91 -0
  45. data/spec/metrics_generator_daniel_spec.rb +10 -0
  46. data/spec/metrics_generator_spec.rb +35 -0
  47. data/spec/repositories_spec.rb +29 -0
  48. data/spec/svn_client_spec.rb +16 -0
  49. data/spec/svn_data_collector_spec.rb +93 -0
  50. data/spec/svn_log_parser_spec.rb +141 -0
  51. data/spec/teams_spec.rb +16 -0
  52. metadata +142 -0
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <log>
3
+ </log>
@@ -0,0 +1,265 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <log>
3
+ <logentry
4
+ revision="19572">
5
+ <author>tterribe</author>
6
+ <date>2016-07-22T20:16:14.047035Z</date>
7
+ <msg>Add ids to v-comment.html
8
+
9
+ This allows linking to specific sections.
10
+
11
+ Patch from Christian Weiske &lt;cweiske@cweiske.de&gt;.
12
+ </msg>
13
+ </logentry>
14
+ <logentry
15
+ revision="19573">
16
+ <author>tdaede</author>
17
+ <date>2016-07-27T22:41:16.776063Z</date>
18
+ <msg>Add objective-1.1.
19
+ </msg>
20
+ </logentry>
21
+ <logentry
22
+ revision="19574">
23
+ <author>tdaede</author>
24
+ <date>2016-07-27T22:58:28.078476Z</date>
25
+ <msg>Regenerate index.html.
26
+ </msg>
27
+ </logentry>
28
+ <logentry
29
+ revision="19575">
30
+ <author>giles</author>
31
+ <date>2016-07-29T16:36:32.632817Z</date>
32
+ <msg>Add status badges for travis and appveyor build results.
33
+ </msg>
34
+ </logentry>
35
+ <logentry
36
+ revision="19576">
37
+ <author>giles</author>
38
+ <date>2016-07-29T17:09:01.409550Z</date>
39
+ <msg>Link the github mirrors.
40
+ </msg>
41
+ </logentry>
42
+ <logentry
43
+ revision="19577">
44
+ <author>tmatth</author>
45
+ <date>2016-08-03T17:32:06.479129Z</date>
46
+ <msg>speex.org: provide better links
47
+ </msg>
48
+ </logentry>
49
+ <logentry
50
+ revision="19578">
51
+ <author>tmatth</author>
52
+ <date>2016-08-03T17:41:01.958378Z</date>
53
+ <msg>speex.org: trim git sentence
54
+ </msg>
55
+ </logentry>
56
+ <logentry
57
+ revision="19579">
58
+ <author>tmatth</author>
59
+ <date>2016-08-03T17:55:40.588263Z</date>
60
+ <msg>speex.org: fix speexdsp git url
61
+ </msg>
62
+ </logentry>
63
+ <logentry
64
+ revision="19580">
65
+ <author>tmatth</author>
66
+ <date>2016-08-09T02:11:27.704775Z</date>
67
+ <msg>roadmap: fixed-point is already complete
68
+ </msg>
69
+ </logentry>
70
+ <logentry
71
+ revision="19581">
72
+ <author>tdaede</author>
73
+ <date>2016-09-09T22:36:59.278191Z</date>
74
+ <msg>Add 4:2:0 y4m links for Twitch content.
75
+ </msg>
76
+ </logentry>
77
+ <logentry
78
+ revision="19582">
79
+ <author>tdaede</author>
80
+ <date>2016-09-15T20:11:23.578867Z</date>
81
+ <msg>Add Meridian.
82
+ </msg>
83
+ </logentry>
84
+ <logentry
85
+ revision="19583">
86
+ <author>jm</author>
87
+ <date>2016-09-17T06:12:18.984845Z</date>
88
+ <msg>TI tutorial
89
+ </msg>
90
+ </logentry>
91
+ <logentry
92
+ revision="19584">
93
+ <author>tmatth</author>
94
+ <date>2016-09-20T21:17:55.951031Z</date>
95
+ <msg>Make submission path more obvious
96
+ </msg>
97
+ </logentry>
98
+ <logentry
99
+ revision="19585">
100
+ <author>epirat</author>
101
+ <date>2016-09-23T16:10:03.254189Z</date>
102
+ <msg>Repository migrated to git.
103
+ </msg>
104
+ </logentry>
105
+ <logentry
106
+ revision="19586">
107
+ <author>epirat</author>
108
+ <date>2016-09-23T16:14:36.157087Z</date>
109
+ <msg>Repository moved to git
110
+ </msg>
111
+ </logentry>
112
+ <logentry
113
+ revision="19587">
114
+ <author>epirat</author>
115
+ <date>2016-09-23T16:18:23.339102Z</date>
116
+ <msg>Remove accidentally forgotten .htaccess file
117
+ </msg>
118
+ </logentry>
119
+ <logentry
120
+ revision="19588">
121
+ <author>giles</author>
122
+ <date>2016-09-24T03:09:02.631853Z</date>
123
+ <msg>Fix TestSeqences typo.
124
+
125
+ The referenced data directory has been updated as well.
126
+ Thanks to DonDiego for the report.
127
+ </msg>
128
+ </logentry>
129
+ <logentry
130
+ revision="19589">
131
+ <author>jm</author>
132
+ <date>2016-11-03T18:40:10.996897Z</date>
133
+ <msg>Opus 1.2-alpha
134
+ </msg>
135
+ </logentry>
136
+ <logentry
137
+ revision="19590">
138
+ <author>tmatth</author>
139
+ <date>2016-12-07T23:37:47.373581Z</date>
140
+ <msg>Speex 1.2.0 release
141
+ </msg>
142
+ </logentry>
143
+ <logentry
144
+ revision="19591">
145
+ <author>tmatth</author>
146
+ <date>2016-12-07T23:53:50.999861Z</date>
147
+ <msg>Announce Speex 1.2.0 release.
148
+ </msg>
149
+ </logentry>
150
+ <logentry
151
+ revision="19592">
152
+ <author>giles</author>
153
+ <date>2016-12-07T23:53:58.526254Z</date>
154
+ <msg>Update xiph.org/downloads for speex-1.2.0.
155
+ </msg>
156
+ </logentry>
157
+ <logentry
158
+ revision="19593">
159
+ <author>erikd</author>
160
+ <date>2017-01-01T01:56:07.963546Z</date>
161
+ <msg>Add flac 1.3.2 release files</msg>
162
+ </logentry>
163
+ <logentry
164
+ revision="19594">
165
+ <author>erikd</author>
166
+ <date>2017-01-01T02:00:56.751710Z</date>
167
+ <msg>Add checksums for flac-1.3.2 release</msg>
168
+ </logentry>
169
+ <logentry
170
+ revision="19595">
171
+ <author>erikd</author>
172
+ <date>2017-01-01T04:03:41.693072Z</date>
173
+ <msg>Minor tweak to flac 1.3.2 tarball</msg>
174
+ </logentry>
175
+ <logentry
176
+ revision="19596">
177
+ <author>erikd</author>
178
+ <date>2017-01-03T08:22:52.313196Z</date>
179
+ <msg>Update xiph.org/downloads for flac-1.3.2</msg>
180
+ </logentry>
181
+ <logentry
182
+ revision="19597">
183
+ <author>jm</author>
184
+ <date>2017-01-20T21:13:11.978533Z</date>
185
+ <msg>Releases 1.1.4 and 1.2-alpha2
186
+ </msg>
187
+ </logentry>
188
+ <logentry
189
+ revision="19598">
190
+ <author>tmatth</author>
191
+ <date>2017-01-22T19:43:20.626869Z</date>
192
+ <msg>Downloads: add travis badge for speex
193
+ </msg>
194
+ </logentry>
195
+ <logentry
196
+ revision="19599">
197
+ <author>giles</author>
198
+ <date>2017-01-22T22:18:11.773687Z</date>
199
+ <msg>opus-tools 0.1.10 source package.
200
+ </msg>
201
+ </logentry>
202
+ <logentry
203
+ revision="19600">
204
+ <author>tdaede</author>
205
+ <date>2017-03-10T01:21:15.733320Z</date>
206
+ <msg>Add objective-2-*
207
+ </msg>
208
+ </logentry>
209
+ <logentry
210
+ revision="19601">
211
+ <author>jm</author>
212
+ <date>2017-05-24T18:31:57.563606Z</date>
213
+ <msg>3 new releases
214
+ </msg>
215
+ </logentry>
216
+ <logentry
217
+ revision="19602">
218
+ <author>derf</author>
219
+ <date>2017-06-03T20:09:33.092466Z</date>
220
+ <msg>Update the spec to fbb275803696.
221
+
222
+ This includes typo fixes from r18195 and r17912, and incorrect
223
+ intra-document link fixes from r17891.
224
+ </msg>
225
+ </logentry>
226
+ <logentry
227
+ revision="19603">
228
+ <author>jm</author>
229
+ <date>2017-06-07T22:25:25.325108Z</date>
230
+ <msg>Opus 1.2-rc1 tarballs
231
+ </msg>
232
+ </logentry>
233
+ <logentry
234
+ revision="19604">
235
+ <author>jm</author>
236
+ <date>2017-06-20T05:07:56.727436Z</date>
237
+ <msg>Tarball for Opus 1.2
238
+ </msg>
239
+ </logentry>
240
+ <logentry
241
+ revision="19605">
242
+ <author>derf</author>
243
+ <date>2017-06-21T01:32:15.343892Z</date>
244
+ <msg>website: News post for libopus 1.2 release.
245
+
246
+ Committed on behalf of Monty.
247
+ </msg>
248
+ </logentry>
249
+ <logentry
250
+ revision="19606">
251
+ <author>tmatth</author>
252
+ <date>2017-07-19T02:08:40.909206Z</date>
253
+ <msg>ci: add .travis.yml based on daala's
254
+ </msg>
255
+ </logentry>
256
+ <logentry
257
+ revision="19607">
258
+ <author>derf</author>
259
+ <date>2017-07-19T08:47:36.353889Z</date>
260
+ <msg>websites/ogg: Fix a typo.
261
+
262
+ Thanks to rolpherTheBolphe for the report.
263
+ </msg>
264
+ </logentry>
265
+ </log>
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ require File.expand_path('../lib/codespicuous/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = 'codespicuous'
6
+ gem.version = Codespicuous::VERSION
7
+ gem.date = Date.today.to_s
8
+ gem.license = "MIT"
9
+
10
+ gem.summary = "Codespicuous is a tool for generating team based metrics from code"
11
+ gem.description = "Codespicuous is a tool for generating several different metrics from codebases to gain insight in how the teams are working."
12
+
13
+ gem.authors = ['Bas Vodde']
14
+ gem.email = 'basv@odd-e.com'
15
+ gem.homepage = 'https://github.com/basvodde/codespicuous'
16
+
17
+ gem.add_runtime_dependency 'rake', '~> 0'
18
+ gem.add_development_dependency 'rspec', '~> 2.0', '>= 2.0.0'
19
+ gem.add_runtime_dependency( 'attempt_to', '~> 0')
20
+
21
+ gem.files = `git ls-files -- {.,test,spec,lib}/*`.split("\n")
22
+ end
@@ -0,0 +1,38 @@
1
+
2
+ # Util
3
+ require_relative 'codespicuous/commandrunner.rb'
4
+ require_relative 'codespicuous/dateutil.rb'
5
+
6
+ # Core
7
+ require_relative 'codespicuous/teams.rb'
8
+ require_relative 'codespicuous/repositories.rb'
9
+ require_relative 'codespicuous/commits.rb'
10
+ require_relative 'codespicuous/commithistory.rb'
11
+ require_relative 'codespicuous/commithistory_builder.rb'
12
+ require_relative 'codespicuous/committer.rb'
13
+
14
+ require_relative 'codespicuous/commitstatistics.rb'
15
+
16
+ require_relative 'codespicuous/danielparser.rb'
17
+
18
+ # Parsers
19
+ require_relative 'codespicuous/danielparser.rb'
20
+
21
+ # SVN
22
+ require_relative 'codespicuous/svn_client.rb'
23
+ require_relative 'codespicuous/svn_log_parser.rb'
24
+ require_relative 'codespicuous/svn_data_collector.rb'
25
+
26
+ # Config
27
+ require_relative 'codespicuous/codespicuousconfigurator.rb'
28
+ require_relative 'codespicuous/codespicuous_config.rb'
29
+
30
+ # Generator
31
+ require_relative 'codespicuous/metrics_generator.rb'
32
+ require_relative 'codespicuous/metrics_generator_daniel.rb'
33
+ require_relative 'codespicuous/metrics_generator_csv.rb'
34
+
35
+ require_relative 'codespicuous/repository_lister.rb'
36
+ # App
37
+ require_relative 'codespicuous/codespicuous.rb'
38
+
@@ -0,0 +1,55 @@
1
+
2
+ require 'optparse'
3
+
4
+ class Codespicuous
5
+
6
+ attr_reader :repositories, :commit_history, :committers, :teams, :config
7
+
8
+ def initialize
9
+ @config = CodespicuousConfig.new
10
+ end
11
+
12
+ def run(argv)
13
+
14
+ puts "Stage 1: Configuring"
15
+ return false unless configure(argv)
16
+
17
+ puts "Stage 2: Collecting input data"
18
+ collect
19
+
20
+ if @config.list_repositories
21
+ puts "Stage 3: Listing repositories committed to"
22
+ list_committed_repositories
23
+ else
24
+ puts "Stage 3: Generating output"
25
+ generate_output
26
+ end
27
+ true
28
+ end
29
+
30
+ def configure(argv)
31
+ configurator = CodespicuousConfigurator.new(@config)
32
+ return false unless configurator.configure(argv)
33
+
34
+ @repositories = configurator.repositories
35
+ @committers = configurator.committers
36
+ @teams = configurator.teams
37
+
38
+ true
39
+ end
40
+
41
+ def collect
42
+ collector = SVNDataCollector.new(config)
43
+ @commit_history = collector.collect_commit_history(repositories)
44
+ end
45
+
46
+ def generate_output
47
+ generator = MetricsGenerator.new
48
+ generator.generate(@commit_history)
49
+ end
50
+
51
+ def list_committed_repositories
52
+ repository_lister = RepositoryLister.new
53
+ repository_lister.list(@commit_history)
54
+ end
55
+ end
@@ -0,0 +1,35 @@
1
+
2
+ require 'pathname'
3
+
4
+ class CodespicuousConfig
5
+
6
+ attr_accessor :offline, :configuration_file_name, :list_repositories, :input_path, :output_path
7
+
8
+ def initialize
9
+ @offline = false
10
+ @configuration_file_name = "codespicuous.yaml"
11
+ @input_path = Pathname.new(".")
12
+ @list_repositories = false
13
+ @svnlogdir = "svnlog"
14
+ end
15
+
16
+ def input_path=(path)
17
+ @input_path = Pathname.new(path)
18
+ end
19
+
20
+ def output_path=(path)
21
+ @output_path = Pathname.new(path)
22
+ end
23
+
24
+ def path_to_configuration_file
25
+ (@input_path + @configuration_file_name).to_s
26
+ end
27
+
28
+ def path_to_cached_svn_log(repository_name)
29
+ (Pathname.new(path_to_cached_svn_log_dir) + Pathname.new(repository_name + ".log")).to_s
30
+ end
31
+
32
+ def path_to_cached_svn_log_dir
33
+ (@input_path + Pathname.new(@svnlogdir)).to_s
34
+ end
35
+ end
@@ -0,0 +1,136 @@
1
+ require 'yaml'
2
+
3
+ class CodespicuousConfigurator
4
+
5
+
6
+ attr_reader :repositories, :repositories_to_check, :committers, :teams, :config
7
+
8
+ def initialize(config)
9
+
10
+ @config = config
11
+
12
+ @repositories = Repositories.new
13
+ @repositories_to_check = Repositories.new
14
+
15
+ @committers = Committers.new
16
+ @teams = Teams.new
17
+ end
18
+
19
+ def configure(argv)
20
+
21
+ parse_command_line_arguments(argv)
22
+
23
+ yaml_content = configure_from_yaml
24
+ postprocess_yaml_configuration(yaml_content)
25
+
26
+ find_alternative_configuration_files
27
+
28
+ validate_configuration
29
+ end
30
+
31
+ def parse_command_line_arguments(argv)
32
+
33
+ parser = OptionParser.new do | opts |
34
+ opts.on('-r', '--repositories', "List the repositories the team committed to") do
35
+ @config.list_repositories = true
36
+ end
37
+
38
+ opts.on('-i', '--input-dir [dir]', String, "Directory location for input files such as configuration and cache") do |path|
39
+ @config.input_path = path
40
+ end
41
+
42
+ opts.on('-o', '--output-dir [dir]', String, "Directory location for output files") do |path|
43
+ @config.output_path = path
44
+ end
45
+ end
46
+
47
+ parser.parse!(argv)
48
+ end
49
+
50
+ def postprocess_yaml_configuration(yaml_content)
51
+ postprocess_yaml_configuration_repositories(yaml_content)
52
+ postprocess_yaml_configuration_committers(yaml_content)
53
+ end
54
+
55
+ def find_alternative_configuration_files
56
+ find_alternative_configuration_files_for_repositories
57
+ find_alternative_configuration_files_for_committers
58
+ end
59
+
60
+ def configure_from_yaml
61
+ return {} unless File.exist?(config.path_to_configuration_file)
62
+
63
+ puts "** Configuring options with \"#{config.path_to_configuration_file}\""
64
+ yaml_content = YAML::load(File.read(config.path_to_configuration_file))
65
+ config.offline = yaml_content["offline"] if yaml_content["offline"]
66
+ #{@filezilla_path#{@filezilla_path}}yaml_content
67
+ end
68
+
69
+ def postprocess_yaml_configuration_repositories(yaml_content)
70
+ repositories_in_yaml = yaml_content["repositories"] || {}
71
+ repositories_in_yaml.each { |name, url|
72
+ @repositories.add(Repository.new(name, url))
73
+ }
74
+
75
+ names_of_repositories_to_check = yaml_content["repositories_to_check"]
76
+ if (names_of_repositories_to_check)
77
+ @repositories.each { |repository|
78
+ @repositories_to_check.add(repository) if names_of_repositories_to_check.include?(repository.name)
79
+ }
80
+ else
81
+ @repositories_to_check = @repositories
82
+ end
83
+ end
84
+
85
+ def find_alternative_configuration_files_for_repositories
86
+ return unless repositories.empty?
87
+ return unless File.exist?("repositories.csv")
88
+
89
+ puts '** Configuring repositories with "repositories.csv"'
90
+
91
+ CSV.parse(File.read("repositories.csv"), headers: true) { |row|
92
+ @repositories.add(Repository.new(row["name"], row["url"]))
93
+ }
94
+ end
95
+
96
+ def validate_configuration
97
+ if @repositories.empty?
98
+ puts "** Error: No repositories configured in \"#{config.path_to_configuration_file}\""
99
+ return false
100
+ end
101
+ true
102
+ end
103
+
104
+ def postprocess_yaml_configuration_committers(yaml_content)
105
+ teams = yaml_content["teams"] || []
106
+
107
+ teams.each { |team_name, team_members|
108
+ new_team = Team.new(team_name)
109
+ team_members.each { |person|
110
+ committer = Committer.create_committer(person["Login"], person["First Name"], person["Last Name"], person["Email"], new_team)
111
+ new_team.add_member(committer)
112
+ @committers.add(committer)
113
+ @teams.add(new_team)
114
+ }
115
+ }
116
+ end
117
+
118
+ def find_alternative_configuration_files_for_committers
119
+ return unless committers.empty?
120
+ return unless File.exist?("committers.csv")
121
+
122
+ puts '** Configuring committers with "committers.csv"'
123
+
124
+ @committers = Committers.new
125
+ @teams = Teams.new
126
+
127
+ CSV.parse(File.read("committers.csv"), headers: true) { |row|
128
+ team = @teams.team(row["Team"])
129
+ committer = Committer.create_committer(row["Login"], row["First Name"], row["Last Name"], row["Email"], team)
130
+ team.add_member(committer)
131
+ @committers.add(committer)
132
+ }
133
+ @committers
134
+ end
135
+
136
+ end