metior 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +15 -3
- data/README.md +6 -1
- data/lib/metior.rb +0 -10
- data/lib/metior/github/commit.rb +2 -0
- data/lib/metior/github/repository.rb +1 -1
- data/lib/metior/vcs.rb +2 -9
- data/lib/metior/version.rb +1 -1
- data/metior.gemspec +0 -1
- data/test/test_github.rb +3 -3
- metadata +15 -31
data/Changelog.md
CHANGED
@@ -1,10 +1,22 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## Version 0.1.3
|
4
|
+
|
5
|
+
**June 13<sup>th</sup>, 2011**
|
6
|
+
|
7
|
+
* Fixed several GitHub bugs
|
8
|
+
* Made Metior.simple_stats more informative
|
9
|
+
* Improved Bundler integration
|
10
|
+
|
11
|
+
See the
|
12
|
+
[Git history](https://github.com/koraktor/metior/compare/0.1.2...0.1.3) for
|
13
|
+
version 0.1.3
|
14
|
+
|
3
15
|
## Version 0.1.2
|
4
16
|
|
5
17
|
**June 10<sup>th</sup>, 2011**
|
6
18
|
|
7
|
-
* Fixed Bundler integration
|
19
|
+
* Fixed Bundler integration
|
8
20
|
* Fixed Metior.simple_stats with default branch
|
9
21
|
|
10
22
|
See the
|
data/README.md
CHANGED
@@ -14,10 +14,15 @@ If you're interested in Metior, feel free to join the discussion on Convore in
|
|
14
14
|
### One-liner for some basic statistics
|
15
15
|
|
16
16
|
Metior.simple_stats :git, '~/open-source/metior'
|
17
|
+
Metior.simple_stats :github, 'koraktor', 'metior'
|
17
18
|
|
18
|
-
###
|
19
|
+
### Create a repository object for different VCSs
|
19
20
|
|
20
21
|
repo = Metior::Git::Repository.new '~/open-source/metior'
|
22
|
+
repo = Metior::GitHub::Repository.new 'koraktor', 'metior'
|
23
|
+
|
24
|
+
### More fine-grained access to repository statistics
|
25
|
+
|
21
26
|
repo.commits 'development' # Get all commits in development
|
22
27
|
repo.file_stats # Basic statistics about the files
|
23
28
|
# contained in a repository
|
data/lib/metior.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
#
|
4
4
|
# Copyright (c) 2011, Sebastian Staudt
|
5
5
|
|
6
|
-
require 'bundler'
|
7
|
-
|
8
6
|
require 'core_ext/object'
|
9
7
|
require 'metior/git'
|
10
8
|
require 'metior/github'
|
@@ -16,14 +14,6 @@ require 'metior/version'
|
|
16
14
|
# @author Sebastian Staudt
|
17
15
|
module Metior
|
18
16
|
|
19
|
-
# Returns the Bundler runtime to access Metior's dependencies
|
20
|
-
#
|
21
|
-
# @return [Bundler::Runtime] The Bundler runtime instance
|
22
|
-
def self.runtime
|
23
|
-
@@runtime ||= Bundler::Runtime.new File.dirname(__FILE__),
|
24
|
-
Bundler.definition
|
25
|
-
end
|
26
|
-
|
27
17
|
# Creates a new repository for the given repository type and path
|
28
18
|
#
|
29
19
|
# @param [Symbol] type The type of the repository, e.g. `:git`
|
data/lib/metior/github/commit.rb
CHANGED
data/lib/metior/vcs.rb
CHANGED
@@ -58,16 +58,9 @@ module Metior
|
|
58
58
|
|
59
59
|
# This initializes the VCS's implementation `Module`
|
60
60
|
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
# required.
|
64
|
-
#
|
65
|
-
# @see Bundler.require
|
61
|
+
# This requires the `Actor`, `Commit` and `Repository` classes for that
|
62
|
+
# VCS implementation.
|
66
63
|
def init
|
67
|
-
Metior.runtime.dependencies_for(self::NAME).each do |dep|
|
68
|
-
gem dep.name, dep.requirement
|
69
|
-
end
|
70
|
-
|
71
64
|
path = self::NAME.to_s
|
72
65
|
require "metior/#{path}/actor"
|
73
66
|
require "metior/#{path}/commit"
|
data/lib/metior/version.rb
CHANGED
data/metior.gemspec
CHANGED
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = 'A source code history analyzer API'
|
13
13
|
s.description = 'Metior is a source code history analyzer that provides various statistics about a source code repository and its change over time.'
|
14
14
|
|
15
|
-
s.add_dependency 'bundler', '~> 1.0.14'
|
16
15
|
Bundler.definition.dependencies.each do |dep|
|
17
16
|
if dep.groups.include?(:development) || dep.groups.include?(:test)
|
18
17
|
s.add_development_dependency(dep.name, dep.requirement.to_s)
|
data/test/test_github.rb
CHANGED
@@ -28,7 +28,7 @@ class TestGitHub < Test::Unit::TestCase
|
|
28
28
|
api_response = Fixtures.commits_as_rashies(''..'master')
|
29
29
|
@commits_stub = Octokit.stubs :commits
|
30
30
|
14.times { @commits_stub.returns api_response.shift(35) }
|
31
|
-
@commits_stub.then.raises
|
31
|
+
@commits_stub.then.raises Octokit::NotFound.new(nil)
|
32
32
|
end
|
33
33
|
|
34
34
|
should 'be able to load all commits from the repository\'s default branch' do
|
@@ -44,10 +44,10 @@ class TestGitHub < Test::Unit::TestCase
|
|
44
44
|
@commits_stub = Octokit.stubs :commits
|
45
45
|
api_response = Fixtures.commits_as_rashies(''..'4c592b4')
|
46
46
|
14.times { @commits_stub.returns api_response.shift(35) }
|
47
|
-
@commits_stub.raises
|
47
|
+
@commits_stub.raises Octokit::NotFound.new(nil)
|
48
48
|
api_response = Fixtures.commits_as_rashies(''..'ef2870b')
|
49
49
|
13.times { @commits_stub.returns api_response.shift(35) }
|
50
|
-
@commits_stub.then.raises
|
50
|
+
@commits_stub.then.raises Octokit::NotFound.new(nil)
|
51
51
|
|
52
52
|
commits = @repo.commits 'ef2870b'..'4c592b4'
|
53
53
|
assert_equal 6, commits.size
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sebastian Staudt
|
@@ -15,27 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-16 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :runtime
|
22
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 11
|
28
|
-
segments:
|
29
|
-
- 1
|
30
|
-
- 0
|
31
|
-
- 14
|
32
|
-
version: 1.0.14
|
33
|
-
prerelease: false
|
34
|
-
name: bundler
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
type: :runtime
|
38
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
39
23
|
none: false
|
40
24
|
requirements:
|
41
25
|
- - ~>
|
@@ -48,10 +32,10 @@ dependencies:
|
|
48
32
|
version: 2.4.1
|
49
33
|
prerelease: false
|
50
34
|
name: grit
|
51
|
-
version_requirements: *
|
35
|
+
version_requirements: *id001
|
52
36
|
- !ruby/object:Gem::Dependency
|
53
37
|
type: :runtime
|
54
|
-
requirement: &
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
55
39
|
none: false
|
56
40
|
requirements:
|
57
41
|
- - ~>
|
@@ -64,10 +48,10 @@ dependencies:
|
|
64
48
|
version: 0.6.3
|
65
49
|
prerelease: false
|
66
50
|
name: octokit
|
67
|
-
version_requirements: *
|
51
|
+
version_requirements: *id002
|
68
52
|
- !ruby/object:Gem::Dependency
|
69
53
|
type: :development
|
70
|
-
requirement: &
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
71
55
|
none: false
|
72
56
|
requirements:
|
73
57
|
- - ~>
|
@@ -80,10 +64,10 @@ dependencies:
|
|
80
64
|
version: 0.9.1
|
81
65
|
prerelease: false
|
82
66
|
name: rake
|
83
|
-
version_requirements: *
|
67
|
+
version_requirements: *id003
|
84
68
|
- !ruby/object:Gem::Dependency
|
85
69
|
type: :development
|
86
|
-
requirement: &
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
87
71
|
none: false
|
88
72
|
requirements:
|
89
73
|
- - ~>
|
@@ -96,10 +80,10 @@ dependencies:
|
|
96
80
|
version: 0.7.1
|
97
81
|
prerelease: false
|
98
82
|
name: yard
|
99
|
-
version_requirements: *
|
83
|
+
version_requirements: *id004
|
100
84
|
- !ruby/object:Gem::Dependency
|
101
85
|
type: :development
|
102
|
-
requirement: &
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
103
87
|
none: false
|
104
88
|
requirements:
|
105
89
|
- - ~>
|
@@ -112,10 +96,10 @@ dependencies:
|
|
112
96
|
version: 0.9.12
|
113
97
|
prerelease: false
|
114
98
|
name: mocha
|
115
|
-
version_requirements: *
|
99
|
+
version_requirements: *id005
|
116
100
|
- !ruby/object:Gem::Dependency
|
117
101
|
type: :development
|
118
|
-
requirement: &
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
119
103
|
none: false
|
120
104
|
requirements:
|
121
105
|
- - ~>
|
@@ -128,7 +112,7 @@ dependencies:
|
|
128
112
|
version: 2.11.3
|
129
113
|
prerelease: false
|
130
114
|
name: shoulda
|
131
|
-
version_requirements: *
|
115
|
+
version_requirements: *id006
|
132
116
|
description: Metior is a source code history analyzer that provides various statistics about a source code repository and its change over time.
|
133
117
|
email:
|
134
118
|
- koraktor@gmail.com
|