hotspots 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ v1.0.0
2
+ ------
3
+
4
+ * Drop older compatibility methods, modules and classes
5
+
1
6
  v0.3.0
2
7
  ------
3
8
 
data/TODO.md CHANGED
@@ -1,3 +1,2 @@
1
1
  * Allow better use as a library - add documentation
2
2
  * Reduce conditionals
3
- * Remove compatibility layers in a major release
@@ -2,4 +2,6 @@
2
2
 
3
3
  require 'hotspots'
4
4
 
5
- Hotspots::Main.new.output
5
+ options = Hotspots::OptionsParser.new.parse(*ARGV)
6
+
7
+ Hotspots::Main.new(options).output
@@ -10,10 +10,8 @@ module Hotspots
10
10
  :exit_strategy, :driver, :parser, :store,
11
11
  :time, :message_filters, :file_filter, :cutoff
12
12
 
13
- # TODO : change this signature - this method should get resolved options as parameters
14
- # initialize is not responsible for invoking option parsing
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
- # TODO : this method should be private
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
@@ -48,16 +48,11 @@ module Hotspots
48
48
  sink << format(message, options)
49
49
  end
50
50
 
51
- # Make this method private
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
@@ -41,7 +41,3 @@ module Hotspots
41
41
  end
42
42
  end
43
43
  end
44
-
45
- # compatibility begin
46
- require 'hotspots/exit_strategy'
47
- # compatibility 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}) }
@@ -1,3 +1,3 @@
1
1
  module Hotspots
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
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.3.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: -2901882375356969213
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: -2901882375356969213
140
+ hash: 684827185202909371
142
141
  requirements: []
143
142
  rubyforge_project: hotspots
144
143
  rubygems_version: 1.8.24
@@ -1,13 +0,0 @@
1
- # compatibility begin
2
- module Hotspots
3
- module OptionBasedExit #:nodoc: all
4
- class Error; end
5
- class Safe; end
6
- class Noop; end
7
-
8
- ExitStrategy = Error
9
- ExitStrategy::Safe = Safe
10
- ExitStrategy::Null = Noop
11
- end
12
- end
13
- # compatibility end