hotspots 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG.markdown → CHANGELOG.md} +10 -2
- data/{README.markdown → README.md} +12 -1
- data/TODO.md +4 -0
- data/bin/hotspots +0 -3
- data/lib/hotspots.rb +2 -2
- data/lib/hotspots/logger.rb +2 -2
- data/lib/hotspots/store.rb +1 -1
- data/lib/hotspots/version.rb +1 -1
- data/test/hotspots/options_parser_test.rb +3 -1
- data/test/hotspots/repository/parser/git_test.rb +2 -0
- data/test/hotspots/store_test.rb +2 -0
- data/test/minitest_helper.rb +17 -0
- metadata +86 -75
- data/.gitignore +0 -2
- data/Gemfile +0 -4
- data/Rakefile +0 -53
- data/hotspots.gemspec +0 -27
@@ -1,12 +1,20 @@
|
|
1
|
+
v0.1.1
|
2
|
+
-------
|
3
|
+
|
4
|
+
* Sort for an array of array via spaceship operator returns different result on each run on ruby 1.8.7. Store has a string representation breaks intermittently on 1.8.7. Tests fail intermittently on 1.8.7. So support for ruby 1.9.x only
|
5
|
+
* Simplify Rakefile
|
6
|
+
* Pull out a minitest_helper
|
7
|
+
* Allow gem to be used as a library
|
8
|
+
|
1
9
|
v0.1.0
|
2
10
|
------
|
3
11
|
|
4
|
-
* Version bump to force gem install to
|
12
|
+
* Version bump to force gem install to download latest version
|
5
13
|
|
6
14
|
v0.0.13
|
7
15
|
-------
|
8
16
|
|
9
|
-
* Fix switch 'since' for git 1.7.2.5 (Thanks to Phil Hofmann)
|
17
|
+
* Fix switch 'since' for git 1.7.2.5 (Thanks to Phil Hofmann https://github.com/branch14)
|
10
18
|
* Display a warning and run tests without reporting coverage if simplecov is not present
|
11
19
|
* Change format in verbose mode
|
12
20
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://secure.travis-ci.org/chiku/hotspots.png?branch=master)](https://travis-ci.org/chiku/hotspots)
|
2
|
+
|
1
3
|
Overview
|
2
4
|
--------
|
3
5
|
|
@@ -28,7 +30,7 @@ Specific options:
|
|
28
30
|
-f, --file-filter [REGEX] Regular expression to filtering file names. All files are allowed when not specified
|
29
31
|
-m, --message-filter [PIPE SEPARATED] Values to filter files names against each commit message separated by pipe.
|
30
32
|
All files are allowed when not specified
|
31
|
-
-c, --cutoff [CUTOFF] The minimum
|
33
|
+
-c, --cutoff [CUTOFF] The minimum occurrence to consider for a file to appear in the list. Defaults to zero
|
32
34
|
-v, --verbose Show verbose output
|
33
35
|
--version Show version information
|
34
36
|
-h, --help Show this message
|
@@ -61,6 +63,15 @@ gem install simplecov
|
|
61
63
|
rake
|
62
64
|
```
|
63
65
|
|
66
|
+
Contributing
|
67
|
+
------------
|
68
|
+
|
69
|
+
* Fork the project.
|
70
|
+
* Make your feature addition or bug fix.
|
71
|
+
* Add tests for it. This is important so I don't break it in a future version unintentionally.
|
72
|
+
* Commit, but do not mess with the VERSION. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.
|
73
|
+
* Send me a pull request.
|
74
|
+
|
64
75
|
License
|
65
76
|
-------
|
66
77
|
|
data/TODO.md
ADDED
data/bin/hotspots
CHANGED
data/lib/hotspots.rb
CHANGED
@@ -9,8 +9,8 @@ module Hotspots
|
|
9
9
|
attr_reader :logger, :options, :repository, :verbose,
|
10
10
|
:exit_strategy, :driver, :parser, :store
|
11
11
|
|
12
|
-
def initialize
|
13
|
-
@options = Hotspots::OptionsParser.new.parse(*ARGV)
|
12
|
+
def initialize(opts = nil)
|
13
|
+
@options = opts || Hotspots::OptionsParser.new.parse(*ARGV)
|
14
14
|
@repository = options[:repository]
|
15
15
|
@verbose = options[:verbose]
|
16
16
|
@exit_strategy = options[:exit_strategy]
|
data/lib/hotspots/logger.rb
CHANGED
data/lib/hotspots/store.rb
CHANGED
data/lib/hotspots/version.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib', 'hotspots', 'options_parser')
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib', 'hotspots', 'exit_strategy')
|
2
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib', 'hotspots', 'options_parser')
|
3
|
+
|
4
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'minitest_helper')
|
3
5
|
|
4
6
|
module Hotspots
|
5
7
|
describe "OptionsParser" do
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', '..', '..', 'lib', 'hotspots', 'repository', 'parser', 'git')
|
2
2
|
|
3
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', '..', 'minitest_helper')
|
4
|
+
|
3
5
|
module Hotspots::Repository
|
4
6
|
describe "Parser::Git" do
|
5
7
|
it "fetches a commit hash based on filter and time" do
|
data/test/hotspots/store_test.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib', 'hotspots', 'store')
|
2
2
|
|
3
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'minitest_helper')
|
4
|
+
|
3
5
|
module Hotspots
|
4
6
|
describe "Store" do
|
5
7
|
it "counts occurances of a line present once" do
|
@@ -0,0 +1,17 @@
|
|
1
|
+
begin
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter "/test/"
|
5
|
+
end
|
6
|
+
rescue LoadError
|
7
|
+
puts "\nPlease install simplecov to generate coverage report!\n\n"
|
8
|
+
end
|
9
|
+
|
10
|
+
# eager load all files
|
11
|
+
Dir["lib/**/*.rb"].each do |file|
|
12
|
+
require File.expand_path(file)
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
require 'minitest/autorun'
|
17
|
+
require 'minitest/spec'
|
metadata
CHANGED
@@ -1,115 +1,126 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotspots
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Chirantan Mitra
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
name: simplecov
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-12-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :development
|
32
|
-
|
33
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
34
31
|
name: minitest
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
35
39
|
prerelease: false
|
36
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: simplecov
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
37
49
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
- 0
|
43
|
-
version: "0"
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
44
54
|
type: :development
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: ! 'Find all files that changed over the past days for a git repository.
|
63
|
+
If the same file is modified over
|
64
|
+
|
65
|
+
and over again, it may require re-design. Watch out for file changes that don''t
|
66
|
+
have a corresponding
|
67
|
+
|
49
68
|
test change.
|
50
69
|
|
51
|
-
|
70
|
+
'
|
71
|
+
email:
|
52
72
|
- chirantan.mitra@gmail.com
|
53
|
-
executables:
|
73
|
+
executables:
|
54
74
|
- hotspots
|
55
75
|
extensions: []
|
56
|
-
|
57
76
|
extra_rdoc_files: []
|
58
|
-
|
59
|
-
files:
|
60
|
-
- .gitignore
|
61
|
-
- CHANGELOG.markdown
|
62
|
-
- Gemfile
|
63
|
-
- LICENSE
|
64
|
-
- README.markdown
|
65
|
-
- Rakefile
|
66
|
-
- bin/hotspots
|
67
|
-
- hotspots.gemspec
|
68
|
-
- lib/hotspots.rb
|
77
|
+
files:
|
69
78
|
- lib/hotspots/exit_strategy.rb
|
70
79
|
- lib/hotspots/logger.rb
|
71
80
|
- lib/hotspots/options_parser.rb
|
72
|
-
- lib/hotspots/repository.rb
|
73
|
-
- lib/hotspots/repository/driver.rb
|
74
81
|
- lib/hotspots/repository/driver/git.rb
|
75
|
-
- lib/hotspots/repository/
|
82
|
+
- lib/hotspots/repository/driver.rb
|
76
83
|
- lib/hotspots/repository/parser/git.rb
|
84
|
+
- lib/hotspots/repository/parser.rb
|
85
|
+
- lib/hotspots/repository.rb
|
77
86
|
- lib/hotspots/store.rb
|
78
87
|
- lib/hotspots/version.rb
|
88
|
+
- lib/hotspots.rb
|
89
|
+
- bin/hotspots
|
79
90
|
- test/hotspots/options_parser_test.rb
|
80
91
|
- test/hotspots/repository/parser/git_test.rb
|
81
92
|
- test/hotspots/store_test.rb
|
82
|
-
|
93
|
+
- test/minitest_helper.rb
|
94
|
+
- LICENSE
|
95
|
+
- README.md
|
96
|
+
- CHANGELOG.md
|
97
|
+
- TODO.md
|
83
98
|
homepage: https://github.com/chiku/hotspots
|
84
99
|
licenses: []
|
85
|
-
|
86
100
|
post_install_message:
|
87
101
|
rdoc_options: []
|
88
|
-
|
89
|
-
require_paths:
|
102
|
+
require_paths:
|
90
103
|
- lib
|
91
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
105
|
none: false
|
93
|
-
requirements:
|
94
|
-
- -
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
|
97
|
-
|
98
|
-
version: "0"
|
99
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
111
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
- 0
|
106
|
-
version: "0"
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
107
116
|
requirements: []
|
108
|
-
|
109
117
|
rubyforge_project: hotspots
|
110
|
-
rubygems_version: 1.
|
118
|
+
rubygems_version: 1.8.24
|
111
119
|
signing_key:
|
112
120
|
specification_version: 3
|
113
121
|
summary: Find all files that changed over the past in a git repository based on conditions
|
114
|
-
test_files:
|
115
|
-
|
122
|
+
test_files:
|
123
|
+
- test/hotspots/options_parser_test.rb
|
124
|
+
- test/hotspots/repository/parser/git_test.rb
|
125
|
+
- test/hotspots/store_test.rb
|
126
|
+
- test/minitest_helper.rb
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
def load_all_tests
|
2
|
-
require 'rake/runtest'
|
3
|
-
require 'minitest/autorun'
|
4
|
-
require 'minitest/spec'
|
5
|
-
|
6
|
-
lib = File.expand_path(File.dirname(__FILE__) + '/lib')
|
7
|
-
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
8
|
-
end
|
9
|
-
|
10
|
-
def load_all_source_files
|
11
|
-
Dir[File.join(File.expand_path(File.dirname(__FILE__)), "lib", "**", "*.rb")].each do |file|
|
12
|
-
require file
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def run_all_tests
|
17
|
-
Dir[File.join(File.expand_path(File.dirname(__FILE__)), "test", "**", "*_test.rb")].each do |file|
|
18
|
-
Rake.run_tests file
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def require_simplecov
|
23
|
-
begin
|
24
|
-
require 'simplecov'
|
25
|
-
|
26
|
-
SimpleCov.start do
|
27
|
-
add_filter "/test/"
|
28
|
-
end
|
29
|
-
|
30
|
-
rescue LoadError
|
31
|
-
$stderr.puts <<-EOS
|
32
|
-
|
33
|
-
Could bot generate coverage report since 'simplecov' is unavailable.
|
34
|
-
Please install simplecov and re-run to generate coverage report.
|
35
|
-
[sudo] gem install simplecov
|
36
|
-
|
37
|
-
EOS
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
task :test do
|
42
|
-
load_all_tests
|
43
|
-
run_all_tests
|
44
|
-
end
|
45
|
-
|
46
|
-
task :coverage do
|
47
|
-
require_simplecov
|
48
|
-
load_all_tests
|
49
|
-
load_all_source_files
|
50
|
-
run_all_tests
|
51
|
-
end
|
52
|
-
|
53
|
-
task :default => [:coverage]
|
data/hotspots.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
$:.push File.expand_path("../lib", __FILE__)
|
4
|
-
|
5
|
-
require "hotspots/version"
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "hotspots"
|
9
|
-
s.version = Hotspots::VERSION
|
10
|
-
s.authors = ["Chirantan Mitra"]
|
11
|
-
s.email = ["chirantan.mitra@gmail.com"]
|
12
|
-
s.homepage = "https://github.com/chiku/hotspots"
|
13
|
-
s.summary = "Find all files that changed over the past in a git repository based on conditions"
|
14
|
-
s.description = <<-EOS
|
15
|
-
Find all files that changed over the past days for a git repository. If the same file is modified over
|
16
|
-
and over again, it may require re-design. Watch out for file changes that don't have a corresponding
|
17
|
-
test change.
|
18
|
-
EOS
|
19
|
-
s.rubyforge_project = "hotspots"
|
20
|
-
s.files = `git ls-files`.split("\n")
|
21
|
-
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
22
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
-
s.require_paths = ["lib"]
|
24
|
-
|
25
|
-
s.add_development_dependency "simplecov"
|
26
|
-
s.add_development_dependency "minitest"
|
27
|
-
end
|