code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
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 |
$files = FileList.new([
"content/colorediffs/callbacks.js",
"content/colorediffs/colorediffs.js",
"content/colorediffs/contents.rdf",
"content/colorediffs/dom.js",
"content/colorediffs/globals.js",
"content/colorediffs/icon.png",
"content/colorediffs/ilUtils.js",
"content/colorediffs/main-overlay.xul",
... | Ruby |
#gem install json
#gem install rubyzip
require 'json/pure'
require 'zip/zip'
require 'openssl'
require 'files'
#some library extension to better life
class Zip::ZipFile
def add_r(entry, src_path)
if (File.directory?(src_path))
Dir.foreach(src_path) do |f|
add_r(File.join(entry, f), File.join(sr... | Ruby |
Project.configure do |project|
# project.source_control = Subversion.new(:url =>'http://colorediffs.googlecode.com/svn/trunk')
# project.do_clean_checkout :every => 2.days
project.email_notifier.emails = ['vadim.atlygin@gmail.com']
project.email_notifier.from = 'vadim.atlygin@gmail.com'
end
| Ruby |
#detect-bad-timelapse-frames.rb runs multiple algorithms across frames in a timelapse
#to remove frames that are deemed bad (Flickering of an image, completely greyed
#out images,Images that did not completely render, etc...)
#@authors: David Villareal, Justin Peterson, TJ Boyle
#@Date: 06/18/13
require 'rubygems'
re... | 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 'data_mapper', '~> 1.2'
gem 'dm-postgres-adapter'
gem 'google-api-client', '>= 0.4.3'
group :development do
gem 'dm-sqlite-adapter', '~> 1.2'
gem 'do_sqlite3', '~> 0.10'
end
| Ruby |
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | Ruby |
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use yo... | 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 |
# 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 is used 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 diction... | 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.
Colet::Application.config.session_store :cookie_store, key: '_colet_session'
| 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 |
Colet::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 thread web server... | Ruby |
Colet::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 ser... | Ruby |
Colet::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 sui... | Ruby |
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Colet::Application.initialize!
| Ruby |
# 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'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Colet
class Application < Rails::Application
# Settings in config/environments/* take p... | Ruby |
Colet::Application.routes.draw do
devise_for :users
resources :users
match 'index' => 'home#index' , :as => 'index' , :via => :get
match 'about' => 'home#about' , :as => 'about' , :via => :get
match 'suport' => 'home#suport' , :as => 'suport' , :via => :get
root :to => 'home#index'... | Ruby |
json.extract! @user, :id, :nome, :email, :data_nascimento, :data_registo, :activo, :created_at, :updated_at
| Ruby |
json.array!(@users) do |user|
json.extract! user, :id, :nome, :email, :data_nascimento, :data_registo, :activo
json.url user_url(user, format: :json)
end
| Ruby |
module ApplicationHelper
end
| Ruby |
module UsersHelper
end
| Ruby |
class DataFile < ActiveRecord::Base
end
| Ruby |
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
| Ruby |
class HomeController < ApplicationController
def index
@index = true
if current_user
redirect_to user_path(current_user)
end
end
def about
@about = true
end
def suport
@suport = true
end
end
| Ruby |
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| Ruby |
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
@users = User.all
end
# GET /users/1
# GET /users/1.json
def show
end
# GET /users/new
def new
@user = User.new
end
# GET /users/1... | 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__)
Colet::Application.load_tasks
| Ruby |
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
gem 'mysql2'
gem 'devise'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem '... | Ruby |
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :nome
t.date :data_nascimento
t.date :data_registo
t.boolean :activo
t.timestamps
end
end
end
| Ruby |
class CreateDataFiles < ActiveRecord::Migration
def change
create_table :data_files do |t|
t.timestamps
end
end
end
| Ruby |
class AddDeviseToUsers < ActiveRecord::Migration
def self.up
change_table(:users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_to... | 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 |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
| Ruby |
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to de... | Ruby |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'data_mapper', '~> 1.2'
gem 'dm-postgres-adapter'
gem 'google-api-client', '>= 0.4.3'
group :development do
gem 'dm-sqlite-adapter', '~> 1.2'
gem 'do_sqlite3', '~> 0.10'
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 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 |
require 'support/class_options'
require 'acts_as_versioned'
require 'redcloth' unless defined?(RedCloth)
require 'liquid' unless defined?(Liquid)
require 'comatose'
require 'text_filters'
require 'support/route_mapper'
# if defined? ActionController::Routing::RouteSet::Mapper
# require 'support/route_mapper'
# els... | Ruby |
class <%= class_name %> < ActiveRecord::Migration
# Upgrades schema from version 0.3 to version 0.4
def self.up
add_column :comatose_pages, "filter_type", :string, :limit => 25, :default => "Textile"
add_column :comatose_pages, "keywords", :string, :limit => 1000
end
# Downgrades schema from version ... | Ruby |
module Comatose
class Page < ActiveRecord::Base
set_table_name 'comatose_pages'
acts_as_versioned :if_changed => [:title, :slug, :keywords, :body]
end
end
class <%= class_name %> < ActiveRecord::Migration
# Upgrades schema from version 0.6 to version 0.7
def self.up
add_column :comatose_pages, "v... | Ruby |
module Comatose
class Page < ActiveRecord::Base
set_table_name 'comatose_pages'
end
end
class <%= class_name %> < ActiveRecord::Migration
# Upgrades schema from version 0.4 to version 0.6
def self.up
add_column :comatose_pages, "created_on", :datetime
puts "Setting created_on times..."
Comato... | Ruby |
module Comatose
class Page < ActiveRecord::Base
set_table_name 'comatose_pages'
acts_as_versioned :if_changed => [:title, :slug, :keywords, :body]
end
end
class <%= class_name %> < ActiveRecord::Migration
# Schema for Comatose version 0.7+
def self.up
create_table :comatose_pages do |t|
t.co... | Ruby |
class ComatoseMigrationGenerator < Rails::Generator::Base
def initialize(runtime_args, runtime_options = {})
@mode = :new
if runtime_args.include? '--upgrade' or runtime_args.include? '-u'
@mode = :upgrade
@upgrade_from = nil
runtime_args.delete '--upgrade'
runtime_args.delete '-u'
... | Ruby |
require 'rake'
require 'rake/tasklib'
require 'rake/testtask'
require 'rake/rdoctask'
require 'test/behaviors'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the Comatose plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
Behaviors... | Ruby |
namespace :comatose do
#
# Customization Tasks
#
namespace :admin do
desc "Create Comatose views, layouts, and public files..."
task :customize do
puts "Copying public files..."
plugin_dir = File.join(File.dirname(__FILE__), '..')
FileUtils.cp(
Dir[File.join(plugin_dir, 'reso... | Ruby |
namespace :comatose do
#
# Setup Task...
#
namespace :setup do
desc "If the installation didn't add the images correctly, use this task"
task :copy_images do
plugin_dir = File.join(File.dirname(__FILE__), '..')
unless FileTest.exist? File.join(RAILS_ROOT, 'public', 'images', 'comatose')... | Ruby |
namespace :comatose do
#
# Data Migration Tasks
#
namespace :data do
def page_to_hash(page)
data = page.attributes.clone
# Pull out the specific, or unnecessary fields
%w(id parent_id updated_on author position version created_on full_path).each {|key| data.delete(key)}
if !page... | Ruby |
# Copy the images (*.gif) into RAILS_ROOT/public/images/comatose
RAILS_ROOT = File.join(File.dirname(__FILE__), '../../../')
unless FileTest.exist? File.join(RAILS_ROOT, 'public', 'images', 'comatose')
FileUtils.mkdir( File.join(RAILS_ROOT, 'public', 'images', 'comatose') )
end
FileUtils.cp(
Dir[File.join(File.d... | Ruby |
# vim:ts=4:sw=4:
# = RedCloth - Textile and Markdown Hybrid for Ruby
#
# Homepage:: http://whytheluckystiff.net/ruby/redcloth/
# Author:: why the lucky stiff (http://whytheluckystiff.net/)
# Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.)
# License:: BSD
#
... | Ruby |
# Extends the view to support rendering inline comatose pages...
ActionView::Base.class_eval do
alias_method :render_otherwise, :render
def render(options = {}, old_local_assigns = {}, &block) #:nodoc:
if options.is_a?(Hash) && page_name = options.delete(:comatose)
render_comatose(page_name, options[:p... | Ruby |
class Class
def define_option(name, default=nil)
sym = name.to_sym
cattr_reader(sym)
cattr_writer(sym)
send("#{name.to_s}=", default)
end
def blockable_attr_accessor(sym)
module_eval(<<-EVAL, __FILE__, __LINE__)
def #{sym}(&block)
if block_given?
@#{sym} = block
... | Ruby |
# For use with 'Edge Rails'
class ActionController::Routing::RouteSet::Mapper
# For mounting a page to a path
def comatose_root( path, options={} )
opts = {
:index => '',
:layout => 'comatose_content',
:use_cache => 'true',
:cache_path => nil,
:named_route=> nil
}.me... | Ruby |
# For Rails 1.1 - DEPRECATED
# Adds the comatose_root mapping support to the Rails Routset
class ActionController::Routing::RouteSet
def comatose_root( path, options={} )
opts = {
:index => '',
:layout => 'comatose_content',
:use_cache => 'true',
:cache_path => nil,
:nam... | Ruby |
module Liquid
# A Liquid file system is way to let your templates retrieve other templates for use with the include tag.
#
# You can implement subclasses that retrieve templates from the database, from the file system using a different
# path structure, you can provide them as hard-coded inline strings, or any... | Ruby |
module Liquid
class FilterNotFound < StandardError
end
class FileSystemError < StandardError
end
end | Ruby |
module Liquid
# A drop in liquid is a class which allows you to to export DOM like things to liquid
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless neede... | Ruby |
module Liquid
# Templates are central to liquid.
# Interpretating templates is a two step process. First you compile the
# source code you got. During compile time some extensive error checking is performed.
# your code should expect to get some SyntaxErrors.
#
# After you have a compiled template you ... | Ruby |
module Liquid
class Assign < Tag
Syntax = /(\w+)\s*=\s*(#{AllowedVariableCharacters}+)/
def initialize(markup, tokens)
if markup =~ Syntax
@to = $1
@from = $2
else
raise SyntaxError.new("Syntax Error in 'assign' - Valid syntax: assign [var] = [source]")
en... | Ruby |
class String
def to_liquid
self
end
end
class Array
def to_liquid
self
end
end
class Hash
def to_liquid
self
end
end
class Numeric
def to_liquid
self
end
end
class Time
def to_liquid
self
end
end
class DateTime
def to_liquid
self
end
end
class Date
def to_liquid... | Ruby |
module Liquid
# Strainer is the parent class for the filters system.
# New filters are mixed into the strainer class which is then instanciated for each liquid template render run.
#
# One of the strainer's responsibilities is to keep malicious method calls out
class Strainer
@@required_methods = ["__... | Ruby |
module Liquid
class TableRow < Block
Syntax = /(\w+)\s+in\s+(#{AllowedVariableCharacters}+)/
def initialize(markup, tokens)
super
if markup =~ Syntax
@variable_name = $1
@collection_name = $2
@attributes = {}
mar... | Ruby |
module Liquid
class ContextError < StandardError
end
# Context keeps the variable stack and resolves variables, as well as keywords
#
# context['variable'] = 'testing'
# context['variable'] #=> 'testing'
# context['true'] #=> true
# context['10.2232'] #=> 10.2232
#
# context.... | Ruby |
module Liquid
class Block < Tag
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
case token
when /^#{TagStart}/
if token =~ /^#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}$/
# if we found the proper block delimit... | Ruby |
module Liquid
module StandardFilters
# Return the size of an array or of an string
def size(input)
input.respond_to?(:size) ? input.size : 0
end
# convert a input string to DOWNCASE
def downcase(input)
input.downcase rescue input
end
# con... | Ruby |
module Liquid
class Tag
attr_accessor :nodelist
def initialize(markup, tokens)
@markup = markup
parse(tokens)
end
def parse(tokens)
end
def name
self.class.name.downcase
end
def render(context)
''
end
end
end
| Ruby |
module Liquid
# Hols variables. Variables are only loaded "just in time"
# they are not evaluated as part of the render stage
class Variable
attr_accessor :filters, :name
def initialize(markup)
@markup = markup
@name = markup.match(/\s*(#{QuotedFragment}... | Ruby |
module Liquid
class Document < Block
# we don't need markup to open this block
def initialize(tokens)
parse(tokens)
end
# There isn't a real delimter
def... | Ruby |
#
# TEXTILE
#
TextFilters.define :textile, "Textile" do
require 'redcloth'
def render_text(text)
RedCloth.new(text).to_html(:refs_markdown, :textile, :markdown)
end
def create_link(title, url)
%Q|"#{title}":#{url}|
end
end
| Ruby |
#
# NONE
#
TextFilters.define :none, "[No Filter]" do
def render_text(text)
text
end
end
| Ruby |
#
# RDOC
#
TextFilters.define :rdoc, "RDoc" do
require 'rdoc/markup/simple_markup'
require 'rdoc/markup/simple_markup/to_html'
def render_text(text)
p = SM::SimpleMarkup.new
h = SM::ToHtml.new
p.convert(text, h)
end
end
| Ruby |
#
# MARKDOWN + SMARTYPANTS
#
TextFilters.define :markdown_smartypants, "Markdown + SmartyPants" do
require 'bluecloth'
require 'rubypants'
def render_text(text)
RubyPants.new( BlueCloth.new(text).to_html ).to_html
end
def create_link(title, url)
"[#{title}](#{url})"
end
end
| Ruby |
#
# SIMPLE
#
TextFilters.define :simple, "Simple" do
def render_text(text)
text.gsub("\n", '<br/>')
end
end
| Ruby |
#
# MARKDOWN
#
TextFilters.define :markdown, "Markdown" do
require 'bluecloth'
def render_text(text)
BlueCloth.new(text).to_html
end
def create_link(title, url)
"[#{title}](#{url})"
end
end
| Ruby |
module Comatose::AdminHelper
# Checks the hidden_meta_fields class variable for a specified field name...
def show_field?(key)
!Comatose.config.hidden_meta_fields.include? key
end
# Used in the Page Form to build an indented drop-down list of pages
def tree_select_box(nodes, selected= nil, hide= nil, l... | Ruby |
# Comatose::Page attributes
# - parent_id
# - title
# - full_path
# - slug
# - keywords
# - body
# - author
# - filter_type
# - position
# - version
# - updated_on
# - created_on
class Comatose::Page < ActiveRecord::Base
set_table_name 'comatose_pages'
# Only versions the content... Not all of the... | Ruby |
# The controller for serving cms content...
module Comatose
class Controller < ActionController::Base
before_filter :handle_authorization, :set_content_type
after_filter :cache_cms_page
# Render a specific page
def show
page_name, page_ext = get_page_path
page = Comatose::Page.... | Ruby |
module Comatose::Helper; end
| Ruby |
module Comatose
# The controller for serving cms content...
class AdminController < ActionController::Base
define_option :original_template_root, nil
define_option :plugin_layout_path, File.join( '..', '..', '..', 'vendor', 'plugins', 'comatose', 'views', 'layouts' )
before_filter :handle_aut... | Ruby |
# This is the rendering context object you have access to in text processing...
module Comatose
class ProcessingContext
@@supported_methods = %w(page include)
def initialize( page, locals={} )
@locals = locals.stringify_keys if locals.respond_to? :stringify_keys
@page = Comatose::PageWrapper.new(... | Ruby |
module Comatose
def self.config
@@config ||= Configuration.new
end
def self.configure(&block)
raise "#configure must be sent a block" unless block_given?
yield config
config.validate!
end
# All of the 'mount' points for Comatose
def self.mount_points
@@mount_points ||= []
end
#... | Ruby |
module Comatose
# Wrapper around a Liquid::Drop
class ComatoseDrop < Liquid::Drop
private :initialize
def before_method(method)
self.send(method.to_sym)
rescue
ComatoseController.logger.debug "Error calling #{method}: #{$!}"
raise $!
end
class << self
# Define a n... | Ruby |
# Giving direct access to the AR model is disconcerting, so this wraps the AR
# Model to prevent access to certain, destructive behavior
class Comatose::PageWrapper
@@allowed_methods = %w(id full_path uri slug keywords title to_html filter_type author updated_on created_on)
@@custom_methods = %w(link content par... | Ruby |
# Copyright (c) 2005 Rick Olson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distr... | Ruby |
module Comatose
VERSION = "0.8"
# DEPRECATED
# Loads extensions from RAILS_ROOT/lib/comatose/*.rb
def self.load_extensions
Dir[File.join(RAILS_ROOT, 'lib', 'comatose', '*.rb')].each do |path|
require "comatose/#{File.basename(path)}"
end
end
end
require 'comatose/configuration'
require 'com... | Ruby |
# Copyright (c) 2005 Tobias Luetke
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# di... | Ruby |
require 'support/class_options'
class TextFilters
define_option :default_processor, :liquid
define_option :default_filter, :textile
define_option :logger, nil
@registered_filters = {}
@registered_titles = {}
attr_reader :name
attr_reader :title
def initialize(name, title)
@nam... | Ruby |
require 'rake'
require 'rake/tasklib'
module Behaviors
include Rake
class ReportTask < TaskLib
attr_accessor :pattern
attr_accessor :html_dir
def initialize(name=:behaviors)
@name = name
@html_dir = 'doc'
yield self if block_given?
define
end
def define
desc "List... | Ruby |
ENV["RAILS_ENV"] = 'test'
require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
require 'test/unit'
require 'test_help'
class Test::Unit::TestCase
self.fixture_path = File.expand_path( File.join(File.dirname(__FILE__), 'fixtures') )
self.use_transactional_fixtures = t... | Ruby |
NOT READY YET
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
require 'oauth/oauth_util'
client = Google::APIClient.new
youtube = client.discovered_api('youtube', 'v3alpha')
auth_util = CommandLineOAuthHelper.new('https://www.googleapis.com/auth/youtube')
client.authorization = auth_util.authorize()
... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
require 'trollop'
# This code assumes that there's a client_secrets.j... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
# A limited OAuth 2 access scope that allows for read-only access.
YO... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
require 'trollop'
# An OAuth 2 access scope that allows for full read... | Ruby |
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'json'
require 'launchy'
require 'thin'
RESPONSE_HTML = <<stop
<html>
<head>
<title>OAuth 2 Flow Complete</title>
</head>
<body>
You have successfully completed the OAuth 2 flow. Please close this browser window and return to ... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
require 'trollop'
# Set DEVELOPER_KEY to the "API key" value from the "Access" tab of the
# Google APIs Console <http://code.google.com/apis/console#access>
# Please ensure that you have enabled the YouTube Data API for your project.
DEVELOPER_KEY = "REP... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
# An OAuth 2 access scope that allows for full read/write access.
YOU... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.