100% free for Open Source, forever. Get another set of eyes on your code.

100% free for Open Source, forever. Get another set of eyes on your code.

aefdc076
A

Clearance::Generators::SpecsGenerator

Updated 2 months ago.

No issues here.

Congrats! Give yourself time to reflect on your awesome coding skillz.

require 'rails/generators/base'
require 'rspec/rails/version'

module Clearance
  module Generators
    class SpecsGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)

      def create_specs
        @helper_file = rspec_helper_file
        directory '.', 'spec'
      end

      private

      def rspec_helper_file
        if RSpec::Rails::Version::STRING.to_i > 2
          "rails_helper"
        else
          "spec_helper"
        end
      end
    end
  end
end
9
Complexity
0
Duplication
25
Lines
2
Methods
4.4
Complexity / M
1
Churn
21
Lines of Code
11
LOC / Method