code
stringlengths
1
1.73M
language
stringclasses
1 value
# This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirect...
Ruby
include ApplicationHelper def valid_signin(user) fill_in titleize(I18n.t(:email)), with: user.email fill_in titleize(I18n.t(:password)), with: user.password click_button titleize(I18n.t(:sign_in)) end RSpec::Matchers.define :have_error_message do |message| match do |page| expect(page).to have...
Ruby
FactoryGirl.define do factory :user do sequence(:name) { |n| "Karol #{n}" } sequence(:surname) { |n| "Idiota #{n}" } sequence(:email) { |n| "szmata#{n}@example.com"} password "siersciuch" password_confirmation "siersciuch" factory :admin do admin true end end ...
Ruby
namespace :db do desc "Fill database with sample data" task populate: :environment do User.create!(name: "Szmatalson", surname: "Dupalson", email: "example@dupa.org", password: "chujek", password_confirmation: "chujek", ...
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
SET app_name create-dmg VERSION create-dmg.cur create-dmg heads/master NEWDIR build.dir temp %-build - NEWFILE create-dmg.zip featured %.zip % COPYTO [build.dir] INTO create-dmg [create-dmg.cur]/create-dmg INTO sample [create-dmg.cur]/sample INTO support [create-dmg.cur]/support SUBSTVARS [build.dir<alter>]/c...
Ruby
# Guardfile for the jQuery mmenu plugin javascript files. # Basically, all non-minified files in the "src/js" directory are minified. # For some reason, uglify only seems to work if the input and output is the same file. # Therefor, we need to copy the contents from the original files to the minified files (using conc...
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 require "rexml/document" require 'net/http' mapping = { 'title' => 'title', 'author' => 'authors', 'pub_nm' => 'publisher', 'description' => 'summary' } listxml = REXML::Document.new(File.new("/tmp/books-quickfill.xml")) #listxml = REXML::Document.new(File.new("books-quickfill.xm...
Ruby
#!/usr/bin/ruby require "rexml/document" require 'net/http' mapping = { 'title' => 'title', 'author' => 'authors', 'pub_nm' => 'publisher', 'description' => 'summary' } listxml = REXML::Document.new(File.new("/tmp/books-quickfill.xml")) #listxml = REXML::Document.new(File.new("books-quickfill.xm...
Ruby
#!/usr/bin/ruby require "rexml/document" require 'net/http' mapping = { 'title' => 'title', 'author' => 'authors', 'pub_nm' => 'publisher', 'pub_date' => 'publishDate', 'description' => 'summary', 'cover_l_url' => 'CoverImageURL', 'category' => 'genre' } listxml = REXML::Document.new...
Ruby
#!/usr/bin/ruby require "rexml/document" require 'net/http' mapping = { 'title' => 'title', 'author' => 'authors', 'pub_nm' => 'publisher', 'pub_date' => 'publishDate', 'description' => 'summary', 'cover_l_url' => 'CoverImageURL', 'category' => 'genre' } listxml = REXML::Document.new...
Ruby
source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.02' # 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 'uglifier', '>= 1.3.0' # U...
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. BooksBarter::Application.config.session_store :cookie_store, :key => '_BooksBarter_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 wi...
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
BooksBarter::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 turne...
Ruby
BooksBarter::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 w...
Ruby
BooksBarter::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 t...
Ruby
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application BooksBarter::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 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 BooksBarter class Application < Rails::Application ...
Ruby
BooksBarter::Application.routes.draw do # 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 :controller and :action # Sample of named route: # match 'p...
Ruby
module ApplicationHelper end
Ruby
class ApplicationController < ActionController::Base protect_from_forgery end
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' BooksBarter::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
#!/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 'http://rubygems.org' gem 'rails', '3.0.9' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3' # Use unicorn as the web server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1....
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 =>...
Ruby
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run BooksBarter::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
#!/usr/bin/ruby # -*- coding: undecided -*- # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' def get_text(node) if node != nil then return node.text else return "" end end def get_int(node) if node != nil ...
Ruby
#!/usr/bin/ruby # -*- coding: undecided -*- # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' def get_text(node) if node != nil then return node.text else return "" end end def get_int(node) if node != nil ...
Ruby
#!/usr/bin/ruby require 'mysql' require '../db_setting' ct = 0 weight = 1.0 before_asin = "" before_layer = 0 db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin, id, layer from link_book2browse_node as A, browse_nodes as B where A.browse_node_id = B.id order by A.asin, B.layer desc") res...
Ruby
#!/usr/bin/ruby # require 'mysql' require 'net/http' require 'date' require 'aws.rb' id = ARGV.shift Net::HTTP.start(AWS_URL, 80) do |http| request = AWS_PATH + '?' + 'Service=AWSECommerceService&' + "AWSAccessKeyId=#{AWS_ACCESS_KEY_ID}&" + "Version=#{AWS_VERSION}&" + "Operation=ItemLookup&" + ...
Ruby
#!/usr/bin/ruby # -*- coding: utf-8 -*- # require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' $block_words = [/の著者$/, /^その他$/, /別$/, /賞$/, /^一般$/] def db_add_node(db, id, parent_id, name, layer) puts "add node #{parent_id}->#{id} '#{name}' '(#{layer}...
Ruby
#!/usr/bin/ruby # require 'mysql' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, "test")#DB_NAME) buf_link = '' buf_node = '' $stderr.print "load data..." res = db.query("select * from browse_nodes") res.each_hash do |row| id = row['id'].to_i name = row['name'] buf_node << '%d [label="%...
Ruby
#!/usr/bin/ruby # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin from books where year(publication_date) = 0") res.each do |row| asin = row[0...
Ruby
#!/usr/bin/ruby # require 'mysql' require 'net/http' require 'date' require 'aws.rb' id = ARGV.shift Net::HTTP.start(AWS_URL, 80) do |http| request = AWS_PATH + '?' + 'Service=AWSECommerceService&' + "AWSAccessKeyId=#{AWS_ACCESS_KEY_ID}&" + "Version=#{AWS_VERSION}&" + "Operation=ItemLookup&" + ...
Ruby
#!/usr/bin/ruby # require 'mysql' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, "test")#DB_NAME) buf_link = '' buf_node = '' $stderr.print "load data..." res = db.query("select * from browse_nodes") res.each_hash do |row| id = row['id'].to_i name = row['name'] buf_node << '%d [label="%...
Ruby
#!/usr/bin/ruby # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin from books where year(publication_date) = 0") res.each do |row| asin = row[0...
Ruby
# amazon web service # require 'openssl' require 'base64' require 'cgi' require 'aws_pass' def aws_signed_url(req) message = ["GET", AWS_URL, AWS_PATH, req].join("\n") hash = OpenSSL::HMAC::digest(OpenSSL::Digest::SHA256.new, AWS_SECRET_KEY, message) signature = Base64.encode64(hash).chomp return AWS_PATH + ...
Ruby
#!/usr/bin/ruby # -*- coding: utf-8 -*- # require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' $block_words = [/の著者$/, /^その他$/, /別$/, /賞$/, /^一般$/] def db_add_node(db, id, parent_id, name, layer) puts "add node #{parent_id}->#{id} '#{name}' '(#{layer}...
Ruby
#!/usr/bin/ruby require 'mysql' require '../db_setting' ct = 0 weight = 1.0 before_asin = "" before_layer = 0 db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin, id, layer from link_book2browse_node as A, browse_nodes as B where A.browse_node_id = B.id order by A.asin, B.layer desc") res...
Ruby
DB_HOST = 'localhost' DB_USER = 'root' DB_PASS = '' DB_NAME = 'amazon200907'
Ruby
#!/usr/bin/ruby require 'RMagick' require 'mysql' require '../db_setting.rb' class Layer class DBLayer attr_reader :db_layer_number, :scale, :weight_min, :weight_max attr_reader :label_color, :graph_color, :alpha def initialize(layer_num, scale, min, max, label_color, graph_color, alpha) @db_laye...
Ruby
#!/usr/bin/ruby require 'RMagick' require 'mysql' require '../db_setting.rb' class Layer class DBLayer attr_reader :db_layer_number, :scale, :weight_min, :weight_max attr_reader :label_color, :graph_color, :alpha def initialize(layer_num, scale, min, max, label_color, graph_color, alpha) @db_laye...
Ruby
#!/usr/bin/ruby # -*- coding: undecided -*- # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' def get_text(node) if node != nil then return node.text else return "" end end def get_int(node) if node != nil ...
Ruby
#!/usr/bin/ruby # -*- coding: undecided -*- # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' def get_text(node) if node != nil then return node.text else return "" end end def get_int(node) if node != nil ...
Ruby
#!/usr/bin/ruby require 'mysql' require '../db_setting' ct = 0 weight = 1.0 before_asin = "" before_layer = 0 db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin, id, layer from link_book2browse_node as A, browse_nodes as B where A.browse_node_id = B.id order by A.asin, B.layer desc") res...
Ruby
#!/usr/bin/ruby # require 'mysql' require 'net/http' require 'date' require 'aws.rb' id = ARGV.shift Net::HTTP.start(AWS_URL, 80) do |http| request = AWS_PATH + '?' + 'Service=AWSECommerceService&' + "AWSAccessKeyId=#{AWS_ACCESS_KEY_ID}&" + "Version=#{AWS_VERSION}&" + "Operation=ItemLookup&" + ...
Ruby
#!/usr/bin/ruby # -*- coding: utf-8 -*- # require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' $block_words = [/の著者$/, /^その他$/, /別$/, /賞$/, /^一般$/] def db_add_node(db, id, parent_id, name, layer) puts "add node #{parent_id}->#{id} '#{name}' '(#{layer}...
Ruby
#!/usr/bin/ruby # require 'mysql' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, "test")#DB_NAME) buf_link = '' buf_node = '' $stderr.print "load data..." res = db.query("select * from browse_nodes") res.each_hash do |row| id = row['id'].to_i name = row['name'] buf_node << '%d [label="%...
Ruby
#!/usr/bin/ruby # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin from books where year(publication_date) = 0") res.each do |row| asin = row[0...
Ruby
#!/usr/bin/ruby # require 'mysql' require 'net/http' require 'date' require 'aws.rb' id = ARGV.shift Net::HTTP.start(AWS_URL, 80) do |http| request = AWS_PATH + '?' + 'Service=AWSECommerceService&' + "AWSAccessKeyId=#{AWS_ACCESS_KEY_ID}&" + "Version=#{AWS_VERSION}&" + "Operation=ItemLookup&" + ...
Ruby
#!/usr/bin/ruby # require 'mysql' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, "test")#DB_NAME) buf_link = '' buf_node = '' $stderr.print "load data..." res = db.query("select * from browse_nodes") res.each_hash do |row| id = row['id'].to_i name = row['name'] buf_node << '%d [label="%...
Ruby
#!/usr/bin/ruby # require 'nkf' require 'uri' require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin from books where year(publication_date) = 0") res.each do |row| asin = row[0...
Ruby
# amazon web service # require 'openssl' require 'base64' require 'cgi' require 'aws_pass' def aws_signed_url(req) message = ["GET", AWS_URL, AWS_PATH, req].join("\n") hash = OpenSSL::HMAC::digest(OpenSSL::Digest::SHA256.new, AWS_SECRET_KEY, message) signature = Base64.encode64(hash).chomp return AWS_PATH + ...
Ruby
#!/usr/bin/ruby # -*- coding: utf-8 -*- # require 'mysql' require 'rexml/document' require 'net/http' require 'date' require 'aws' require '../db_setting' $block_words = [/の著者$/, /^その他$/, /別$/, /賞$/, /^一般$/] def db_add_node(db, id, parent_id, name, layer) puts "add node #{parent_id}->#{id} '#{name}' '(#{layer}...
Ruby
#!/usr/bin/ruby require 'mysql' require '../db_setting' ct = 0 weight = 1.0 before_asin = "" before_layer = 0 db = Mysql::new(DB_HOST, DB_USER, DB_PASS, DB_NAME) res = db.query("select asin, id, layer from link_book2browse_node as A, browse_nodes as B where A.browse_node_id = B.id order by A.asin, B.layer desc") res...
Ruby
DB_HOST = 'localhost' DB_USER = 'root' DB_PASS = '' DB_NAME = 'amazon200907'
Ruby
#!/usr/bin/ruby require 'RMagick' require 'mysql' require '../db_setting.rb' class Layer class DBLayer attr_reader :db_layer_number, :scale, :weight_min, :weight_max attr_reader :label_color, :graph_color, :alpha def initialize(layer_num, scale, min, max, label_color, graph_color, alpha) @db_laye...
Ruby
#!/usr/bin/ruby require 'RMagick' require 'mysql' require '../db_setting.rb' class Layer class DBLayer attr_reader :db_layer_number, :scale, :weight_min, :weight_max attr_reader :label_color, :graph_color, :alpha def initialize(layer_num, scale, min, max, label_color, graph_color, alpha) @db_laye...
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 'rake' require 'yaml' module PhpThumbHelper ROOT_DIR = File.expand_path(File.dirname(__FILE__)) SRC_DIR = File.join(ROOT_DIR, 'src') DOCS_DIR = File.join(ROOT_DIR, 'apidocs') VERSION = YAML.load(IO.read(File.join(ROOT_DIR, 'config.yml')))['CURRENT_VERSION'].gsub(' ', '-').downcase...
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
cur_dir = File.dirname(__FILE__) output_style = :nested
Ruby
description "Unit tests for the Zen Grids system." stylesheet 'sass/function-zen-direction-flip.scss', :media => 'all', :to => 'function-zen-direction-flip.scss' stylesheet 'sass/function-zen-grid-item-width.scss', :media => 'all', :to => 'function-zen-grid-item-width.scss' stylesheet 'sass/function-zen-half-gutter.s...
Ruby
description "The Zen Grids system." stylesheet '_init.scss', :media => 'all' stylesheet '_layout.scss', :media => 'all' stylesheet '_modules.scss', :media => 'all' stylesheet '_visually-hidden.scss', :media => 'all' stylesheet 'styles.scss', :media => 'all' html ...
Ruby
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'zen-grids' s.summary = %q{A Compass plugin for Zen Grids, a fluid responsive grid system} s.description = %q{Zen Grids is an intuitive, flexible grid system that leverages the natural source order of your content to make it easier to c...
Ruby
require 'compass' extension_path = File.expand_path(File.join(File.dirname(__FILE__), "..")) Compass::Frameworks.register('zen-grids', :path => extension_path)
Ruby
# # This file is only needed for Compass/Sass integration. If you are not using # Compass, you may safely ignore or delete this file. # # If you'd like to learn more about Sass and Compass, see the sass/README.txt # file for more information. # # Change this to :production when ready to deploy the CSS to the live ser...
Ruby
description "Unit tests for the Zen Grids system." stylesheet 'sass/function-zen-direction-flip.scss', :media => 'all', :to => 'function-zen-direction-flip.scss' stylesheet 'sass/function-zen-grid-item-width.scss', :media => 'all', :to => 'function-zen-grid-item-width.scss' stylesheet 'sass/function-zen-half-gutter.s...
Ruby
description "The Zen Grids system." stylesheet '_init.scss', :media => 'all' stylesheet '_layout.scss', :media => 'all' stylesheet '_modules.scss', :media => 'all' stylesheet '_visually-hidden.scss', :media => 'all' stylesheet 'styles.scss', :media => 'all' html ...
Ruby
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'zen-grids' s.summary = %q{A Compass plugin for Zen Grids, a fluid responsive grid system} s.description = %q{Zen Grids is an intuitive, flexible grid system that leverages the natural source order of your content to make it easier to c...
Ruby
require 'compass' extension_path = File.expand_path(File.join(File.dirname(__FILE__), "..")) Compass::Frameworks.register('zen-grids', :path => extension_path)
Ruby
# # This file is only needed for Compass/Sass integration. If you are not using # Compass, you may safely ignore or delete this file. # # If you'd like to learn more about Sass and Compass, see the sass/README.txt # file for more information. # # Change this to :production when ready to deploy the CSS to the live ser...
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
# encoding: UTF-8 Dir.chdir "boolinq" HeaderFile = Struct.new(:name, :links, :content) include_std = []; file_list = []; for file in Dir.glob("*.h").sort!{|a,b| a.length <=> b.length} puts "Processing file #{file} ..." links = []; content = []; for line in File.open(file, "r") if...
Ruby
#!/usr/bin/env ruby # # Get platform (code from Matt Mower <self@mattmower.com>) # if RUBY_PLATFORM =~ /darwin/i OS = :unix IMPL = :macosx elsif RUBY_PLATFORM =~ /linux/i OS = :unix IMPL = :linux elsif RUBY_PLATFORM =~ /freebsd/i OS = :unix IMPL = :freebsd elsif RUBY_PLATFORM =~ /netbsd/i OS = :unix IMPL = :ne...
Ruby