code
stringlengths
1
1.73M
language
stringclasses
1 value
require File.expand_path('../boot', __FILE__) require 'rails/all' if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.requi...
Ruby
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Cereal::Application.initialize!
Ruby
Cereal::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 # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_...
Ruby
Cereal::Application.configure do # Settings specified here will take precedence over those in config/application.rb config.action_mailer.default_url_options = { :host => 'localhost:3000' } # In the development environment your application's code is reloaded on # every request. This slows down response time bu...
Ruby
Cereal::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
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Cereal::Application
Ruby
#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Cereal::Application.load_tasks
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
#!/usr/bin/ruby # # Demonstation for Ruby # puts $LOAD_PATH # extend the load path for wosg $LOAD_PATH << '../../bin/ruby' # include all necessary libs require 'wosg' require 'wosgDB' require 'wosgProducer' class Viewer def initialize() # open a viewer @viewer = WosgProducer::Viewer.new # open @vi...
Ruby
# # Demonstation for Ruby # # extend the load path for wosg $LOAD_PATH << '../../bin/ruby' # include all necessary libs require 'wosg' require 'wosgDB' require 'wosgProducer' require 'wosgART' class Viewer def initialize() # a producer @viewer = WosgProducer::Viewer.new # esc stops the viewer @viewer...
Ruby
#!/usr/bin/ruby # # based on Simple Ruby/GtkGLExt example by Vincent Isambart # require 'gtkglext' # extend the load path for wosg $LOAD_PATH << '../../bin/ruby' require 'wosg' require 'wosgDB' require 'wosgUtil' sceneview = WosgUtil::SceneView.new sceneview.setDefaults() scene = Wosg::Transform.new sceneview....
Ruby
#!/usr/bin/env ruby require 'CentroidFold' include CentroidFold cf = CentroidFold::CentroidFold.new(CentroidFold::CentroidFold::CONTRAFOLD) cf.calculate_posterior("GGGCCCAUAGCUCAGUGGUAGAGUGCCUCCUUUGCAAGGAGGAUGCCCUGGGUUCGAAUCCCAGUGGGUCCA") [0.5, 1.0, 2.0, 4.0].each do |g| s,ea=cf.decode_structure(g) p [s,ea] end ...
Ruby
require 'mkmf' CONFIG["CC"] = 'g++' $CFLAGS += ' -Wall -DHAVE_CONFIG_H ' $LOCAL_LIBS += ' ../src/libcentroid.a ../src/contrafold/libcontrafold.a -lRNA ' create_makefile("CentroidFold")
Ruby
#!/usr/bin/env ruby require 'tempfile' require 'optparse' $centroid_fold="centroid_fold" $contrafold="contrafold" $th=1e-5 $opts="" $viterbi=false $params="" OptionParser.new do |opt| opt.on('-g', '--gamma gamma', 'weight of base-pairs') {|v| $opts+=" -g #{v}"} opt.on('--mea', 'MEA estimators') {|v| $opts+=" --me...
Ruby
#!/usr/bin/env ruby require 'tempfile' require 'optparse' $centroid_fold="centroid_fold" $simfold="simfold" $simfold_pf="simfold_pf" $th=1e-5 $opts="" $viterbi=false $params="" OptionParser.new do |opt| opt.on('-g', '--gamma gamma', 'weight of base-pairs') {|v| $opts+=" -g #{v}"} opt.on('--mea', 'MEA estimators')...
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
require 'rake/clean' CLEAN.include('dist/kmltree.css', 'dist/kmltree.min.js', 'dist/kmltree.js', 'dist/images', 'src/_sprites.sass', 'sprites-url') CLOBBER.include('compiler') SRC = FileList[ 'src/kmltreeManager.js', 'src/base64.js', 'src/tmpl.js', 'src/kmldom.js', 'src/URI.js', 'src/kmltree.js', 'src/googleLayers.js...
Ruby
require 'fileutils' require 'digest/md5' require 'redcarpet' require 'albino' PYGMENTS_CACHE_DIR = File.expand_path('../../_cache', __FILE__) FileUtils.mkdir_p(PYGMENTS_CACHE_DIR) class Redcarpet2Markdown < Redcarpet::Render::HTML def block_code(code, lang) lang = lang || "text" path = File.join(PYGMENTS_CA...
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
# 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. # 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 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. # # 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 ...
Ruby
# Be sure to restart your server when you modify this file. Blog::Application.config.session_store :cookie_store, key: '_blog_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 "rails generat...
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
Blog::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 # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_co...
Ruby
Blog::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 serve...
Ruby
Blog::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 suite...
Ruby
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Blog::Application.initialize!
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 defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.requi...
Ruby
Blog::Application.routes.draw do resources :posts do resources :comments end get "home/index" # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than ...
Ruby
module ApplicationHelper end
Ruby
module HomeHelper end
Ruby
module PostsHelper def join_tags(post) post.tags.map { |t| t.name }.join(", ") end end
Ruby
module CommentsHelper end
Ruby
class Tag < ActiveRecord::Base belongs_to :post attr_accessible :name end
Ruby
class Comment < ActiveRecord::Base belongs_to :post attr_accessible :body, :commenter end
Ruby
class Post < ActiveRecord::Base attr_accessible :content, :name, :title, :tags_attributes validates :name, :presence => true validates :title, :presence => true, :length => { :minimum => 5 } has_many :comments, :dependent => :destroy has_many :tags accepts_nested_attributes_for :ta...
Ruby
class HomeController < ApplicationController def index end end
Ruby
class PostsController < ApplicationController # GET /posts # GET /posts.json def index @posts = Post.all respond_to do |format| format.html # index.html.erb format.json { render json: @posts } end end # GET /posts/1 # GET /posts/1.json def show @post = Post.find(params[:id]) ...
Ruby
class CommentsController < ApplicationController http_basic_authenticate_with :name => "dhh", :password => "secret", :only => :destroy def create @post = Post.find(params[:post_id]) @comment = @post.comments.create(params[:comment]) redirect_to post_path(@post) end def destroy @post = Post....
Ruby
class ApplicationController < ActionController::Base protect_from_forgery end
Ruby
#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Blog::Application.load_tasks
Ruby
#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require 'rails/commands'
Ruby
source 'https://rubygems.org' gem 'rails', '3.2.6' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3' # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3...
Ruby
class CreateTags < ActiveRecord::Migration def change create_table :tags do |t| t.string :name t.references :post t.timestamps end add_index :tags, :post_id end end
Ruby
class CreatePosts < ActiveRecord::Migration def change create_table :posts do |t| t.string :name t.string :title t.text :content t.timestamps end end end
Ruby
class CreateComments < ActiveRecord::Migration def change create_table :comments do |t| t.string :commenter t.text :body t.references :post t.timestamps end add_index :comments, :post_id end end
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 Blog::Application
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integrati...
Ruby
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
# $ext_path: This should be the path of where the ExtJS SDK is installed # Generally this will be in a lib/extjs folder in your applications root # <root>/lib/extjs $ext_path = "../../" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resource...
Ruby
# include the utils rb file which has extra functionality for the ext theme dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'utils.rb') # register ext4 as a compass framework Compass::Frameworks.register 'ext4', dir
Ruby
# $ext_path: This should be the path of where the ExtJS SDK is installed # Generally this will be in a lib/extjs folder in your applications root # <root>/lib/extjs $ext_path = "../../lib/extjs" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a...
Ruby
module ExtJS4 module SassExtensions module Functions module Utils def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must...
Ruby
# stdlib require 'openssl' # chaffing-rb require 'random' require 'binstr' module Chaffing # # for a particular algorithm (i.e. OpenSSL::Digest::Digest) and MAC key, # validate and generate MACs for any given payload # class MACr attr_accessor :key # returns a binary MAC value # def self.g...
Ruby
# * Rick Hull # * Genesis: 2006-02-01 # # additional methods for Ruby core modules, classes, and instances are below # class Object # shows which class defines a method # def method_sites width = self.methods.col_width + 1 self.methods.sort.map { |m| [m.to_s.ljust(width, ' '), (self.method(...
Ruby
require 'core_mods' # # this is a utility object, using String for storage # it is useful for representing binary data # class BinStr # these next 5 constants may be relied upon by other modules # specified constants ELEMENTS_PER_BYTE = 1 BITS_PER_BYTE = 8 # derived constants BYTE_MAGNITUDE = 2**BITS_PER...
Ruby
require 'random' require 'cipher' require 'binstr' module AllOrNothing class Packager KNOWN_KEY = 0x69.chr # from PyCrypto source TEXT_PAD_CHAR = ' ' MIN_PACKAGE_BLOCKS = 3 # 1+ for data, 1 for pad_length, 1 for session key def self.known_key(key_length) KNOWN_KEY * key_length end ...
Ruby
require 'openssl' # wrapper over OpenSSL::Cipher::Cipher module Cipher class Base attr_reader :cipher DEFAULT_IV = 0.chr * 8 DEFAULT_PADDING = 0 def initialize(cipher_string, iv = DEFAULT_IV, padding = DEFAULT_PADDING) @cipher = OpenSSL::Cipher::Cipher.new(cipher_string) self.iv...
Ruby
require 'openssl' module Random def self.pseudo_bytes(num_bytes) Array.new(num_bytes) { rand(256) }.pack("C*") end def self.dev_bytes(num_bytes) IO.read('/dev/random', num_bytes) end def self.openssl_bytes(num_bytes) OpenSSL::Random.random_bytes(num_bytes) end end
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' ################################################################################ # Prepare #### LIB = File.join('lib', 'cgu.digest.js') MIN = File.join('lib', 'cgu.digest.min.js') SRC = File.join('src', 'cgu.digest.js') ######...
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' ################################################################################ # Prepare #### LIB = File.join('lib', 'cgu.crypto.js') MIN = File.join('lib', 'cgu.crypto.min.js') SRC = File.join('src', 'cgu.crypto.js') ######...
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' require 'build/pager' ################################################################################ # Prepare #### DOCS = File.join('docs') DSRC = File.join('docs', 'src') LIB = File.join('lib', 'cgu.js') MIN = File.join('l...
Ruby
################################################################################ ### Builder ### ERB Wrapper ################################################################################ # Requires: jsmin (http://rubyforge.org/projects/riposte/) # $ gem install jsmin # # More info at http://www.crockford.com/javas...
Ruby
require 'rake' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') MAIN = { 'cgu' => File.join(SRCS, 'cgu.js') } INCS = { 'type' => File.join(SRCS, 'type', 'anc...
Ruby
################################################################################ ### Builder ### ERB Wrapper ################################################################################ # Requires: jsmin (http://rubyforge.org/projects/riposte/) # $ gem install jsmin # # More info at http://www.crockford.com/javas...
Ruby
require 'rake' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') GLOB = { 'HEADER' => File.join(SRCS, 'header.js') } INCS = { 'type' => File.join(SRCS, 'type'...
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' ################################################################################ # Prepare #### LIB = File.join('lib', 'cgu.digest.js') MIN = File.join('lib', 'cgu.digest.min.js') SRC = File.join('src', 'cgu.digest.js') ######...
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' ################################################################################ # Prepare #### LIB = File.join('lib', 'cgu.crypto.js') MIN = File.join('lib', 'cgu.crypto.min.js') SRC = File.join('src', 'cgu.crypto.js') ######...
Ruby
Dir.chdir(File.expand_path(File.dirname(__FILE__))) require 'rake' require 'build/builder' require 'build/pager' ################################################################################ # Prepare #### DOCS = File.join('docs') DSRC = File.join('docs', 'src') LIB = File.join('lib', 'cgu.js') MIN = File.join('l...
Ruby
ROOT = File.expand_path(File.dirname(__FILE__)) require 'rake' Dir.chdir(ROOT) do require 'build/builder' end ################################################################################ # Prepare #### DOCS = File.join(ROOT, 'docs') DSRC = File.join(DOCS, 'src') FINAL = File.join(ROOT, 'lib', 'cgu.crypto.js')...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'rake' require 'erb' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') INCS = { 'type' => [], 'crypto' => ['type'], 'cookie' => ['type'], 'query' ...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'rubygems' require 'jsmin' require 'erb' module Builder PKGS = {} class Reader def initialize(name, file, pkgs) return if !Builder.registered?(name) @save_reqs = true @pkgs = pkgs.uniq.sort if (PKGS[name]['src'].nil?) start = File.split(file) Dir.chd...
Ruby
require 'rake' require 'builder' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') INCS = { 'type' => File.join(SRCS, 'type', 'anchor.js'), 'crypto' => File.j...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'rake' require 'erb' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') INCS = { 'type' => [], 'crypto' => ['type'], 'cookie' => ['type'], 'query' ...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
################################################################################ ### Builder ### ERB Wrapper ################################################################################ # Requires: jsmin (http://rubyforge.org/projects/riposte/) # $ gem install jsmin # # More info at http://www.crockford.com/javas...
Ruby
require 'rake' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') GLOB = { 'HEADER' => File.join(SRCS, 'header.js') } INCS = { 'type' => File.join(SRCS, 'type'...
Ruby
################################################################################ ### Builder ### ERB Wrapper ################################################################################ # Requires: jsmin (http://rubyforge.org/projects/riposte/) # $ gem install jsmin # # More info at http://www.crockford.com/javas...
Ruby
require 'rake' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') GLOB = { 'HEADER' => File.join(SRCS, 'header.js') } INCS = { 'type' => File.join(SRCS, 'type'...
Ruby
require 'rake' ################################################################################ # Prepare ## PWD = Dir.pwd ROOT = File.expand_path(File.dirname(__FILE__)) C_BLD = File.join(ROOT, 'build'); C_DST = File.join(ROOT, 'lib'); C_SRC = File.join(ROOT, 'src'); # source file list $SRC = eval(File.open(File...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'rake' require 'erb' ################################################################################ # Prepare #### ROOT = File.expand_path(File.dirname(__FILE__)) LIBS = File.join(ROOT, 'lib') SRCS = File.join(ROOT, 'src') INCS = { 'type' => [], 'crypto' => ['type'], 'cookie' => ['type'], 'query' ...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby