hotspots 0.3.0 → 1.0.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.
- data/CHANGELOG.md +5 -0
- data/TODO.md +0 -1
- data/bin/hotspots +3 -1
- data/lib/hotspots.rb +4 -15
- data/lib/hotspots/logger.rb +2 -7
- data/lib/hotspots/option_based_exit.rb +0 -4
- data/lib/hotspots/repository/driver/git.rb +0 -2
- data/lib/hotspots/version.rb +1 -1
- metadata +3 -4
- data/lib/hotspots/exit_strategy.rb +0 -13
data/CHANGELOG.md
CHANGED
data/TODO.md
CHANGED
data/bin/hotspots
CHANGED
data/lib/hotspots.rb
CHANGED
@@ -10,10 +10,8 @@ module Hotspots
|
|
10
10
|
:exit_strategy, :driver, :parser, :store,
|
11
11
|
:time, :message_filters, :file_filter, :cutoff
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
def initialize(opts = nil)
|
16
|
-
options = opts.nil? ? Hotspots::OptionsParser.new.parse(*ARGV) : Hotspots::OptionsParser.default_options.merge(opts)
|
13
|
+
def initialize(opts)
|
14
|
+
options = Hotspots::OptionsParser.default_options.merge(opts)
|
17
15
|
|
18
16
|
@logger = Hotspots::Logger.new
|
19
17
|
@repository = options[:repository]
|
@@ -33,32 +31,23 @@ module Hotspots
|
|
33
31
|
run
|
34
32
|
end
|
35
33
|
|
36
|
-
|
34
|
+
private
|
35
|
+
|
37
36
|
def validate #:nodoc:
|
38
37
|
exit_if_options_are_for_help
|
39
38
|
exit_if_not_git_repository
|
40
39
|
end
|
41
40
|
|
42
|
-
# TODO : this method should be private
|
43
41
|
def set #:nodoc:
|
44
42
|
configure_logger
|
45
43
|
set_path
|
46
44
|
assign
|
47
45
|
end
|
48
46
|
|
49
|
-
# TODO : this method should be private
|
50
47
|
def run #:nodoc:
|
51
48
|
puts store.to_s
|
52
49
|
end
|
53
50
|
|
54
|
-
# TODO : these methods should be private
|
55
|
-
# compatibility begin
|
56
|
-
alias_method :execute!, :output
|
57
|
-
alias_method :validate!, :validate
|
58
|
-
# compatibility end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
51
|
def exit_if_options_are_for_help
|
63
52
|
exit_strategy.perform
|
64
53
|
end
|
data/lib/hotspots/logger.rb
CHANGED
@@ -48,16 +48,11 @@ module Hotspots
|
|
48
48
|
sink << format(message, options)
|
49
49
|
end
|
50
50
|
|
51
|
-
|
51
|
+
private
|
52
|
+
|
52
53
|
# Time stampimg should be part of log level
|
53
54
|
def format(message, options = {})
|
54
55
|
colour.as(options[:as] || "black", "[#{Time.now}] #{message}\n")
|
55
56
|
end
|
56
|
-
|
57
|
-
# compatibility begin
|
58
|
-
alias_method :set_console, :as_console
|
59
|
-
Console = Sink::Console
|
60
|
-
Null = Sink::Null
|
61
|
-
# compatibility end
|
62
57
|
end
|
63
58
|
end
|
@@ -8,13 +8,11 @@ module Hotspots
|
|
8
8
|
@logger = logger
|
9
9
|
end
|
10
10
|
|
11
|
-
# Input and output should be optionally coloured
|
12
11
|
def pretty_log(options)
|
13
12
|
command = log_with_tag("Input", :as => :green) { Command::Git::Log.new(:since_days => options[:since_days], :message_filter => options[:message_filter]).build }
|
14
13
|
log_with_tag("Output", :as => :red) { %x(#{command}) }
|
15
14
|
end
|
16
15
|
|
17
|
-
# Input and output should be optionally coloured
|
18
16
|
def show_one_line_names(options)
|
19
17
|
command = log_with_tag("Input", :as => :green) { Command::Git::Show.new(:commit_hash => options[:commit_hash]).build }
|
20
18
|
log_with_tag("Output", :as => :red) { %x(#{command}) }
|
data/lib/hotspots/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotspots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -91,7 +91,6 @@ executables:
|
|
91
91
|
extensions: []
|
92
92
|
extra_rdoc_files: []
|
93
93
|
files:
|
94
|
-
- lib/hotspots/exit_strategy.rb
|
95
94
|
- lib/hotspots/logger.rb
|
96
95
|
- lib/hotspots/option_based_exit.rb
|
97
96
|
- lib/hotspots/options_parser.rb
|
@@ -129,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
128
|
version: '0'
|
130
129
|
segments:
|
131
130
|
- 0
|
132
|
-
hash:
|
131
|
+
hash: 684827185202909371
|
133
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
133
|
none: false
|
135
134
|
requirements:
|
@@ -138,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
137
|
version: '0'
|
139
138
|
segments:
|
140
139
|
- 0
|
141
|
-
hash:
|
140
|
+
hash: 684827185202909371
|
142
141
|
requirements: []
|
143
142
|
rubyforge_project: hotspots
|
144
143
|
rubygems_version: 1.8.24
|