code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
module MyContributionsHelper
end
| Ruby |
module FriendshipSentRequestsHelper
end
| Ruby |
module DonorRequestsHelper
end
| Ruby |
class TestProduct < ActiveRecord::Base
end
| Ruby |
class ReceiverRequest < ActiveRecord::Base
end
| Ruby |
class DonorRequest < ActiveRecord::Base
validates :project_id, :sent_money, :sent_date, :sent_user_id, :presence => true
end
| Ruby |
class ProjectFunding < ActiveRecord::Base
end
| Ruby |
class Friendship < ActiveRecord::Base
validates :friend1_id, :friend2_id, :begin_date, :presence => true
belongs_to :user
end
| Ruby |
class User < ActiveRecord::Base
validates :first_name, :last_name, :user_id, :presence => true
validates :user_id, :uniqueness => true
validates :password, :confirmation => true
validates :password_confirmation, :presence => true
has_many :friendship
def User.authenticate(userid,password)... | Ruby |
class Project < ActiveRecord::Base
validates :name, :summary, :description, :maximum_budget, :days_to_return_money, :user_id, :presence => true
end
| Ruby |
class FriendshipSentRequest < ActiveRecord::Base
validates :from_user, :to_user, :message, :presence => true
belongs_to :users
end
| Ruby |
class ApplicationController < ActionController::Base
protect_from_forgery
end
def destroy_friendship_sent_request
@friendship_sent_request = FriendshipSentRequest.find_by_to_user_and_from_user(session[:user_text_id], params[:id])
@friendship_sent_request.destroy
end | Ruby |
class ProjectsController < ApplicationController
# GET /projects
# GET /projects.xml
def index
@projects = Project.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @projects }
end
end
# GET /projects/1
# GET /projects/1.xml
def show
@projec... | Ruby |
class LogoutController < ApplicationController
def new
session[:user_id] = 0
session[:login_status] = 0
session[:user_text_id] = 0
session[:first_name] = ''
session[:last_name] = ''
respond_to do |format|
format.html { redirect_to(login_path, :notice => 'You are successfully logged out... | Ruby |
class ProjectFundingsController < ApplicationController
# GET /project_fundings
# GET /project_fundings.xml
def index
@project_fundings = ProjectFunding.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @project_fundings }
end
end
# GET /project_fun... | Ruby |
class TestProductsController < ApplicationController
# GET /test_products
# GET /test_products.xml
def index
@test_products = TestProduct.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @test_products }
end
end
# GET /test_products/1
# GET /test... | Ruby |
class FriendshipSentRequestsController < ApplicationController
# GET /friendship_sent_requests
# GET /friendship_sent_requests.xml
def index
@friendship_sent_requests = FriendshipSentRequest.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @friendship_sent_... | Ruby |
class MyContributionsController < ApplicationController
def get_my_contributions
@my_contributions = DonorRequest.find_all_by_sent_user_id(session[:user_text_id])
end
end
| Ruby |
class ReceiverRequestsController < ApplicationController
# GET /receiver_requests
# GET /receiver_requests.xml
def index
@receiver_requests = ReceiverRequest.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @receiver_requests }
end
end
# GET /recei... | Ruby |
class DonorRequestsController < ApplicationController
# GET /donor_requests
# GET /donor_requests.xml
def index
@donor_requests = DonorRequest.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @donor_requests }
end
end
# GET /donor_requests/1
# GE... | Ruby |
class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
@user = User.find(session[:user_id])
if @user
redirect_to(:action => show)
else
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @use... | Ruby |
class ProfileController < ApplicationController
def index
end
def show
if(session[:user_id] == 0)
redirect_to(login_url)
return
end
@user = User.find_by_user_id(session[:user_text_id])
@friends = User.joins("INNER JOIN friendships on friendships.friend1_id = users.user_id").wher... | Ruby |
class FriendshipsController < ApplicationController
# GET /friendships
# GET /friendships.xml
def index
@friendships = Friendship.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @friendships }
end
end
# GET /friendships/1
# GET /friendships/1.xm... | Ruby |
class SessionsController < ApplicationController
def new
@account_buttons = Hash.new
session[:login_status] = 0
session[:user_id] = 0
end
def create
if user=User.authenticate(params[:user_text_id], params[:password])
session[:user_id] = user.id
session[:user_text_id] = user.user_id
... | 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.
Meethodu::Application.config.session_store :cookie_store, :key => '_meethodu_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 "ra... | Ruby |
Meethodu::Application.routes.draw do
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
root :to => "sessions#new"
controller :sessions do
get 'login' => :new
post 'login' => :create
get 'about' => :about
get 'howit' => :howit
get 'whyit'... | 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 Meethodu
class Application < Rails::Application
... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# config.gem "recaptcha", :lib => "recaptcha/rails"
# Initialize the rails application
Meethodu::Application.initialize!
| Ruby |
Meethodu::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 o... | Ruby |
Meethodu::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 webs... | Ruby |
Meethodu::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... | Ruby |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Meethodu::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'
Meethodu::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 |
Generic C code for red-black trees.
Copyright (C) 2000 James S. Plank
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
... | Ruby |
Generic C code for red-black trees.
Copyright (C) 2000 James S. Plank
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
... | 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 |
require 'sinatra/activerecord/rake'
require './main' | 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 |
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 |
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 'fileutils'
include FileUtils
require 'rubygems'
%w[rake hoe newgem rubigen].each do |req_gem|
begin
require req_gem
rescue LoadError
puts "This Rakefile requires the '#{req_gem}' RubyGem."
puts "Installation: gem install #{req_gem} -y"
exit
end
end
$:.unshift(File.join(File.dirname(__FI... | Ruby |
require 'ankoder/version'
AUTHOR = 'RoRCraft.com' # can also be an array of Authors
EMAIL = "chris.chan@rorcraft.com"
DESCRIPTION = "ankoder"
GEM_NAME = 'ankoder' # what ppl will type to install your gem
RUBYFORGE_PROJECT = 'ankoder' # The unix name for your project
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.o... | Ruby |
require 'fileutils'
include FileUtils
require 'rubygems'
%w[rake hoe newgem rubigen].each do |req_gem|
begin
require req_gem
rescue LoadError
puts "This Rakefile requires the '#{req_gem}' RubyGem."
puts "Installation: gem install #{req_gem} -y"
exit
end
end
$:.unshift(File.join(File.dirname(__FI... | Ruby |
require 'ankoder/version'
AUTHOR = 'RoRCraft.com' # can also be an array of Authors
EMAIL = "chris.chan@rorcraft.com"
DESCRIPTION = "ankoder"
GEM_NAME = 'ankoder' # what ppl will type to install your gem
RUBYFORGE_PROJECT = 'ankoder' # The unix name for your project
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.o... | 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 |
require 'config/requirements'
require 'config/hoe' # setup Hoe + all gem configuration
Dir['tasks/**/*.rake'].each { |rake| load rake } | Ruby |
#!/usr/bin/env ruby
require 'rubygems'
begin
require 'newgem'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
exit(1)
end
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require File.dirname(__FILE__) + '/../lib/ankoder/ver... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/destroy'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, ... | Ruby |
#!/usr/bin/env ruby
require 'rubygems'
begin
require 'newgem'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
exit(1)
end
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require File.dirname(__FILE__) + '/../lib/ankoder/ver... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/generate'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem,... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/destroy'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, ... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/generate'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem,... | Ruby |
desc 'Generate website files'
task :website_generate => :ruby_env do
(Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
end
end
desc 'Upload website files to rubyforge'
task :website_upload do
host = "#{rubyforge_usern... | Ruby |
task :ruby_env do
RUBY_APP = if RUBY_PLATFORM =~ /java/
"jruby"
else
"ruby"
end unless defined? RUBY_APP
end
| Ruby |
desc 'Release the website and new gem version'
task :deploy => [:check_version, :website, :release] do
puts "Remember to create SVN tag:"
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
put... | Ruby |
$:.unshift File.dirname(__FILE__)
require "xmlsimple"
require "cgi"
module Ankoder
HOST = "api.ankoder.com" unless const_defined? :HOST
OUT_FORMAT = "xml" unless const_defined? :OUT_FORMAT
RESOURCES = %w{job profile download video account upload} unless const_defined? :RESOURCES
DEFAULT_EXPIRY = 300 unless cons... | Ruby |
require 'hmac'
require 'hmac-sha1'
module Ankoder
# Get a video from Ankoder
#
# Videos.find(video_id)
#
class Video < Base
end
end
| Ruby |
module Ankoder
class DownloadFailed < RuntimeError; end
class Download < Base
# Download file from the given URL
#
# Download.create('url' => 'http://host.com/file.avi', :postback_url => 'http://your_own_host.com/postback/download')
#
# the return result would be the Video record that you... | Ruby |
module Ankoder #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 0
TINY = 4
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| Ruby |
module Ankoder
class Account < Base #:nodoc:
def new_record?
false
end
def update_attributes(attributes={})
attributes.delete "account"
attributes.keys.each do |k|
attributes.merge!("user[#{k.to_s}]" => attributes[k])
attributes.delete k
end
if Account.u... | Ruby |
require "net/http"
module Ankoder
# This class is used to request the _ankoderapi_session service.
#
# Browser::get '/video', session
# Browser::post '/download', {:url => 'http://host.com/video.avi'}, session
# Browser::put '/video/54000', {:name => 'new title'}, session
# Browser::delete '/video/... | Ruby |
module Ankoder
class JobFailed < RuntimeError; end
class Job < Base
# Encode the given video into the given format
#
# Video_ID is the video id that get from Ankoder::Download
# Profile_ID is selected from the list of Ankoder::Profile.find(:all)
#
# Job.create(:original_file_id => "... | Ruby |
class String
# convert "undercore_string" in "UnderscoreString"
#
# Method from Rails
def camelize
self.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
end
end
module Ankoder
module CoreExtension
module HashExtension
# Replace "-" by "_" in all keys of the hash
def un... | Ruby |
module Ankoder
# to get the list of the supported profile
#
# Profile.find(:all)
#
class Profile < Base
end
end
| Ruby |
module Ankoder
# You can connect to the _ankoderapi_session service permanently
#
# You can access all the resources and manipulate the objects like in ActiveRecord
#
# v = Video.find(15).update_attributes :name => "My edited title"
# puts v.title
class Base
attr_reader :attributes, :errors
... | Ruby |
module Ankoder
# to get the list of the upload api url
#
# Upload.find(:all)
#
class Upload < Base
end
end
| Ruby |
module Ankoder
# Authenticate to the ankoder service
#
# user = Auth.create("login", "password")
# user.account
#
# If you want to recover a session:
#
# user = Auth.recover(session_id)
# user.account
#
# The initialize and create methods can take blocks.
#
# Auth.create("login", "passwor... | Ruby |
require File.dirname(__FILE__) + '/test_helper.rb'
class TestAnkoder < Test::Unit::TestCase
def setup
end
def test_truth
assert true
end
end
| Ruby |
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/ankoder'
| 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 |
require 'config/requirements'
require 'config/hoe' # setup Hoe + all gem configuration
Dir['tasks/**/*.rake'].each { |rake| load rake } | Ruby |
#!/usr/bin/env ruby
require 'rubygems'
begin
require 'newgem'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
exit(1)
end
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require File.dirname(__FILE__) + '/../lib/ankoder/ver... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/destroy'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, ... | Ruby |
#!/usr/bin/env ruby
require 'rubygems'
begin
require 'newgem'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
exit(1)
end
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require File.dirname(__FILE__) + '/../lib/ankoder/ver... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/generate'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem,... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/destroy'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, ... | Ruby |
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/generate'
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem,... | Ruby |
desc 'Generate website files'
task :website_generate => :ruby_env do
(Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
end
end
desc 'Upload website files to rubyforge'
task :website_upload do
host = "#{rubyforge_usern... | Ruby |
task :ruby_env do
RUBY_APP = if RUBY_PLATFORM =~ /java/
"jruby"
else
"ruby"
end unless defined? RUBY_APP
end
| Ruby |
desc 'Release the website and new gem version'
task :deploy => [:check_version, :website, :release] do
puts "Remember to create SVN tag:"
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
put... | Ruby |
require "xmlsimple"
require "cgi"
module Ankoder
OUT_FORMAT = "xml" unless const_defined? :OUT_FORMAT
RESOURCES = %w{job profile download video account upload} unless const_defined? :RESOURCES
DEFAULT_EXPIRY = 300 unless const_defined? :DEFAULT_EXPIRY
# These are error codes you receive if you use ping opt... | Ruby |
require 'hmac'
require 'hmac-sha1'
module Ankoder
# Get a video from Ankoder
#
# Videos.find(video_id)
#
class Video < Base
def self.url_for(video_id, expires_in = nil)
message = {:access_key => Configuration::access_key, :expires => expires(expires_in)}.to_json
encoded_message = Base64.encod... | Ruby |
module Ankoder
class DownloadFailed < RuntimeError; end
class Download < Base
# Download file from the given URL
# Download.create('url' => 'http://host.com/file.avi', :postback_url => 'http://your_own_host.com/postback/download')
#
# the return result would be the Video record that you can s... | Ruby |
module Ankoder #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 0
TINY = 6
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| Ruby |
module Ankoder
class Account < Base #:nodoc:
def new_record?
false
end
def update_attributes(attributes={})
attributes.delete "account"
attributes.keys.each do |k|
attributes.merge!("user[#{k.to_s}]" => attributes[k])
attributes.delete k
end
if Account.u... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.