hexx-suit 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -0
  3. data/.travis.yml +4 -9
  4. data/Gemfile +5 -6
  5. data/README.md +35 -26
  6. data/Rakefile +5 -6
  7. data/{lib/hexx/suit/install → config}/metrics/simplecov.yml +0 -0
  8. data/hexx-suit.gemspec +1 -6
  9. data/lib/hexx/suit/install/Guardfile +14 -5
  10. data/lib/hexx/suit/install/_rubocop.yml +1 -0
  11. data/lib/hexx/suit/install/_yardopts +1 -0
  12. data/lib/hexx/suit/install.rb +15 -46
  13. data/lib/hexx/suit/metrics/metric_fu/base.rb +15 -7
  14. data/lib/hexx/suit/metrics/metric_fu/cane.rb +1 -1
  15. data/lib/hexx/suit/metrics/metric_fu/churn.rb +1 -1
  16. data/lib/hexx/suit/metrics/metric_fu/flay.rb +1 -1
  17. data/lib/hexx/suit/metrics/metric_fu/reek.rb +1 -1
  18. data/lib/hexx/suit/metrics/metric_fu/roodi.rb +1 -1
  19. data/lib/hexx/suit/metrics/metric_fu/saikuro.rb +1 -1
  20. data/lib/hexx/suit/metrics/metric_fu.rb +1 -1
  21. data/lib/hexx/suit/metrics/rubocop.rb +1 -1
  22. data/lib/hexx/suit/metrics/yardstick.rb +1 -1
  23. data/lib/hexx/suit/metrics.rb +0 -3
  24. data/lib/hexx/suit/version.rb +7 -1
  25. data/lib/hexx/suit.rb +14 -67
  26. data/lib/hexx-suit.rb +10 -14
  27. data/lib/tasks/check/coverage.rake +2 -2
  28. data/lib/tasks/check/fu.rake +1 -1
  29. data/lib/tasks/check/inch.rake +1 -1
  30. data/lib/tasks/check/rubocop.rake +1 -1
  31. data/lib/tasks/check/yardstick.rake +1 -1
  32. data/lib/tasks/check.rake +9 -11
  33. data/lib/tasks/debug.rake +1 -1
  34. data/lib/tasks/test.rake +1 -1
  35. data/spec/spec_helper.rb +8 -6
  36. data/spec/support/config/tasks.rb +1 -1
  37. data/spec/tests/bin/install_spec.rb +22 -25
  38. data/spec/tests/lib/install_spec.rb +0 -4
  39. data/spec/tests/suit_spec.rb +7 -55
  40. data/spec/tests/tasks/check/coverage/display_spec.rb +2 -2
  41. data/spec/tests/tasks/check/coverage/run_spec.rb +2 -2
  42. data/spec/tests/tasks/check/display_spec.rb +0 -6
  43. data/spec/tests/tasks/check/fu/display_spec.rb +1 -1
  44. data/spec/tests/tasks/check/fu/run_spec.rb +1 -1
  45. data/spec/tests/tasks/check/inch_spec.rb +1 -1
  46. data/spec/tests/tasks/check/rubocop/display_spec.rb +1 -1
  47. data/spec/tests/tasks/check/rubocop/run_spec.rb +1 -1
  48. data/spec/tests/tasks/check/run_spec.rb +0 -6
  49. data/spec/tests/tasks/check/yardstick/display_spec.rb +1 -1
  50. data/spec/tests/tasks/check_spec.rb +0 -12
  51. data/spec/tests/tasks/debug_spec.rb +1 -1
  52. metadata +6 -103
  53. data/config/initializers/focus.rb +0 -5
  54. data/config/initializers/garbage_collection.rb +0 -11
  55. data/config/initializers/i18n.rb +0 -3
  56. data/config/initializers/random_order.rb +0 -4
  57. data/config/initializers/rspec.rb +0 -11
  58. data/lib/hexx/suit/install/Rakefile +0 -17
  59. data/lib/hexx/suit/install/_rspec +0 -2
  60. data/lib/hexx/suit/install/metrics/pippi.yml +0 -3
  61. data/lib/hexx/suit/metrics/base.rb +0 -88
  62. data/lib/hexx/suit/metrics/pippi.rb +0 -89
  63. data/lib/hexx/suit/metrics/simplecov.rb +0 -119
  64. data/lib/hexx/suit/utils/system.rb +0 -66
  65. data/lib/tasks/check/pippi.rake +0 -33
  66. data/spec/tests/lib/metrics/pippi_spec.rb +0 -104
  67. data/spec/tests/lib/metrics/simplecov_spec.rb +0 -102
  68. data/spec/tests/lib/utils/system_spec.rb +0 -85
  69. data/spec/tests/tasks/check/pippi/display_spec.rb +0 -48
  70. data/spec/tests/tasks/check/pippi/run_spec.rb +0 -26
  71. data/spec/tests/tasks/check/pippi_spec.rb +0 -27
  72. data/spec/tests/tasks/test_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fdbdb475f334c8f5e60e3fa6451b362fe480cd0
4
- data.tar.gz: f0b436a826bb72e564dc73e0665da7ca76410d59
3
+ metadata.gz: 4e924682d1675f4e8884330b4aeabab278fbea26
4
+ data.tar.gz: e3d471c9998711c7056dc4fc4b7af0f250ab440a
5
5
  SHA512:
6
- metadata.gz: 835100001fc537f397cac461ba3c636be4ecee2071203e9ce37f2f467a3862ecd8429f8ec7fd12e87656b1daa2ee769eb4899b8e3c9430c0fd7f389fcaa6d66a
7
- data.tar.gz: 6a5e1231d15cc059f10b4436de1ea46d8e0c5030d7915b5b141be168c029ed822d574865d58eb7656b641be046ef504f012d35527d8d68904794897b07726918
6
+ metadata.gz: 9cfcd2f272e615b57ba4e97870c3d7eb3bf399985bba9789ebfed029e09a5562fcd17b74be9f84e01290b099a5a3b9aedbdf7b61ef78712c51ca909cb7a58fe4
7
+ data.tar.gz: b3b22710eec9e5e59c7d52de1706b53b5d01a568d44c7f49a514291d8e3962fc4c5f09227217e6a6e5fc8a5ecfa251d1782a5da5fb2c6c0f86eaf2839a9be6b2
data/.coveralls.yml CHANGED
@@ -1 +1,2 @@
1
+ ---
1
2
  service_name: travis-ci
data/.travis.yml CHANGED
@@ -3,13 +3,8 @@ language: ruby
3
3
  script: bundle exec rspec spec
4
4
  rvm:
5
5
  - '1.9.3'
6
- - '2.0'
7
- - '2.1'
8
- - '2.2'
9
- - rbx-2
10
- - jruby-1.7
11
6
  - ruby-head
12
- - jruby-head
13
- allow_failures:
14
- - rvm: ruby-head
15
- - rvm: jruby-head
7
+ - rbx-2 --1.9
8
+ - rbx-2 --2.0
9
+ - jruby-1.7-mode19
10
+ - jruby-head-mode21
data/Gemfile CHANGED
@@ -3,15 +3,14 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  platforms :ruby do
6
- gem "pry-rescue", "~> 1.4"
7
- gem "pry-stack_explorer", "~> 0.4"
6
+ gem "pry-rescue", "~> 1.4", require: true
7
+ gem "pry-stack_explorer", "~> 0.4", require: true
8
8
  end
9
9
 
10
10
  platforms :mri_19 do
11
- gem "pry-debugger", "~> 0.2"
11
+ gem "pry-debugger", "~> 0.2", require: true
12
12
  end
13
13
 
14
- platforms :mri_20, :mri_21, :mri_22 do
15
- gem "pry-byebug", "~> 3.0"
16
- gem "pippi", "~> 0.0"
14
+ platforms :mri_20, :mri_21 do
15
+ gem "pry-byebug", "~> 3.0", require: true
17
16
  end
data/README.md CHANGED
@@ -21,35 +21,34 @@ It also defines a set of Rake tasks.
21
21
  Add this line to your application's Gemfile:
22
22
 
23
23
  ```ruby
24
- group :test, :development do
25
- gem "hexx-suit"
26
- end
24
+ group :test, :development do
25
+ gem "hexx-rspec"
26
+ gem "hexx-suit", require: false
27
+ end
27
28
  ```
28
29
 
29
30
  Then execute:
30
31
 
31
32
  ```
32
- bundle
33
+ bundle
33
34
  ```
34
35
 
35
36
  And run the task from the application root:
36
37
 
37
38
  ```
38
- hexx-suit install
39
+ hexx-suit install
39
40
  ```
40
41
 
41
- Require the gem in the `spec_helper.rb` **before** loading application:
42
+ Require the `hexx-rspec` part of the gem in the `spec_helper.rb` **before** loading application:
42
43
 
43
44
  ```ruby
44
- # spec/spec_helper.rb
45
- require "hexx-suit"
45
+ # spec/spec_helper.rb
46
+ require "hexx-rspec"
46
47
 
47
- # Loads coveralls and pippi runtime metrics
48
- # in the application's scope.
49
- Hexx::Suit.load_metrics_for(self)
48
+ # Loads coveralls runtime metrics
49
+ Hexx::RSpec.load_metrics_for(self)
50
50
 
51
- # ...
52
- require "my_app"
51
+ require "my_app"
53
52
  ```
54
53
 
55
54
  You can configure all metrics separately in a corresponding yml files, that are created at `config/metrics` directory. The directory also contains default STYLEGUIDE. Feel free to adapt it to your needs.
@@ -63,13 +62,13 @@ The gem adds three tasks for a development process authomation:
63
62
  The task runs rspec (runs no coverage controls) **in a bundle environment**.
64
63
 
65
64
  ```
66
- rake test
65
+ rake test
67
66
  ```
68
67
 
69
68
  This is a simple shortcut for longer syntaxes:
70
69
 
71
70
  ```
72
- bundle exec rspec spec
71
+ bundle exec rspec spec
73
72
  ```
74
73
 
75
74
  ### Debug
@@ -77,13 +76,13 @@ This is a simple shortcut for longer syntaxes:
77
76
  The tasks runs specs wrapped to pry `rescue` command.
78
77
 
79
78
  ```
80
- rake debug
79
+ rake debug
81
80
  ```
82
81
 
83
82
  This is the same as:
84
83
 
85
84
  ```
86
- bundle exec rescue rspec spec
85
+ bundle exec rescue rspec spec
87
86
  ```
88
87
 
89
88
  ### Check
@@ -91,19 +90,19 @@ This is the same as:
91
90
  The task runs rspec under the test coverage control, and then calls all the code metrics, except for mutation testing.
92
91
 
93
92
  ```
94
- rake check
93
+ rake check
95
94
  ```
96
95
 
97
96
  You can use single metrics as well:
98
97
 
99
98
  ```
100
- rake check:yardstick
99
+ rake check:yardstick
101
100
  ```
102
101
 
103
102
  See all tasks at:
104
103
 
105
104
  ```
106
- rake -T check
105
+ rake -T check
107
106
  ```
108
107
 
109
108
  All the tasks will use settings from `config/metrics` folder.
@@ -134,9 +133,8 @@ The gem loads dependencies from the projects below.
134
133
 
135
134
  * [rubocop](https://github.com/bbatsov/rubocop) - a Ruby static code analyzer
136
135
  * [metric_fu](https://github.com/metricfu/metric_fu/) - a collection of Ruby code analyzers.
137
- * [pippi](https://github.com/tcopeland/pippi) - a utility for finding suboptimal Ruby class API usage. Available for MRI ruby 2.0+ only.
138
136
 
139
- ### Tools for Documenting
137
+ ### Documentation Tools
140
138
 
141
139
  * [yard](https://yardoc.org/) - a Ruby documentation tool.
142
140
  * [inch](https://trivelop.de/inch/) - a documentation measurement tool.
@@ -144,13 +142,24 @@ The gem loads dependencies from the projects below.
144
142
 
145
143
  ## Compatibility
146
144
 
147
- Tested under rubies:
145
+ Tested under rubies API 1.9.3+:
148
146
 
149
147
  * MRI 1.9.3+
150
- * Rubinius 2+
151
- * JRuby 1.7+ (ruby 1.9.3)
148
+ * Rubinius 2+ (1.9 and 2.0 modes)
149
+ * JRuby 1.7+ (1.9 and 2.0+ modes)
152
150
 
153
- RSpec 3.0+ used for testing
151
+ RSpec 3.0+ used for testing via [hexx-rspec] suit.
152
+
153
+ [hexx-rspec]: https://github.com/nepalez/hexx-rspec
154
+
155
+ ## Latest Changes
156
+
157
+ ### v1.0.0
158
+
159
+ * Pippi metric removed as incompatible to rubies 1.9.3
160
+ * 'hexx-rspec' module extracted to separate gem.
161
+
162
+ It is now possible using 'hexx-suit' with the `require: false` key.
154
163
 
155
164
  ## Contributing
156
165
 
data/Rakefile CHANGED
@@ -9,10 +9,9 @@ end
9
9
  # Loads bundler tasks
10
10
  Bundler::GemHelper.install_tasks
11
11
 
12
- # Loads the Hexx::Suit without tasks
13
- require "hexx-suit"
12
+ # Loads the Hexx::RSpec and its tasks
13
+ require "hexx-rspec"
14
+ Hexx::RSpec.install_tasks
14
15
 
15
- # Sets the :spec task to default
16
- task :default do
17
- system "bundle exec rspec spec"
18
- end
16
+ # Sets the Hexx::RSpec :test task to default
17
+ task default: :test
data/hexx-suit.gemspec CHANGED
@@ -19,17 +19,12 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.required_ruby_version = ">= 1.9.3"
21
21
 
22
- s.add_runtime_dependency "coveralls", "~> 0.7"
23
22
  s.add_runtime_dependency "guard-rspec", "~> 4.3"
24
- s.add_runtime_dependency "i18n", "~> 0.7"
23
+ s.add_runtime_dependency "hexx-rspec", "~> 0.0"
25
24
  s.add_runtime_dependency "inch", "~> 0.5"
26
25
  s.add_runtime_dependency "metric_fu", "~> 4.11"
27
26
  s.add_runtime_dependency "mutant-rspec", "~> 0.7"
28
- s.add_runtime_dependency "pry", "~> 0.10"
29
- s.add_runtime_dependency "rake", "~> 10.3"
30
- s.add_runtime_dependency "rspec", "~> 3.0"
31
27
  s.add_runtime_dependency "rubocop", "~> 0.23"
32
- s.add_runtime_dependency "thor", "~> 0.19"
33
28
  s.add_runtime_dependency "yardstick", "~> 0.9"
34
29
 
35
30
  end
@@ -1,6 +1,15 @@
1
1
  # encoding: utf-8
2
- guard :rspec, cmd: "rake test" do
3
- watch(%r{^spec/tests/.+_spec\.rb})
4
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
5
- watch(/^spec\/spec_helper\w*.rb/) { "spec" }
6
- end
2
+
3
+ guard :rspec, cmd: "bundle exec rspec" do
4
+
5
+ watch(/^lib(.+)\.rb$/) do |m|
6
+ "spec/tests#{ m[1] }_spec.rb"
7
+ end
8
+
9
+ watch("spec/tests/*_spec.rb")
10
+
11
+ watch("lib/*.rb") { "spec" }
12
+ watch("spec/spec_helper.rb") { "spec" }
13
+ watch("spec/support/**/*.rb") { "spec" }
14
+
15
+ end # guard :rspec
@@ -1 +1,2 @@
1
+ ---
1
2
  inherit_from: "./config/metrics/rubocop.yml"
@@ -1,2 +1,3 @@
1
1
  --asset LICENSE
2
2
  --exclude lib/**/version.rb
3
+ --output doc/api
@@ -1,4 +1,7 @@
1
+ # encoding: utf-8
2
+
1
3
  module Hexx
4
+
2
5
  module Suit
3
6
 
4
7
  # The generator creates a Rakefile in a destination root
@@ -15,11 +18,7 @@ module Hexx
15
18
  #
16
19
  # @api public
17
20
 
18
- # Root folder for the generator's templates
19
- #
20
- # @return [String]
21
- #
22
- # @api private
21
+ # @private
23
22
  def self.source_root
24
23
  @source_root ||= File.expand_path "../install", __FILE__
25
24
  end
@@ -27,68 +26,38 @@ module Hexx
27
26
  namespace :install
28
27
  desc "Installs the 'hexx-suit' gem."
29
28
 
30
- # Creates the Rakefile
31
- #
32
- # @return [undefined]
33
- #
34
- # @api private
35
- def create_rakefile
36
- copy_file "Rakefile"
29
+ # @private
30
+ def install_rspec
31
+ Hexx::RSpec::Install.start
37
32
  end
38
33
 
39
- # Creates the Guardfile
40
- #
41
- # @return [undefined]
42
- #
43
- # @api private
34
+ # @private
44
35
  def create_guardfile
45
36
  copy_file "Guardfile"
46
37
  end
47
38
 
48
- # Creates the .rspec settings
49
- #
50
- # @return [undefined]
51
- #
52
- # @api private
53
- def create_rspec
54
- copy_file "_rspec", ".rspec"
55
- end
56
-
57
- # Creates the .yardopts settings
58
- #
59
- # @return [undefined]
60
- #
61
- # @api private
39
+ # @private
62
40
  def create_yardopts
63
41
  copy_file "_yardopts", ".yardopts"
64
42
  end
65
43
 
66
- # creates the metric settings
67
- #
68
- # @return [undefined]
69
- #
70
- # @api private
44
+ # @private
71
45
  def create_metrics
72
46
  directory "metrics", "config/metrics"
73
47
  end
74
48
 
75
- # creates metric_fu loader
76
- #
77
- # @return [undefined]
78
- #
79
- # @api private
49
+ # @private
80
50
  def create_metrics_loader
81
51
  copy_file "_metrics", ".metrics"
82
52
  end
83
53
 
84
- # creates metric_fu loader
85
- #
86
- # @return [undefined]
87
- #
88
- # @api private
54
+ # @private
89
55
  def create_rubocop_loader
90
56
  copy_file "_rubocop.yml", ".rubocop.yml"
91
57
  end
58
+
92
59
  end # class Install
60
+
93
61
  end # module Suit
62
+
94
63
  end # module Hexx
@@ -1,12 +1,15 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Hexx
4
+
4
5
  module Suit
6
+
5
7
  module Metrics
6
- class MetricFu < Base
8
+
9
+ class MetricFu < RSpec::Metrics::Base
7
10
 
8
11
  # Base class for metrics configured via metric_fu
9
- class Base < Metrics::Base
12
+ class Base < RSpec::Metrics::Base
10
13
 
11
14
  # Constructs the object and loads 'metric_fu' dependency
12
15
  #
@@ -52,8 +55,13 @@ module Hexx
52
55
  yield(metric)
53
56
  end
54
57
  end
55
- end
56
- end
57
- end
58
- end
59
- end
58
+
59
+ end # class Base
60
+
61
+ end # class MetricFu
62
+
63
+ end # module Metrics
64
+
65
+ end # module Suit
66
+
67
+ end # module Hexx
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Cane metric
9
9
  class Cane < Base
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Churn metric
9
9
  class Churn < Base
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Flay metric
9
9
  class Flay < Base
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Reek metric
9
9
  class Reek < Base
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Roodi metric
9
9
  class Roodi < Base
@@ -3,7 +3,7 @@
3
3
  module Hexx
4
4
  module Suit
5
5
  module Metrics
6
- class MetricFu < Base
6
+ class MetricFu < RSpec::Metrics::Base
7
7
 
8
8
  # The configurer for the Saikuro metric
9
9
  class Saikuro < Base
@@ -5,7 +5,7 @@ module Hexx
5
5
  module Metrics
6
6
 
7
7
  # Configurator for the metric_fu and all its subpackages
8
- class MetricFu < Base
8
+ class MetricFu < RSpec::Metrics::Base
9
9
 
10
10
  require_relative "metric_fu/base"
11
11
  require_relative "metric_fu/cane"
@@ -3,7 +3,7 @@ module Hexx
3
3
  module Metrics
4
4
 
5
5
  # Prepares and runs rubocop environment from '.hexx-suit.yml'
6
- class Rubocop < Base
6
+ class Rubocop < RSpec::Metrics::Base
7
7
 
8
8
  # @!scope class
9
9
  # Sets ENV variables for rubocop rake tasks
@@ -3,7 +3,7 @@ module Hexx
3
3
  module Metrics
4
4
 
5
5
  # Prepares and runs yardstick environment from '.hexx-suit.yml'
6
- class Yardstick < Base
6
+ class Yardstick < RSpec::Metrics::Base
7
7
 
8
8
  # Loads yardstick verifier
9
9
  #
@@ -13,12 +13,9 @@ module Hexx
13
13
  # Configurators loads their own dependencies in a corresponding constructor.
14
14
  module Metrics
15
15
 
16
- require_relative "metrics/base"
17
16
  require_relative "metrics/metric_fu"
18
17
  require_relative "metrics/rubocop.rb"
19
- require_relative "metrics/simplecov.rb"
20
18
  require_relative "metrics/yardstick.rb"
21
- require_relative "metrics/pippi.rb" if USE_PIPPI_METRIC
22
19
 
23
20
  end
24
21
 
@@ -1,7 +1,13 @@
1
+ # encoding: utf-8
2
+
1
3
  module Hexx
4
+
2
5
  module Suit
6
+
3
7
  # The semantic version of the module.
4
8
  # @see http://semver.org/ Semantic versioning 2.0
5
- VERSION = "0.2.2".freeze
9
+ VERSION = "1.0.0".freeze
10
+
6
11
  end # module Suit
12
+
7
13
  end # module Hexx
data/lib/hexx/suit.rb CHANGED
@@ -1,10 +1,13 @@
1
- # Shared namespace for the Hexx-based gems
1
+ # encoding: utf-8
2
+
2
3
  module Hexx
3
4
 
4
5
  # Namespace for the module.
5
- #
6
- # @api public
7
6
  module Suit
7
+
8
+ require_relative "suit/metrics"
9
+ require_relative "suit/install"
10
+
8
11
  class << self
9
12
 
10
13
  # Loads all the necessary rake tasks
@@ -12,90 +15,34 @@ module Hexx
12
15
  # @example
13
16
  # Hexx::Suit.install_tasks
14
17
  #
15
- # @return [self]
18
+ # @return [undefined]
16
19
  def install_tasks
17
- load_gem_tasks
18
20
  load_rspec_tasks
19
21
  load_custom_tasks
20
-
21
- self
22
22
  end
23
23
 
24
- # Loads runtime metrics in a given scope
25
- #
26
- # Checks if a corresponding environment is set
24
+ # Loads runtime metrics for the host gem
27
25
  #
28
26
  # @example
29
27
  # # spec/spec_helper.rb
30
28
  # Hexx::Suit.load_metrics_for(self)
31
- #
32
- # @param [Object] scope
33
- #
34
- # @return [self]
35
29
  def load_metrics_for(scope)
36
- load_pippi_for(scope)
37
- load_coverage_for(scope)
38
-
39
- self
30
+ RSpec.load_metrics_for(scope)
40
31
  end
41
32
 
42
33
  private
43
34
 
44
- # Loads runtime coverage metric in a given scope
45
- #
46
- # @param [Object] scope
47
- #
48
- # @return self
49
- def load_coverage_for(scope)
50
- return unless ENV["USE_SIMPLECOV"]
51
- scope.instance_eval { Hexx::Suit::Metrics::SimpleCov.run }
52
- end
53
-
54
- # Loads runtime pippi metric in a given scope
55
- #
56
- # @param [Object] scope
57
- #
58
- # @return [self]
59
- def load_pippi_for(scope)
60
- return unless ENV["USE_PIPPI"]
61
- scope.instance_eval { Hexx::Suit::Metrics::Pippi.run }
62
- end
63
-
64
- # Loads bundler rake tasks
65
- #
66
- # @return [self]
67
- #
68
- # @api private
69
- def load_gem_tasks
70
- require "bundler/gem_tasks"
71
- ::Bundler::GemHelper.install_tasks
72
-
73
- self
74
- end
75
-
76
- # Loads rspec +spec+ rake task
77
- #
78
- # @return [self]
79
- #
80
- # @api private
81
35
  def load_rspec_tasks
82
- require "rspec/core/rake_task"
83
- ::RSpec::Core::RakeTask.new(:spec)
84
-
85
- self
36
+ Hexx::RSpec.install_tasks
86
37
  end
87
38
 
88
- # Loads rake tasks, defined in the gem
89
- #
90
- # @return [self]
91
- #
92
- # @api private
93
39
  def load_custom_tasks
94
40
  tasks = ::File.expand_path "../../tasks/**/*.rake", __FILE__
95
41
  ::Dir[tasks].each { |task| load task }
96
-
97
- self
98
42
  end
99
- end # singleton_class Suit
43
+
44
+ end # singleton class Suit
45
+
100
46
  end # module Suit
47
+
101
48
  end # module Hexx
data/lib/hexx-suit.rb CHANGED
@@ -1,16 +1,12 @@
1
- # Loads the parts of the suit to be available.
2
- %w(i18n pry rake rspec thor yaml).each { |gem| require gem }
1
+ # encoding: utf-8
3
2
 
4
- # Pippi depends on MRI ruby 2.0+ only
5
- USE_PIPPI_METRIC = (RUBY_ENGINE == "ruby") && (RUBY_VERSION >= "2.0")
3
+ require "hexx-rspec"
4
+ require "pry"
6
5
 
7
- # Loads the code (the order is significant)
8
- Dir.chdir File.expand_path("../..", __FILE__) do
9
- Dir[
10
- "./config/initializers/*.rb",
11
- "./lib/hexx/suit/utils/*.rb",
12
- "./lib/hexx/suit/metrics.rb",
13
- "./lib/hexx/suit/*.rb",
14
- "./lib/hexx/suit.rb"
15
- ].each { |file| require file }
16
- end
6
+ # Shared namespace for the Hexx-based gems
7
+ module Hexx
8
+
9
+ require_relative "hexx/suit/version"
10
+ require_relative "hexx/suit"
11
+
12
+ end # module Hexx