code
stringlengths
1
1.73M
language
stringclasses
1 value
class SeguroController < ApplicationController def index end protected def secure? true end end
Ruby
class JogandoController < ApplicationController layout 'jogar' def selecao #Mudar depois @jogador = Jogador.find_by_id(session[:jogador]) @selecao = Missao.all @jogador.missaos.each do |z| @selecao.delete(z) end respond_to do |format| format.html # selecao.html.erb format.x...
Ruby
class AddColumnEmailToJogador < ActiveRecord::Migration def self.up add_column :jogadors, :email, :string end def self.down remove_column :jogadors, :email end end
Ruby
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', ...
Ruby
# 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. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attac...
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 # Mime::Type.register_alias "text/html", :iphone
Ruby
# Be sure to restart your server when you modify this file. Baladeira::Application.config.session_store :cookie_store, :key => '_baladeira_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "...
Ruby
ActionController::Routing::Routes.draw do |map| #Baladeira::Application.routes.draw do root :to => 'login#login' map.root :controller => 'login' get "login/login" get "seguro/index" #get "login/email:string" #get "login/senha:string" resources :jogadors resources :missaos resources :nivels res...
Ruby
require 'rubygems' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Ruby
require File.expand_path('../boot', __FILE__) require 'rails/all' # If you have a Gemfile, require the gems listed there, including any gems # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) module Baladeira class Application < Rails::Application ...
Ruby
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Baladeira::Application.initialize!
Ruby
Baladeira::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned ...
Ruby
Baladeira::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...
Ruby
Baladeira::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 tes...
Ruby
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Baladeira::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__) require 'rake' Baladeira::Application.load_tasks
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
# Copyright 2008-2009 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Ruby
#!/usr/bin/env ruby class ExampleRemoteLibrary def count_items_in_directory(path) Dir.entries(path).find_all{|i| not i.match('^\.')}.length end def strings_should_be_equal(str1, str2) puts "Comparing '#{str1}' to '#{str2}'" if str1 != str2 raise RuntimeError, "Given strings are not equal" ...
Ruby
class RubyLibraryExample def get_server_language 'ruby' end # Basic communication def passing end def failing(message) raise message end def logging(message, level='INFO') puts "*#{level}* #{message}" end def returning 'returned string' end # Logging def one_message_w...
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 ChangeInclusionTours < ActiveRecord::Migration def up add_column :tours, :inclusion_eng, :string add_column :tours, :inclusion_idn, :string remove_column :tours, :inclusion add_column :tours, :exclusion_eng, :string add_column :tours, :exclusion_idn, :string remove_column :tours, :exclus...
Ruby
class AddDescTourDayImages < ActiveRecord::Migration def up add_column :tour_day_images, :description, :string end def down end end
Ruby
class CreateTourImages < ActiveRecord::Migration def change create_table :tour_images do |t| t.integer :tour_id t.string :tour_image t.timestamps end end end
Ruby
class AddPrimaryPictureTours < ActiveRecord::Migration def up add_column :tours, :primary_picture, :string add_column :tours, :area_id, :integer end def down end end
Ruby
class AddUseridHotels < ActiveRecord::Migration def up add_column :hotels, :userid, :integer end end
Ruby
class CreateCountries < ActiveRecord::Migration def change create_table :countries do |t| t.string :contry_name t.timestamps end end end
Ruby
class Change < ActiveRecord::Migration def up add_column :transports, :transport_type_id, :integer remove_column :transports, :transport_id end def down end end
Ruby
class CreateRoomTypeImages < ActiveRecord::Migration def change create_table :room_type_images do |t| t.integer :image_id t.integer :room_type_id t.timestamps end end end
Ruby
class CreatePropertyTypes < ActiveRecord::Migration def change create_table :property_types do |t| t.string :property_type_name t.timestamps end end end
Ruby
class CreateUserTypes < ActiveRecord::Migration def change create_table :user_types do |t| t.string :user_type_name t.timestamps end end end
Ruby
class CreateTourDayImages < ActiveRecord::Migration def change create_table :tour_day_images do |t| t.integer :tour_day_id t.string :tour_day_image t.timestamps end end end
Ruby
class AddDescTourImage < ActiveRecord::Migration def up add_column :tour_images, :description, :string end def down end end
Ruby
class CreateHotelTransactions < ActiveRecord::Migration def change create_table :hotel_transactions do |t| t.integer :hotel_room_type_id t.integer :payment_type_id t.integer :status_id t.integer :price t.string :first_name t.string :last_name t.string :address t.str...
Ruby
class CreateRoomTypeFacilities < ActiveRecord::Migration def change create_table :room_type_facilities do |t| t.integer :room_type_id t.integer :room_facility_id t.timestamps end end end
Ruby
class CreateAreas < ActiveRecord::Migration def change create_table :areas do |t| t.string :area t.timestamps end end end
Ruby
class TravelTranslation < ActiveRecord::Migration def up add_column :tours, :termcon_eng, :string add_column :tours, :termcon_idn, :string add_column :hotels, :termcon_eng, :string add_column :hotels, :termcon_idn, :string add_column :hotel_images, :description_eng, :string add_column :ho...
Ruby
class AddTittleTd < ActiveRecord::Migration def up add_column :tour_days, :title_idn, :string add_column :tour_days, :title_eng, :string end def down end end
Ruby
class CreateHotelRoomTypes < ActiveRecord::Migration def change create_table :hotel_room_types do |t| t.integer :hotel_id t.string :room_name t.integer :price t.integer :promotion_price t.integer :max_guest t.boolean :is_on_promoted t.timestamps end end end
Ruby
class CreateImages < ActiveRecord::Migration def change create_table :images do |t| t.string :table_name t.integer :foreign_id t.integer :image_name t.timestamps end end end
Ruby
class AddImageRoomType < ActiveRecord::Migration def up add_column :hotel_room_types, :primary_picture, :string end def down end end
Ruby
class CreateTransportTypes < ActiveRecord::Migration def change create_table :transport_types do |t| t.string :name_eng t.string :name_idn t.timestamps end end end
Ruby
class CreateHotels < ActiveRecord::Migration def change create_table :hotels do |t| t.integer :property_type_id t.integer :province_id t.integer :district_id t.integer :country_id t.integer :area_id t.string :hotel_name t.string :address t.string :postal_code ...
Ruby
class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.integer :user_type_id t.string :first_name t.string :last_name t.string :email t.string :password_digest t.string :index_phone t.string :phone t.string :address t.string :count...
Ruby
class CreateDistricts < ActiveRecord::Migration def change create_table :districts do |t| t.string :district_name t.timestamps end end end
Ruby
class CreateTransports < ActiveRecord::Migration def change create_table :transports do |t| t.string :transport_name t.string :description_idn t.string :description_eng t.boolean :is_published t.boolean :is_on_promoted t.boolean :is_recomended t.integer :person t.st...
Ruby
class AddTrasportId < ActiveRecord::Migration def up add_column :transports, :transport_id, :integer add_column :transports, :stars, :integer end def down end end
Ruby
class ChangeDescTours < ActiveRecord::Migration def up add_column :tours, :description_eng, :string add_column :tours, :description_idn, :string remove_column :tours, :description end def down end end
Ruby
class CreateHotelImages < ActiveRecord::Migration def change create_table :hotel_images do |t| t.integer :hotel_id t.string :image t.string :description t.timestamps end end end
Ruby
class CreateFacilities < ActiveRecord::Migration def change create_table :facilities do |t| t.string :facility_name_idn t.string :facility_name_eng t.timestamps end end end
Ruby
class ChagePromotionPrice < ActiveRecord::Migration def up add_column :hotel_room_types, :idr_promotion_price, :integer add_column :hotel_room_types, :usd_promotion_price, :integer remove_column :hotel_room_types, :promotion_price end end
Ruby
class CreateTransportPackages < ActiveRecord::Migration def change create_table :transport_packages do |t| t.integer :transport_id t.integer :idr_price t.integer :usd_price t.integer :idr_promotion_price t.integer :usd_promotion_price t.text :description_ind t.text :descr...
Ruby
class ChangeTourImage < ActiveRecord::Migration def up add_column :tour_images, :image, :string remove_column :tour_images, :tour_image end def down end end
Ruby
class AddTitleTransPack < ActiveRecord::Migration def up add_column :transport_packages, :title_idn, :string add_column :transport_packages, :title_eng, :string end def down end end
Ruby
class RoomPrimaryPicture < ActiveRecord::Migration def up add_column :hotel_room_types, :primary_picture, :string end def down end end
Ruby
class CreateRoomFacilities < ActiveRecord::Migration def change create_table :room_facilities do |t| t.string :facility_name_idn t.string :facility_name_eng t.timestamps end end end
Ruby
class CreateTourTypes < ActiveRecord::Migration def change create_table :tour_types do |t| t.string :tour_type_name t.text :description t.timestamps end end end
Ruby
class PriceChange < ActiveRecord::Migration def change add_column :hotel_room_types, :idr_price, :integer add_column :hotel_room_types, :usd_price, :integer remove_column :hotel_room_types, :price end end
Ruby
class CreateTransportImages < ActiveRecord::Migration def change create_table :transport_images do |t| t.integer :transport_id t.string :image t.timestamps end end end
Ruby
class CreatePaymentTypes < ActiveRecord::Migration def change create_table :payment_types do |t| t.string :payment_type t.timestamps end end end
Ruby
class CreateTourDays < ActiveRecord::Migration def change create_table :tour_days do |t| t.integer :tour_id t.string :day_number t.text :description t.timestamps end end end
Ruby
class ChangeTourDayImages < ActiveRecord::Migration def up add_column :tour_day_images, :image, :string remove_column :tour_day_images, :tour_day_image end def down end end
Ruby
class AddRoomMax < ActiveRecord::Migration def up add_column :hotel_room_types, :max_room, :string end def down end end
Ruby
class CreateHotelFacilities < ActiveRecord::Migration def change create_table :hotel_facilities do |t| t.integer :hotel_id t.integer :facility_id t.timestamps end end end
Ruby
class CreateStatuses < ActiveRecord::Migration def change create_table :statuses do |t| t.string :status_idn t.string :status_eng t.timestamps end end end
Ruby
class AddTourDescription < ActiveRecord::Migration def up add_column :tours, :description, :string end def down end end
Ruby
class CreateHotelRoomTypeImages < ActiveRecord::Migration def change create_table :hotel_room_type_images do |t| t.integer :hotel_room_type_id t.string :image t.string :description t.timestamps end end end
Ruby
class CreateProvinces < ActiveRecord::Migration def change create_table :provinces do |t| t.string :province_name t.timestamps end end end
Ruby
class AddRatingTour < ActiveRecord::Migration def up add_column :tours, :rating, :integer end def down end end
Ruby
class UserChanged < ActiveRecord::Migration def change add_column :users, :password_hash, :string add_column :users, :password_salt, :string remove_column :users, :password_digest end def down end end
Ruby
class CreateTours < ActiveRecord::Migration def change create_table :tours do |t| t.integer :tour_type_id t.string :tour_name_idn t.string :tour_name_eng t.integer :days t.integer :night t.string :transport_eng t.string :transport_idn t.string :inclusion t.str...
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
#!/usr/bin/env rake # 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__) BaliFantastico::Application.load_tasks
Ruby
source 'https://rubygems.org' gem 'rails', '3.2.12' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3' gem 'devise', '~> 2.2.3' gem 'mini_magick', '3.5.0' gem "ckeditor" gem 'carrierwave' gem 'remotipart' # Gems used only for assets and not required # in produc...
Ruby
module DistrictsHelper end
Ruby
module ApplicationHelper def sortable(column, title = nil) title ||= column.titleize css_class = (column == sort_column) ? "current #{sort_direction}" : nil title += css_class.nil? ? "" : ((column == sort_column && sort_direction == "asc") ? " <i class='icon-caret-up'></i>" : " <i class='i...
Ruby
module HotelRoomTypeImagesHelper end
Ruby
module RoomFacilitiesHelper end
Ruby
module ImagesHelper end
Ruby
module CountriesHelper end
Ruby
module StatusesHelper end
Ruby
module PropertyTypesHelper end
Ruby
module ProvincesHelper end
Ruby
module SessionsHelper end
Ruby
module TourDayImagesHelper end
Ruby
module HotelRoomTypesHelper end
Ruby
module AreasHelper end
Ruby
module UsersHelper end
Ruby
module AdminHelper end
Ruby
module TransportsHelper end
Ruby