code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | 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/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | 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/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | 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/plugin' | Ruby |
class CreateArchs < ActiveRecord::Migration
def self.up
create_table :arches do |t|
t.column :name, :string
t.column :description, :string
end
end
def self.down
drop_table :arches
end
end
| Ruby |
class CreatePreselections < ActiveRecord::Migration
def self.up
create_table :preselections do |t|
t.column :name, :string
t.column :description, :string
end
end
def self.down
drop_table :preselections
end
end
| Ruby |
class AddVendor < ActiveRecord::Migration
def self.up
add_column :devices, :vendor, :string
end
def self.down
remove_column :devices, :vendor
end
end
| Ruby |
class AddDependencies < ActiveRecord::Migration
def self.up
create_table :dependencies, :id => false do |t|
t.column :dependant, :integer
t.column :depends_on, :integer
end
end
def self.down
drop_table :dependencies
end
end
| Ruby |
class CreateDevices < ActiveRecord::Migration
def self.up
create_table :devices do |t|
t.column :name, :string
t.column :description, :string
t.column :board_id, :integer
t.column :ram_size, :integer
t.column :flash_size, :integer
t.column :erase_size, :integer
t.column :... | Ruby |
class CreateFilesystems < ActiveRecord::Migration
def self.up
create_table :filesystems do |t|
t.column :name, :string
t.column :description, :string
t.column :overhead_size, :integer
t.column :compression_ratio, :float
end
end
def self.down
drop_table :filesystems
end
end
| Ruby |
class CreateCategory < ActiveRecord::Migration
def self.up
create_table :categories do |t|
t.column :name, :string
t.column :description, :string
end
end
def self.down
drop_table :categories
end
end
| Ruby |
class CreateHabtmTables < ActiveRecord::Migration
def self.up
create_table :devices_os_kernels, :id => false do |t|
t.column :device_id, :integer
t.column :os_kernel_id, :integer
end
create_table :devices_filesystems, :id => false do |t|
t.column :device_id, :integer
t.column :file... | Ruby |
class CreateKernels < ActiveRecord::Migration
def self.up
create_table :os_kernels do |t|
t.column :name, :string
t.column :description, :string
end
end
def self.down
drop_table :os_kernels
end
end
| Ruby |
class AddPackageGroups < ActiveRecord::Migration
def self.up
add_column :packages, :group_master, :integer
end
def self.down
remove_column :packages, :group_master
end
end
| Ruby |
class AddLongName < ActiveRecord::Migration
def self.up
add_column :devices, :longname, :string
end
def self.down
remove_column :devices, :longname
end
end
| Ruby |
class CreateMaintainers < ActiveRecord::Migration
def self.up
create_table :maintainers do |t|
t.column :name, :string
t.column :email, :string
end
end
def self.down
drop_table :maintainers
end
end
| Ruby |
class AddPackageStatus < ActiveRecord::Migration
def self.up
add_column :packages, :status, :string
end
def self.down
remove_column :packages, :status
end
end
| Ruby |
class CreateFeatures < ActiveRecord::Migration
def self.up
create_table :features do |t|
t.column :name, :string
t.column :description, :string
end
end
def self.down
drop_table :features
end
end
| Ruby |
class CreatePackages < ActiveRecord::Migration
def self.up
create_table :packages do |t|
t.column :name, :string
t.column :description, :string
t.column :size, :integer
t.column :board_id, :integer
t.column :os_kernel_id, :integer
t.column :category_id, :integer
t.column ... | Ruby |
class AddFields < ActiveRecord::Migration
def self.up
add_column :devices, :image_type, :string
add_column :devices, :image_opts, :string
add_column :packages, :version, :string
add_column :packages, :release, :integer
end
def self.down
remove_column :devices, :image_type, :string
remove_... | Ruby |
class CreateBoards < ActiveRecord::Migration
def self.up
create_table :boards do |t|
t.column :name, :string
t.column :description, :string
t.column :arch_id, :integer
end
end
def self.down
drop_table :boards
end
end
| Ruby |
class HelpController < ApplicationController
layout "help"
def step1
@title = "Device Selection"
end
def step2
end
def step3
@title = "Filesystem Selection"
end
def step4
@title = "Package Preselections"
end
def step5
@title = "Finetuning your package selection"
end
end
| Ruby |
class ConfigController < ApplicationController
layout 'wib'
before_filter :get_config
def index
if params[:from]
from = params[:from].to_i
if params[:commit] == 'Back'
to = from - 1
else
to = from + 1
end
case from
when 0
@config.board = nil
... | Ruby |
class StAboutController < ApplicationController
end | Ruby |
class ImageController < ApplicationController
def get
filename = params[:id]
path = "public/images/"
if File.exist?(path + filename)
send_file(path + filename)
else
send_file(path + "transparent.png")
end
end
end
| Ruby |
# Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
require 'models/configuration'
class ApplicationController < ActionController::Base
end
| Ruby |
class StHelpController < ApplicationController
end | Ruby |
class FilesystemUI < Streamlined::UI
end
module FilesystemAdditions
end
Filesystem.class_eval {include FilesystemAdditions}
| Ruby |
class MaintainerUI < Streamlined::UI
end
module MaintainerAdditions
end
Maintainer.class_eval {include MaintainerAdditions}
| Ruby |
class FeatureUI < Streamlined::UI
end
module FeatureAdditions
end
Feature.class_eval {include FeatureAdditions}
| Ruby |
class PreselectionUI < Streamlined::UI
end
module PreselectionAdditions
end
Preselection.class_eval {include PreselectionAdditions}
| Ruby |
class PackageUI < Streamlined::UI
user_columns :exclude => [:group_master]
end
module PackageAdditions
end
Package.class_eval {include PackageAdditions}
| Ruby |
class CategoryUI < Streamlined::UI
end
module CategoryAdditions
end
Category.class_eval {include CategoryAdditions}
| Ruby |
class BoardUI < Streamlined::UI
end
module BoardAdditions
end
Board.class_eval {include BoardAdditions}
| Ruby |
class ArchUI < Streamlined::UI
end
module ArchAdditions
end
Arch.class_eval {include ArchAdditions}
| Ruby |
class DeviceUI < Streamlined::UI
end
module DeviceAdditions
end
Device.class_eval {include DeviceAdditions}
| Ruby |
class KernelUI < Streamlined::UI
end
module KernelAdditions
end
Kernel.class_eval {include KernelAdditions}
| Ruby |
class OsKernelUI < Streamlined::UI
end
module OsKernelAdditions
end
OsKernel.class_eval {include OsKernelAdditions}
| Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module HelpHelper
end
| Ruby |
# Streamlined
# (c) 2005-6 Relevance, LLC. (www.relevancellc.com)
# Streamlined is freely distributable under the terms of an MIT-style license.
# For details, see http://streamlined.relevancellc.com
#
# The methods here are available to all Streamlined views.
module StreamlinedHelper
# Given an image file, chec... | Ruby |
module ConfigHelper
end
| Ruby |
module ImageHelper
end
| Ruby |
class Filesystem < ActiveRecord::Base
has_and_belongs_to_many :boards
end
| Ruby |
class Maintainer < ActiveRecord::Base
has_many :packages
end
| Ruby |
class Preconfig < ActiveRecord::Base
belongs_to :package
end
| Ruby |
class Package < ActiveRecord::Base
belongs_to :category
belongs_to :maintainer
has_and_belongs_to_many :boards
has_and_belongs_to_many :profiles
has_and_belongs_to_many :dependencies, :class_name => "Package", :join_table => "dependencies", :foreign_key => "dependant", :association_foreign_key => "depends_on"... | Ruby |
class Profile < ActiveRecord::Base
belongs_to :boards
has_and_belongs_to_many :packages, :join_table => 'profiles_packages'
end
| Ruby |
class Category < ActiveRecord::Base
has_many :packages
end
| Ruby |
class PageOptions
attr_accessor :filter, :page, :order, :counter
def filter?
!self.filter.blank?
end
def order?
!self.order.blank?
end
def initialize(hash)
if hash
hash.each do |k,v|
sym = "#{k}="
self.send sym, v
end
end
end
end | Ruby |
class Configuration
attr_writer :id, :board, :profile, :filesystem, :packages, :preconfig
attr_reader :id, :board, :profile, :filesystem, :packages, :preconfig
def initialize
@board = nil
@profile = nil
@filesystem = nil
@preconfig = nil
@packages = Array.new
@id = sprintf("%X", (Time.new.to_i.... | Ruby |
class Board < ActiveRecord::Base
has_and_belongs_to_many :filesystems
has_and_belongs_to_many :packages
has_many :profiles
end
| Ruby |
class Notifier < ActionMailer::Base
def error_message(message)
# @recipients = "wbx@freewrt.org"
# @from ="noreply@freewrt.org"
# @subject = "An error in the Web Image Builder occured"
# @body["message"] = message
end
end
| Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
#!/usr/bin/ruby1.8
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired... | Ruby |
#!/usr/bin/ruby1.8
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
#... | Ruby |
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(__FILE__), '..')
unless RUBY_PLATFORM =~ /mswin32/
require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
RAILS... | 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 |
# Be sure to restart your web server when you modify this file.
# 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'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION ... | 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 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
# 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 |
# 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
#-------------------------------------------------------------------------------------------------
# The apm_demo of the Ruby binding
# Copyright (C) 2011 Antiy Labs
# This file is part of free software: you can redistribute it and/or mod... | Ruby |
#!/usr/bin/env ruby
#-------------------------------------------------------------------------------------------------
# The apm_migration of the Ruby binding
# Copyright (C) 2011 Antiy Labs
# This file is part of free software: you can redistribute it and/o... | Ruby |
#!/usr/bin/env ruby
#-------------------------------------------------------------------------------------------------
# The apm of the Ruby binding
# Copyright (C) 2011 Antiy Labs
# This file is part of free software: you can redistribute it and/or modify i... | Ruby |
#!/usr/bin/env ruby
#-------------------------------------------------------------------------------------------------
# The apm_base of the Ruby binding
# Copyright (C) 2011 Antiy Labs
# This file is part of free software: you can redistribute it and/or mod... | Ruby |
#!/usr/bin/env ruby
#-------------------------------------------------------------------------------------------------
# The apm_config of the Ruby binding
# Copyright (C) 2011 Antiy Labs
# This file is part of free software: you can redistribute it and/or m... | 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 |
# 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.
Xuproject::Application.config.session_store :cookie_store, key: '_xuproject_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 "rai... | 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 |
Xuproject::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.acti... | Ruby |
Xuproject::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 ... | Ruby |
Xuproject::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test ... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Xuproject::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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.