code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class Conversation < ActiveRecord::Base
attr_reader :originator, :original_message, :last_sender, :last_message, :users
has_many :messages
has_many :mails
before_create :clean
#looks like shit but isnt too bad
#has_many :users, :through :messages, :source => :recipients, :uniq => true doesnt work due ... | Ruby |
class MessageableGenerator < Rails::Generator::Base
def manifest
record do |m|
# Models
m.file "models/conversation.rb", "app/models/conversation.rb"
m.file "models/message.rb", "app/models/message.rb"
m.file "models/mail.rb", "app/models/mail.rb"
#Migrations
ge... | Ruby |
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
| Ruby |
require 'rake'
require 'rake/rdoctask'
desc 'Generate RDoc documentation for acts_as_messageable.'
Rake::RDocTask.new(:rdoc) do |rdoc|
files = ['README', '**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README" # page to start on
rdoc.title = "acts_as_messageable"
rdoc.rdoc_dir = 'doc' # rdoc outp... | Ruby |
# Include hook code here
require 'acts_as_messageable' | Ruby |
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nodoc
class Mailbox
#this is used to filter mail by mailbox type, use the [] method rather than setting this directly.
attr_accessor :type
#the user/owner of this mailbox, set when initialized.
attr_read... | Ruby |
require 'mailbox'
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nocdoc:
def self.included(mod)
mod.extend(ClassMethods)
end
# declare the class level helper methods which
# will load the relevant instance methods
# defined below when... | Ruby |
class CreateMessagesRecipients < ActiveRecord::Migration
def self.up
create_table :messages_recipients, :id => false do |t|
t.column :message_id, :integer, :null => false
t.column :recipient_id, :integer, :null => false
end
#i use foreign keys but its a custom method, so i'm leaving it up... | Ruby |
class CreateMessages < ActiveRecord::Migration
def self.up
create_table :messages do |t|
t.column :body, :text
t.column :subject, :string, :default => ""
t.column :headers, :text
t.column :sender_id, :integer, :null => false
t.column :conversation_id, :integer
t.column :... | Ruby |
class CreateMail < ActiveRecord::Migration
def self.up
create_table :mail do |t|
t.column :user_id, :integer, :null => false
t.column :message_id, :integer, :null => false
t.column :conversation_id, :integer
t.column :read, :boolean, :default => false
t.column :trashed, :boolean... | Ruby |
class CreateConversations < ActiveRecord::Migration
def self.up
create_table :conversations do |t|
t.column :subject, :string, :default => ""
t.column :created_at, :datetime, :null => false
end
end
def self.down
drop_table :conversations
end
end
| Ruby |
class Message < ActiveRecord::Base
#any additional info that needs to be sent in a message (ex. I use these to determine request types)
serialize :headers
class_inheritable_accessor :on_deliver_callback
protected :on_deliver_callback
belongs_to :sender, :class_name => 'User', :foreign_key => 'sen... | Ruby |
class Mail < ActiveRecord::Base
self.table_name = "mail"
belongs_to :message
belongs_to :user
belongs_to :conversation
#sets the read attribute of the mail message to true.
def mark_as_read()
update_attribute('read', true)
end
#sets the read attribute of the mail message to false.
... | Ruby |
class Conversation < ActiveRecord::Base
attr_reader :originator, :original_message, :last_sender, :last_message, :users
has_many :messages
has_many :mails
before_create :clean
#looks like shit but isnt too bad
#has_many :users, :through :messages, :source => :recipients, :uniq => true doesnt work due ... | Ruby |
class MessageableGenerator < Rails::Generator::Base
def manifest
record do |m|
# Models
m.file "models/conversation.rb", "app/models/conversation.rb"
m.file "models/message.rb", "app/models/message.rb"
m.file "models/mail.rb", "app/models/mail.rb"
#Migrations
ge... | Ruby |
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
| Ruby |
require 'rake'
require 'rake/rdoctask'
desc 'Generate RDoc documentation for acts_as_messageable.'
Rake::RDocTask.new(:rdoc) do |rdoc|
files = ['README', '**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README" # page to start on
rdoc.title = "acts_as_messageable"
rdoc.rdoc_dir = 'doc' # rdoc outp... | Ruby |
# Include hook code here
require 'acts_as_messageable' | Ruby |
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nodoc
class Mailbox
#this is used to filter mail by mailbox type, use the [] method rather than setting this directly.
attr_accessor :type
#the user/owner of this mailbox, set when initialized.
attr_read... | Ruby |
require 'mailbox'
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nocdoc:
def self.included(mod)
mod.extend(ClassMethods)
end
# declare the class level helper methods which
# will load the relevant instance methods
# defined below when... | Ruby |
class CreateMessagesRecipients < ActiveRecord::Migration
def self.up
create_table :messages_recipients, :id => false do |t|
t.column :message_id, :integer, :null => false
t.column :recipient_id, :integer, :null => false
end
#i use foreign keys but its a custom method, so i'm leaving it up... | Ruby |
class CreateMessages < ActiveRecord::Migration
def self.up
create_table :messages do |t|
t.column :body, :text, :default => ""
t.column :subject, :string, :default => ""
t.column :headers, :text
t.column :sender_id, :integer, :null => false
t.column :conversation_id, :integer
... | Ruby |
class CreateMail < ActiveRecord::Migration
def self.up
create_table :mail do |t|
t.column :user_id, :integer, :null => false
t.column :message_id, :integer, :null => false
t.column :conversation_id, :integer
t.column :read, :boolean, :default => false
t.column :trashed, :boolean... | Ruby |
class CreateConversations < ActiveRecord::Migration
def self.up
create_table :conversations do |t|
t.column :subject, :string, :default => ""
t.column :created_at, :datetime, :null => false
end
end
def self.down
drop_table :conversations
end
end
| Ruby |
class Message < ActiveRecord::Base
#any additional info that needs to be sent in a message (ex. I use these to determine request types)
serialize :headers
class_inheritable_accessor :on_deliver_callback
protected :on_deliver_callback
belongs_to :sender, :class_name => 'User', :foreign_key => 'sen... | Ruby |
class Mail < ActiveRecord::Base
self.table_name = "mail"
belongs_to :message
belongs_to :user
belongs_to :conversation
#sets the read attribute of the mail message to true.
def mark_as_read()
update_attribute('read', true)
end
#sets the read attribute of the mail message to false.
... | Ruby |
class Conversation < ActiveRecord::Base
attr_reader :originator, :original_message, :last_sender, :last_message, :users
has_many :messages
has_many :mails
before_create :clean
#looks like shit but isnt too bad
#has_many :users, :through :messages, :source => :recipients, :uniq => true doesnt work due ... | Ruby |
class MessageableGenerator < Rails::Generator::Base
def manifest
record do |m|
# Models
m.file "models/conversation.rb", "app/models/conversation.rb"
m.file "models/message.rb", "app/models/message.rb"
m.file "models/mail.rb", "app/models/mail.rb"
#Migrations
ge... | Ruby |
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
| Ruby |
require 'rake'
require 'rake/rdoctask'
desc 'Generate RDoc documentation for acts_as_messageable.'
Rake::RDocTask.new(:rdoc) do |rdoc|
files = ['README', '**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README" # page to start on
rdoc.title = "acts_as_messageable"
rdoc.rdoc_dir = 'doc' # rdoc outp... | Ruby |
# Include hook code here
require 'acts_as_messageable' | Ruby |
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nodoc
class Mailbox
#this is used to filter mail by mailbox type, use the [] method rather than setting this directly.
attr_accessor :type
#the user/owner of this mailbox, set when initialized.
attr_read... | Ruby |
require 'mailbox'
module Sergi #:nocdoc:
module Acts #:nocdoc:
module Messageable #:nocdoc:
def self.included(mod)
mod.extend(ClassMethods)
end
# declare the class level helper methods which
# will load the relevant instance methods
# defined below when... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# adjust the load path and load the plugin_test_helper
$:.unshift(File.dirname(__FILE__) + '/../lib')
$:.unshift(File.dirname(__FILE__))
require 'rubygems'
require 'plugin_test_helper.rb'
require 'network_stubs.rb'
require 'file_stub.rb'
require 'exception_inspector.rb'
# load the database schema
schema_file = File.di... | Ruby |
# Make sure our default RAILS_ROOT from the helper plugin is in the load path
unless defined?(HELPER_RAILS_ROOT)
HELPER_RAILS_ROOT = "#{File.dirname(__FILE__)}/../generators/plugin_test_structure/templates/app_root"
end
$:.unshift(HELPER_RAILS_ROOT)
# Determine the plugin's root test directory and add it to the load... | Ruby |
class Exception
def inspect
begin
message + "\n" + application_backtrace.join("\n")
rescue => e
message
end
end
end | Ruby |
require 'rails_generator'
module PluginAWeek #:nodoc:
module PluginTestHelper
# The base generator for creating parts of the test application
class Generator < Rails::Generator::NamedBase
attr_accessor :plugin_name
def initialize(*runtime_args) #:nodoc:
@plugin_name = runtime_args.... | Ruby |
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'test', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
Fixtures.create_fixtures(File.join(RAILS_ROOT, 'test/fixtures'), File.basename(fixture_file, '.*'))
end
| Ruby |
module PluginAWeek #:nodoc:
module PluginTestHelper
module Extensions #:nodoc:
# Overrides some of the default values in the Rails configuration so that
# files can be reused from this test helper or overridden by the plugin
# using the helper
module Configuration
def self.included... | Ruby |
module PluginAWeek #:nodoc:
module PluginTestHelper
module Extensions #:nodoc:
# Overrides where the path of the application routes is located so that
# it defaults to this helper's implementation or can be overridden by the
# plugin using this helper
module Routing
def self.includ... | Ruby |
require 'digest/sha2'
class User < ActiveRecord::Base
acts_as_uuid
acts_as_auditor
validates_presence_of :login
attr_accessor :password, :password_confirmation
def password=(pass)
salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
self.password_salt, self.password_hash = salt, Digest::SHA256... | Ruby |
class ReturnOrder < ActiveRecord::Base
acts_as_replica
has_many :batches
end
| Ruby |
class Batch < ActiveRecord::Base
acts_as_replica
belongs_to :return_order
end
| Ruby |
class ApplicationController < ActionController::Base
end
| Ruby |
class SyncsController < ApplicationController
include SyncsHelper::ServerActions
include SyncsHelper::Handshake
include SyncsHelper::Request
include SyncsHelper::NetSupport
include SyncsHelper::Misc
include SyncsHelper::Processes
acts_as_userstamp
before_filter :authenticated?, :only => [:perform_sync,... | Ruby |
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
end
| Ruby |
unless defined?(RAILS_ROOT)
root_path = File.join(File.expand_path('.'), 'test/app_root')
unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
RAILS_ROOT = root_path
end
unless defined?(RAILS_FRAMEWORK_ROOT)
RAILS_FRAMEWORK_ROOT ... | Ruby |
require 'config/boot'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '1.2.6' # unless defined? RAILS_GEM_VERSION
Rails::Initializer.run do |config|
config.plugin_paths << '..'
config.plugins = [File.basename(File.expand_path('.'))]
config.cache_classes = false
con... | Ruby |
class ReplicatorGenerator < Rails::Generator::Base
def manifest
record do |m|
m.file 'controllers/syncs_controller.rb', 'app/controllers/syncs_controller.rb'
m.directory 'app/views/syncs'
m.file 'views/perform_sync.rhtml', 'app/views/syncs/perform_sync.rhtml'
m.file 'views/perform_upgrade.... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
class CreateReplicas < ActiveRecord::Migration
def self.up
create_table :replicas do |t|
t.column :crud, :string, :default => "", :null => false
t.column :for_id, :string, :limit => 36
t.column :for_machine_id, :string, :limit => 36
t.column :met... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
#!/usr/bin/ruby
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
libs = " -r irb/completion"
libs << " -r test/test_helper"
libs << " -r plugin_test_helper/console_with_fixtures"
libs << " -r console_app"
libs << " -r console_with_helpers"
exec "#{irb} #{libs} --simple-prompt"
| Ruby |
#!/usr/bin/ruby
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
libs = " -r irb/completion"
libs << " -r test/test_helper"
libs << " -r plugin_test_helper/console_with_fixtures"
libs << " -r console_app"
libs << " -r console_with_helpers"
exec "#{irb} #{libs} --simple-prompt"
| Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test all units and functionals'
task :test do
exceptions = ["test:units", "test:functionals"].collect do |task|
begin
Rake::Task[task].invoke
nil
rescue => e
e
en... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
module ActiveRecord
# Active Records will automatically record the user who created and/or updated a database objects
# if fields of the names created_by/created_by are present.
#
# This module requires that your user object (which by default is <tt>User</tt> but can be changed
# using the <tt>user_model... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
class ReplicatorGenerator < Rails::Generator::Base
def manifest
record do |m|
m.migration_template 'migrate/create_replicas.rb', 'db/migrate'
m.file 'controllers/syncs_controller.rb', 'app/controllers/syncs_controller.rb'
m.directory 'app/views/syncs'
m.file 'views/perform_sync.rhtml', 'ap... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
class CreateReplicas < ActiveRecord::Migration
def self.up
create_table :replicas do |t|
t.column :crud, :string, :default => "", :null => false
t.column :for_id, :string, :limit => 36
t.column :for_machine_id, :string, :limit => 36
t.column :met... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the acts_as_replica plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the acts_as_replic... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
module ActiveRecord
# Active Records will automatically record the user who created and/or updated a database objects
# if fields of the names created_by/created_by are present.
#
# This module requires that your user object (which by default is <tt>User</tt> but can be changed
# using the <tt>user_model... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
module UpgradesHelper
def log_timestamp
Time.now.iso8601
end
def log_fmt_timestamp(time)
[(time/3600).to_i, (time/60 % 60).to_i, (time % 60).to_i].map{|t| t.to_s.rjust(2,'0')}.join(':')
end
# create or delete the process semaphore
def upgrade_semaphore_deal(create = true)
semaphore_file = ... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
class ReplicatorGenerator < Rails::Generator::Base
def manifest
record do |m|
m.migration_template 'migrate/create_replicas.rb', 'db/migrate'
m.file 'controllers/syncs_controller.rb', 'app/controllers/syncs_controller.rb'
m.directory 'app/views/syncs'
m.file 'views/perform_sync.rhtml', 'ap... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
# Copyright (c) 2007 Fabio Makoto Akita
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.