code
stringlengths
1
1.73M
language
stringclasses
1 value
require File.dirname(__FILE__) + '/<%= file_name %>/helper.rb' require File.dirname(__FILE__) + '/<%= file_name %>/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module <%= class_name %> mattr_accessor :service_url self.service_...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module <%= class_name %> class Helper < ActiveMerchant::Billing::Integrations::Helper # Replace with the real mapping mapping :account, '' mapping :amount, '' mapping ...
Ruby
require 'net/http' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module <%= class_name %> class Notification < ActiveMerchant::Billing::Integrations::Notification def complete? params[''] end def item_id p...
Ruby
class IntegrationGenerator < ActiveMerchant::Generator::Base def manifest @manifest ||= record do |m| m.directory "lib/active_merchant/billing/integrations/#{file_name}" m.template 'integration.rb', "lib/active_merchant/billing/integrations/#{file_name}.rb" m.templ...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class <%= class_name %>Gateway < Gateway TEST_URL = 'https://example.com/test' LIVE_URL = 'https://example.com/live' attr_reader :url attr_reader :response attr_reader :options def initialize(options = {}) ...
Ruby
class GatewayGenerator < ActiveMerchant::Generator::Base def manifest record do |m| m.template 'gateway.rb', "lib/active_merchant/billing/gateways/#{file_name}.rb" m.template 'gateway_test.rb', "test/unit/gateways/#{file_name}_test.rb" m.template 'remote_gatew...
Ruby
module ActiveMerchant #:nodoc: module Generator class Manifest attr_reader :templates, :directories def initialize @templates, @directories = [], [] yield self if block_given? end def template(input, output) @templates << { :input => input, :output => output } ...
Ruby
require 'script/generator/manifest' require 'script/generator/base' module ActiveMerchant #:nodoc: module Generator class Generator def self.run(args = []) unless args.size == 2 puts <<-BANNER Usage: script/generate <generator> <ClassName> Where <generator> is one of: gateway - Gene...
Ruby
module ActiveMerchant #:nodoc: module Generator class Base attr_reader :class_name, :name def initialize(name, class_name) @name = name @class_name = class_name end def root File.dirname(__FILE__) + '/../..' end def run # Create the required d...
Ruby
#!/usr/bin/env ruby begin require 'active_support' rescue LoadError require 'rubygems' require 'active_support' end require 'erb' require 'script/generator/generator' ActiveMerchant::Generator::Generator.run(ARGV)
Ruby
# Figure out the root path of this app. The default method will assume that # its the same as the location of the running Rakefile ROOT = File.expand_path(FileUtils.pwd) + '/' # Standard settings, you can override each of them using the environment # e.g. rake cia EMAIL_TO=your@email.com # RAKE_TASK = ENV['RAKE_T...
Ruby
#-- # Copyright (c) 2005 Tobias Luetke # # 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 'active_merchant/billing/integrations/notification' require 'active_merchant/billing/integrations/helper' require 'active_merchant/billing/integrations/bogus' require 'active_merchant/billing/integrations/chronopay' require 'active_merchant/billing/integrations/paypal' require 'active_merchant/billing/integrati...
Ruby
require 'active_merchant/billing/gateway' require 'active_merchant/billing/gateways/bogus' require 'active_merchant/billing/gateways/psigate' require 'active_merchant/billing/gateways/authorize_net' require 'active_merchant/billing/gateways/moneris' require 'active_merchant/billing/gateways/trust_commerce' require 'act...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module CreditCardFormatting def format(number, format) return '' if number.blank? case format when :two_digits sprintf("%.2i", number)[-2..-1] when :four_digits sprintf("%.4i", number)[-4..-1]...
Ruby
require File.dirname(__FILE__) + '/payflow/payflow_common_api' require File.dirname(__FILE__) + '/payflow/payflow_express_response' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowExpressGateway < Gateway include PayflowCommonAPI LIVE_REDIRECT_URL = 'https://www.paypal.com/...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowExpressResponse < Response def email @params['e_mail'] end def token @params['token'] end def payer_id @params['payer_id'] end def address { 'name' ...
Ruby
require 'digest/sha1' module ActiveMerchant #:nodoc: module Billing #:nodoc: module PayflowCommonAPI def self.included(base) base.class_inheritable_accessor :default_currency base.default_currency = 'USD' # The certification_id is required by PayPal to make direct HTTPS p...
Ruby
# Portions of the LinkPoint Gateway by Ryan Heneise #-- # Copyright (c) 2005 Tobias Luetke # # 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 limitatio...
Ruby
# Author:: MoneySpyder, http://moneyspyder.co.uk module ActiveMerchant module Billing # ActiveMerchant Datacash Gateway # # Datacash allows a policy for CV2 checks. There is currently no way # to modify this programatically. The policy may be changed in the # add_credit_card method. # ...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class AuthorizeNetGateway < Gateway API_VERSION = '3.1' LIVE_URL = "https://secure.authorize.net/gateway/transact.dll" TEST_URL = "https://test.authorize.net/gateway/transact.dll" APPROVED, DECLINED, ERROR = 1, 2, 3 RE...
Ruby
require File.dirname(__FILE__) + '/paypal/paypal_common_api' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PaypalGateway < Gateway include PaypalCommonAPI def self.supported_cardtypes [:visa, :master, :american_express, :discover] end def authorize(mon...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: # This class is an abstract base class for both PaypalGateway and # PaypalExpressGateway module PaypalCommonAPI def self.included(base) base.cattr_accessor :pem_file end TEST_URL = 'https://api.sandbox.paypal.com/2.0/'...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class PaypalExpressResponse < Response def email @params['payer'] end def token @params['token'] end def payer_id @params['payer_id'] end def address { 'name' ...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: # Bogus Gateway class BogusGateway < Gateway def authorize(money, creditcard, options = {}) case creditcard.number when '1' Response.new(true, "Bogus Gateway: Forced success", {:authorized_amount => money.to_s}, :tes...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class UsaEpayGateway < Gateway GATEWAY_URL = 'https://www.usaepay.com/gate.php' attr_reader :url attr_reader :response attr_reader :options def initialize(options = {}) requires!(options, :login) ...
Ruby
# This class implements the Psigate gateway for the ActiveMerchant module. # Psigate = http://www.psigate.com/ The class is currently set up to use # the psigate test server while rails is in testing or developement mode. # The real server will be used while in production mode. # # Modifications by Sean O'Hara ...
Ruby
require File.dirname(__FILE__) + '/payflow/payflow_common_api' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowGateway < Gateway include PayflowCommonAPI def authorize(money, credit_card, options = {}) if result = test_result_from_cc_number(credit_card.number) ...
Ruby
begin require 'tclink' rescue LoadError # Ignore, but we will fail hard if someone actually tries to use this gateway end module ActiveMerchant #:nodoc: module Billing #:nodoc: # To get started using TrustCommerce with active_merchant, download the tclink library from http://www.trustcommerce.com/tclin...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowExpressUkGateway < PayflowExpressGateway self.default_currency = 'GBP' self.partner = 'PayPalUk' end end end
Ruby
require 'rexml/document' module ActiveMerchant #:nodoc: module Billing #:nodoc: class MonerisGateway < Gateway attr_reader :url attr_reader :response attr_reader :options TEST_URL = 'https://esqa.moneris.com/gateway2/servlet/MpgRequest' LIVE_URL = 'https://www3.moneris.com/gatewa...
Ruby
require File.dirname(__FILE__) + '/paypal/paypal_common_api' require File.dirname(__FILE__) + '/paypal/paypal_express_response' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PaypalExpressGateway < Gateway include PaypalCommonAPI LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowUkGateway < PayflowGateway self.default_currency = 'GBP' self.partner = 'PayPalUk' def express @express ||= PayflowExpressUkGateway.new(@options) end def self.supported_cardtypes [:visa,...
Ruby
# Author:: Lucas Carlson (mailto:lucas@rufy.com) # Copyright:: Copyright (c) 2005 Lucas Carlson # License:: Distributes under the same terms as Ruby require 'rexml/document' module ActiveMerchant #:nodoc: module Billing #:nodoc: # TO USE: # First, make sure you have everything setup correctly and all ...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Bogus class Helper < ActiveMerchant::Billing::Integrations::Helper mapping :account, 'account' mapping :order, 'order' mapping :amount, 'amount' mapping :currency, 'curr...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Bogus class Notification < ActiveMerchant::Billing::Integrations::Notification end end end end end
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Chronopay class Helper < ActiveMerchant::Billing::Integrations::Helper self.country_format = :alpha3 def initialize(order, account, options = {}) super ad...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Chronopay class Notification < ActiveMerchant::Billing::Integrations::Notification def complete? status == 'Completed' end # Status of transaction. List of possible v...
Ruby
require File.dirname(__FILE__) + '/nochex/helper.rb' require File.dirname(__FILE__) + '/nochex/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Nochex mattr_accessor :service_url self.service_url = 'https://www.nochex.com/no...
Ruby
require 'active_merchant/billing/integrations/paypal/helper.rb' require 'active_merchant/billing/integrations/paypal/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Paypal # Overwrite this if you want to change the Paypal test url...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Paypal class Helper < ActiveMerchant::Billing::Integrations::Helper CANADIAN_PROVINCES = { 'AB' => 'Alberta', 'BC' => 'British Columbia', ...
Ruby
require 'net/http' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Paypal # Parser and handler for incoming Instant payment notifications from paypal. # The Example shows a typical handler in a rails application. Note that this # is an exa...
Ruby
require File.dirname(__FILE__) + '/two_checkout/helper.rb' require File.dirname(__FILE__) + '/two_checkout/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module TwoCheckout mattr_accessor :service_url self.service_url = 'https:/...
Ruby
require 'active_merchant/billing/integrations/chronopay/helper.rb' require 'active_merchant/billing/integrations/chronopay/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Chronopay mattr_accessor :service_url self.service_url = 'ht...
Ruby
# With help from Giovanni Intini and his code for RGestPay - http://medlar.it/it/progetti/rgestpay require File.dirname(__FILE__) + '/gestpay/common.rb' require File.dirname(__FILE__) + '/gestpay/helper.rb' require File.dirname(__FILE__) + '/gestpay/notification.rb' module ActiveMerchant #:nodoc: module Billing #:n...
Ruby
require 'active_merchant/billing/integrations/bogus/helper.rb' require 'active_merchant/billing/integrations/bogus/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Bogus mattr_accessor :service_url self.service_url = 'http://www.bog...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: class Helper #:nodoc: attr_reader :fields class_inheritable_accessor :service_url class_inheritable_hash :mappings class_inheritable_accessor :country_format self.country_format = :alp...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Nochex class Helper < ActiveMerchant::Billing::Integrations::Helper # Required Parameters # email # amount mapping :account, 'email' mapping :amount, 'amount' ...
Ruby
require 'net/http' require 'date' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Nochex # Parser and handler for incoming Automatic Payment Confirmations from Nochex. class Notification < ActiveMerchant::Billing::Integrations::Notification ...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Gestpay module Common VERSION = "2.0" ENCRYPTION_PATH = "/CryptHTTPS/Encrypt.asp" DECRYPTION_PATH = "/CryptHTTPS/Decrypt.asp" DELIMITER = '*P1*' CUR...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Gestpay class Helper < ActiveMerchant::Billing::Integrations::Helper include Common # Valid language codes # Italian => 1 # English => 2 # Spanish => 3 ...
Ruby
require 'net/http' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Gestpay class Notification < ActiveMerchant::Billing::Integrations::Notification include Common def complete? status == 'Completed' end ...
Ruby
require_library_or_gem 'action_pack' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module ActionViewHelper # This helper allows the usage of different payment integrations # through a single form helper. Payment integrations are the # type of s...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: class Notification attr_accessor :params attr_accessor :raw def initialize(post, options = {}) @options = options empty! parse(post) end def status ...
Ruby
require 'net/http' require 'net/https' require 'active_merchant/billing/response' module ActiveMerchant #:nodoc: module Billing #:nodoc: # The Gateway class is the base class for all ActiveMerchant gateway # implementations. The list of gateway functions that concrete # gateway classes can and should imp...
Ruby
require 'time' require 'date' module ActiveMerchant #:nodoc: module Billing #:nodoc: # This credit card object can be used as a stand alone object. It acts just like a active record object # but doesn't support the .save method as its not backed by a database. class CreditCard include CreditCardMet...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: class Error < StandardError #:nodoc: end class Response attr_reader :params attr_reader :message attr_reader :test attr_reader :authorization def success? @success end def test? @te...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Base # Set ActiveMerchant gateways in test mode. # # ActiveMerchant::Billing::Base.gateway_mode = :test mattr_accessor :gateway_mode # Set ActiveMerchant gateways in test mode. # # ActiveMerchant::Bi...
Ruby
module ActiveMerchant #:nodoc: module Billing #:nodoc: # Convenience methods that can be included into a custom Credit Card object, such as an ActiveRecord based Credit Card object. module CreditCardMethods def self.included(base) base.extend(ClassMethods) end def valid_month?...
Ruby
module ActiveMerchant #:nodoc: class InvalidCountryCodeError < StandardError end class CountryCodeFormatError < StandardError end class CountryCode attr_reader :value, :format def initialize(value) @value = value.to_s.upcase detect_format end def to_s value end p...
Ruby
module ActiveMerchant #:nodoc: module PostsData #:nodoc: def self.included(base) base.class_inheritable_accessor :ssl_strict base.ssl_strict = true end def ssl_post(url, data, headers = {}) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_...
Ruby
module ActiveMerchant #:nodoc: module Validateable #:nodoc: def valid? errors.clear before_validate if respond_to?(:before_validate) validate if respond_to?(:validate) errors.empty? end def initialize(attributes = {}) self.attributes = attributes end def error...
Ruby
module ActiveMerchant #:nodoc: module RequiresParameters #:nodoc: def requires!(hash, *params) keys = hash.keys params.each do |param| if param.is_a?(Array) raise ArgumentError.new("Missing required parameter: #{param}") unless keys.include?(param.first) valid_options = ...
Ruby
#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/mocks') $:.unshift(File.dirname(__FILE__) + '/../lib/active_merchant/billing') $:.unshift(File.dirname(__FILE__)+ '/extra') require 'rubygems' require 'money' require 'yaml' require 'net/http' require 'net/https' r...
Ruby
module Net remove_const "HTTP" class Response def initialize(result) @result = result end def body @result end end class Request < Struct.new(:host, :port, :query, :post_data) cattr_accessor :fail @@fail = false def post(query, post) self.query ...
Ruby
class Module def mock_methods(mock_methods) raise "mock methods needs a block" unless block_given? original = self namespace = original.name.split("::") class_name = namespace.last mod = namespace[0..-2].inject(Object) { |mod, part| mod.const_get(part) } klass = (original....
Ruby
class Continuation # :nodoc: def self.create(*args, &block) # :nodoc: cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?} result ||= args return *[cc, *result] end end class Binding; end # for RDoc # This method returns the binding of the method that called your # ...
Ruby
# The Breakpoint library provides the convenience of # being able to inspect and modify state, diagnose # bugs all via IRB by simply setting breakpoints in # your applications by the call of a method. # # This library was written and is supported by me, # Florian Gross. I can be reached at flgr@ccan.de # and enj...
Ruby
#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/mocks') $:.unshift(File.dirname(__FILE__) + '/../lib/active_merchant/billing') $:.unshift(File.dirname(__FILE__)+ '/extra') require 'rubygems' require 'money' require 'yaml' require 'net/http' require 'net/https' r...
Ruby
# Author:: Lucas Carlson (lucas at rufy dot com) # Author:: Thomas Nichols (thomas at nexus10 dot com) # Copyright:: Copyright (c) 2005-2006 Lucas Carlson, Thomas Nichols # License:: Distributes under the same terms as Ruby require 'cgi' require 'csv' require 'payment/base' # NOTE: A patch is required to th...
Ruby
require 'acts_as_exclusive'
Ruby
require 'active_record' module BearBrand module Acts module Exclusive def self.included(base) base.extend(ClassMethods) end module ClassMethods def acts_as_exclusive extend Exclusive::SingletonMethods include Exclusive::InstanceMethods end ...
Ruby
# Include hook code here require File.dirname(__FILE__) + '/lib/acts_as_tagged_tree'
Ruby
class ActsAsTaggedTreeMigration < ActiveRecord::Migration def self.up create_table :tag_trees do |t| t.integer :parent_id t.integer :tag_id t.integer :node_id t.string :name t.string :klass t.timestamps end TagTree.create(:id =>0, :name => "root") end def self.d...
Ruby
class ActsAsTaggedTreeMigrationGenerator < Rails::Generator::Base def manifest record do |m| m.migration_template 'migration.rb', 'db/migrate' end end def file_name "acts_as_tagged_tree_migration" end end
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the acts_as_tagged_tree 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_ta...
Ruby
# desc "Explaining what the task does" # task :acts_as_tagged_tree do # # Task goes here # end
Ruby
# Uninstall hook code here
Ruby
# ActsAsTaggedTree module ActiveRecord #:nodoc: module Acts #:nodoc: module Tagged #:nodoc: module Tree #:nodoc: def self.included(base) base.extend(ClassMethods) end module ClassMethods def acts_as_tagged_tree(options = { }) configuration = { :label...
Ruby
class TagTree < ActiveRecord::Base acts_as_tree attr_accessor :bounds end
Ruby
module TagTreeMap TagTree.send("acts_as_treemap", :label => :node_label, :color => :node_color, :size => :node_size) def node_label if self.node_id obj = eval "#{self.klass}.find(#{self.node_id})" if obj && obj.respond_to?("label") return obj.label end end re...
Ruby
require 'rubygems' require 'test/unit' require 'active_support' require 'active_support/test_case'
Ruby
# Install hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the acts_crummy plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the...
Ruby
# Uninstall hook code here
Ruby
require 'has_parent' require 'breadcrumbs_helper' ActiveRecord::Base.send :include, ActsCrummy::HasParent ActionView::Base.send :include, ActsCrummy::BreadcrumbsHelper
Ruby
module Shoulda module ActiveRecord module Matchers def be_child_to(name) AssociationMatcher.new(:is_child_to, name) end class AssociationMatcher protected alias_method :old_macro_description, :macro_description def macro_description @macro....
Ruby
module ActsCrummy #:nodoc: # This module is mixed into ActiveRecord::Base to provide methods to help define # the direct hierarcy in the model structure of a project, so that breadcrumbs # can be rendered dynamically from it. module HasParent # the self.included/class << base trick is all for the s...
Ruby
module ActsCrummy #:nodoc: # This module is mixed into ActionView::Base to provide the ability to render # breadcrumbs using the structure from the models. module BreadcrumbsHelper DEFAULT_BREADCRUMB_SEPARATOR = ' &gt; ' # Renders breadcrumbs up the model hierarchy starting with <tt>child</tt>, ...
Ruby
require 'rubygems' require 'test/unit' require 'active_support' require 'active_support/test_case'
Ruby
# Install hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the acts_crummy plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the...
Ruby
# Uninstall hook code here
Ruby
require 'has_parent' require 'breadcrumbs_helper' ActiveRecord::Base.send :include, ActsCrummy::HasParent ActionView::Base.send :include, ActsCrummy::BreadcrumbsHelper
Ruby
module Shoulda module ActiveRecord module Matchers def be_child_to(name) AssociationMatcher.new(:is_child_to, name) end class AssociationMatcher protected alias_method :old_macro_description, :macro_description def macro_description @macro....
Ruby
module ActsCrummy #:nodoc: # This module is mixed into ActiveRecord::Base to provide methods to help define # the direct hierarcy in the model structure of a project, so that breadcrumbs # can be rendered dynamically from it. module HasParent # the self.included/class << base trick is all for the s...
Ruby
module ActsCrummy #:nodoc: # This module is mixed into ActionView::Base to provide the ability to render # breadcrumbs using the structure from the models. module BreadcrumbsHelper DEFAULT_BREADCRUMB_SEPARATOR = ' &gt; ' # Renders breadcrumbs up the model hierarchy starting with <tt>child</tt>, ...
Ruby
require 'rubygems' require 'test/unit' require 'active_support' require 'active_support/test_case'
Ruby
# Install hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the acts_crummy plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the...
Ruby