Sha256: df76da10c8ad49013eb6163044f729e95ed36e1f2a996f802d4850950c47d239

Contents?: true

Size: 825 Bytes

Versions: 11

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

module AnnotateRb
  class RakeBootstrapper
    class << self
      def call(options)
        begin
          require "rake/dsl_definition"
        rescue => e
          # We might just be on an old version of Rake...
          warn e.message
          exit e.status_code
        end

        require "rake"
        load "./Rakefile" if File.exist?("./Rakefile")

        begin
          Rake::Task[:environment].invoke
        rescue
          nil
        end

        unless defined?(Rails)
          # Not in a Rails project, so time to load up the parts of
          # ActiveSupport we need.
          require "active_support"
          require "active_support/core_ext/class/subclasses"
          require "active_support/core_ext/string/inflections"
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
annotaterb-4.10.1 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.10.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.9.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.7.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.6.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.5.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.4.1 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.4.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.3.1 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.3.0 lib/annotate_rb/rake_bootstrapper.rb
annotaterb-4.2.0 lib/annotate_rb/rake_bootstrapper.rb