adamantium 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/.travis.yml +86 -0
- data/Gemfile +54 -0
- data/Guardfile +18 -0
- data/LICENSE +21 -0
- data/README.md +90 -0
- data/Rakefile +9 -0
- data/TODO +1 -0
- data/adamantium.gemspec +25 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/roodi.yml +18 -0
- data/config/site.reek +91 -0
- data/config/yardstick.yml +2 -0
- data/lib/adamantium.rb +249 -0
- data/lib/adamantium/version.rb +3 -0
- data/spec/rcov.opts +7 -0
- data/spec/shared/command_method_behavior.rb +7 -0
- data/spec/shared/each_method_behaviour.rb +15 -0
- data/spec/shared/hash_method_behavior.rb +17 -0
- data/spec/shared/idempotent_method_behavior.rb +7 -0
- data/spec/shared/invertible_method_behaviour.rb +9 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/unit/adamantium/class_methods/freeze_object_spec.rb +57 -0
- data/spec/unit/adamantium/class_methods/new_spec.rb +14 -0
- data/spec/unit/adamantium/dup_spec.rb +13 -0
- data/spec/unit/adamantium/fixtures/classes.rb +28 -0
- data/spec/unit/adamantium/freeze_spec.rb +51 -0
- data/spec/unit/adamantium/memoize_spec.rb +57 -0
- data/spec/unit/adamantium/memoized_spec.rb +29 -0
- data/spec/unit/adamantium/module_methods/included_spec.rb +16 -0
- data/spec/unit/adamantium/module_methods/memoize_spec.rb +88 -0
- data/tasks/metrics/ci.rake +7 -0
- data/tasks/metrics/flay.rake +47 -0
- data/tasks/metrics/flog.rake +43 -0
- data/tasks/metrics/heckle.rake +208 -0
- data/tasks/metrics/metric_fu.rake +29 -0
- data/tasks/metrics/reek.rake +15 -0
- data/tasks/metrics/roodi.rake +15 -0
- data/tasks/metrics/yardstick.rake +23 -0
- data/tasks/spec.rake +45 -0
- data/tasks/yard.rake +9 -0
- metadata +174 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
begin
|
2
|
+
require 'metric_fu'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
# XXX: temporary hack until metric_fu is fixed
|
6
|
+
MetricFu::Saikuro.class_eval { include FileUtils }
|
7
|
+
|
8
|
+
MetricFu::Configuration.run do |config|
|
9
|
+
config.rcov = {
|
10
|
+
:environment => 'test',
|
11
|
+
:test_files => %w[ spec/**/*_spec.rb ],
|
12
|
+
:rcov_opts => %w[
|
13
|
+
--sort coverage
|
14
|
+
--no-html
|
15
|
+
--text-coverage
|
16
|
+
--no-color
|
17
|
+
--profile
|
18
|
+
--exclude spec/,^/
|
19
|
+
--include lib:spec
|
20
|
+
],
|
21
|
+
}
|
22
|
+
end
|
23
|
+
rescue LoadError
|
24
|
+
namespace :metrics do
|
25
|
+
task :all do
|
26
|
+
$stderr.puts 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
begin
|
2
|
+
require 'reek/rake/task'
|
3
|
+
|
4
|
+
if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'rbx'
|
5
|
+
task :reek do
|
6
|
+
$stderr.puts 'Reek fails under rubinius, fix rubinius and remove guard'
|
7
|
+
end
|
8
|
+
else
|
9
|
+
Reek::Rake::Task.new
|
10
|
+
end
|
11
|
+
rescue LoadError
|
12
|
+
task :reek do
|
13
|
+
$stderr.puts 'Reek is not available. In order to run reek, you must: gem install reek'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
begin
|
2
|
+
require 'roodi'
|
3
|
+
require 'rake/tasklib'
|
4
|
+
require 'roodi_task'
|
5
|
+
|
6
|
+
RoodiTask.new do |t|
|
7
|
+
t.verbose = false
|
8
|
+
t.config = File.expand_path('../../../config/roodi.yml', __FILE__)
|
9
|
+
t.patterns = %w[ lib/**/*.rb ]
|
10
|
+
end
|
11
|
+
rescue LoadError
|
12
|
+
task :roodi do
|
13
|
+
abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
begin
|
2
|
+
require 'pathname'
|
3
|
+
require 'yardstick'
|
4
|
+
require 'yardstick/rake/measurement'
|
5
|
+
require 'yardstick/rake/verify'
|
6
|
+
require 'yaml'
|
7
|
+
|
8
|
+
config = YAML.load_file(File.expand_path('../../../config/yardstick.yml', __FILE__))
|
9
|
+
|
10
|
+
# yardstick_measure task
|
11
|
+
Yardstick::Rake::Measurement.new
|
12
|
+
|
13
|
+
# verify_measurements task
|
14
|
+
Yardstick::Rake::Verify.new do |verify|
|
15
|
+
verify.threshold = config.fetch('threshold')
|
16
|
+
end
|
17
|
+
rescue LoadError
|
18
|
+
%w[ yardstick_measure verify_measurements ].each do |name|
|
19
|
+
task name.to_s do
|
20
|
+
abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
begin
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
rescue LoadError
|
6
|
+
require 'spec/rake/spectask'
|
7
|
+
|
8
|
+
module RSpec
|
9
|
+
module Core
|
10
|
+
RakeTask = Spec::Rake::SpecTask
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'run all specs'
|
16
|
+
task :spec => %w[ spec:unit spec:integration ]
|
17
|
+
|
18
|
+
namespace :spec do
|
19
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
20
|
+
t.pattern = 'spec/integration/**/*_spec.rb'
|
21
|
+
end
|
22
|
+
|
23
|
+
RSpec::Core::RakeTask.new(:unit) do |t|
|
24
|
+
t.pattern = 'spec/unit/**/*_spec.rb'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
rescue LoadError
|
28
|
+
task :spec do
|
29
|
+
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
begin
|
34
|
+
desc "Generate code coverage"
|
35
|
+
RSpec::Core::RakeTask.new(:rcov) do |t|
|
36
|
+
t.rcov = true
|
37
|
+
t.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
|
38
|
+
end
|
39
|
+
rescue LoadError
|
40
|
+
task :rcov do
|
41
|
+
abort 'rcov is not available. In order to run rcov, you must: gem install rcov'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
task :test => 'spec'
|
data/tasks/yard.rake
ADDED
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: adamantium
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dan Kubb
|
9
|
+
- Markus Schirp
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-10-12 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: backports
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.6.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 2.6.1
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: ice_nine
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 0.4.0
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.4.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.2
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.9.2
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rspec
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 1.3.2
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.3.2
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: yard
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.8.1
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.8.1
|
95
|
+
description: Immutable extensions to objects
|
96
|
+
email:
|
97
|
+
- dan.kubb@gmail.com
|
98
|
+
- mbj@seonic.net
|
99
|
+
executables: []
|
100
|
+
extensions: []
|
101
|
+
extra_rdoc_files:
|
102
|
+
- LICENSE
|
103
|
+
- README.md
|
104
|
+
- TODO
|
105
|
+
files:
|
106
|
+
- .gitignore
|
107
|
+
- .rvmrc
|
108
|
+
- .travis.yml
|
109
|
+
- Gemfile
|
110
|
+
- Guardfile
|
111
|
+
- LICENSE
|
112
|
+
- README.md
|
113
|
+
- Rakefile
|
114
|
+
- TODO
|
115
|
+
- adamantium.gemspec
|
116
|
+
- config/flay.yml
|
117
|
+
- config/flog.yml
|
118
|
+
- config/roodi.yml
|
119
|
+
- config/site.reek
|
120
|
+
- config/yardstick.yml
|
121
|
+
- lib/adamantium.rb
|
122
|
+
- lib/adamantium/version.rb
|
123
|
+
- spec/rcov.opts
|
124
|
+
- spec/shared/command_method_behavior.rb
|
125
|
+
- spec/shared/each_method_behaviour.rb
|
126
|
+
- spec/shared/hash_method_behavior.rb
|
127
|
+
- spec/shared/idempotent_method_behavior.rb
|
128
|
+
- spec/shared/invertible_method_behaviour.rb
|
129
|
+
- spec/spec_helper.rb
|
130
|
+
- spec/unit/adamantium/class_methods/freeze_object_spec.rb
|
131
|
+
- spec/unit/adamantium/class_methods/new_spec.rb
|
132
|
+
- spec/unit/adamantium/dup_spec.rb
|
133
|
+
- spec/unit/adamantium/fixtures/classes.rb
|
134
|
+
- spec/unit/adamantium/freeze_spec.rb
|
135
|
+
- spec/unit/adamantium/memoize_spec.rb
|
136
|
+
- spec/unit/adamantium/memoized_spec.rb
|
137
|
+
- spec/unit/adamantium/module_methods/included_spec.rb
|
138
|
+
- spec/unit/adamantium/module_methods/memoize_spec.rb
|
139
|
+
- tasks/metrics/ci.rake
|
140
|
+
- tasks/metrics/flay.rake
|
141
|
+
- tasks/metrics/flog.rake
|
142
|
+
- tasks/metrics/heckle.rake
|
143
|
+
- tasks/metrics/metric_fu.rake
|
144
|
+
- tasks/metrics/reek.rake
|
145
|
+
- tasks/metrics/roodi.rake
|
146
|
+
- tasks/metrics/yardstick.rake
|
147
|
+
- tasks/spec.rake
|
148
|
+
- tasks/yard.rake
|
149
|
+
homepage: https://github.com/dkubb/adamantium
|
150
|
+
licenses: []
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 1.8.24
|
170
|
+
signing_key:
|
171
|
+
specification_version: 3
|
172
|
+
summary: Immutable extensions to objects
|
173
|
+
test_files: []
|
174
|
+
has_rdoc:
|