abstract_type 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+
3
+ begin
4
+ require 'metric_fu'
5
+ require 'json'
6
+
7
+ # XXX: temporary hack until metric_fu is fixed
8
+ MetricFu::Saikuro.class_eval { include FileUtils }
9
+
10
+ MetricFu::Configuration.run do |config|
11
+ config.rcov = {
12
+ :environment => 'test',
13
+ :test_files => %w[ spec/**/*_spec.rb ],
14
+ :rcov_opts => %w[
15
+ --sort coverage
16
+ --no-html
17
+ --text-coverage
18
+ --no-color
19
+ --profile
20
+ --exclude spec/,^/
21
+ --include lib:spec
22
+ ],
23
+ }
24
+ end
25
+ rescue LoadError
26
+ namespace :metrics do
27
+ task :all do
28
+ $stderr.puts 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ begin
4
+ require 'reek/rake/task'
5
+
6
+ RBX_18_MODE = RUBY_VERSION < '1.9' && defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
7
+
8
+ namespace :metrics do
9
+ Reek::Rake::Task.new do |t|
10
+ # reek has some problems under rbx in 1.8 mode that cause the underlying
11
+ # script to raise an exception. Rather than halt the "rake ci" process due
12
+ # to one bug, we choose to ignore it in this specific case until reek can be
13
+ # fixed.
14
+ t.fail_on_error = ! RBX_18_MODE # always true, except under rbx 18 mode
15
+ end
16
+ end
17
+ rescue LoadError
18
+ task :reek do
19
+ $stderr.puts 'Reek is not available. In order to run reek, you must: gem install reek'
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+
3
+ begin
4
+ require 'roodi'
5
+ require 'rake/tasklib'
6
+ require 'roodi_task'
7
+
8
+ namespace :metrics do
9
+ RoodiTask.new do |t|
10
+ t.verbose = false
11
+ t.config = File.expand_path('../../../config/roodi.yml', __FILE__)
12
+ t.patterns = %w[ lib/**/*.rb ]
13
+ end
14
+ end
15
+ rescue LoadError
16
+ task :roodi do
17
+ $stderr.puts 'Roodi is not available. In order to run roodi, you must: gem install roodi'
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ begin
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
+ namespace :metrics do
11
+ # yardstick_measure task
12
+ Yardstick::Rake::Measurement.new
13
+
14
+ # verify_measurements task
15
+ Yardstick::Rake::Verify.new do |verify|
16
+ verify.threshold = config.fetch('threshold')
17
+ end
18
+ end
19
+ rescue LoadError
20
+ %w[ yardstick_measure verify_measurements ].each do |name|
21
+ task name.to_s do
22
+ $stderr.puts "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,60 @@
1
+ # encoding: utf-8
2
+
3
+ spec_defaults = lambda do |spec|
4
+ spec.ruby_opts = %w[ -r./spec/support/config_alias ]
5
+ spec.spec_opts << '--options' << 'spec/spec.opts'
6
+ end
7
+
8
+ begin
9
+ require 'spec/rake/spectask'
10
+
11
+ desc 'Run all specs'
12
+ task :spec => %w[ spec:unit spec:integration ]
13
+
14
+ namespace :spec do
15
+ desc 'Run unit specs'
16
+ Spec::Rake::SpecTask.new(:unit) do |unit|
17
+ spec_defaults.call(unit)
18
+ unit.pattern = 'spec/unit/**/*_spec.rb'
19
+ end
20
+
21
+ desc 'Run integration specs'
22
+ Spec::Rake::SpecTask.new(:integration) do |integration|
23
+ spec_defaults.call(integration)
24
+ integration.pattern = 'spec/integration/**/*_spec.rb'
25
+ end
26
+ end
27
+ rescue LoadError
28
+ %w[ spec spec:unit spec:integration ].each do |name|
29
+ task name do
30
+ $stderr.puts "rspec is not available. In order to run #{name}, you must: gem install rspec"
31
+ end
32
+ end
33
+ end
34
+
35
+ namespace :metrics do
36
+ begin
37
+ if RUBY_VERSION < '1.9'
38
+ desc 'Generate code coverage'
39
+ Spec::Rake::SpecTask.new(:coverage) do |rcov|
40
+ spec_defaults.call(rcov)
41
+ rcov.rcov = true
42
+ rcov.pattern = 'spec/unit/**/*_spec.rb'
43
+ rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
44
+ end
45
+ else
46
+ desc 'Generate code coverage'
47
+ task :coverage do
48
+ ENV['COVERAGE'] = 'true'
49
+ Rake::Task['spec:unit'].execute
50
+ end
51
+ end
52
+ rescue LoadError
53
+ task :coverage do
54
+ lib = RUBY_VERSION < '1.9' ? 'rcov' : 'simplecov'
55
+ $stderr.puts "coverage is not available. In order to run #{lib}, you must: gem install #{lib}"
56
+ end
57
+ end
58
+ end
59
+
60
+ task :test => :spec
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ begin
4
+ require 'yard'
5
+
6
+ YARD::Rake::YardocTask.new
7
+ rescue LoadError
8
+ task :yard do
9
+ $stderr.puts 'YARD is not available. In order to run yard, you must: gem install yard'
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: abstract_type
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Dan Kubb
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-11-26 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 75
29
+ segments:
30
+ - 10
31
+ - 0
32
+ - 2
33
+ version: 10.0.2
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 31
45
+ segments:
46
+ - 1
47
+ - 3
48
+ - 2
49
+ version: 1.3.2
50
+ type: :development
51
+ version_requirements: *id002
52
+ description: Module to declare abstract classes and methods
53
+ email:
54
+ - dan.kubb@gmail.com
55
+ executables: []
56
+
57
+ extensions: []
58
+
59
+ extra_rdoc_files:
60
+ - LICENSE
61
+ - README.md
62
+ - TODO
63
+ files:
64
+ - .gitignore
65
+ - .rvmrc
66
+ - .travis.yml
67
+ - Gemfile
68
+ - Guardfile
69
+ - LICENSE
70
+ - README.md
71
+ - Rakefile
72
+ - TODO
73
+ - abstract_type.gemspec
74
+ - config/flay.yml
75
+ - config/flog.yml
76
+ - config/roodi.yml
77
+ - config/site.reek
78
+ - config/yardstick.yml
79
+ - lib/abstract_type.rb
80
+ - lib/abstract_type/version.rb
81
+ - spec/rcov.opts
82
+ - spec/shared/command_method_behavior.rb
83
+ - spec/shared/each_method_behaviour.rb
84
+ - spec/shared/hash_method_behavior.rb
85
+ - spec/shared/idempotent_method_behavior.rb
86
+ - spec/shared/invertible_method_behaviour.rb
87
+ - spec/spec.opts
88
+ - spec/spec_helper.rb
89
+ - spec/support/config_alias.rb
90
+ - spec/unit/abstract_type/class_methods/abstract_method_spec.rb
91
+ - spec/unit/abstract_type/class_methods/abstract_singleton_method_spec.rb
92
+ - spec/unit/abstract_type/class_methods/new_spec.rb
93
+ - tasks/metrics/ci.rake
94
+ - tasks/metrics/flay.rake
95
+ - tasks/metrics/flog.rake
96
+ - tasks/metrics/heckle.rake
97
+ - tasks/metrics/metric_fu.rake
98
+ - tasks/metrics/reek.rake
99
+ - tasks/metrics/roodi.rake
100
+ - tasks/metrics/yardstick.rake
101
+ - tasks/spec.rake
102
+ - tasks/yard.rake
103
+ homepage: https://github.com/dkubb/abstract_type
104
+ licenses: []
105
+
106
+ post_install_message:
107
+ rdoc_options: []
108
+
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ hash: 3
117
+ segments:
118
+ - 0
119
+ version: "0"
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ hash: 3
126
+ segments:
127
+ - 0
128
+ version: "0"
129
+ requirements: []
130
+
131
+ rubyforge_project:
132
+ rubygems_version: 1.8.24
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: Module to declare abstract classes and methods
136
+ test_files: []
137
+
138
+ has_rdoc: