code
stringlengths
1
1.73M
language
stringclasses
1 value
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a probl...
Ruby
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters f...
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.action_dispatch.cookies_serializer = :json
Ruby
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails...
Ruby
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_xlearning_session'
Ruby
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
Ruby
Rails.application.routes.draw do resources :facilitadores get 'perfil/index' resources :carreras get 'asignar_rol/index' get 'principal_carreras/index' get 'gestionar_carreras/index' get 'gestionar_carreras/cargar_arbol' post 'gestionar_carreras/actualizar_carreras' post 'gestionar_carreras/actual...
Ruby
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
Ruby
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Xlearning class Application < Rails::Application # Settings in config/environments/* take pre...
Ruby
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize!
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suit...
Ruby
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Rails.application
Ruby
# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks
Ruby
require 'echoe' Echoe.new('xlr8') do |p| p.author = "Hemant Bhanoo" p.summary = " automate the packaging, versioning, and management of your public directory so that all content served is accessed super-fast by your customers from s3 and cloudfront." p.url = "http://code.google.com/p/xlr8/" p.runtime_dependenci...
Ruby
Capistrano.configuration(:must_exist).load do |c| namespace :xlr8 do task :default do prepare xlr8 end # task default desc "Make sure that the Xlr8 configuration is happy" task :verify do puts "verify" end desc <<-DESC Prepare to xlr8. This is mainly here so t...
Ruby
require 'rake' require 'digest/md5' task :xlr8 => ['xlr8:copy_to_s3', 'xlr8:edge_cache', 'xlr8:finalize_config'] namespace :xlr8 do desc <<-DESC xlr8 your rails application. This should not be invoked locally, but by a capistrano task that knows about your release version DESC task :default do end ...
Ruby
Dir["#{File.dirname(__FILE__)}/tasks/**/*.rake"].each { |ext| load ext }
Ruby
require 'right_aws' module Xlr8 class Proxy def initialize( access_key_id, secret_access_key, bucket ) @access_key_id = access_key_id @secret_access_key = secret_access_key # TODO: # make sure that s3 lib is loaded w/ support for # - persistent connections ( i think right_aws might ...
Ruby
# coding: utf-8 # Title: LightPack API wrapper for Ruby # Author: Mikhail S. Pobolovets # License: GPL v3 # Date: 2011/08/15 # API Version: 5.5 require 'socket' class LightPack include Socket::Constants # host = '127.0.0.1' # The remote host # port = 3636 ...
Ruby
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel...
Ruby
class CreateGroupInformations < ActiveRecord::Migration def self.up create_table :group_informations do |t| t.string :groupId t.string :title t.integer :groupTypeId t.integer :mediaLocatorId t.integer :howRelatedId t.integer :memberOfId t.integer :group_type t.integ...
Ruby
class CreateKeywordprograms < ActiveRecord::Migration def self.up create_table :keywordprograms do |t| t.string :program_information_id t.string :language t.string :type_keyword t.string :text t.timestamps end end def self.down drop_table :keywordprograms end end
Ruby
class CreateSelectFiles < ActiveRecord::Migration def self.up create_table :select_files do |t| t.string :file t.string :server t.timestamps end end def self.down drop_table :select_files end end
Ruby
class CreateServiceInformationTables < ActiveRecord::Migration def self.up create_table :service_information_tables do |t| t.integer :id t.integer :select_file_id t.timestamps end end def self.down drop_table :service_information_tables end end
Ruby
class CreateCreditItems < ActiveRecord::Migration def self.up create_table :credit_items do |t| t.string :program_information_id t.string :role t.integer :index t.string :givenName t.string :familyName t.timestamps end end def self.down drop_table :credit_items e...
Ruby
class CreateTitles < ActiveRecord::Migration def self.up create_table :titles do |t| t.string :program_information_id t.string :language t.string :type_title t.string :text t.timestamps end end def self.down drop_table :titles end end
Ruby
class CreateServiceInformations < ActiveRecord::Migration def self.up create_table :service_informations do |t| t.string :serviceId t.string :name t.integer :serviceGenreId t.integer :service_information_table_id t.timestamps end end def self.down drop_table :service_inf...
Ruby
class CreateMediaLocators < ActiveRecord::Migration def self.up create_table :media_locators do |t| t.integer :id t.string :uri t.timestamps end end def self.down drop_table :media_locators end end
Ruby
class CreateMemberOfs < ActiveRecord::Migration def self.up create_table :member_ofs do |t| t.string :program_information_id t.string :xsiType t.integer :index t.string :crid t.timestamps end end def self.down drop_table :member_ofs end end
Ruby
class CreateEpisodeOfs < ActiveRecord::Migration def self.up create_table :episode_ofs do |t| t.string :program_information_id t.string :xsiType t.integer :index t.string :crid t.timestamps end end def self.down drop_table :episode_ofs end end
Ruby
class CreateSynopses < ActiveRecord::Migration def self.up create_table :synopses do |t| t.string :program_information_id t.string :language t.string :length t.string :text t.timestamps end end def self.down drop_table :synopses end end
Ruby
class CreateProgramLocationTables < ActiveRecord::Migration def self.up create_table :program_location_tables do |t| t.integer :id t.integer :select_file_id t.timestamps end end def self.down drop_table :program_location_tables end end
Ruby
class CreateSchedules < ActiveRecord::Migration def self.up create_table :schedules do |t| t.string :service_id t.string :start t.string :end t.integer :id t.integer :program_location_table_id t.timestamps end end def self.down drop_table :schedules end end
Ruby
class CreateGenres < ActiveRecord::Migration def self.up create_table :genres do |t| t.integer :id t.string :language t.string :href t.string :name t.timestamps end end def self.down drop_table :genres end end
Ruby
class CreateProgramInformationTables < ActiveRecord::Migration def self.up create_table :program_information_tables do |t| t.integer :id t.integer :select_file_id t.timestamps end end def self.down drop_table :program_information_tables end end
Ruby
class CreateProgramInformations < ActiveRecord::Migration def self.up create_table :program_informations do |t| t.string :id t.string :crid t.string :language t.integer :genreId t.integer :episodeOfId t.integer :memberOfId t.integer :howRelatedId t.integer :program_...
Ruby
class CreateScheduleEvents < ActiveRecord::Migration def self.up create_table :schedule_events do |t| t.integer :schedule_id t.string :programCrid t.string :instanceMetadataId t.string :startime t.string :duration t.string :memberOfId t.string :episodeOdId t.timesta...
Ruby
class CreateAvattributes < ActiveRecord::Migration def self.up create_table :avattributes do |t| t.integer :id t.string :avtype t.integer :schedule_event_id t.string :content t.string :value t.timestamps end end def self.down drop_table :avattributes end end
Ruby
class CreateHowRelateds < ActiveRecord::Migration def self.up create_table :how_relateds do |t| t.integer :id t.string :href t.string :name t.timestamps end end def self.down drop_table :how_relateds end end
Ruby
class CreateIndex < ActiveRecord::Migration def up add_index :avattributes, :avtype add_index :avattributes, :schedule_event_id add_index :episode_ofs, :program_information_id add_index :episode_ofs, :index add_index :episode_ofs, :crid add_index :group_information_tables, :sele...
Ruby
class CreateGroupInformationTables < ActiveRecord::Migration def self.up create_table :group_information_tables do |t| t.integer :id t.integer :select_file_id t.timestamps end end def self.down drop_table :group_information_tables end end
Ruby
class CreateDefaultChannels < ActiveRecord::Migration def self.up create_table :default_channels do |t| t.string :name t.string :language t.timestamps end end def self.down drop_table :default_channels end end
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integrati...
Ruby
source 'https://rubygems.org' gem 'rails', '3.2.2' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem "libxml-ruby" gem 'nokogiri' gem 'sqlite3' gem 'mysql2' gem "nifty-generators", :group => :development gem 'therubyracer' gem 'execjs' # Gems used only for assets and not req...
Ruby
#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require 'rails/commands'
Ruby
module AvattributesHelper end
Ruby
module SynopsesHelper end
Ruby
module ApplicationHelper end
Ruby
module SelectFilesHelper end
Ruby
module DefaultChannelsHelper end
Ruby
module ErrorMessagesHelper # Render error messages for the given objects. The :message and :header_message options are allowed. def error_messages_for(*objects) options = objects.extract_options! options[:header_message] ||= I18n.t(:"activerecord.errors.header", :default => "Invalid Fields") options[:me...
Ruby
module GenresHelper end
Ruby
module ProgramInformationTablesHelper end
Ruby
module GroupInformationsHelper end
Ruby
module KeywordprogramsHelper end
Ruby
module AvAttributesHelper end
Ruby
module GroupInformationTablesHelper end
Ruby
module ScheduleEventsHelper end
Ruby
module SchedulesHelper end
Ruby
module HowRelatedsHelper end
Ruby
module ProgramInformationsHelper end
Ruby
# These helper methods can be called in your template to set variables to be used in the layout # This module should be included in all views globally, # to do so you may need to add this line to your ApplicationController # helper :layout module LayoutHelper def title(page_title, show_title = true) content_for...
Ruby
module ServiceInformationTablesHelper end
Ruby
module MemberOfsHelper end
Ruby
module MediaLocatorsHelper end
Ruby
module ServiceInformationsHelper end
Ruby
module CreditItemsHelper end
Ruby
module EpisodeOfsHelper end
Ruby
module ProgramLocationTablesHelper end
Ruby
module TitlesHelper end
Ruby
class EpisodeOf < ActiveRecord::Base attr_accessible :program_information_id, :xsiType, :index, :crid belongs_to :program_information end
Ruby
require 'rubygems' require 'libxml' include LibXML class PostCallbacks< XML::SAX::Document include XML::SaxParser::Callbacks def on_start_element(element, attributes) logger.debug " - - - -- - - - - - -- - - - - - -- - " logger.debug element logger.debug attributes end end
Ruby
class ScheduleEvent < ActiveRecord::Base attr_accessible :schedule_id, :programCrid, :instanceMetadataId, :startime, :duration, :memberOfId, :episodeOdId, :avattribute_attributes belongs_to :schedule has_many :avattribute, :dependent => :delete_all end
Ruby
class Title < ActiveRecord::Base attr_accessible :program_information_id, :language, :type_title, :text belongs_to :program_information end
Ruby
class ServiceInformationTable < ActiveRecord::Base attr_accessible :id, :select_file_id belongs_to :select_file has_many :service_information, :dependent => :delete_all def self.to_csv idFileRedBee = SelectFile.where(:server => "RedBee").first.id idSIT = ServiceInformationTable.where(:se...
Ruby
class MediaLocator < ActiveRecord::Base attr_accessible :id, :uri end
Ruby
class HowRelated < ActiveRecord::Base attr_accessible :id, :href, :name end
Ruby
class Avattribute < ActiveRecord::Base attr_accessible :id, :avtype, :schedule_event_id, :content, :value belongs_to :schedule_event end
Ruby
class GroupInformation < ActiveRecord::Base attr_accessible :groupId, :title, :group_type, :mediaLocatorId, :howRelatedId, :memberOfId,:group_information_table_id belongs_to :group_information_table end
Ruby
class MemberOf < ActiveRecord::Base attr_accessible :program_information_id, :xsiType, :index, :crid belongs_to :program_information end
Ruby
class ProgramLocationTable < ActiveRecord::Base attr_accessible :id, :select_file_id belongs_to :select_file has_many :schedule, :dependent => :delete_all end
Ruby
class SelectFile < ActiveRecord::Base attr_accessible :file, :server has_attached_file :xmlFile1 has_attached_file :xmlFile2 has_many :program_information_table, :dependent => :delete_all has_many :program_location_table, :dependent => :delete_all has_many :service_information_table, :dependent => :de...
Ruby
class ProgramInformation < ActiveRecord::Base attr_accessible :id, :crid, :language, :genreId, :episodeOfId, :memberOfId, :howRelatedId,:program_information_table_id, :title_attributes, :synopses_attributes,:keywordprogram_attributes,:credit_item_attributes, :episode_of_attributes, :member_of_attribut...
Ruby
class Schedule < ActiveRecord::Base attr_accessible :service_id, :start, :end, :id,:program_location_table_id, :schedule_event_attributes belongs_to :program_location_table has_many :schedule_event, :dependent => :delete_all end
Ruby
class Genre < ActiveRecord::Base attr_accessible :id, :language, :href, :name end
Ruby
class Synopsis < ActiveRecord::Base attr_accessible :program_information_id, :language, :length, :text belongs_to :program_information end
Ruby
class ProgramInformationTable < ActiveRecord::Base attr_accessible :id, :select_file_id belongs_to :select_file has_many :program_information, :dependent => :delete_all end
Ruby
class SelectFile < ActiveRecord::Base attr_accessible :file, :server has_attached_file :xmlFile1 has_attached_file :xmlFile2 has_many :program_information_table, :dependent => :delete_all has_many :program_location_table, :dependent => :delete_all has_many :service_information_table, :dependent => :de...
Ruby
class CreditItem < ActiveRecord::Base attr_accessible :program_information_id, :role, :index, :givenName, :familyName,:id belongs_to :program_information end
Ruby
class DefaultChannel < ActiveRecord::Base attr_accessible :name, :language end
Ruby
class GroupInformationTable < ActiveRecord::Base attr_accessible :id, :select_file_id belongs_to :select_file has_many :group_information, :dependent => :delete_all end
Ruby
class ServiceInformation < ActiveRecord::Base attr_accessible :serviceId, :name, :serviceGenreId,:service_information_table_id belongs_to :service_information_table end
Ruby
class Keywordprogram < ActiveRecord::Base attr_accessible :program_information_id, :language, :type_keyword, :text belongs_to :program_information end
Ruby
class SchedulesController < ApplicationController def index @schedules = Schedule.all end def show @schedule = Schedule.find(params[:id]) end def new @schedule = Schedule.new end def create @schedule = Schedule.new(params[:schedule]) if @schedule.save redirect_to @schedule, :n...
Ruby
class EpisodeOfsController < ApplicationController def index @episode_ofs = EpisodeOf.all end def show @episode_of = EpisodeOf.find(params[:id]) end def new @episode_of = EpisodeOf.new end def create @episode_of = EpisodeOf.new(params[:episode_of]) if @episode_of.save redirect...
Ruby
class MediaLocatorsController < ApplicationController def index @media_locators = MediaLocator.all end def show @media_locator = MediaLocator.find(params[:id]) end def new @media_locator = MediaLocator.new end def create @media_locator = MediaLocator.new(params[:media_locator]) if @...
Ruby
class ScheduleEventsController < ApplicationController def index @schedule_events = ScheduleEvent.all end def show @schedule_event = ScheduleEvent.find(params[:id]) end def new @schedule_event = ScheduleEvent.new end def create @schedule_event = ScheduleEvent.new(params[:schedule_event]...
Ruby