Sha256: 597a03c1f56ce4c3f34c7bf7ceb223940a5a624fb4223631433b8f9c4e9740f4

Contents?: true

Size: 1.4 KB

Versions: 15

Compression:

Stored size: 1.4 KB

Contents

#!/usr/bin/env ruby

require 'bundler/setup'
require 'active_record'

require 'rubypitaya'
require 'rubypitaya/core/database_config'

# Database connection
environment_name = ENV.fetch("RUBYPITAYA_ENV") { 'development' }
database_config = RubyPitaya::DatabaseConfig.new(environment_name, RubyPitaya::Path::DATABASE_CONFIG_PATH)
ActiveRecord::Base.establish_connection(database_config.connection_data)
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
ActiveSupport::LogSubscriber.colorize_logging = true

# Loading core files
Gem.find_files('rubypitaya/**/*.rb').each do |path|
  require path unless path.end_with?('spec.rb') ||
                      path.include?('db/migration') ||
                      path.include?('core/templates') ||
                      path.include?('core/spec-helpers') ||
                      path.include?('app-template')
end

# Loading application files
app_folder_paths = RubyPitaya::Path::Plugins::APP_FOLDER_PATHS + [RubyPitaya::Path::APP_FOLDER_PATH]
app_folder_paths.each do |app_folder_path|
  app_files_path = File.join(app_folder_path, '**/*.rb')

  Dir[app_files_path].each do |path|
    require path unless path.end_with?('spec.rb') ||
                        path.include?('db/migration') ||
                        path.include?('spec_helper.rb')
  end
end

# Starting irb
require 'irb'
IRB.start(__FILE__)

# Closing database connection
ActiveRecord::Base.connection.close

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rubypitaya-2.20.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.19.1 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.19.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.18.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.17.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.16.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.15.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.14.1 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.14.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.13.1 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.13.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.12.0 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.11.2 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.11.1 ./lib/rubypitaya/app-template/bin/console
rubypitaya-2.11.0 ./lib/rubypitaya/app-template/bin/console