code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class ProgramInformationsController < ApplicationController
def index
@program_informations = ProgramInformation.all
end
def show
@program_information = ProgramInformation.find(params[:id])
end
def new
@program_information = ProgramInformation.new
end
def create
@program_information = P... | Ruby |
class ApplicationController < ActionController::Base
protect_from_forgery
end
| Ruby |
class ProgramInformationTablesController < ApplicationController
def index
@program_information_tables = ProgramInformationTable.all
end
def show
@program_information_table = ProgramInformationTable.find(params[:id])
end
def new
@program_information_table = ProgramInformationTable.new
end
d... | Ruby |
class ServiceInformationsController < ApplicationController
def index
@service_informations = ServiceInformation.all
end
def show
@service_information = ServiceInformation.find(params[:id])
end
def new
@service_information = ServiceInformation.new
end
def create
@service_information = S... | Ruby |
class SelectFilesController < ApplicationController
def index
@select_files = SelectFile.all
end
def show
@select_file = SelectFile.find(params[:id])
end
def new
@select_file = SelectFile.new
end
def create
@select_file = SelectFile.new(params[:select_file])
if @select_file.save
... | Ruby |
class SynopsesController < ApplicationController
def index
@synopses = Synopsis.all
end
def show
@synopsis = Synopsis.find(params[:id])
end
def new
@synopsis = Synopsis.new
end
def create
@synopsis = Synopsis.new(params[:synopsis])
if @synopsis.save
redirect_to @synopsis, :not... | Ruby |
class DefaultChannelsController < ApplicationController
def index
@default_channels = DefaultChannel.all
end
def show
@default_channel = DefaultChannel.find(params[:id])
end
def new
@default_channel = DefaultChannel.new
end
def create
@default_channel = DefaultChannel.new(params[:defaul... | Ruby |
class TitlesController < ApplicationController
def index
@titles = Title.all
end
def show
@title = Title.find(params[:id])
end
def new
@title = Title.new
end
def create
@title = Title.new(params[:title])
if @title.save
redirect_to @title, :notice => "Successfully created title... | Ruby |
class HowRelatedsController < ApplicationController
def index
@how_relateds = HowRelated.all
end
def show
@how_related = HowRelated.find(params[:id])
end
def new
@how_related = HowRelated.new
end
def create
@how_related = HowRelated.new(params[:how_related])
if @how_related.save
... | Ruby |
class AvattributeController < ApplicationController
def index
@avattribute = Avattribute.all
end
def show
@avattribute = Avattribute.find(params[:id])
end
def new
@avattribute = Avattribute.new
end
def create
@avattribute = Avattribute.new(params[:avattributes])
if @avattribute.save... | Ruby |
class CreditItemsController < ApplicationController
def index
@credit_items = CreditItem.all
end
def show
@credit_item = CreditItem.find(params[:id])
end
def new
@credit_item = CreditItem.new
end
def create
@credit_item = CreditItem.new(params[:credit_item])
if @credit_item.save
... | Ruby |
class MemberOfsController < ApplicationController
def index
@member_ofs = MemberOf.all
end
def show
@member_of = MemberOf.find(params[:id])
end
def new
@member_of = MemberOf.new
end
def create
@member_of = MemberOf.new(params[:member_of])
if @member_of.save
redirect_to @member... | Ruby |
class GroupInformationsController < ApplicationController
def index
#@group_informations = GroupInformation.all
end
def show
@group_information_item = params[:id]
end
def new
@group_information = GroupInformation.new
end
def create
@group_information = GroupInformation.new(params[:group... | Ruby |
class GroupInformationTablesController < ApplicationController
def index
@group_information_tables = GroupInformationTable.all
end
def show
@group_information_table = GroupInformationTable.find(params[:id])
end
def new
@group_information_table = GroupInformationTable.new
end
def create
... | Ruby |
class ServiceInformationTablesController < ApplicationController
def index
@service_information_tables = ServiceInformationTable.all
respond_to do |format|
format.html
format.csv { send_data ServiceInformationTable.to_csv }
format.xls
end
end
def show
@service_information_table... | Ruby |
class ProgramLocationTablesController < ApplicationController
def index
@program_location_tables = ProgramLocationTable.all
end
def show
@program_location_table = ProgramLocationTable.find(params[:id])
end
def new
@program_location_table = ProgramLocationTable.new
end
def create
@progra... | Ruby |
class KeywordprogramsController < ApplicationController
def index
@keywordprograms = Keywordprogram.all
end
def show
@keywordprogram = Keywordprogram.find(params[:id])
end
def new
@keywordprogram = Keywordprogram.new
end
def create
@keywordprogram = Keywordprogram.new(params[:keywordpro... | Ruby |
class GenresController < ApplicationController
def index
@genres = Genre.all
end
def show
@genre = Genre.find(params[:id])
end
def new
@genre = Genre.new
end
def create
@genre = Genre.new(params[:genre])
if @genre.save
redirect_to @genre, :notice => "Successfully created genre... | 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.
# 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 |
# 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.
# 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.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register "application/xls", :xls | Ruby |
# Be sure to restart your server when you modify this file.
XmlAnalyzer::Application.config.session_store :cookie_store, key: '_xmlAnalyzer_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 ... | Ruby |
XmlAnalyzer::Application.routes.draw do
resources :avattributes
resources :av_attributes
resources :default_channels
resources :select_files
match 'main' => 'select_files#main',:via=>'get', :as => :main
match 'loaddata' => 'select_files#loaddata',:via=>'get', :as => :loaddata
match 'loaddata' => 'se... | 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'
require 'csv'
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
#... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
XmlAnalyzer::Application.initialize!
| Ruby |
XmlAnalyzer::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.ac... | Ruby |
XmlAnalyzer::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 we... | Ruby |
XmlAnalyzer::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 tes... | Ruby |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run XmlAnalyzer::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__)
XmlAnalyzer::Application.load_tasks
| Ruby |
# Include hook code here
require 'xmlcache' | Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the xmlcache plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the xmlcache plugin.'
Rak... | Ruby |
# desc "Explaining what the task does"
# task :xmlcache do
# # Task goes here
# end | Ruby |
# Uninstall hook code here
| Ruby |
# Install hook code here
| Ruby |
# Xmlcache
module ActionView
module Helpers
module CacheHelper
def cache_xml(name ={}, &block)
@controller.cache_xml_fragment(block, name)
end
end
end
end
module ActionController
module Caching
module Fragments
def cache_xml_fragment(block, name = {}, options ... | Ruby |
class DirectorController < ApplicationController
def all
@directors = Director.find(:all)
end
def show
@director = Director.find(params[:id])
end
end | Ruby |
# script requests XML report of specified SW level via HTTP
# shall be executed on regular time basis (every day, week, etc)
# XML report is stored in file and used for creation/update of xml-data file
# for burn down chart
#search current dir first for includes
$:.unshift File.dirname(__FILE__)
require 'rubyge... | Ruby |
# file contain suuport functions for parsing and validating JIRA xml-reports
require 'rubygems'
require 'nokogiri'
require 'Date'
# validates date from JIRA xml-report comment
def jira_sup_check_date(str_2_chk = "")
result = 0
jira_rep_wday_regex = Regexp.new('at (Mon|Tue|Wed|Thu|Fri|Sat|Sun)')
... | Ruby |
#!/usr/bin/env ruby
require 'nokogiri'
class XmlUtil
attr_accessor :doc, :path, :info, :version
def initialize(doc = nil)
if doc.class == Nokogiri::XML::Document
@doc = doc
elsif doc.class == ''.class
loadDoc(doc)
end
end
def loadDoc(path=@path)
file = File.open(path)
i... | Ruby |
# Jabber::Simple - An extremely easy-to-use Jabber client library.
# Copyright 2006 Blaine Cook <blaine@obvious.com>, Obvious Corp.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | Ruby |
# Jabber::Simple - Ruby Helper for Faking Web Requests
# Copyright 2006 Blaine Cook <romeda@gmail.com>.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#... | Ruby |
# Jabber::Simple - An extremely easy-to-use Jabber client library.
# Copyright 2006 Blaine Cook <blaine@obvious.com>, Obvious Corp.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | Ruby |
# Jabber::Simple - An extremely easy-to-use Jabber client library.
# Copyright 2006 Blaine Cook <blaine@obvious.com>, Obvious Corp.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | Ruby |
# Jabber::Simple - Ruby Helper for Faking Web Requests
# Copyright 2006 Blaine Cook <romeda@gmail.com>.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#... | Ruby |
# Jabber::Simple - An extremely easy-to-use Jabber client library.
# Copyright 2006 Blaine Cook <blaine@obvious.com>, Obvious Corp.
#
# Jabber::Simple is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | 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 |
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/ruby
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
re... | Ruby |
#!/usr/bin/ruby
#
# 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
# an... | Ruby |
#!/usr/bin/ruby
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
re... | Ruby |
#!/usr/bin/ruby
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
re... | Ruby |
#!/usr/bin/ruby
#
# 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
# an... | Ruby |
#!/usr/bin/ruby
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
re... | 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/about' | 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/runner' | 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/generate' | 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/breakpointer' | 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/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/console' | 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/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| 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/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module MessageHelper
end
| Ruby |
module LoginHelper
end
| Ruby |
module HelloHelper
end
| Ruby |
require 'xmpp4r'
require 'xmpp4r/roster/helper/roster'
class Login
def initialize id, password
puts 'new model initialized'
#connect
@mesage= Array.new
@mesage << Jabber::Message::new('shishir.srivastava@oracle.com', '').set_type(:normal).set_id('1')
@mesage[0].from='shishir.srivastava@oracle.com'... | Ruby |
require 'xmpp4r'
class LoginController < ApplicationController
@@user = Hash.new
def index
end
def initialize
puts 'new login controller initialized'
end
def contact_tree
#newl=LoginController::new.get_sess
buddy_list='['
contacts=session[:sess].get_buddies
contacts.keys.each do |cjid|
buddy_list+='#{cjid},... | Ruby |
class MessageController < ApplicationController
def initialize
puts 'new message controller initialized'
end
def msg_display
content = ''
newl=LoginController.session[:sess]
for m in newl.throw
content+=("<p><b>"+m.from.to_s()+"</b>" +" Says: "+m.body+"</p>")
end
render_text "#{content}"
end
... | 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
# Pick a unique cookie name to distinguish our session data from others'
session :session_key => '_oic_sessio... | Ruby |
class HelloController < ApplicationController
def index
render_text 'hello testing 1,2,3...'
end
end
| 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 |
# 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 =~ /(:?mswin|mingw)/
require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
... | 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
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.