log_switch 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +5 -0
- data/README.rdoc +7 -1
- data/Rakefile +2 -2
- data/lib/log_switch.rb +1 -1
- data/lib/log_switch/version.rb +1 -1
- data/log_switch.gemspec +5 -5
- data/spec/log_switch_spec.rb +2 -2
- data/spec/spec_helper.rb +12 -10
- metadata +14 -39
- data/tasks/metrics.rake +0 -59
- data/tasks/roodi_config.yaml +0 -14
- data/tasks/stats.rake +0 -12
data/History.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -63,7 +63,13 @@ If you have another Logger object you want to write to, no problem:
|
|
63
63
|
|
64
64
|
== REQUIREMENTS
|
65
65
|
|
66
|
-
*
|
66
|
+
* Rubies (tested):
|
67
|
+
* MRI 1.9.3-rc1
|
68
|
+
* MRI 1.9.2
|
69
|
+
* MRI 1.8.7
|
70
|
+
* ree 1.8.7-2011.03
|
71
|
+
* JRuby 1.6.4
|
72
|
+
* Rubinius 1.2.4
|
67
73
|
* RubyGems:
|
68
74
|
* None!
|
69
75
|
|
data/Rakefile
CHANGED
data/lib/log_switch.rb
CHANGED
data/lib/log_switch/version.rb
CHANGED
data/log_switch.gemspec
CHANGED
@@ -12,18 +12,18 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.required_rubygems_version = ">=1.8.0"
|
14
14
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
15
|
-
s.files = Dir.glob("{bin,features,lib,spec
|
15
|
+
s.files = Dir.glob("{bin,features,lib,spec}/**/*") + Dir.glob("*.rdoc") +
|
16
16
|
%w(.gemtest Gemfile log_switch.gemspec Rakefile)
|
17
17
|
s.test_files = Dir.glob("{features,spec}/**/*")
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
20
|
s.add_development_dependency("bundler", [">= 0"])
|
21
|
-
s.add_development_dependency("code_statistics", ["~> 0.2.13"])
|
22
|
-
s.add_development_dependency("metric_fu", [">= 2.0.1"])
|
23
21
|
s.add_development_dependency("rake", [">= 0"])
|
24
22
|
s.add_development_dependency("rspec", ["~> 2.6.0"])
|
25
|
-
|
26
|
-
|
23
|
+
if RUBY_VERSION > '1.9'
|
24
|
+
s.add_development_dependency("simplecov", [">= 0"])
|
25
|
+
s.add_development_dependency("simplecov-rcov-text", [">= 0"])
|
26
|
+
end
|
27
27
|
s.add_development_dependency("yard", [">= 0.7.2"])
|
28
28
|
end
|
29
29
|
|
data/spec/log_switch_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
describe Kernel do
|
4
4
|
def self.get_requires
|
@@ -23,7 +23,7 @@ describe "LogSwitch" do
|
|
23
23
|
MyClass.reset_config!
|
24
24
|
end
|
25
25
|
|
26
|
-
it { LogSwitch::VERSION.should == '0.1.
|
26
|
+
it { LogSwitch::VERSION.should == '0.1.3' }
|
27
27
|
|
28
28
|
describe "log" do
|
29
29
|
it "should default to true" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
-
|
2
|
-
require 'simplecov
|
1
|
+
if RUBY_VERSION > '1.9'
|
2
|
+
require 'simplecov'
|
3
|
+
require 'simplecov-rcov-text'
|
3
4
|
|
4
|
-
class SimpleCov::Formatter::MergedFormatter
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
class SimpleCov::Formatter::MergedFormatter
|
6
|
+
def format(result)
|
7
|
+
SimpleCov::Formatter::HTMLFormatter.new.format(result)
|
8
|
+
SimpleCov::Formatter::RcovTextFormatter.new.format(result)
|
9
|
+
end
|
8
10
|
end
|
9
|
-
end
|
10
11
|
|
11
|
-
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
|
12
|
+
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
|
12
13
|
|
13
|
-
SimpleCov.start do
|
14
|
-
|
14
|
+
SimpleCov.start do
|
15
|
+
add_filter "/spec"
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
19
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_switch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-10 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70304360655700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,32 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: code_statistics
|
27
|
-
requirement: &70120720066540 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.2.13
|
33
|
-
type: :development
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70120720066540
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: metric_fu
|
38
|
-
requirement: &70120720060020 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ! '>='
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 2.0.1
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70120720060020
|
24
|
+
version_requirements: *70304360655700
|
47
25
|
- !ruby/object:Gem::Dependency
|
48
26
|
name: rake
|
49
|
-
requirement: &
|
27
|
+
requirement: &70304360655220 !ruby/object:Gem::Requirement
|
50
28
|
none: false
|
51
29
|
requirements:
|
52
30
|
- - ! '>='
|
@@ -54,10 +32,10 @@ dependencies:
|
|
54
32
|
version: '0'
|
55
33
|
type: :development
|
56
34
|
prerelease: false
|
57
|
-
version_requirements: *
|
35
|
+
version_requirements: *70304360655220
|
58
36
|
- !ruby/object:Gem::Dependency
|
59
37
|
name: rspec
|
60
|
-
requirement: &
|
38
|
+
requirement: &70304360654740 !ruby/object:Gem::Requirement
|
61
39
|
none: false
|
62
40
|
requirements:
|
63
41
|
- - ~>
|
@@ -65,10 +43,10 @@ dependencies:
|
|
65
43
|
version: 2.6.0
|
66
44
|
type: :development
|
67
45
|
prerelease: false
|
68
|
-
version_requirements: *
|
46
|
+
version_requirements: *70304360654740
|
69
47
|
- !ruby/object:Gem::Dependency
|
70
48
|
name: simplecov
|
71
|
-
requirement: &
|
49
|
+
requirement: &70304360654240 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
51
|
requirements:
|
74
52
|
- - ! '>='
|
@@ -76,10 +54,10 @@ dependencies:
|
|
76
54
|
version: '0'
|
77
55
|
type: :development
|
78
56
|
prerelease: false
|
79
|
-
version_requirements: *
|
57
|
+
version_requirements: *70304360654240
|
80
58
|
- !ruby/object:Gem::Dependency
|
81
59
|
name: simplecov-rcov-text
|
82
|
-
requirement: &
|
60
|
+
requirement: &70304360653760 !ruby/object:Gem::Requirement
|
83
61
|
none: false
|
84
62
|
requirements:
|
85
63
|
- - ! '>='
|
@@ -87,10 +65,10 @@ dependencies:
|
|
87
65
|
version: '0'
|
88
66
|
type: :development
|
89
67
|
prerelease: false
|
90
|
-
version_requirements: *
|
68
|
+
version_requirements: *70304360653760
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
70
|
name: yard
|
93
|
-
requirement: &
|
71
|
+
requirement: &70304360653280 !ruby/object:Gem::Requirement
|
94
72
|
none: false
|
95
73
|
requirements:
|
96
74
|
- - ! '>='
|
@@ -98,7 +76,7 @@ dependencies:
|
|
98
76
|
version: 0.7.2
|
99
77
|
type: :development
|
100
78
|
prerelease: false
|
101
|
-
version_requirements: *
|
79
|
+
version_requirements: *70304360653280
|
102
80
|
description: Extends a class for singleton style logging that can easily be turned
|
103
81
|
on and off.
|
104
82
|
email:
|
@@ -111,9 +89,6 @@ files:
|
|
111
89
|
- lib/log_switch.rb
|
112
90
|
- spec/log_switch_spec.rb
|
113
91
|
- spec/spec_helper.rb
|
114
|
-
- tasks/metrics.rake
|
115
|
-
- tasks/roodi_config.yaml
|
116
|
-
- tasks/stats.rake
|
117
92
|
- History.rdoc
|
118
93
|
- README.rdoc
|
119
94
|
- .gemtest
|
data/tasks/metrics.rake
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'metric_fu'
|
2
|
-
|
3
|
-
MetricFu::Configuration.run do |config|
|
4
|
-
config.metrics = [
|
5
|
-
:churn,
|
6
|
-
:flog,
|
7
|
-
:flay,
|
8
|
-
:hotspots,
|
9
|
-
:rcov,
|
10
|
-
:reek,
|
11
|
-
:roodi,
|
12
|
-
:stats,
|
13
|
-
]
|
14
|
-
config.graphs = [
|
15
|
-
:flog,
|
16
|
-
:flay,
|
17
|
-
:rcov,
|
18
|
-
:reek,
|
19
|
-
:roodi,
|
20
|
-
:stats
|
21
|
-
]
|
22
|
-
config.churn = {
|
23
|
-
start_date: "1 year ago",
|
24
|
-
minimum_churn_count: 10
|
25
|
-
}
|
26
|
-
config.flay = {
|
27
|
-
dirs_to_flay: %w(
|
28
|
-
lib
|
29
|
-
features/step_definitions
|
30
|
-
features/support
|
31
|
-
),
|
32
|
-
minimum_score: 10,
|
33
|
-
filetypes: %w(rb)
|
34
|
-
}
|
35
|
-
config.flog = {
|
36
|
-
dirs_to_flog: %w(
|
37
|
-
lib
|
38
|
-
features/step_definitions
|
39
|
-
features/support
|
40
|
-
)
|
41
|
-
}
|
42
|
-
config.reek = {
|
43
|
-
dirs_to_reek: %w(
|
44
|
-
lib
|
45
|
-
features/step_definitions
|
46
|
-
features/support
|
47
|
-
)
|
48
|
-
}
|
49
|
-
config.roodi = {
|
50
|
-
dirs_to_roodi: %w(
|
51
|
-
lib
|
52
|
-
features/step_definitions
|
53
|
-
features/support
|
54
|
-
),
|
55
|
-
roodi_config: "tasks/roodi_config.yaml"
|
56
|
-
}
|
57
|
-
config.rcov[:external] = 'coverage/rcov/rcov.txt'
|
58
|
-
config.graph_engine = :bluff
|
59
|
-
end
|
data/tasks/roodi_config.yaml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
---
|
2
|
-
AssignmentInConditionalCheck: { }
|
3
|
-
CaseMissingElseCheck: { }
|
4
|
-
ClassLineCountCheck: { line_count: 300 }
|
5
|
-
ClassNameCheck: { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
|
6
|
-
CyclomaticComplexityBlockCheck: { complexity: 4 }
|
7
|
-
CyclomaticComplexityMethodCheck: { complexity: 8 }
|
8
|
-
EmptyRescueBodyCheck: { }
|
9
|
-
ForLoopCheck: { }
|
10
|
-
MethodLineCountCheck: { line_count: 30 }
|
11
|
-
MethodNameCheck: { pattern: !ruby/regexp /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ }
|
12
|
-
ModuleLineCountCheck: { line_count: 300 }
|
13
|
-
ModuleNameCheck: { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
|
14
|
-
ParameterNumberCheck: { parameter_count: 5 }
|
data/tasks/stats.rake
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'code_statistics'
|
2
|
-
|
3
|
-
STATS_DIRECTORIES = [
|
4
|
-
%w(Library lib),
|
5
|
-
%w(Behavior\ tests features/step_definitions),
|
6
|
-
%w(Unit\ tests spec)
|
7
|
-
].collect { |name, dir| [ name, "#{dir}" ] }.select { |name, dir| File.directory?(dir) }
|
8
|
-
|
9
|
-
desc "Report code statistics (KLOCs, etc) from the application"
|
10
|
-
task :stats do
|
11
|
-
CodeStatistics::CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
12
|
-
end
|