code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
module Picnic
# Provides an interface for accessing your Picnic app's configuration file.
#
# Usage example:
#
# # Load the configuration from /etc/foo/config.yml
# Conf.load('foo')
#
# # The contents of config.yml is now available as follows:
# puts Conf[:server]
# puts Conf[:authenticati... | Ruby |
$: << File.dirname(File.expand_path(__FILE__))
$: << File.dirname(File.expand_path(__FILE__))+"/../vendor/camping-1.5.180/lib"
unless Object.const_defined?(:ActiveSupport)
begin
require 'active_support'
rescue LoadError
require 'rubygems'
require 'active_support'
end
end
require 'camping'
require ... | Ruby |
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/picnic'
| Ruby |
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
require 'hoe'
include FileUtils
require File.join(File.dirname(__FILE__), 'lib', 'picnic', 'versio... | Ruby |
#
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
un... | Ruby |
module Picnic
# Supporting utility functions used throughout Picnic
module Utils
# Generates a random string, at most 32 characters in length.
def random_string
"#{Time.now.to_i}r%X" % rand(10**32)
end
module_function :random_string
# The customized Logger used for logging in Picnic.
... | Ruby |
module Picnic #:nodoc:
# These modules (currently only one module, but more in the future) provide authentication
# for your Camping app.
#
module Authentication
# Picnic::Authentication::Basic provides Basic HTTP Authentication for your Camping app.
# The module defines a <tt>service</tt> method that... | Ruby |
require 'optparse'
begin
require 'active_support'
rescue LoadError
require 'rubygems'
require 'active_support'
end
module Picnic
# Provides a command-line interface for your app.
# This is useful for creating a 'bin' file for launching your application.
#
# Usage example (put this in a file called 'foo... | Ruby |
module Picnic
module Controllers
end
end | Ruby |
module Picnic
# In Camping, "postambles" are wrappers used to make your application run under
# some given web server. They are called "postambles" because traditionally this
# was a piece of code included at the bottom of your Camping script. Picnic
# provides postambles for two popular Ruby-based web servers:... | Ruby |
module Picnic #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 6
TINY = 4
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| Ruby |
require 'optparse'
module Picnic
# Provides functionality for controlling a Picnic-based server as
# an init.d service.
#
# Based on code from rubycas-server by jzylks and matt.zukowski.
#
# Usage Example:
#
# #!/usr/bin/env ruby
#
# require 'rubygems'
# require 'picnic/service_cont... | Ruby |
module Picnic
# Provides an interface for accessing your Picnic app's configuration file.
#
# Usage example:
#
# # Load the configuration from /etc/foo/config.yml
# Conf.load('foo')
#
# # The contents of config.yml is now available as follows:
# puts Conf[:server]
# puts Conf[:authenticati... | Ruby |
$: << File.dirname(File.expand_path(__FILE__))
$: << File.dirname(File.expand_path(__FILE__))+"/../vendor/camping-1.5.180/lib"
unless Object.const_defined?(:ActiveSupport)
begin
require 'active_support'
rescue LoadError
require 'rubygems'
require 'active_support'
end
end
require 'camping'
require ... | Ruby |
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/picnic'
| Ruby |
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
require 'hoe'
include FileUtils
require File.join(File.dirname(__FILE__), 'lib', 'picnic', 'versio... | Ruby |
#
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
un... | Ruby |
module Picnic
# Supporting utility functions used throughout Picnic
module Utils
# Generates a random string, at most 32 characters in length.
def random_string
"#{Time.now.to_i}r%X" % rand(10**32)
end
module_function :random_string
# The customized Logger used for logging in Picnic.
... | Ruby |
module Picnic #:nodoc:
# These modules (currently only one module, but more in the future) provide authentication
# for your Camping app.
#
module Authentication
# Picnic::Authentication::Basic provides Basic HTTP Authentication for your Camping app.
# The module defines a <tt>service</tt> method that... | Ruby |
require 'optparse'
module Picnic
# Provides a command-line interface for your app.
# This is useful for creating a 'bin' file for launching your application.
#
# Usage example (put this in a file called 'foo'):
#
# #!/usr/bin/env ruby
#
# require 'rubygems'
# require 'picnic'
#
# require... | Ruby |
module Picnic
module Controllers
end
end | Ruby |
module Picnic
# In Camping, "postambles" are wrappers used to make your application run under
# some given web server. They are called "postambles" because traditionally this
# was a piece of code included at the bottom of your Camping script. Picnic
# provides postambles for two popular Ruby-based web servers:... | Ruby |
module Picnic #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 7
TINY = 0
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| Ruby |
require 'optparse'
module Picnic
# Provides functionality for controlling a Picnic-based server as
# an init.d service.
#
# Based on code from rubycas-server by jzylks and matt.zukowski.
#
# Usage Example:
#
# #!/usr/bin/env ruby
#
# require 'rubygems'
# require 'picnic/service_cont... | Ruby |
module Picnic
# Provides an interface for accessing your Picnic app's configuration file.
#
# Usage example:
#
# # Load the configuration from /etc/foo/config.yml
# Conf.load('foo')
#
# # The contents of config.yml is now available as follows:
# puts Conf[:server]
# puts Conf[:authenticati... | Ruby |
require 'rubygems'
#require 'active_support'
$: << File.dirname(File.expand_path(__FILE__))+"/../vendor/camping-1.5.180/lib"
require "camping"
$: << File.dirname(File.expand_path(__FILE__))
require "picnic/utils.rb"
require "picnic/conf.rb"
require "picnic/postambles.rb"
class Module
# Adds Picnic functionali... | Ruby |
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/picnic'
| Ruby |
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
require 'hoe'
include FileUtils
require File.join(File.dirname(__FILE__), 'lib', 'picnic', 'versio... | Ruby |
#
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
un... | Ruby |
module Picnic
# Supporting utility functions used throughout Picnic
module Utils
# Generates a random string, at most 32 characters in length.
def random_string
"#{Time.now.to_i}r%X" % rand(10**32)
end
module_function :random_string
# The customized Logger used for logging in Picnic.
... | Ruby |
module Picnic #:nodoc:
# These modules (currently only one module, but more in the future) provide authentication
# for your Camping app.
#
module Authentication
# Picnic::Authentication::Basic provides Basic HTTP Authentication for your Camping app.
# The module defines a <tt>service</tt> method that... | Ruby |
require 'optparse'
begin
require 'active_support'
rescue LoadError
require 'rubygems'
require 'active_support'
end
module Picnic
# Provides a command-line interface for your app.
# This is useful for creating a 'bin' file for launching your application.
#
# Usage example (put this in a file called 'foo... | Ruby |
module Picnic
module Controllers
end
end | Ruby |
module Picnic
# In Camping, "postambles" are wrappers used to make your application run under
# some given web server. They are called "postambles" because traditionally this
# was a piece of code included at the bottom of your Camping script. Picnic
# provides postambles for two popular Ruby-based web servers:... | Ruby |
module Picnic #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 6
TINY = 5
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| Ruby |
require 'optparse'
module Picnic
# Provides functionality for controlling a Picnic-based server as
# an init.d service.
#
# Based on code from rubycas-server by jzylks and matt.zukowski.
#
# Usage Example:
#
# #!/usr/bin/env ruby
#
# require 'rubygems'
# require 'picnic/service_cont... | Ruby |
module Picnic
# Provides an interface for accessing your Picnic app's configuration file.
#
# Usage example:
#
# # Load the configuration from /etc/foo/config.yml
# Conf.load('foo')
#
# # The contents of config.yml is now available as follows:
# puts Conf[:server]
# puts Conf[:authenticati... | Ruby |
$: << File.dirname(File.expand_path(__FILE__))
$: << File.dirname(File.expand_path(__FILE__))+"/../vendor/camping-1.5.180/lib"
unless Object.const_defined?(:ActiveSupport)
begin
require 'active_support'
rescue LoadError
require 'rubygems'
gem 'activesupport', '>=2.0.2'
gem 'activerecord', '>=2.0.2'... | Ruby |
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "theme/css"
sass_dir = "theme/scss"
images_dir = "images"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :co... | 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' }])
# Major.create(:name... | Ruby |
class CreateLanguages < ActiveRecord::Migration
def self.up
create_table :languages do |t|
t.string :code
t.string :name
t.timestamps
end
end
def self.down
drop_table :languages
end
end
| Ruby |
class CreateClubs < ActiveRecord::Migration
def self.up
create_table :clubs do |t|
t.string :name
t.timestamps
end
end
def self.down
drop_table :clubs
end
end
| Ruby |
class DbPopulate4 < ActiveRecord::Migration
def self.up
add_column :rss_links, :club_id, :integer
add_column :clubs, :country_id, :integer
remove_column :countries, :club_id, :integer
@portugues = Language.find_by_code("en")
@english = Language.find_by_code("en")
@club = Club.create(:name => '... | Ruby |
class CreatePlayers < ActiveRecord::Migration
def self.up
create_table :players do |t|
t.string :authId
t.string :fullName
t.string :eMail
t.string :nickName
t.string :language
t.string :provider
t.integer :profileUpdateType
t.timestamps
end
end
def self.d... | Ruby |
class DbFixLanguage < ActiveRecord::Migration
def self.up
end
def self.down
end
end
| Ruby |
class DbAdicionaCampos < ActiveRecord::Migration
def self.up
add_column :players, :club_id, :integer
end
def self.down
remove_column :players, :club_id
end
end
| Ruby |
class DbFixLanguage2 < ActiveRecord::Migration
def self.up
add_column :country_localizations, :language_id, :integer
add_column :rss_links, :language_id, :integer
portuguese = Language.create(:code => "pt", :name => "Português")
english = Language.create(:code => "en", :name => "English")
CountryL... | Ruby |
class CreateCountryLocalizations < ActiveRecord::Migration
def self.up
create_table :country_localizations do |t|
t.string :name
t.string :language
t.timestamps
end
end
def self.down
drop_table :country_localizations
end
end
| Ruby |
class DbPopulate2 < ActiveRecord::Migration
def self.up
add_column :country_localizations, :country_id, :integer
# @country = Country.create(:countryId => 'BR')
# @country.country_localizations.create(:name => "Brasil", :language => "pt")
# @country.country_localizations.create(:name => "Brazil", :langua... | Ruby |
class CreateCountries < ActiveRecord::Migration
def self.up
create_table :countries do |t|
t.string :countryId
t.timestamps
end
end
def self.down
drop_table :countries
end
end
| Ruby |
class PopulateDb1 < ActiveRecord::Migration
def self.up
end
def self.down
end
end
| Ruby |
class CreateRssLinks < ActiveRecord::Migration
def self.up
create_table :rss_links do |t|
t.string :link
t.string :language
t.timestamps
end
end
def self.down
drop_table :rss_links
end
end
| Ruby |
class DbPopulate3 < ActiveRecord::Migration
def self.up
#add_column :rss_links, :club_id, :integer
#add_column :clubs, :country_id, :integer
remove_column :countries, :club_id, :integer
# @club = Club.create(:name => 'Internacional')
#
# @country = Country.create(:countryId => 'BR')
# @club.... | Ruby |
class AddCountryToClub < ActiveRecord::Migration
def self.up
end
def self.down
end
end
| Ruby |
class AddOpenIdAuthenticationTables < ActiveRecord::Migration
def self.up
create_table :open_id_authentication_associations, :force => true do |t|
t.integer :issued, :lifetime
t.string :handle, :assoc_type
t.binary :server_url, :secret
end
create_table :open_id_authentication_nonces, :f... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class ActiveSupport::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test da... | Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/destroy'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/generate'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/destroy'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/plugin'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/plugin'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/generate'
| Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module ListClubsHelper
end
| Ruby |
module SignUpHelper
end
| Ruby |
class EnumProfileUpdateType
@@ALWAYS_SAVE = 1
@@ALWAYS_ASK = 2
@@NEVER_SAVE = 3
def get_description(_type)
case _type
when EnumProfileUpdateType.ALWAYS_SAVE
I18n.t :tr_profile_update_always_save
when EnumProfileUpdateType.ALWAYS_ASK
I18n.t :tr_profile_update_always_ask
when EnumPr... | Ruby |
class EnumMemberApprovalType
@@BY_OWNER = 1
@@BY_MEMBERS = 2
@@AUTO = 3
def get_description(_type)
case _type
when EnumMemberApprovalType.BY_OWNER
I18n.t :tr_member_approval_by_owner
when EnumMemberApprovalType.BY_MEMBERS
I18n.t :tr_member_approval_by_members
when EnumMember... | Ruby |
class Player < ActiveRecord::Base
belongs_to :rss_link
belongs_to :language
belongs_to :favorite_club, :class_name => "Club", :foreign_key => "club_id"
end
| Ruby |
class ProviderUtils
GOOGLE_AUTH_ID="https://www.google.com/accounts/o8/id"
def self.find_player_condition _provider, _options
{:conditions => ["email = ? AND authId= ? ", _options[:email], _provider]}
end
end
| Ruby |
class Club < ActiveRecord::Base
has_many :rss_links
#has_many :followers, class_name => 'Player'
belongs_to :country
end
| Ruby |
class RssLink < ActiveRecord::Base
belongs_to :language
end
| Ruby |
class Country < ActiveRecord::Base
has_many :country_localizations
end
| Ruby |
class CountryLocalization < ActiveRecord::Base
belongs_to :language
end
| Ruby |
class Language < ActiveRecord::Base
end
| Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryPr... | Ruby |
class LogoutController < ApplicationController
before_filter :logout
def logout
session[:user_id] = @user
session[:player] = @player
redirect_to "/login"
end
end | Ruby |
require 'ostruct'
class LoginController < ApplicationController
before_filter :redirect,
:only => [ :index, :google, :openid]
def index
end
def google
@openIdUrl = url_for :controller => :login, :action => :google
auth ProviderUtils::GOOGLE_AUTH_ID,{ :required => [:nickname, :email] }, :GOOGLE
end
... | Ruby |
class SignUpController < ApplicationController
before_filter :redireciona_index
def index
if (params['authenticity_token'].nil?)
@user = session[:user_id]
end
end
def new_account
@user = OpenStruct.new(params)
@user.language = Language.find(@user.language_id)
@user.favorite_c... | Ruby |
class CaneladaController < ApplicationController
before_filter :authorize,
:only => [ :index, :new , :edit, :create, :update, :destroy]
end
| Ruby |
class ListClubsController < ApplicationController
def list
favclub = params['favclub']
clubs = Club.find(:all, :conditions => ["name LIKE ?", "%#{favclub}%"])
html = "<ul class=\"favclub_list\">"
clubs.each do |club|
html << "<li class=\"favclub_list\" id=\"club_" << club.id.to_s << "\">" <<... | 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 do debug a probl... | Ruby |
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveReco... | 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.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions 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 attacks.
Act... | Ruby |
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# ... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.