code
stringlengths
1
1.73M
language
stringclasses
1 value
#!/usr/bin/env ruby # Rubyripper - A secure ripper for Linux/BSD/OSX # Copyright (C) 2007 - 2013 Bouke Woudstra (boukewoudstra@gmail.com) # # This file is part of Rubyripper. Rubyripper is free software: you can # redistribute it and/or modify it under the terms of the GNU General # Public License as pu...
Ruby
#!/usr/bin/env ruby # Rubyripper - A secure ripper for Linux/BSD/OSX # Copyright (C) 2007 - 2010 Bouke Woudstra (boukewoudstra@gmail.com) # # This file is part of Rubyripper. Rubyripper is free software: you can # redistribute it and/or modify it under the terms of the GNU General # Public License as pu...
Ruby
#!/usr/bin/env ruby # Rubyripper - A secure ripper for Linux/BSD/OSX # Copyright (C) 2007 - 2012 Bouke Woudstra (boukewoudstra@gmail.com) # # This file is part of Rubyripper. Rubyripper is free software: you can # redistribute it and/or modify it under the terms of the GNU General # Public License as pu...
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
Reported by bXXX.rXXX@oXXX.com, Mar 11, 2011 I found the need to have a nice start / stop / restart wrapper for shellinabox, and a quick way to add new configurations and URLS. Attached is a file that does just that. It is ruby based, and expects a conf directory in the shellinthebox home directory. All file(s) plac...
Ruby
#!/usr/bin/ruby #=============================================================================== # # FILE: siab.rb # # USAGE: ruby siab.rb [start|stop|restar|help] # # DESCRIPTION: a ShellInAbox control script and configuration system reader. # To auto-configure a shellinabox service creat...
Ruby
require 'mytest_ext' module Mytest def hello puts MytestInt::hello() end module_function :hello end
Ruby
puts 'hello world' #require 'hello2'
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
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
# 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
module CppUTestToUnityUtils def convert_test_filename_to_unity_filename(testpath) testpath.sub(/^tests\/(.*)\.cpp/, "unity/\\1.c") end def convert_test_filename_to_unity_testrunner_filename(testpath) testpath.sub(/^tests\/(.*)\.cpp/, "unity/\\1_runner.c") end def convert_one_liners(line, grou...
Ruby
#!/usr/bin/ruby require File.join(File.dirname(__FILE__), 'cpp_u_test_to_unity_utils.rb') include CppUTestToUnityUtils in_file = ARGV[0] create_group_runner_file(in_file) unity_runner_filename = convert_test_filename_to_unity_testrunner_filename(in_file) puts "Creating test runner for :" + in_file + "\n" puts " ...
Ruby
#!/usr/bin/ruby require File.join(File.dirname(__FILE__), 'cpp_u_test_to_unity_utils.rb') include CppUTestToUnityUtils in_file = ARGV[0] unity_filename = convert_test_filename_to_unity_filename(in_file) unity_runner_filename = convert_test_filename_to_unity_testrunner_filename(in_file) puts "Converting :" + in_file +...
Ruby
#!/usr/bin/ruby require File.join(File.dirname(__FILE__), 'cpp_u_test_to_unity_utils.rb') include CppUTestToUnityUtils test_lines = Array.new expected_lines = Array.new #--------------------------------------------------- test_lines = ["\n", "TEST_GROUP(mygroup)\n", "{\n", "}\n", "\n" ] group = get_test_group(...
Ruby
#!/bin/ruby require File.join(File.dirname(__FILE__), 'cpp_u_test_to_unity_utils.rb') include CppUTestToUnityUtils in_file = ARGV[0] test_lines = File.open(in_file).collect out_file = File.open(File.basename(in_file, ".c") + "_runner.c", 'w') group_runner = generate_group_runner_plainUnity("unity", test_lines) wri...
Ruby
require 'rubygems' require 'crxmake' require 'json' $name = 'chromefullfeed' $manifest = "src/manifest.json" $pem = File.expand_path "~/dev/private/chromefullfeed.pem" $manifest_data = File.open($manifest, 'rb'){|f| JSON.parse(f.read) } $version = $manifest_data["version"] # package task namespace :pkg do ...
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
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 'rubygems' gem 'rubyzip' require 'zip/zip' require 'zip/zipfilesystem' zip = File.join(File.join('build', "light-themes-selection.zip")) task :default => :package task :clear do if (File.exists?(zip)) File.delete(zip) end end task :watch do sh "compass -w" end task :compile => :clear do sh "compass -...
Ruby
# Require any additional compass plugins here. project_type = :stand_alone # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "src" images_dir = "images" output_style = :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relat...
Ruby
require 'rubygems' gem 'rubyzip' require 'zip/zip' require 'zip/zipfilesystem' zip = File.join(File.join('build', "light-themes-scrollbar.zip")) task :default => :package task :clear do if (File.exists?(zip)) File.delete(zip) end end task :watch do sh "compass -w" end task :compile => :clear do sh "compass -...
Ruby
# Require any additional compass plugins here. project_type = :stand_alone # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "src" images_dir = "images" output_style = :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relat...
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
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
[virtual=x86,bios +compress] .bootstrap = { startup-bios PATH=:/proc/boot:/usr/bin:/bin:/usr/photon/bin LD_LIBRARY_PATH=:/proc/boot:/usr/lib:/lib:/lib/dll PHOTON_PATH=/usr/photon procnto -v } [+script] .script = { procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2 devc-con -n2 waitfor /d...
Ruby
[virtual=x86,bios +compress] .bootstrap = { startup-bios PATH=:/proc/boot:/usr/bin:/bin:/usr/photon/bin LD_LIBRARY_PATH=:/proc/boot:/usr/lib:/lib:/lib/dll PHOTON_PATH=/usr/photon procnto -v } [+script] .script = { procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2 devc-con -n1 waitfor /d...
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
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 'RMagick' class NumberImageGenerator @@IMAGE_DIR = 'numbers-hdpi/' def generate(text, fs=18) #filename = "b" + sprintf("%03d", text) + ".png"; filename = "" + sprintf("%03d", text) + ".png"; font_size = fs; height = 35; width = 35; image = Magick::Image.new(width, height) {self.ba...
Ruby
#!/usr/bin/env ruby # encoding: utf-8 project = 'battery-indicator' user = `cat ~/.netrc | awk '{print $4;}'`.strip pass = `cat ~/.netrc | awk '{print $6;}'`.strip version = `grep "android:versionName=" AndroidManifest.xml`.split('"')[1] apk_location = "BatteryIndicatorPro-#{version}.apk" system("cp bin/*-release.ap...
Ruby
#!/usr/bin/env ruby require 'net/http' require 'uri' LANGS_URI = 'http://ath.darshancomputing.com/bi/langs/' langs = Net::HTTP.get(URI.parse(LANGS_URI)).split() langs.each do |lang| if lang.length == 2 dir = 'res/values-' << lang else dir = 'res/values-' << lang[0,2] << '-r' << lang[2,2] end if ! D...
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
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
# 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
# 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. ActiveRecord::Base.include_root_in_json = true # Store the full clas...
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
set :application, "Chunky" set :repository, "http://svn.explain-it.org/trunk/chunky" # If you aren't deploying to /u/apps/#{application} on the target # servers (which is the default), you can specify the actual location # via the :deploy_to variable: # set :deploy_to, "/var/www/#{application}" # If you aren't using...
Ruby
# Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Full error repor...
Ruby
# Settings specified here will take precedence over those in config/environment.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 webserver when you make code changes. config.ca...
Ruby
# Settings specified here will take precedence over those in config/environment.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 suite and is wiped # and recreated between...
Ruby
# Be sure to restart your server when you modify this file SCRIPT_LINES__ = {} if ENV['RAILS_ENV'] == 'development' # Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way # ENV['RAILS_ENV'] ||= 'production' UPLOAD_DIR="/uploads" LINK_DIR="/links" #...
Ruby
# Don't change this file! # Configure your app in config/environment.rb and config/environments/*.rb RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) module Rails class << self def boot! unless booted? preinitialize pick_boot.run end end def booted? ...
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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } load 'config/deploy'
Ruby
# Methods added to this helper will be available to all templates in the application. module ApplicationHelper end
Ruby
module DownloadHelper end
Ruby
module ChunksHelper end
Ruby
require 'digest/md5' require 'ftools' class Chunk < ActiveRecord::Base email_regex = %r{ # \A[0-9a-z._\-\+]+@[0-9a-z.-]+\.[a-z]{2,4}\Z ^ # Start of string [0-9a-z._\-\+]+ # name part @ # the separator [0-9a-z.-]+ # Domain port \. # last period [a-z]{2,3} # TLD $ # End of string }...
Ruby
require 'ftools' class Uploadedfile < ActiveRecord::BaseWithoutTable def file= (fileobj) if fileobj.size > 0 @file = fileobj puts "Bis hierhin ists gut gegangen: #{fileobj.class}\n" filename = unique_filename(fileobj.original_filename) save_uploaded_file(@file, filename) end e...
Ruby
class ChunkMailer < ActionMailer::Base def send_link(chunk) @subject = "Your download link for #{chunk.client}" @recipients = chunk.author @from = "chunky@#{BASE_URL}" @sent_on = Time.now @body["chunk"] = chunk end def notify_client(chunk) @subject = 'You got a Do...
Ruby
class Admin::UploadedfilesController < ApplicationController layout 'standard' def index @uploadfile = Uploadedfile.new @filelist = Uploadedfile.filelist end def upload @uploadfile = Uploadedfile.new(params[:uploadfile]) @uploadfile.save! redirect_to(:action => :index) end ...
Ruby
class Admin::ChunksController < ApplicationController layout 'standard' def input @chunk = Chunk.new @chunk.filename = params[:chunk][:filename] end def cleanup cleaner = Chunk.new cleaner.clean_up_database flash.now[:notice] ="Database cleaned!" redirect_to(:action => :list_...
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 # See ActionController::RequestForgeryProtection for details...
Ruby
# require 'ruby-debug' class DownloadController < ApplicationController layout :select_layout def download # debugger # @chunk = Chunk.new(params[:chunks]) # puts "Download klasse: " + @chunk.inspect # send_file RAILS_ROOT + UPLOAD_DIR + "/" + Chunk.find(:first, :conditions => "link = '#{params[:...
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.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'tasks/rails'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/dbconsole'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/console'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/benchmarker'
Ruby