Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

Commit

Permalink
Whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
myabc committed May 16, 2008
1 parent 37f3b63 commit 1d63179
Show file tree
Hide file tree
Showing 123 changed files with 555 additions and 557 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ nbproject
pkg pkg
pkg/* pkg/*
tmp tmp
www/output www/output
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1 @@
= Change Log = Change Log

2 changes: 1 addition & 1 deletion README
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
= merb_mart = merb_mart
== Open-source e-commerce built on the Merb MVC Framework == Open-source e-commerce built on the Merb MVC Framework


Please see README.markdown. Please see README.markdown.
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ require 'merb-core'
require 'rubigen' require 'rubigen'
include FileUtils include FileUtils


# Load the basic runtime dependencies; this will include # Load the basic runtime dependencies; this will include
# any plugins and therefore plugin rake tasks. # any plugins and therefore plugin rake tasks.
init_env = ENV['MERB_ENV'] || 'rake' init_env = ENV['MERB_ENV'] || 'rake'
Merb.load_dependencies(:environment => init_env) Merb.load_dependencies(:environment => init_env)

# Get Merb plugins and dependencies # Get Merb plugins and dependencies
Merb::Plugins.rakefiles.each { |r| require r } Merb::Plugins.rakefiles.each { |r| require r }


desc "start runner environment" desc "start runner environment"
task :merb_env do task :merb_env do
Expand Down
1 change: 0 additions & 1 deletion TODO
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1 @@
= To-Do = To-Do

4 changes: 2 additions & 2 deletions app/controllers/admin/files.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Files < Application class Files < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/admin/orders.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Orders < Application class Orders < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/admin/preferences.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Preferences < Application class Preferences < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/admin/products.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Products < Application class Products < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/admin/promotions.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Promotions < Application class Promotions < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/admin/tags.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
module Admin module Admin
class Tags < Application class Tags < Application

def index def index
render render
end end

end end
end # Admin end # Admin
4 changes: 2 additions & 2 deletions app/controllers/customers.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
class Customers < Application class Customers < Application

def index def index
render render
end end

end end
4 changes: 2 additions & 2 deletions app/controllers/exceptions.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
class Exceptions < Application class Exceptions < Application

# handle NotFound exceptions (404) # handle NotFound exceptions (404)
def not_found def not_found
render :format => :html render :format => :html
Expand All @@ -10,4 +10,4 @@ def not_acceptable
render :format => :html render :format => :html
end end


end end
6 changes: 3 additions & 3 deletions app/controllers/sessions.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
# require 'lib/authenticated_system_controller' # require 'lib/authenticated_system_controller'
require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies") require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies")
class Sessions < Application class Sessions < Application

skip_before :login_required skip_before :login_required

def new def new
render render
end end
Expand All @@ -27,5 +27,5 @@ def destroy
reset_session reset_session
redirect_back_or_default('/') redirect_back_or_default('/')
end end

end end
6 changes: 3 additions & 3 deletions app/controllers/store.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
class Store < Application class Store < Application

def index def index
render render
end end

end end
10 changes: 5 additions & 5 deletions app/controllers/users.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,26 +1,26 @@
require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies") require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies")
class Users < Application class Users < Application
provides :xml provides :xml

skip_before :login_required skip_before :login_required

def new def new
only_provides :html only_provides :html
@user = User.new(params[:user] || {}) @user = User.new(params[:user] || {})
display @user display @user
end end

def create def create
cookies.delete :auth_token cookies.delete :auth_token

@user = User.new(params[:user]) @user = User.new(params[:user])
if @user.save if @user.save
redirect_back_or_default('/') redirect_back_or_default('/')
else else
render :new render :new
end end
end end

def activate def activate
self.current_user = User.find_activated_authenticated_model(params[:activation_code]) self.current_user = User.find_activated_authenticated_model(params[:activation_code])
if logged_in? && !current_user.active? if logged_in? && !current_user.active?
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/admin/files_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module FilesHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/admin/orders_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module OrdersHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/admin/products_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module ProductsHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/admin/promotions_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module PromotionsHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/admin/sections_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module SectionsHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/admin/tags_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ module TagsHelper


end end
end # Admin end # Admin
end end
2 changes: 1 addition & 1 deletion app/helpers/customers_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module Merb
module CustomersHelper module CustomersHelper


end end
end end
2 changes: 1 addition & 1 deletion app/helpers/global_helpers.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
module Merb module Merb
module GlobalHelpers module GlobalHelpers
# helpers defined here available to all views. # helpers defined here available to all views.
end end
end end
8 changes: 4 additions & 4 deletions app/mailers/user_mailer.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,13 @@
class UserMailer < Merb::MailController class UserMailer < Merb::MailController

def signup_notification def signup_notification
@user = params[:user] @user = params[:user]
render_mail render_mail
end end

def activation_notification def activation_notification
@user = params[:user] @user = params[:user]
render_mail render_mail
end end

end end
2 changes: 1 addition & 1 deletion app/mailers/views/layout/application.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
<%= catch_content :for_layout %> <%= catch_content :for_layout %>
2 changes: 1 addition & 1 deletion app/mailers/views/layout/application.text.erb
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
<%= catch_content :for_layout %> <%= catch_content :for_layout %>
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
Your email has been authenticated <%= @user.login %> Your email has been authenticated <%= @user.login %>
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
Your email has been authenticated <%= @user.login %> Your email has been authenticated <%= @user.login %>
2 changes: 1 addition & 1 deletion app/mailers/views/user_mailer/signup_notification.html.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Your account has been created.


Visit this url to activate your account: Visit this url to activate your account:


<%= url(:user_activation, :activation_code => @user.activation_code) %> <%= url(:user_activation, :activation_code => @user.activation_code) %>
2 changes: 1 addition & 1 deletion app/mailers/views/user_mailer/signup_notification.text.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Your account has been created.


Visit this url to activate your account: Visit this url to activate your account:


<%= url(:user_activation, :activation_code => @user.activation_code) %> <%= url(:user_activation, :activation_code => @user.activation_code) %>
4 changes: 2 additions & 2 deletions app/models/address.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Address
property :address1, String, :length => 200, :nullable => false property :address1, String, :length => 200, :nullable => false
property :address2, String, :length => 200 property :address2, String, :length => 200
property :city, String, :length => 50 property :city, String, :length => 50
property :postal_code, String, :length => 10 property :postal_code, String, :length => 10
property :state_id, Fixnum # foreign-key property :state_id, Fixnum # foreign-key
property :country_code, String # foreign-key property :country_code, String # foreign-key


Expand All @@ -38,4 +38,4 @@ def name
"#{self.first_name} #{self.last_name}" "#{self.first_name} #{self.last_name}"
end end


end end
6 changes: 3 additions & 3 deletions app/models/country.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# ISO 3166-1 geographic code. # ISO 3166-1 geographic code.
# #
class Country class Country

include DataMapper::Resource include DataMapper::Resource

property :code, String, :key => true, :length => 2 # ISO 3166-1 alpha-2 property :code, String, :key => true, :length => 2 # ISO 3166-1 alpha-2
property :name, String, :length => 100, :nullable => false, :unique => true property :name, String, :length => 100, :nullable => false, :unique => true


Expand All @@ -16,4 +16,4 @@ class Country


alias :provinces :states alias :provinces :states


end end
4 changes: 2 additions & 2 deletions app/models/mart/abstract_upload.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
module Mart module Mart
class AbstractUpload class AbstractUpload

include DataMapper::Resource include DataMapper::Resource


property :id, Fixnum, :serial => true property :id, Fixnum, :serial => true
Expand All @@ -18,7 +18,7 @@ def filename_base
def extension def extension
filename.split('.').last filename.split('.').last
end end

def relative_path def relative_path
filename # TODO filename # TODO
end end
Expand Down
8 changes: 4 additions & 4 deletions app/models/mart/accounts/abstract_account.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Mart module Mart
module Accounts module Accounts
class AbstractAccount class AbstractAccount

include DataMapper::Resource include DataMapper::Resource
include DataMapper::Validate include DataMapper::Validate
require 'ezcrypto' require 'ezcrypto'
Expand All @@ -12,14 +12,14 @@ class AbstractAccount
property :type, Class # single-table inheritance property :type, Class # single-table inheritance
property :order_id, Fixnum # foreign-key property :order_id, Fixnum # foreign-key
property :customer_id, Fixnum # foreign-key property :customer_id, Fixnum # foreign-key

has 1, :order has 1, :order
belongs_to :customer #, :accessor => :protected belongs_to :customer #, :accessor => :protected


def self.months def self.months
(1..12).to_a (1..12).to_a
end end

def self.years def self.years
year = Date.today.year year = Date.today.year
years = Array.new years = Array.new
Expand All @@ -31,4 +31,4 @@ def self.years


end end
end end
end end
Loading

0 comments on commit 1d63179

Please sign in to comment.