Sha256: 9576c2566e1576109c674fde5db220b911645e2639d9292ac86c8f3d7f596346

Contents?: true

Size: 561 Bytes

Versions: 14

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

require 'pagy'  # so you can require just the extra in the console
require 'pagy/extras/standalone'

class Pagy
  # include Pagy::Console in irb/rails console for a ready to use pagy environment
  module Console
    def self.included(main)
      main.include(Backend)
      main.include(Frontend)
      VARS[:url] = 'http://www.example.com/subdir'
    end

    def pagy_extras(*extras)
      extras.each {|extra| require "pagy/extras/#{extra}"}
      puts "Required extras: #{extras.map(&:inspect).join(', ')}"
    end
  end

end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/pagy-4.11.0/lib/pagy/console.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/pagy-4.11.0/lib/pagy/console.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/pagy-4.11.0/lib/pagy/console.rb
pagy-4.11.0 lib/pagy/console.rb
pagy-4.10.2 lib/pagy/console.rb
pagy-4.10.1 lib/pagy/console.rb
pagy-4.10.0 lib/pagy/console.rb
pagy-4.9.0 lib/pagy/console.rb
pagy-4.8.1 lib/pagy/console.rb
pagy-4.8.0 lib/pagy/console.rb
pagy-4.7.1 lib/pagy/console.rb
pagy-4.7.0 lib/pagy/console.rb
pagy-4.6.0 lib/pagy/console.rb
pagy-4.5.1 lib/pagy/console.rb