cromwell 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/Rakefile +35 -33
- data/VERSION +1 -1
- data/cromwell.gemspec +6 -3
- metadata +12 -2
data/README.rdoc
CHANGED
@@ -26,7 +26,7 @@ When used with a block, Cromwell executes the code inside the block protecting i
|
|
26
26
|
}
|
27
27
|
puts "You're still here?"
|
28
28
|
|
29
|
-
When you run this script (which lives in
|
29
|
+
When you run this script (which lives in {examples/example1.rb}[http://github.com/szeryf/cromwell/blob/master/examples/example1.rb]), you won't be able to interrupt it with <code>^C</code> or simple <code>kill</code> while it's sleeping for ten seconds:
|
30
30
|
|
31
31
|
$ ruby examples/example1.rb
|
32
32
|
See you in a while...
|
@@ -71,7 +71,7 @@ If you want to have more control over what's protected in your script, you can u
|
|
71
71
|
Cromwell.unprotect
|
72
72
|
puts "You're still here?"
|
73
73
|
|
74
|
-
The above code lives in
|
74
|
+
The above code lives in {examples/example2.rb}[http://github.com/szeryf/cromwell/blob/master/examples/example2.rb] and behaves in the same way as previous example.
|
75
75
|
|
76
76
|
In general it might be good idea to place the call to <code>unprotect</code> in an <code>ensure</code> block. Or, if you want your script to just run until it finishes on its own, don't call <code>unprotect</code> at all.
|
77
77
|
|
data/Rakefile
CHANGED
@@ -11,6 +11,7 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/szeryf/cromwell"
|
12
12
|
gem.authors = ["Przemyslaw Kowalczyk"]
|
13
13
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
+
gem.add_development_dependency "mocha", ">= 0"
|
14
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
16
|
end
|
16
17
|
Jeweler::GemcutterTasks.new
|
@@ -55,40 +56,41 @@ end
|
|
55
56
|
|
56
57
|
begin
|
57
58
|
require 'metric_fu'
|
58
|
-
rescue LoadError
|
59
|
-
puts "metric_fu (or a dependency) not available. If you want to run metrics, install it with: gem install metric_fu"
|
60
|
-
end
|
61
59
|
|
62
|
-
MetricFu::Configuration.run do |config|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
60
|
+
MetricFu::Configuration.run do |config|
|
61
|
+
#define which metrics you want to use
|
62
|
+
config.metrics = [:churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov]
|
63
|
+
config.graphs = []
|
64
|
+
config.flay = { :dirs_to_flay => ['lib'] }
|
65
|
+
config.flog = { :dirs_to_flog => ['lib'] }
|
66
|
+
config.reek = { :dirs_to_reek => ['lib'] }
|
67
|
+
config.roodi = { :dirs_to_roodi => ['lib'] }
|
68
|
+
config.saikuro = { :output_directory => 'scratch_directory/saikuro',
|
69
|
+
:input_directory => ['lib'],
|
70
|
+
:cyclo => "",
|
71
|
+
:filter_cyclo => "0",
|
72
|
+
:warn_cyclo => "5",
|
73
|
+
:error_cyclo => "7",
|
74
|
+
:formater => "text"} #this needs to be set to "text"
|
75
|
+
config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10}
|
76
|
+
config.rcov = { :test_files => ['test/**/test_*.rb'],
|
77
|
+
:rcov_opts => ["--sort coverage",
|
78
|
+
"--no-html",
|
79
|
+
"--text-coverage",
|
80
|
+
"--no-color",
|
81
|
+
"--exclude /gems/,/Library/,spec"]}
|
82
|
+
end
|
85
83
|
|
86
|
-
# fix for failing on NaN
|
87
|
-
module MetricFu
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
84
|
+
# fix for failing on NaN
|
85
|
+
module MetricFu
|
86
|
+
class Generator
|
87
|
+
def round_to_tenths(decimal)
|
88
|
+
decimal=0.0 if decimal.to_s.eql?('NaN')
|
89
|
+
(decimal.to_i * 10).round / 10.0
|
90
|
+
end
|
92
91
|
end
|
93
92
|
end
|
94
|
-
|
93
|
+
rescue LoadError
|
94
|
+
puts "metric_fu (or a dependency) not available. If you want to run metrics, install it with: gem install metric_fu"
|
95
|
+
end
|
96
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/cromwell.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cromwell}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Przemyslaw Kowalczyk"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-04}
|
13
13
|
s.description = %q{A very simple wrapper over Signal#trap method that allows you to easily protect your scripts from being killed while they are doing something that should not be interrupted (e.g. interacting with some non-transactional service) or is too costly to restart (e.g. long computations). }
|
14
14
|
s.email = %q{szeryf@negativeiq.pl}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -50,11 +50,14 @@ Gem::Specification.new do |s|
|
|
50
50
|
|
51
51
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
52
52
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
53
54
|
else
|
54
55
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
55
57
|
end
|
56
58
|
else
|
57
59
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
60
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
58
61
|
end
|
59
62
|
end
|
60
63
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cromwell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Przemyslaw Kowalczyk
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-04 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,16 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: mocha
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
25
35
|
description: "A very simple wrapper over Signal#trap method that allows you to easily protect your scripts from being killed while they are doing something that should not be interrupted (e.g. interacting with some non-transactional service) or is too costly to restart (e.g. long computations). "
|
26
36
|
email: szeryf@negativeiq.pl
|
27
37
|
executables: []
|