code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/bin/ruby
#-----------------------------------------------------------
# ruby DebugUtil v2
#-----------------------------------------------------------
class DebugUtil
attr_reader :c; attr_reader :f; attr_reader :ws
def initialize()
@c = true; @f = false; @ws = nil
end
def init( target )
@c = true; @f = fals... | Ruby |
#!/bin/ruby
require "date"
#-----------------------------------------------------------
# main
#-----------------------------------------------------------
def main()
#スクリプト自身のパス
puts "Script"
puts " Path: " << $0 << "\n"
puts " Path (Full): " << File.expand_path($0) << "\n"
puts " Dir: " ... | Ruby |
#!/bin/ruby
$uwscApp = "D:\\mydoc\\Documents\\app\\UWSC\\uwsc501\\UWSC.exe"
$scriptDir = File.dirname(File.expand_path($0))
if ( ARGV.length == 0 ) then
puts "invalid arguments."
exit 1
end
if ( ! File.exist?($uwscApp) )
puts "NOT FOUND: #$uwscApp"
exit 1
end
cmd = "\"#$uwscApp\" \"#{ARGV[0]}\""
puts cmd
p syst... | 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'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
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/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/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
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/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/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin'
| Ruby |
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.text :body
t.integer :commenter_id
t.string :status
t.integer :bug_id
t.timestamps
end
end
def self.down
drop_table :comments
end
end
| Ruby |
class AddDeveloperIdToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :developer_id, :integer
end
def self.down
remove_column :bugs, :developer_id
end
end
| Ruby |
class AddReleaseToBugs < ActiveRecord::Migration
def self.up
change_table :bugs do |t|
t.references :release
end
end
def self.down
change_table :bugs do |t|
t.remove_references :release
end
end
end
| Ruby |
class AddForecastDateToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :estimate, :string
add_column :bugs, :planned_completion_date, :date
end
def self.down
remove_column :bugs, :estimate, :string
remove_column :bugs, :planned_completion_date, :date
end
end
| Ruby |
class CreateReleases < ActiveRecord::Migration
def self.up
create_table :releases do |t|
t.string :release_number
t.datetime :release_date
t.timestamps
end
end
def self.down
drop_table :releases
end
end
| Ruby |
class AddReviewerIdToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :reviewer_id, :integer
end
def self.down
remove_column :bugs, :reviewer_id
end
end
| Ruby |
class AddNicknameToMembers < ActiveRecord::Migration
def self.up
add_column :members, :nickname, :string
end
def self.down
remove_column :members, :nickname
end
end
| Ruby |
class CreateBugs < ActiveRecord::Migration
def self.up
create_table :bugs do |t|
t.integer :defect_id
t.string :defect_type
t.string :priority
t.text :summary
t.string :developer
t.string :status
t.timestamps
end
end
def self.down
drop_table :bugs
end
end
| Ruby |
class AddCommentTypeToComments < ActiveRecord::Migration
def self.up
add_column :comments, :comment_type, :string
end
def self.down
remove_column :comments, :comment_type
end
end
| Ruby |
class CreateMembers < ActiveRecord::Migration
def self.up
create_table :members do |t|
t.string :employee_id
t.string :name
t.string :contact_number
t.string :email
t.timestamps
end
end
def self.down
drop_table :members
end
end
| Ruby |
class MembersController < ApplicationController
skip_before_filter :check_authentication
# GET /members
# GET /members.xml
def index
@members = Member.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @members }
end
end
# GET /members/1
# GET... | 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
before_filter :check_authentication, :except => [:login, :authenticate]
helper :all # include all helpers,... | Ruby |
class CommentsController < ApplicationController
def index
@comments = Comment.all()
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @comments }
end
end
def new
@bug = Bug.find(params[:bug_id])
@comment = @bug.comments.build
@comment.status =... | Ruby |
require 'csv'
class BugsController < ApplicationController
# GET /bugs
# GET /bugs.xml
def index
session[:status_to_filter] = params[:status_to_filter] if params[:status_to_filter]
session[:closed_ones_too] = params[:closed_ones_too]
developer_to_filter = params[:developer_to_filter] || session[:... | Ruby |
class LoginController < ApplicationController
def authenticate
if (params[:user_id])
@members = Member.all(:conditions => "nickname = '#{params[:user_id]}'")
logger.info " **** Logged in " + @members[0].inspect
if ( @members[0] )
cookies[:user_id] = {:value => params[:user_id], ... | Ruby |
class ReleasesController < ApplicationController
def new
@release = Release.new
render :release_details, :layout => false
end
def create
@release = Release.new(params[:release])
if @release.save then
@releases = Release.all
render :release_saved
else
render :release_... | Ruby |
module MembersHelper
end
| Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module CommentsHelper
end
| Ruby |
module ReleasesHelper
end
| Ruby |
module BugsHelper
def bug_feeling (bug)
feeling = "two_persons" if bug.status == "Code review, please!"
feeling = "bag" if bug.status == "Ready for build"
feeling = "person" if bug.status == "Working on it"
feeling = "question" if bug.status == "Pending clarification"
feeling = "locked" if ... | Ruby |
class Bug < ActiveRecord::Base
belongs_to :developer, :class_name => "Member"
belongs_to :reviewer, :class_name => "Member"
belongs_to :release
has_many :comments
validates_presence_of :release, :on=>:update
validate :cant_close_if_open_comments
validate :review_comments_present
def cant_close_if_open... | Ruby |
class Comment < ActiveRecord::Base
belongs_to :bug
belongs_to :commenter, :class_name => "Member", :foreign_key => "commenter_id"
REVIEW = "Review"
ADDITIONAL_REQUIREMENT = "Additional-Requirement"
QA_FAILURE = "QA-Failure"
DEVELOPER_NOTE = "Developer-Note"
def review?
REVIEW.eql?(comment_type)
en... | Ruby |
class Release < ActiveRecord::Base
validates_presence_of :release_number, :release_date
has_many :bugs
def self.active_releases
Release.all(:order => "release_number", :conditions => ["release_date >= :release_date", { :release_date => Time.now }])
end
def release_info
date_format = "%d %b"
... | Ruby |
class Member < ActiveRecord::Base
end
| Ruby |
class BugMailer < ActionMailer::Base
def status_email(bug, action_taken)
recipients ["SITA_WorldTracerWeb@mindtree.com"] #SITA_WorldTracerWeb
from "RoR_Bug_Manager@mindtree.com"
subject "Bug #{bug.defect_id} #{action_taken} (#{bug.status})"
sent_on Time.now
body :bug => bug
content_type "tex... | Ruby |
class BugObserver < ActiveRecord::Observer
def after_create(bug)
#BugMailer.deliver_status_email(bug, 'Created')
end
#def after_update(bug)
# BugMailer.deliver_status_email(bug, 'Updated')
#end
end | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class ActiveSupport::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 da... | Ruby |
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
... | Ruby |
ActionController::Routing::Routes.draw do |map|
map.resources :comments
map.login 'login', :controller => "login", :action => "index"
map.resources :members
map.connect 'releases/report', :controller => 'releases', :action => 'report'
map.connect 'releases/taskboard', :controller => 'releases', :actio... | 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.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions 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 attacks.
Act... | 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 do debug a probl... | 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.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveReco... | Ruby |
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
... | 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
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_reque... | 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
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
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/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/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
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/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/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin'
| Ruby |
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.text :body
t.integer :commenter_id
t.string :status
t.integer :bug_id
t.timestamps
end
end
def self.down
drop_table :comments
end
end
| Ruby |
class AddDeveloperIdToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :developer_id, :integer
end
def self.down
remove_column :bugs, :developer_id
end
end
| Ruby |
class AddActiveToMember < ActiveRecord::Migration
def self.up
add_column :members, :active, :boolean, :default => true
end
def self.down
remove_column :members, :active
end
end
| Ruby |
class AddStatusIdToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :status_id, :integer
Bug.reset_column_information
Bug.all.each do |bug|
status = Status.find_by_description(bug.status)
if (status) then
bug.status_id = status.id
bug.save
end
end
end
... | Ruby |
class AddReleaseToBugs < ActiveRecord::Migration
def self.up
change_table :bugs do |t|
t.references :release
end
end
def self.down
change_table :bugs do |t|
t.remove_references :release
end
end
end
| Ruby |
class AddForecastDateToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :estimate, :string
add_column :bugs, :planned_completion_date, :date
end
def self.down
remove_column :bugs, :estimate, :string
remove_column :bugs, :planned_completion_date, :date
end
end
| Ruby |
class AddIsAdminToMember < ActiveRecord::Migration
def self.up
add_column :members, :admin, :boolean, { :default => false }
end
def self.down
remove_column :members, :admin
end
end
| Ruby |
class CreateReleases < ActiveRecord::Migration
def self.up
create_table :releases do |t|
t.string :release_number
t.datetime :release_date
t.timestamps
end
end
def self.down
drop_table :releases
end
end
| Ruby |
class AddReviewerIdToBugs < ActiveRecord::Migration
def self.up
add_column :bugs, :reviewer_id, :integer
end
def self.down
remove_column :bugs, :reviewer_id
end
end
| Ruby |
class AddNicknameToMembers < ActiveRecord::Migration
def self.up
add_column :members, :nickname, :string
end
def self.down
remove_column :members, :nickname
end
end
| Ruby |
class CreateStatuses < ActiveRecord::Migration
def self.up
create_table :statuses do |t|
t.string :code
t.string :description
t.string :category
t.boolean :admin_only, :default => false
t.timestamps
end
[
{:code => "yet_to_start", :category => "to_do", :description =>... | Ruby |
class CreateBugs < ActiveRecord::Migration
def self.up
create_table :bugs do |t|
t.integer :defect_id
t.string :defect_type
t.string :priority
t.text :summary
t.string :developer
t.string :status
t.timestamps
end
end
def self.down
drop_table :bugs
end
end
| Ruby |
class AddCommentTypeToComments < ActiveRecord::Migration
def self.up
add_column :comments, :comment_type, :string
end
def self.down
remove_column :comments, :comment_type
end
end
| Ruby |
class AddReviewedToBug < ActiveRecord::Migration
def self.up
add_column :bugs, :reviewed, :boolean
end
def self.down
remove_column :bugs, :reviewed
end
end
| Ruby |
class CreateMembers < ActiveRecord::Migration
def self.up
create_table :members do |t|
t.string :employee_id
t.string :name
t.string :contact_number
t.string :email
t.timestamps
end
end
def self.down
drop_table :members
end
end
| Ruby |
class MembersController < ApplicationController
skip_before_filter :check_authentication
ACTIVE = true
INACTIVE = false
# GET /members
# GET /members.xml
def index
@members = Member.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @members }
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
before_filter :check_authentication, :except => [:login, :authenticate]
helper :all # include all helpers,... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.