repo
string
commit
string
message
string
diff
string
validates-email-format-of/validates_email_format_of
5cd668b3c2a393aad01f9923da8411b49e1da9c1
abstracted logic for generating default_message into a separate method
diff --git a/lib/validates_email_format_of.rb b/lib/validates_email_format_of.rb index 2e9dc0b..e2b6bad 100644 --- a/lib/validates_email_format_of.rb +++ b/lib/validates_email_format_of.rb @@ -1,141 +1,145 @@ # encoding: utf-8 require 'validates_email_format_of/version' module ValidatesEmailFormatOf def self.load_i18n_locales require 'i18n' I18n.load_path += Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml'))) end require 'resolv' LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/ def self.validate_email_domain(email) domain = email.match(/\@(.+)/)[1] Resolv::DNS.open do |dns| @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) + dns.getresources(domain, Resolv::DNS::Resource::IN::A) end @mx.size > 0 ? true : false end # Validates whether the specified value is a valid email address. Returns nil if the value is valid, otherwise returns an array # containing one or more validation error messages. # # Configuration options: # * <tt>message</tt> - A custom error message (default is: "does not appear to be valid") # * <tt>check_mx</tt> - Check for MX records (default is false) # * <tt>mx_message</tt> - A custom error message when an MX record validation fails (default is: "is not routable.") # * <tt>with</tt> The regex to use for validating the format of the email address (deprecated) # * <tt>local_length</tt> Maximum number of characters allowed in the local part (default is 64) # * <tt>domain_length</tt> Maximum number of characters allowed in the domain part (default is 255) DEFAULT_MESSAGE = "does not appear to be valid" DEFAULT_MX_MESSAGE = "is not routable" + def self.default_message + defined?(I18n) ? I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => DEFAULT_MESSAGE) : DEFAULT_MESSAGE + end + def self.validate_email_format(email, options={}) - default_options = { :message => defined?(I18n) ? I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => DEFAULT_MESSAGE) : DEFAULT_MESSAGE, + default_options = { :message => default_message, :check_mx => false, :mx_message => defined?(I18n) ? I18n.t(:email_address_not_routable, :scope => [:activemodel, :errors, :messages], :default => DEFAULT_MX_MESSAGE) : DEFAULT_MX_MESSAGE, :domain_length => 255, :local_length => 64 } opts = options.merge(default_options) {|key, old, new| old} # merge the default options into the specified options, retaining all specified options email = email.strip if email begin domain, local = email.reverse.split('@', 2) rescue return [ opts[:message] ] end # need local and domain parts return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty? # check lengths return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length] local.reverse! domain.reverse! if opts.has_key?(:with) # holdover from versions <= 1.4.7 return [ opts[:message] ] unless email =~ opts[:with] else return [ opts[:message] ] unless self.validate_local_part_syntax(local) and self.validate_domain_part_syntax(domain) end if opts[:check_mx] and !self.validate_email_domain(email) return [ opts[:mx_message] ] end return nil # represents no validation errors end def self.validate_local_part_syntax(local) in_quoted_pair = false in_quoted_string = false (0..local.length-1).each do |i| ord = local[i].ord # accept anything if it's got a backslash before it if in_quoted_pair in_quoted_pair = false next end # backslash signifies the start of a quoted pair if ord == 92 and i < local.length - 1 return false if not in_quoted_string # must be in quoted string per http://www.rfc-editor.org/errata_search.php?rfc=3696 in_quoted_pair = true next end # double quote delimits quoted strings if ord == 34 in_quoted_string = !in_quoted_string next end next if local[i,1] =~ /[a-z0-9]/i next if local[i,1] =~ LocalPartSpecialChars # period must be followed by something if ord == 46 return false if i == 0 or i == local.length - 1 # can't be first or last char next unless local[i+1].ord == 46 # can't be followed by a period end return false end return false if in_quoted_string # unbalanced quotes return true end def self.validate_domain_part_syntax(domain) parts = domain.downcase.split('.', -1) return false if parts.length <= 1 # Only one domain part # Empty parts (double period) or invalid chars return false if parts.any? { |part| part.nil? or part.empty? or not part =~ /\A[[:alnum:]\-]+\Z/ or part[0,1] == '-' or part[-1,1] == '-' # hyphen at beginning or end of part } # ipv4 return true if parts.length == 4 and parts.all? { |part| part =~ /\A[0-9]+\Z/ and part.to_i.between?(0, 255) } return false if parts[-1].length < 2 or not parts[-1] =~ /[a-z\-]/ # TLD is too short or does not contain a char or hyphen return true end end require 'validates_email_format_of/active_model' if defined?(::ActiveModel) && !(ActiveModel::VERSION::MAJOR < 2 || (2 == ActiveModel::VERSION::MAJOR && ActiveModel::VERSION::MINOR < 1)) require 'validates_email_format_of/railtie' if defined?(::Rails)
validates-email-format-of/validates_email_format_of
8d2fa311120a745256637137b242a158616199c8
suppressed testing of non-i18n use when ActiveModel is defined
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 842a12b..584a111 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,308 +1,312 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end describe "with a custom error message" do let(:options) { { :check_mx => true, :mx_message => "There ain't no such domain!" } } describe email do it { should have_errors_on_email.because("There ain't no such domain!") } end end describe "i18n" do before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } describe "present locale" do let(:locale) { :pl } describe email do it { should have_errors_on_email.because("jest nieosiągalny") } end end describe email do let(:locale) { :ir } describe email do it { should have_errors_on_email.because("is not routable") } end end end - describe "without i18n" do - before(:each) { hide_const("I18n") } - describe email do - it { should have_errors_on_email.because("is not routable") } + unless defined?(ActiveModel) + describe "without i18n" do + before(:each) { hide_const("I18n") } + describe email do + it { should have_errors_on_email.because("is not routable") } + end end end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end describe "custom regex" do let(:options) { { :with => /[0-9]+\@[0-9]+/ } } describe '012345@789' do it { should_not have_errors_on_email } end describe 'valid@example.com' do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "i18n" do before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } describe "present locale" do let(:locale) { :pl } describe "invalid@exmaple." do it { should have_errors_on_email.because("nieprawidłowy adres e-mail") } end end describe "missing locale" do let(:locale) { :ir } describe "invalid@exmaple." do it { should have_errors_on_email.because("does not appear to be valid") } end end end - describe "without i18n" do - before(:each) { hide_const("I18n") } - describe "invalid@exmaple." do - it { should have_errors_on_email.because("does not appear to be valid") } + unless defined?(ActiveModel) + describe "without i18n" do + before(:each) { hide_const("I18n") } + describe "invalid@exmaple." do + it { should have_errors_on_email.because("does not appear to be valid") } + end end end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
3bf3b0d380da8ce6a3a8ab6389f2845cd7b9ab87
added a Contributing section to the README
diff --git a/README.rdoc b/README.rdoc index f004434..263f0b2 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,73 +1,90 @@ = validates_email_format_of Gem and Rails Plugin Validate e-mail addresses against RFC 2822 and RFC 3696. == Installation Installing as a gem: gem install validates_email_format_of Or in your Gemfile: gem 'validates_email_format_of' == Usage # Rails # I18n locales are loaded automatically. class Person < ActiveRecord::Base validates_email_format_of :email, :message => 'is not looking good' # OR validates :email, :email_format => { :message => 'is not looking good' } end # If you're not using Rails (which really means, if you're not using ActiveModel::Validations) ValidatesEmailFormatOf::load_i18n_locales # Optional, if you want error messages to be in your language I18n.locale = :pl # If, for example, you want Polish error messages. ValidatesEmailFormatOf::validate_email_format("example@mydomain.com") # => nil ValidatesEmailFormatOf::validate_email_format("invalid_because_there_is_no_at_symbol") # => ["does not appear to be a valid e-mail address"] === Options :message String. A custom error message when the email format is invalid (default is: "does not appear to be a valid e-mail address") :check_mx Boolean. Check domain for a valid MX record (default is false) :mx_message String. A custom error message when the domain does not match a valid MX record (default is: "is not routable"). Ignored unless :check_mx option is true. :local_length Maximum number of characters allowed in the local part (everything before the '@') (default is 64) :domain_length Maximum number of characters allowed in the domain part (everything after the '@') (default is 255) :with Specify a custom Regex as the valid email format. :on, :if, :unless, :allow_nil, :allow_blank, :strict Standard ActiveModel validation options. These work in the ActiveModel/ActiveRecord/Rails syntax only. See http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validates for details. == Testing To execute the unit tests run <tt>rspec</tt>. Tested in Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.2, JRuby and REE 1.8.7. +== Contributing + +If you think we're letting some rules about valid email formats slip through the cracks, don't just update the Regex. +Instead, add a failing test, and demonstrate that the described email address should be treated differently. A link to an appropriate RFC is the best way to do this. +Then change the gem code to make the test pass. + + describe "i_think_this_is_not_a_v@lid_email_addre.ss" do + # According to http://..., this email address IS NOT valid. + it { should have_errors_on_email.because("does not appear to be valid") } + end + describe "i_think_this_is_a_v@lid_email_addre.ss" do + # According to http://..., this email address IS valid. + it { should_not have_errors_on_email } + end + +Yes, our Rspec syntax is that simple! + == Homepage * https://github.com/validates-email-format-of/validates_email_format_of == Credits Written by Alex Dunae (dunae.ca), 2006-11. Many thanks to the plugin's recent contributors: https://github.com/alexdunae/validates_email_format_of/contributors Thanks to Francis Hwang (http://fhwang.net/) at Diversion Media for creating the 1.1 update. Thanks to Travis Sinnott for creating the 1.3 update. Thanks to Denis Ahearn at Riverock Technologies (http://www.riverocktech.com/) for creating the 1.4 update. Thanks to George Anderson (http://github.com/george) and 'history' (http://github.com/history) for creating the 1.4.1 update. Thanks to Isaac Betesh (https://github.com/betesh) for converting tests to Rspec and refactoring for version 1.6.0.
validates-email-format-of/validates_email_format_of
159622bb8f45b42f846e35a5b35854dbc66eec2a
made it work without i18n
diff --git a/lib/validates_email_format_of.rb b/lib/validates_email_format_of.rb index 1b48fff..2e9dc0b 100644 --- a/lib/validates_email_format_of.rb +++ b/lib/validates_email_format_of.rb @@ -1,139 +1,141 @@ # encoding: utf-8 require 'validates_email_format_of/version' module ValidatesEmailFormatOf def self.load_i18n_locales require 'i18n' I18n.load_path += Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml'))) end require 'resolv' LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/ def self.validate_email_domain(email) domain = email.match(/\@(.+)/)[1] Resolv::DNS.open do |dns| @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) + dns.getresources(domain, Resolv::DNS::Resource::IN::A) end @mx.size > 0 ? true : false end # Validates whether the specified value is a valid email address. Returns nil if the value is valid, otherwise returns an array # containing one or more validation error messages. # # Configuration options: # * <tt>message</tt> - A custom error message (default is: "does not appear to be valid") # * <tt>check_mx</tt> - Check for MX records (default is false) # * <tt>mx_message</tt> - A custom error message when an MX record validation fails (default is: "is not routable.") # * <tt>with</tt> The regex to use for validating the format of the email address (deprecated) # * <tt>local_length</tt> Maximum number of characters allowed in the local part (default is 64) # * <tt>domain_length</tt> Maximum number of characters allowed in the domain part (default is 255) + DEFAULT_MESSAGE = "does not appear to be valid" + DEFAULT_MX_MESSAGE = "is not routable" def self.validate_email_format(email, options={}) - default_options = { :message => I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => 'does not appear to be valid'), + default_options = { :message => defined?(I18n) ? I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => DEFAULT_MESSAGE) : DEFAULT_MESSAGE, :check_mx => false, - :mx_message => I18n.t(:email_address_not_routable, :scope => [:activemodel, :errors, :messages], :default => 'is not routable'), + :mx_message => defined?(I18n) ? I18n.t(:email_address_not_routable, :scope => [:activemodel, :errors, :messages], :default => DEFAULT_MX_MESSAGE) : DEFAULT_MX_MESSAGE, :domain_length => 255, :local_length => 64 } opts = options.merge(default_options) {|key, old, new| old} # merge the default options into the specified options, retaining all specified options email = email.strip if email begin domain, local = email.reverse.split('@', 2) rescue return [ opts[:message] ] end # need local and domain parts return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty? # check lengths return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length] local.reverse! domain.reverse! if opts.has_key?(:with) # holdover from versions <= 1.4.7 return [ opts[:message] ] unless email =~ opts[:with] else return [ opts[:message] ] unless self.validate_local_part_syntax(local) and self.validate_domain_part_syntax(domain) end if opts[:check_mx] and !self.validate_email_domain(email) return [ opts[:mx_message] ] end return nil # represents no validation errors end def self.validate_local_part_syntax(local) in_quoted_pair = false in_quoted_string = false (0..local.length-1).each do |i| ord = local[i].ord # accept anything if it's got a backslash before it if in_quoted_pair in_quoted_pair = false next end # backslash signifies the start of a quoted pair if ord == 92 and i < local.length - 1 return false if not in_quoted_string # must be in quoted string per http://www.rfc-editor.org/errata_search.php?rfc=3696 in_quoted_pair = true next end # double quote delimits quoted strings if ord == 34 in_quoted_string = !in_quoted_string next end next if local[i,1] =~ /[a-z0-9]/i next if local[i,1] =~ LocalPartSpecialChars # period must be followed by something if ord == 46 return false if i == 0 or i == local.length - 1 # can't be first or last char next unless local[i+1].ord == 46 # can't be followed by a period end return false end return false if in_quoted_string # unbalanced quotes return true end def self.validate_domain_part_syntax(domain) parts = domain.downcase.split('.', -1) return false if parts.length <= 1 # Only one domain part # Empty parts (double period) or invalid chars return false if parts.any? { |part| part.nil? or part.empty? or not part =~ /\A[[:alnum:]\-]+\Z/ or part[0,1] == '-' or part[-1,1] == '-' # hyphen at beginning or end of part } # ipv4 return true if parts.length == 4 and parts.all? { |part| part =~ /\A[0-9]+\Z/ and part.to_i.between?(0, 255) } return false if parts[-1].length < 2 or not parts[-1] =~ /[a-z\-]/ # TLD is too short or does not contain a char or hyphen return true end end require 'validates_email_format_of/active_model' if defined?(::ActiveModel) && !(ActiveModel::VERSION::MAJOR < 2 || (2 == ActiveModel::VERSION::MAJOR && ActiveModel::VERSION::MINOR < 1)) require 'validates_email_format_of/railtie' if defined?(::Rails) diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 9cf7a56..842a12b 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,296 +1,308 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end describe "with a custom error message" do let(:options) { { :check_mx => true, :mx_message => "There ain't no such domain!" } } describe email do it { should have_errors_on_email.because("There ain't no such domain!") } end end describe "i18n" do before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } describe "present locale" do let(:locale) { :pl } describe email do it { should have_errors_on_email.because("jest nieosiągalny") } end end describe email do let(:locale) { :ir } describe email do it { should have_errors_on_email.because("is not routable") } end end end + describe "without i18n" do + before(:each) { hide_const("I18n") } + describe email do + it { should have_errors_on_email.because("is not routable") } + end + end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end describe "custom regex" do let(:options) { { :with => /[0-9]+\@[0-9]+/ } } describe '012345@789' do it { should_not have_errors_on_email } end describe 'valid@example.com' do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "i18n" do before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } describe "present locale" do let(:locale) { :pl } describe "invalid@exmaple." do it { should have_errors_on_email.because("nieprawidłowy adres e-mail") } end end describe "missing locale" do let(:locale) { :ir } describe "invalid@exmaple." do it { should have_errors_on_email.because("does not appear to be valid") } end end end + describe "without i18n" do + before(:each) { hide_const("I18n") } + describe "invalid@exmaple." do + it { should have_errors_on_email.because("does not appear to be valid") } + end + end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
f320524d77733eafac3db80d3298b8164fafcdbb
whitespace changes only
diff --git a/README.rdoc b/README.rdoc index 096c8bf..2a0f6bc 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,93 +1,93 @@ = validates_email_format_of Gem and Rails Plugin Validate e-mail addresses against RFC 2822 and RFC 3696. == Installation Installing as a gem: gem install validates_email_format_of Installing as a Ruby on Rails 2 plugin: ./script/plugin install http://github.com/alexdunae/validates_email_format_of.git Or in your Rails 3 Gemfile gem 'validates_email_format_of', :git => 'git://github.com/alexdunae/validates_email_format_of.git' == Usage class Person < ActiveRecord::Base validates_email_format_of :email end # Rails 3 class Person < ActiveRecord::Base validates :email, :email_format => {:message => 'is not looking good'} end -As of version 1.4, it's possible to run e-mail validation tests (including MX -checks) without using ActiveRecord or even touching a database. The -<tt>validate_email_format</tt> method will return <tt>nil</tt> on a valid +As of version 1.4, it's possible to run e-mail validation tests (including MX +checks) without using ActiveRecord or even touching a database. The +<tt>validate_email_format</tt> method will return <tt>nil</tt> on a valid e-mail address or an array of error messages for invalid addresses. results = ValidatesEmailFormatOf::validate_email_format(email, options) if results.nil? # success! else puts results.join(', ') end === Options :message String. A custom error message (default is: "does not appear to be a valid e-mail address") :on Symbol. Specifies when this validation is active (default is :save, other options :create, :update) :allow_nil Boolean. Allow nil values (default is false) :allow_blank Boolean. Allow blank values (default is false) :check_mx Boolean. Check domain for a valid MX record (default is false) :if - Specifies a method, proc or string to call to determine if the validation should occur - (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The method, - proc or string should return or evaluate to a true or false value. + Specifies a method, proc or string to call to determine if the validation should occur + (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The method, + proc or string should return or evaluate to a true or false value. :unless See :if option. :local_length Maximum number of characters allowed in the local part (default is 64) :domain_length Maximum number of characters allowed in the domain part (default is 255) == Testing To execute the unit tests run <tt>rake test</tt>. The unit tests for this plugin use an in-memory sqlite3 database. Tested in Ruby 1.8.7, 1.9.2, 1.9.3-rc1, JRuby and REE 1.8.7. == Resources * https://github.com/alexdunae/validates_email_format_of == Credits Written by Alex Dunae (dunae.ca), 2006-11. Many thanks to the plugin's recent contributors: https://github.com/alexdunae/validates_email_format_of/contributors Thanks to Francis Hwang (http://fhwang.net/) at Diversion Media for creating the 1.1 update. Thanks to Travis Sinnott for creating the 1.3 update. Thanks to Denis Ahearn at Riverock Technologies (http://www.riverocktech.com/) for creating the 1.4 update. Thanks to George Anderson (http://github.com/george) and 'history' (http://github.com/history) for creating the 1.4.1 update.
validates-email-format-of/validates_email_format_of
400297645a80a4d4e028101fabc9ccf1da7311a5
corrected gem version
diff --git a/lib/validates_email_format_of/version.rb b/lib/validates_email_format_of/version.rb index f88aff5..b83f3d4 100644 --- a/lib/validates_email_format_of/version.rb +++ b/lib/validates_email_format_of/version.rb @@ -1,3 +1,3 @@ module ValidatesEmailFormatOf - VERSION = '4.0.0' + VERSION = '1.6.0' end
validates-email-format-of/validates_email_format_of
5769d238eb9b9c9cdb917e14c0d8f63842a211c5
added warning for older versions of ActiveModel
diff --git a/lib/validates_email_format_of.rb b/lib/validates_email_format_of.rb index 1b73eb4..1b48fff 100644 --- a/lib/validates_email_format_of.rb +++ b/lib/validates_email_format_of.rb @@ -1,139 +1,139 @@ # encoding: utf-8 require 'validates_email_format_of/version' module ValidatesEmailFormatOf def self.load_i18n_locales require 'i18n' I18n.load_path += Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml'))) end require 'resolv' LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/ def self.validate_email_domain(email) domain = email.match(/\@(.+)/)[1] Resolv::DNS.open do |dns| @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) + dns.getresources(domain, Resolv::DNS::Resource::IN::A) end @mx.size > 0 ? true : false end # Validates whether the specified value is a valid email address. Returns nil if the value is valid, otherwise returns an array # containing one or more validation error messages. # # Configuration options: # * <tt>message</tt> - A custom error message (default is: "does not appear to be valid") # * <tt>check_mx</tt> - Check for MX records (default is false) # * <tt>mx_message</tt> - A custom error message when an MX record validation fails (default is: "is not routable.") # * <tt>with</tt> The regex to use for validating the format of the email address (deprecated) # * <tt>local_length</tt> Maximum number of characters allowed in the local part (default is 64) # * <tt>domain_length</tt> Maximum number of characters allowed in the domain part (default is 255) def self.validate_email_format(email, options={}) default_options = { :message => I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => 'does not appear to be valid'), :check_mx => false, :mx_message => I18n.t(:email_address_not_routable, :scope => [:activemodel, :errors, :messages], :default => 'is not routable'), :domain_length => 255, :local_length => 64 } opts = options.merge(default_options) {|key, old, new| old} # merge the default options into the specified options, retaining all specified options email = email.strip if email begin domain, local = email.reverse.split('@', 2) rescue return [ opts[:message] ] end # need local and domain parts return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty? # check lengths return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length] local.reverse! domain.reverse! if opts.has_key?(:with) # holdover from versions <= 1.4.7 return [ opts[:message] ] unless email =~ opts[:with] else return [ opts[:message] ] unless self.validate_local_part_syntax(local) and self.validate_domain_part_syntax(domain) end if opts[:check_mx] and !self.validate_email_domain(email) return [ opts[:mx_message] ] end return nil # represents no validation errors end def self.validate_local_part_syntax(local) in_quoted_pair = false in_quoted_string = false (0..local.length-1).each do |i| ord = local[i].ord # accept anything if it's got a backslash before it if in_quoted_pair in_quoted_pair = false next end # backslash signifies the start of a quoted pair if ord == 92 and i < local.length - 1 return false if not in_quoted_string # must be in quoted string per http://www.rfc-editor.org/errata_search.php?rfc=3696 in_quoted_pair = true next end # double quote delimits quoted strings if ord == 34 in_quoted_string = !in_quoted_string next end next if local[i,1] =~ /[a-z0-9]/i next if local[i,1] =~ LocalPartSpecialChars # period must be followed by something if ord == 46 return false if i == 0 or i == local.length - 1 # can't be first or last char next unless local[i+1].ord == 46 # can't be followed by a period end return false end return false if in_quoted_string # unbalanced quotes return true end def self.validate_domain_part_syntax(domain) parts = domain.downcase.split('.', -1) return false if parts.length <= 1 # Only one domain part # Empty parts (double period) or invalid chars return false if parts.any? { |part| part.nil? or part.empty? or not part =~ /\A[[:alnum:]\-]+\Z/ or part[0,1] == '-' or part[-1,1] == '-' # hyphen at beginning or end of part } # ipv4 return true if parts.length == 4 and parts.all? { |part| part =~ /\A[0-9]+\Z/ and part.to_i.between?(0, 255) } return false if parts[-1].length < 2 or not parts[-1] =~ /[a-z\-]/ # TLD is too short or does not contain a char or hyphen return true end end -require 'validates_email_format_of/active_model' if defined?(::ActiveModel) +require 'validates_email_format_of/active_model' if defined?(::ActiveModel) && !(ActiveModel::VERSION::MAJOR < 2 || (2 == ActiveModel::VERSION::MAJOR && ActiveModel::VERSION::MINOR < 1)) require 'validates_email_format_of/railtie' if defined?(::Rails) diff --git a/lib/validates_email_format_of/active_model.rb b/lib/validates_email_format_of/active_model.rb index bf834fc..14ad5d0 100644 --- a/lib/validates_email_format_of/active_model.rb +++ b/lib/validates_email_format_of/active_model.rb @@ -1,19 +1,24 @@ require 'validates_email_format_of' +require 'active_model' + +if ActiveModel::VERSION::MAJOR < 2 || (2 == ActiveModel::VERSION::MAJOR && ActiveModel::VERSION::MINOR < 1) + puts "WARNING: ActiveModel validation helper methods in validates_email_format_of gem are not compatible with ActiveModel < 2.1.0. Please use ValidatesEmailFormatOf::validate_email_format(email, options) or upgrade ActiveModel" +end module ActiveModel module Validations class EmailFormatValidator < EachValidator def validate_each(record, attribute, value) (ValidatesEmailFormatOf::validate_email_format(value, options) || []).each do |error| record.errors.add(attribute, error) end end end module HelperMethods def validates_email_format_of(*attr_names) validates_with EmailFormatValidator, _merge_attributes(attr_names) end end end end
validates-email-format-of/validates_email_format_of
bbdbaad91ad0ce34cbd72021d8c2abf83b0c40fc
made sure we're getting our error messages from I18n
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 34536a1..9cf7a56 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,265 +1,296 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end describe "with a custom error message" do let(:options) { { :check_mx => true, :mx_message => "There ain't no such domain!" } } describe email do it { should have_errors_on_email.because("There ain't no such domain!") } end end + describe "i18n" do + before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } + describe "present locale" do + let(:locale) { :pl } + describe email do + it { should have_errors_on_email.because("jest nieosiągalny") } + end + end + describe email do + let(:locale) { :ir } + describe email do + it { should have_errors_on_email.because("is not routable") } + end + end + end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end describe "custom regex" do let(:options) { { :with => /[0-9]+\@[0-9]+/ } } describe '012345@789' do it { should_not have_errors_on_email } end describe 'valid@example.com' do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end + + describe "i18n" do + before(:each) { allow(I18n.config).to receive(:locale).and_return(locale) } + describe "present locale" do + let(:locale) { :pl } + describe "invalid@exmaple." do + it { should have_errors_on_email.because("nieprawidłowy adres e-mail") } + end + end + describe "missing locale" do + let(:locale) { :ir } + describe "invalid@exmaple." do + it { should have_errors_on_email.because("does not appear to be valid") } + end + end + end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
c6cdf38da1e06223b8981ec7b3755b32e0f0c14f
added spec for custom mx_message
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 06924ff..34536a1 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,259 +1,265 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end + describe "with a custom error message" do + let(:options) { { :check_mx => true, :mx_message => "There ain't no such domain!" } } + describe email do + it { should have_errors_on_email.because("There ain't no such domain!") } + end + end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end describe "custom regex" do let(:options) { { :with => /[0-9]+\@[0-9]+/ } } describe '012345@789' do it { should_not have_errors_on_email } end describe 'valid@example.com' do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
d4a739ac94dd8309adfe26f47ef22d17dfa554bf
removed POC spec now that all tests have been moved to spec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 578c65c..06924ff 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,262 +1,259 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } - describe "user1@gmail.com" do - it { should_not have_errors_on_email } - end shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end describe "custom regex" do let(:options) { { :with => /[0-9]+\@[0-9]+/ } } describe '012345@789' do it { should_not have_errors_on_email } end describe 'valid@example.com' do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
fe3d6465949d16bfb7bc9e3b49d14fd2de9d958d
moved test for custom email regex from minitest to rspec. No more minitest!
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index c3aee40..578c65c 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,252 +1,262 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end + + describe "custom regex" do + let(:options) { { :with => /[0-9]+\@[0-9]+/ } } + describe '012345@789' do + it { should_not have_errors_on_email } + end + describe 'valid@example.com' do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end + end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index c12d1b9..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,16 +0,0 @@ -$:.unshift(File.dirname(__FILE__)) -$:.unshift(File.dirname(__FILE__) + '/../lib') - -require 'bundler/setup' -require 'minitest/autorun' - -require 'active_model' -require "validates_email_format_of" - -if ActiveSupport.const_defined?(:TestCase) - TEST_CASE = ActiveSupport::TestCase -else - TEST_CASE = Test::Unit::TestCase -end - -Dir.glob("#{File.dirname(__FILE__)}/fixtures/*.rb") { |f| require f } diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb deleted file mode 100644 index d430c28..0000000 --- a/test/validates_email_format_of_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- encoding : utf-8 -*- -require File.expand_path(File.dirname(__FILE__) + '/test_helper') - -class ValidatesEmailFormatOfTest < TEST_CASE - def test_validating_with_custom_regexp - assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) - end -end
validates-email-format-of/validates_email_format_of
43ec8684fa76d753fbf042e8524f8b82249ad340
whitespace changes only
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 465d7ac..c3aee40 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,252 +1,252 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end shared_examples_for :all_specs do - [ - 'valid@example.com', - 'Valid@test.example.com', - 'valid+valid123@test.example.com', - 'valid_valid123@test.example.com', - 'valid-valid+123@test.example.co.uk', - 'valid-valid+1.23@test.example.com.au', - 'valid@example.co.uk', - 'v@example.com', - 'valid@example.ca', - 'valid_@example.com', - 'valid123.456@example.org', - 'valid123.456@example.travel', - 'valid123.456@example.museum', - 'valid@example.mobi', - 'valid@example.info', - 'valid-@example.com', - 'fake@p-t.k12.ok.us', - # allow single character domain parts - 'valid@mail.x.example.com', - 'valid@x.com', - 'valid@example.w-dash.sch.uk', - # from RFC 3696, page 6 - 'customer/department=shipping@example.com', - '$A12345@example.com', - '!def!xyz%abc@example.com', - '_somename@example.com', - # apostrophes - "test'test@example.com", - # international domain names - 'test@xn--bcher-kva.ch', - 'test@example.xn--0zwm56d', - 'test@192.192.192.1', - # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 - '"Abc\@def"@example.com', - '"Fred\ Bloggs"@example.com', - '"Joe.\\Blow"@example.com', - # Balanced quoted characters - %!"example\\\\\\""@example.com!, - %!"example\\\\"@example.com! - ].each do |address| - describe address do - it { should_not have_errors_on_email } + [ + 'valid@example.com', + 'Valid@test.example.com', + 'valid+valid123@test.example.com', + 'valid_valid123@test.example.com', + 'valid-valid+123@test.example.co.uk', + 'valid-valid+1.23@test.example.com.au', + 'valid@example.co.uk', + 'v@example.com', + 'valid@example.ca', + 'valid_@example.com', + 'valid123.456@example.org', + 'valid123.456@example.travel', + 'valid123.456@example.museum', + 'valid@example.mobi', + 'valid@example.info', + 'valid-@example.com', + 'fake@p-t.k12.ok.us', + # allow single character domain parts + 'valid@mail.x.example.com', + 'valid@x.com', + 'valid@example.w-dash.sch.uk', + # from RFC 3696, page 6 + 'customer/department=shipping@example.com', + '$A12345@example.com', + '!def!xyz%abc@example.com', + '_somename@example.com', + # apostrophes + "test'test@example.com", + # international domain names + 'test@xn--bcher-kva.ch', + 'test@example.xn--0zwm56d', + 'test@192.192.192.1', + # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 + '"Abc\@def"@example.com', + '"Fred\ Bloggs"@example.com', + '"Joe.\\Blow"@example.com', + # Balanced quoted characters + %!"example\\\\\\""@example.com!, + %!"example\\\\"@example.com! + ].each do |address| + describe address do + it { should_not have_errors_on_email } + end end - end - [ - 'no_at_symbol', - 'invalid@example-com', - # period can not start local part - '.invalid@example.com', - # period can not end local part - 'invalid.@example.com', - # period can not appear twice consecutively in local part - 'invali..d@example.com', - # should not allow underscores in domain names - 'invalid@ex_mple.com', - 'invalid@e..example.com', - 'invalid@p-t..example.com', - 'invalid@example.com.', - 'invalid@example.com_', - 'invalid@example.com-', - 'invalid-example.com', - 'invalid@example.b#r.com', - 'invalid@example.c', - 'invali d@example.com', - # TLD can not be only numeric - 'invalid@example.123', - # unclosed quote - "\"a-17180061943-10618354-1993365053@example.com", - # too many special chars used to cause the regexp to hang - "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", - 'invalidexample.com', - # should not allow special chars after a period in the domain - 'local@sub.)domain.com', - 'local@sub.#domain.com', - # one at a time - "foo@example.com\nexample@gmail.com", - 'invalid@example.', - "\"foo\\\\\"\"@bar.com", - "foo@mail.com\r\nfoo@mail.com", - '@example.com', - 'foo@', - 'foo', - 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', - # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 - 'Fred\ Bloggs_@example.com', - 'Abc\@def+@example.com', - 'Joe.\\Blow@example.com', - # Unbalanced quoted characters - %!"example\\\\""example.com! - ].each do |address| - describe address do - it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + [ + 'no_at_symbol', + 'invalid@example-com', + # period can not start local part + '.invalid@example.com', + # period can not end local part + 'invalid.@example.com', + # period can not appear twice consecutively in local part + 'invali..d@example.com', + # should not allow underscores in domain names + 'invalid@ex_mple.com', + 'invalid@e..example.com', + 'invalid@p-t..example.com', + 'invalid@example.com.', + 'invalid@example.com_', + 'invalid@example.com-', + 'invalid-example.com', + 'invalid@example.b#r.com', + 'invalid@example.c', + 'invali d@example.com', + # TLD can not be only numeric + 'invalid@example.123', + # unclosed quote + "\"a-17180061943-10618354-1993365053@example.com", + # too many special chars used to cause the regexp to hang + "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", + 'invalidexample.com', + # should not allow special chars after a period in the domain + 'local@sub.)domain.com', + 'local@sub.#domain.com', + # one at a time + "foo@example.com\nexample@gmail.com", + 'invalid@example.', + "\"foo\\\\\"\"@bar.com", + "foo@mail.com\r\nfoo@mail.com", + '@example.com', + 'foo@', + 'foo', + 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', + # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 + 'Fred\ Bloggs_@example.com', + 'Abc\@def+@example.com', + 'Joe.\\Blow@example.com', + # Unbalanced quoted characters + %!"example\\\\""example.com! + ].each do |address| + describe address do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end end - end - describe do - shared_examples_for :local_length_limit do |limit| - describe "#{'a' * limit}@example.com" do - it { should_not have_errors_on_email } + describe do + shared_examples_for :local_length_limit do |limit| + describe "#{'a' * limit}@example.com" do + it { should_not have_errors_on_email } + end + describe "#{'a' * (limit + 1)}@example.com" do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end end - describe "#{'a' * (limit + 1)}@example.com" do - it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + describe "when using default" do + it_should_behave_like :local_length_limit, 64 + end + describe "when overriding defaults" do + let(:options) { { :local_length => 20 } } + it_should_behave_like :local_length_limit, 20 end end - describe "when using default" do - it_should_behave_like :local_length_limit, 64 - end - describe "when overriding defaults" do - let(:options) { { :local_length => 20 } } - it_should_behave_like :local_length_limit, 20 - end - end - describe do - shared_examples_for :domain_length_limit do |limit| - describe "user@#{'a' * (limit - 4)}.com" do - it { should_not have_errors_on_email } + describe do + shared_examples_for :domain_length_limit do |limit| + describe "user@#{'a' * (limit - 4)}.com" do + it { should_not have_errors_on_email } + end + describe "user@#{'a' * (limit - 3)}.com" do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end end - describe "user@#{'a' * (limit - 3)}.com" do - it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + describe "when using default" do + it_should_behave_like :domain_length_limit, 255 + end + describe "when overriding defaults" do + let(:options) { { :domain_length => 100 } } + it_should_behave_like :domain_length_limit, 100 end end - describe "when using default" do - it_should_behave_like :domain_length_limit, 255 - end - describe "when overriding defaults" do - let(:options) { { :domain_length => 100 } } - it_should_behave_like :domain_length_limit, 100 - end - end - describe "custom error messages" do - describe 'invalid@example.' do - let(:options) { { :message => "just because I don't like you" } } - it { should have_errors_on_email.because("just because I don't like you") } + describe "custom error messages" do + describe 'invalid@example.' do + let(:options) { { :message => "just because I don't like you" } } + it { should have_errors_on_email.because("just because I don't like you") } + end end - end - describe "mx record" do - domain = "stubbed.com" - email = "valid@#{domain}" - describe "when testing" do - let(:dns) { double(Resolv::DNS) } - let(:mx_record) { [double] } - let(:a_record) { [double] } - before(:each) do - allow(Resolv::DNS).to receive(:open).and_yield(dns) - allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) - allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) - end - let(:options) { { :check_mx => true } } - describe "and only an mx record is found" do - let(:a_record) { [] } - describe email do - it { should_not have_errors_on_email } + describe "mx record" do + domain = "stubbed.com" + email = "valid@#{domain}" + describe "when testing" do + let(:dns) { double(Resolv::DNS) } + let(:mx_record) { [double] } + let(:a_record) { [double] } + before(:each) do + allow(Resolv::DNS).to receive(:open).and_yield(dns) + allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) + allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end - end - describe "and only an a record is found" do - let(:mx_record) { [] } - describe email do - it { should_not have_errors_on_email } + let(:options) { { :check_mx => true } } + describe "and only an mx record is found" do + let(:a_record) { [] } + describe email do + it { should_not have_errors_on_email } + end end - end - describe "and both an mx record and an a record are found" do - describe email do - it { should_not have_errors_on_email } + describe "and only an a record is found" do + let(:mx_record) { [] } + describe email do + it { should_not have_errors_on_email } + end end - end - describe "and neither an mx record nor an a record is found" do - let(:a_record) { [] } - let(:mx_record) { [] } - describe email do - it { should have_errors_on_email.because("is not routable") } + describe "and both an mx record and an a record are found" do + describe email do + it { should_not have_errors_on_email } + end + end + describe "and neither an mx record nor an a record is found" do + let(:a_record) { [] } + let(:mx_record) { [] } + describe email do + it { should have_errors_on_email.because("is not routable") } + end end end - end - describe "when not testing" do - before(:each) { allow(Resolv::DNS).to receive(:open).never } - describe "by default" do - describe email do - it { should_not have_errors_on_email } + describe "when not testing" do + before(:each) { allow(Resolv::DNS).to receive(:open).never } + describe "by default" do + describe email do + it { should_not have_errors_on_email } + end + end + describe "explicitly" do + describe email do + let(:options) { { :check_mx => false } } + it { should_not have_errors_on_email } + end end end - describe "explicitly" do + describe "without mocks" do describe email do - let(:options) { { :check_mx => false } } + let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end - describe "without mocks" do - describe email do - let(:options) { { :check_mx => true } } - it { should_not have_errors_on_email } - end - end - end end it_should_behave_like :all_specs if defined?(ActiveModel) describe "shorthand ActiveModel validation" do subject do |example| user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates :email, :email_format => example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages end it_should_behave_like :all_specs end end end
validates-email-format-of/validates_email_format_of
c3402959672f7431cfa5af8dbc164d215328b341
moved tests for shorthand format of ActiveModel validation from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 5a9b2ab..465d7ac 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,230 +1,252 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end + shared_examples_for :all_specs do [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end describe "mx record" do domain = "stubbed.com" email = "valid@#{domain}" describe "when testing" do let(:dns) { double(Resolv::DNS) } let(:mx_record) { [double] } let(:a_record) { [double] } before(:each) do allow(Resolv::DNS).to receive(:open).and_yield(dns) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) end let(:options) { { :check_mx => true } } describe "and only an mx record is found" do let(:a_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and only an a record is found" do let(:mx_record) { [] } describe email do it { should_not have_errors_on_email } end end describe "and both an mx record and an a record are found" do describe email do it { should_not have_errors_on_email } end end describe "and neither an mx record nor an a record is found" do let(:a_record) { [] } let(:mx_record) { [] } describe email do it { should have_errors_on_email.because("is not routable") } end end end describe "when not testing" do before(:each) { allow(Resolv::DNS).to receive(:open).never } describe "by default" do describe email do it { should_not have_errors_on_email } end end describe "explicitly" do describe email do let(:options) { { :check_mx => false } } it { should_not have_errors_on_email } end end end describe "without mocks" do describe email do let(:options) { { :check_mx => true } } it { should_not have_errors_on_email } end end end + end + it_should_behave_like :all_specs + + if defined?(ActiveModel) + describe "shorthand ActiveModel validation" do + subject do |example| + user = Class.new do + def initialize(email) + @email = email.freeze + end + attr_reader :email + include ActiveModel::Validations + validates :email, :email_format => example.example_group_instance.options + end + example.example_group_instance.class::User = user + user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages + end + + it_should_behave_like :all_specs + end + end end diff --git a/test/fixtures/person.rb b/test/fixtures/person.rb deleted file mode 100644 index f38d2ab..0000000 --- a/test/fixtures/person.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'validates_email_format_of' - -module ValidatesEmailFormatOf - class Base - include ActiveModel::Model - attr_accessor :email - end -end - - -class Shorthand < ValidatesEmailFormatOf::Base - validates :email, :email_format => { :message => 'fails with shorthand message' }, - :length => { :maximum => 1 } -end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 8249dec..d430c28 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,15 +1,8 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end - - def test_shorthand - s = Shorthand.new(:email => 'invalid') - assert s.invalid? - assert_equal 2, s.errors[:email].size - assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } - end end
validates-email-format-of/validates_email_format_of
d4b5ff27a1dc06719ea2ee33e8733b5763f1d11a
moved mx record tests from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 16db34b..5a9b2ab 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,170 +1,230 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', # Balanced quoted characters %!"example\\\\\\""@example.com!, %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com', # Unbalanced quoted characters %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end + + describe "mx record" do + domain = "stubbed.com" + email = "valid@#{domain}" + describe "when testing" do + let(:dns) { double(Resolv::DNS) } + let(:mx_record) { [double] } + let(:a_record) { [double] } + before(:each) do + allow(Resolv::DNS).to receive(:open).and_yield(dns) + allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::MX).once.and_return(mx_record) + allow(dns).to receive(:getresources).with(domain, Resolv::DNS::Resource::IN::A).once.and_return(a_record) + end + let(:options) { { :check_mx => true } } + describe "and only an mx record is found" do + let(:a_record) { [] } + describe email do + it { should_not have_errors_on_email } + end + end + describe "and only an a record is found" do + let(:mx_record) { [] } + describe email do + it { should_not have_errors_on_email } + end + end + describe "and both an mx record and an a record are found" do + describe email do + it { should_not have_errors_on_email } + end + end + describe "and neither an mx record nor an a record is found" do + let(:a_record) { [] } + let(:mx_record) { [] } + describe email do + it { should have_errors_on_email.because("is not routable") } + end + end + end + describe "when not testing" do + before(:each) { allow(Resolv::DNS).to receive(:open).never } + describe "by default" do + describe email do + it { should_not have_errors_on_email } + end + end + describe "explicitly" do + describe email do + let(:options) { { :check_mx => false } } + it { should_not have_errors_on_email } + end + end + end + describe "without mocks" do + describe email do + let(:options) { { :check_mx => true } } + it { should_not have_errors_on_email } + end + end + end end diff --git a/test/fixtures/person.rb b/test/fixtures/person.rb index 0841762..f38d2ab 100644 --- a/test/fixtures/person.rb +++ b/test/fixtures/person.rb @@ -1,20 +1,14 @@ require 'validates_email_format_of' module ValidatesEmailFormatOf class Base include ActiveModel::Model attr_accessor :email end end -class MxRecord < ValidatesEmailFormatOf::Base - validates_email_format_of :email, - :on => :create, - :check_mx => true -end - class Shorthand < ValidatesEmailFormatOf::Base validates :email, :email_format => { :message => 'fails with shorthand message' }, :length => { :maximum => 1 } end diff --git a/test/test_helper.rb b/test/test_helper.rb index 9865e3c..c12d1b9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,34 +1,16 @@ $:.unshift(File.dirname(__FILE__)) $:.unshift(File.dirname(__FILE__) + '/../lib') require 'bundler/setup' require 'minitest/autorun' require 'active_model' require "validates_email_format_of" if ActiveSupport.const_defined?(:TestCase) TEST_CASE = ActiveSupport::TestCase else TEST_CASE = Test::Unit::TestCase end Dir.glob("#{File.dirname(__FILE__)}/fixtures/*.rb") { |f| require f } - -class Resolv::DNS - # Stub for MX record checks. - # - # If subdomain equals either 'mx' or 'a' returns that kind of record - # otherwise returns no match. - def getresources(name, typeclass) - stub = name.split('.').first - case stub - when 'mx' - [Resolv::DNS::Resource::IN::MX.new(10, '127.0.0.1')] - when 'a' - [Resolv::DNS::Resource::IN::A.new('127.0.0.1')] - else - [] - end - end -end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index b07dde2..8249dec 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,46 +1,15 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE - def setup - @valid_email = 'valid@example.com' - @invalid_email = 'invalid@example.' - end - def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end - def test_check_valid_mx - pmx = MxRecord.new(:email => 'test@mx.example.com') - save_passes(pmx) - end - - def test_check_invalid_mx - pmx = MxRecord.new(:email => 'test@nomx.example.com') - save_fails(pmx) - end - - def test_check_mx_fallback_to_a - pmx = MxRecord.new(:email => 'test@a.example.com') - save_passes(pmx) - end - def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end - - protected - def save_passes(p) - assert p.valid?, " #{p.email} should pass" - assert p.errors[:email].empty? && !p.errors.include?(:email) - end - - def save_fails(p) - assert !p.valid?, " #{p.email} should fail" - assert_equal 1, p.errors[:email].size - end end
validates-email-format-of/validates_email_format_of
886a216a723828e858bf81d1f3b9abb5c8b8cfd5
moved tests for balancing of quoted characters from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 764b69f..16db34b 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,165 +1,170 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', + # Balanced quoted characters + %!"example\\\\\\""@example.com!, + %!"example\\\\"@example.com! ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', - 'Joe.\\Blow@example.com' + 'Joe.\\Blow@example.com', + # Unbalanced quoted characters + %!"example\\\\""example.com! ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end describe "custom error messages" do describe 'invalid@example.' do let(:options) { { :message => "just because I don't like you" } } it { should have_errors_on_email.because("just because I don't like you") } end end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index e40983e..b07dde2 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,65 +1,46 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end - def test_without_activerecord - assert_valid(@valid_email) - assert_invalid(@invalid_email) - end - - def test_should_required_balanced_quoted_characters - assert_valid(%!"example\\\\\\""@example.com!) - assert_valid(%!"example\\\\"@example.com!) - assert_invalid(%!"example\\\\""example.com!) - end - def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end protected - def assert_valid(email) - assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" - end - - def assert_invalid(email) - assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" - end - def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
7db69d9dfdee1fc160eb36c3848e477cf98eb3e3
removed tests for allow_nil option since it just tests native ActiveModel code, not any logic in this library
diff --git a/test/fixtures/person.rb b/test/fixtures/person.rb index ab207de..0841762 100644 --- a/test/fixtures/person.rb +++ b/test/fixtures/person.rb @@ -1,32 +1,20 @@ require 'validates_email_format_of' module ValidatesEmailFormatOf class Base include ActiveModel::Model attr_accessor :email end end -class Person < ValidatesEmailFormatOf::Base - validates_email_format_of :email, - :on => :create, - :message => 'fails with custom message', - :allow_nil => true -end - -class PersonForbidNil < ValidatesEmailFormatOf::Base - validates_email_format_of :email, - :on => :create, - :allow_nil => false -end class MxRecord < ValidatesEmailFormatOf::Base validates_email_format_of :email, :on => :create, :check_mx => true end class Shorthand < ValidatesEmailFormatOf::Base validates :email, :email_format => { :message => 'fails with shorthand message' }, :length => { :maximum => 1 } end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 53b43d5..e40983e 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,77 +1,65 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end - def test_should_allow_nil - p = create_person(:email => nil) - save_passes(p) - - p = PersonForbidNil.new(:email => nil) - save_fails(p) - end - def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end protected - def create_person(params) - ::Person.new(params) - end - def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
fd082ff3139a6042b9e82374ba494fcc55a6676c
moved test for custom error message from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index b87092b..764b69f 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,158 +1,165 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com' ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end + + describe "custom error messages" do + describe 'invalid@example.' do + let(:options) { { :message => "just because I don't like you" } } + it { should have_errors_on_email.because("just because I don't like you") } + end + end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 03e562a..53b43d5 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,83 +1,77 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end - def test_should_allow_custom_error_message - p = create_person(:email => @invalid_email) - save_fails(p) - assert_equal 'fails with custom message', p.errors[:email].first - end - def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
f7916fd0386d6eaeb6243c8c39809952e552ac53
moved test for whether validation modifies argument string from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 56a9e34..b87092b 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,158 +1,158 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) - @email = email + @email = email.freeze end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else - ValidatesEmailFormatOf::validate_email_format(email, options) + ValidatesEmailFormatOf::validate_email_format(email.freeze, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1', # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 '"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 'Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com' ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index a477e7b..03e562a 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,88 +1,83 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_should_allow_custom_error_message p = create_person(:email => @invalid_email) save_fails(p) assert_equal 'fails with custom message', p.errors[:email].first end def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end - def test_frozen_string - assert_valid(" #{@valid_email} ".freeze) - assert_invalid(" #{@invalid_email} ".freeze) - end - protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
97fcb67be942731dafce9be6d96059777782be5e
moved quoted and excaped character tests from minitiest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 7665465..56a9e34 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,150 +1,158 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', - 'test@192.192.192.1' + 'test@192.192.192.1', + # Allow quoted characters. Valid according to http://www.rfc-editor.org/errata_search.php?rfc=3696 + '"Abc\@def"@example.com', + '"Fred\ Bloggs"@example.com', + '"Joe.\\Blow"@example.com', ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', - 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' + 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email', + # Escaped characters with quotes. From http://tools.ietf.org/html/rfc3696, page 5. Corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 + 'Fred\ Bloggs_@example.com', + 'Abc\@def+@example.com', + 'Joe.\\Blow@example.com' ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe do shared_examples_for :local_length_limit do |limit| describe "#{'a' * limit}@example.com" do it { should_not have_errors_on_email } end describe "#{'a' * (limit + 1)}@example.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :local_length_limit, 64 end describe "when overriding defaults" do let(:options) { { :local_length => 20 } } it_should_behave_like :local_length_limit, 20 end end describe do shared_examples_for :domain_length_limit do |limit| describe "user@#{'a' * (limit - 4)}.com" do it { should_not have_errors_on_email } end describe "user@#{'a' * (limit - 3)}.com" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end describe "when using default" do it_should_behave_like :domain_length_limit, 255 end describe "when overriding defaults" do let(:options) { { :domain_length => 100 } } it_should_behave_like :domain_length_limit, 100 end end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 66bdfa8..a477e7b 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,109 +1,88 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end - # from http://www.rfc-editor.org/errata_search.php?rfc=3696 - def test_should_allow_quoted_characters - ['"Abc\@def"@example.com', - '"Fred\ Bloggs"@example.com', - '"Joe.\\Blow"@example.com', - ].each do |email| - assert_valid(email) - end - end - def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end - # from http://tools.ietf.org/html/rfc3696, page 5 - # corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 - def test_should_not_allow_escaped_characters_without_quotes - ['Fred\ Bloggs_@example.com', - 'Abc\@def+@example.com', - 'Joe.\\Blow@example.com' - ].each do |email| - assert_invalid(email) - end - end - def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_should_allow_custom_error_message p = create_person(:email => @invalid_email) save_fails(p) assert_equal 'fails with custom message', p.errors[:email].first end def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end def test_frozen_string assert_valid(" #{@valid_email} ".freeze) assert_invalid(" #{@invalid_email} ".freeze) end protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
cc8f8f201fc6e0d097acac4723c1db5895746903
moved tests of domain and local length limit--both default and override--from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 7b6a82d..7665465 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,115 +1,150 @@ # -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1' ].each do |address| describe address do it { should_not have_errors_on_email } end end [ 'no_at_symbol', 'invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' ].each do |address| describe address do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end end + + describe do + shared_examples_for :local_length_limit do |limit| + describe "#{'a' * limit}@example.com" do + it { should_not have_errors_on_email } + end + describe "#{'a' * (limit + 1)}@example.com" do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end + end + describe "when using default" do + it_should_behave_like :local_length_limit, 64 + end + describe "when overriding defaults" do + let(:options) { { :local_length => 20 } } + it_should_behave_like :local_length_limit, 20 + end + end + describe do + shared_examples_for :domain_length_limit do |limit| + describe "user@#{'a' * (limit - 4)}.com" do + it { should_not have_errors_on_email } + end + describe "user@#{'a' * (limit - 3)}.com" do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end + end + describe "when using default" do + it_should_behave_like :domain_length_limit, 255 + end + describe "when overriding defaults" do + let(:options) { { :domain_length => 100 } } + it_should_behave_like :domain_length_limit, 100 + end + end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index cb3c582..66bdfa8 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,122 +1,109 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end # from http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_allow_quoted_characters ['"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', ].each do |email| assert_valid(email) end end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end # from http://tools.ietf.org/html/rfc3696, page 5 # corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_not_allow_escaped_characters_without_quotes ['Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com' ].each do |email| assert_invalid(email) end end - def test_should_check_length_limits - ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com', - 'test@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' - ].each do |email| - assert_invalid(email) - end - end - - def test_overriding_length_checks - assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :local_length => 1) - assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :domain_length => 1) - end - def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_should_allow_custom_error_message p = create_person(:email => @invalid_email) save_fails(p) assert_equal 'fails with custom message', p.errors[:email].first end def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end def test_frozen_string assert_valid(" #{@valid_email} ".freeze) assert_invalid(" #{@invalid_email} ".freeze) end protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
760ea2bc596add99729619e1dec625b4a38d97c5
moved array of invalid email addresses from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 1090993..7b6a82d 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,72 +1,115 @@ +# -*- encoding : utf-8 -*- require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } - describe "no_at_symbol" do - it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } - end describe "user1@gmail.com" do it { should_not have_errors_on_email } end [ 'valid@example.com', 'Valid@test.example.com', 'valid+valid123@test.example.com', 'valid_valid123@test.example.com', 'valid-valid+123@test.example.co.uk', 'valid-valid+1.23@test.example.com.au', 'valid@example.co.uk', 'v@example.com', 'valid@example.ca', 'valid_@example.com', 'valid123.456@example.org', 'valid123.456@example.travel', 'valid123.456@example.museum', 'valid@example.mobi', 'valid@example.info', 'valid-@example.com', 'fake@p-t.k12.ok.us', # allow single character domain parts 'valid@mail.x.example.com', 'valid@x.com', 'valid@example.w-dash.sch.uk', # from RFC 3696, page 6 'customer/department=shipping@example.com', '$A12345@example.com', '!def!xyz%abc@example.com', '_somename@example.com', # apostrophes "test'test@example.com", # international domain names 'test@xn--bcher-kva.ch', 'test@example.xn--0zwm56d', 'test@192.192.192.1' ].each do |address| describe address do it { should_not have_errors_on_email } end end + + [ + 'no_at_symbol', + 'invalid@example-com', + # period can not start local part + '.invalid@example.com', + # period can not end local part + 'invalid.@example.com', + # period can not appear twice consecutively in local part + 'invali..d@example.com', + # should not allow underscores in domain names + 'invalid@ex_mple.com', + 'invalid@e..example.com', + 'invalid@p-t..example.com', + 'invalid@example.com.', + 'invalid@example.com_', + 'invalid@example.com-', + 'invalid-example.com', + 'invalid@example.b#r.com', + 'invalid@example.c', + 'invali d@example.com', + # TLD can not be only numeric + 'invalid@example.123', + # unclosed quote + "\"a-17180061943-10618354-1993365053@example.com", + # too many special chars used to cause the regexp to hang + "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", + 'invalidexample.com', + # should not allow special chars after a period in the domain + 'local@sub.)domain.com', + 'local@sub.#domain.com', + # one at a time + "foo@example.com\nexample@gmail.com", + 'invalid@example.', + "\"foo\\\\\"\"@bar.com", + "foo@mail.com\r\nfoo@mail.com", + '@example.com', + 'foo@', + 'foo', + 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' + ].each do |address| + describe address do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end + end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 61d6de1..cb3c582 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,165 +1,122 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end - def test_should_not_allow_invalid_email_addresses - ['invalid@example-com', - # period can not start local part - '.invalid@example.com', - # period can not end local part - 'invalid.@example.com', - # period can not appear twice consecutively in local part - 'invali..d@example.com', - # should not allow underscores in domain names - 'invalid@ex_mple.com', - 'invalid@e..example.com', - 'invalid@p-t..example.com', - 'invalid@example.com.', - 'invalid@example.com_', - 'invalid@example.com-', - 'invalid-example.com', - 'invalid@example.b#r.com', - 'invalid@example.c', - 'invali d@example.com', - # TLD can not be only numeric - 'invalid@example.123', - # unclosed quote - "\"a-17180061943-10618354-1993365053@example.com", - # too many special chars used to cause the regexp to hang - "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", - 'invalidexample.com', - # should not allow special chars after a period in the domain - 'local@sub.)domain.com', - 'local@sub.#domain.com', - # one at a time - "foo@example.com\nexample@gmail.com", - 'invalid@example.', - "\"foo\\\\\"\"@bar.com", - "foo@mail.com\r\nfoo@mail.com", - '@example.com', - 'foo@', - 'foo', - 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' - ].each do |email| - assert_invalid(email) - end - end - # from http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_allow_quoted_characters ['"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', ].each do |email| assert_valid(email) end end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end # from http://tools.ietf.org/html/rfc3696, page 5 # corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_not_allow_escaped_characters_without_quotes ['Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com' ].each do |email| assert_invalid(email) end end def test_should_check_length_limits ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com', 'test@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' ].each do |email| assert_invalid(email) end end def test_overriding_length_checks assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :local_length => 1) assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :domain_length => 1) end def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_should_allow_custom_error_message p = create_person(:email => @invalid_email) save_fails(p) assert_equal 'fails with custom message', p.errors[:email].first end def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end def test_frozen_string assert_valid(" #{@valid_email} ".freeze) assert_invalid(" #{@invalid_email} ".freeze) end protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
382239523c003458f1d90dc1ba28d4d9d6041993
moved array of good email addresses from minitest to rspec
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 15431f5..1090993 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,33 +1,72 @@ require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "no_at_symbol" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end describe "user1@gmail.com" do it { should_not have_errors_on_email } end + + [ + 'valid@example.com', + 'Valid@test.example.com', + 'valid+valid123@test.example.com', + 'valid_valid123@test.example.com', + 'valid-valid+123@test.example.co.uk', + 'valid-valid+1.23@test.example.com.au', + 'valid@example.co.uk', + 'v@example.com', + 'valid@example.ca', + 'valid_@example.com', + 'valid123.456@example.org', + 'valid123.456@example.travel', + 'valid123.456@example.museum', + 'valid@example.mobi', + 'valid@example.info', + 'valid-@example.com', + 'fake@p-t.k12.ok.us', + # allow single character domain parts + 'valid@mail.x.example.com', + 'valid@x.com', + 'valid@example.w-dash.sch.uk', + # from RFC 3696, page 6 + 'customer/department=shipping@example.com', + '$A12345@example.com', + '!def!xyz%abc@example.com', + '_somename@example.com', + # apostrophes + "test'test@example.com", + # international domain names + 'test@xn--bcher-kva.ch', + 'test@example.xn--0zwm56d', + 'test@192.192.192.1' + ].each do |address| + describe address do + it { should_not have_errors_on_email } + end + end end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb index 3f36f27..61d6de1 100644 --- a/test/validates_email_format_of_test.rb +++ b/test/validates_email_format_of_test.rb @@ -1,203 +1,165 @@ # -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/test_helper') class ValidatesEmailFormatOfTest < TEST_CASE def setup @valid_email = 'valid@example.com' @invalid_email = 'invalid@example.' end def test_without_activerecord assert_valid(@valid_email) assert_invalid(@invalid_email) end - def test_should_allow_valid_email_addresses - ['valid@example.com', - 'Valid@test.example.com', - 'valid+valid123@test.example.com', - 'valid_valid123@test.example.com', - 'valid-valid+123@test.example.co.uk', - 'valid-valid+1.23@test.example.com.au', - 'valid@example.co.uk', - 'v@example.com', - 'valid@example.ca', - 'valid_@example.com', - 'valid123.456@example.org', - 'valid123.456@example.travel', - 'valid123.456@example.museum', - 'valid@example.mobi', - 'valid@example.info', - 'valid-@example.com', - 'fake@p-t.k12.ok.us', - # allow single character domain parts - 'valid@mail.x.example.com', - 'valid@x.com', - 'valid@example.w-dash.sch.uk', - # from RFC 3696, page 6 - 'customer/department=shipping@example.com', - '$A12345@example.com', - '!def!xyz%abc@example.com', - '_somename@example.com', - # apostrophes - "test'test@example.com", - # international domain names - 'test@xn--bcher-kva.ch', - 'test@example.xn--0zwm56d', - 'test@192.192.192.1' - ].each do |email| - assert_valid(email) - end - end - def test_should_not_allow_invalid_email_addresses ['invalid@example-com', # period can not start local part '.invalid@example.com', # period can not end local part 'invalid.@example.com', # period can not appear twice consecutively in local part 'invali..d@example.com', # should not allow underscores in domain names 'invalid@ex_mple.com', 'invalid@e..example.com', 'invalid@p-t..example.com', 'invalid@example.com.', 'invalid@example.com_', 'invalid@example.com-', 'invalid-example.com', 'invalid@example.b#r.com', 'invalid@example.c', 'invali d@example.com', # TLD can not be only numeric 'invalid@example.123', # unclosed quote "\"a-17180061943-10618354-1993365053@example.com", # too many special chars used to cause the regexp to hang "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", 'invalidexample.com', # should not allow special chars after a period in the domain 'local@sub.)domain.com', 'local@sub.#domain.com', # one at a time "foo@example.com\nexample@gmail.com", 'invalid@example.', "\"foo\\\\\"\"@bar.com", "foo@mail.com\r\nfoo@mail.com", '@example.com', 'foo@', 'foo', 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' ].each do |email| assert_invalid(email) end end # from http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_allow_quoted_characters ['"Abc\@def"@example.com', '"Fred\ Bloggs"@example.com', '"Joe.\\Blow"@example.com', ].each do |email| assert_valid(email) end end def test_should_required_balanced_quoted_characters assert_valid(%!"example\\\\\\""@example.com!) assert_valid(%!"example\\\\"@example.com!) assert_invalid(%!"example\\\\""example.com!) end # from http://tools.ietf.org/html/rfc3696, page 5 # corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 def test_should_not_allow_escaped_characters_without_quotes ['Fred\ Bloggs_@example.com', 'Abc\@def+@example.com', 'Joe.\\Blow@example.com' ].each do |email| assert_invalid(email) end end def test_should_check_length_limits ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com', 'test@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' ].each do |email| assert_invalid(email) end end def test_overriding_length_checks assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :local_length => 1) assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :domain_length => 1) end def test_validating_with_custom_regexp assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) end def test_should_allow_custom_error_message p = create_person(:email => @invalid_email) save_fails(p) assert_equal 'fails with custom message', p.errors[:email].first end def test_should_allow_nil p = create_person(:email => nil) save_passes(p) p = PersonForbidNil.new(:email => nil) save_fails(p) end def test_check_valid_mx pmx = MxRecord.new(:email => 'test@mx.example.com') save_passes(pmx) end def test_check_invalid_mx pmx = MxRecord.new(:email => 'test@nomx.example.com') save_fails(pmx) end def test_check_mx_fallback_to_a pmx = MxRecord.new(:email => 'test@a.example.com') save_passes(pmx) end def test_shorthand s = Shorthand.new(:email => 'invalid') assert s.invalid? assert_equal 2, s.errors[:email].size assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } end def test_frozen_string assert_valid(" #{@valid_email} ".freeze) assert_invalid(" #{@invalid_email} ".freeze) end protected def create_person(params) ::Person.new(params) end def assert_valid(email) assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" end def assert_invalid(email) assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" end def save_passes(p) assert p.valid?, " #{p.email} should pass" assert p.errors[:email].empty? && !p.errors.include?(:email) end def save_fails(p) assert !p.valid?, " #{p.email} should fail" assert_equal 1, p.errors[:email].size end end
validates-email-format-of/validates_email_format_of
473d625452d5bb29a60c437153281c97a59831dd
removed active_record scope from i18n files (and I don't even know Polish\!)
diff --git a/config/locales/en.yml b/config/locales/en.yml index 0869768..7bcb04e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,12 +1,6 @@ en: - activerecord: - errors: - messages: - invalid_email_address: 'does not appear to be a valid e-mail address' - email_address_not_routable: 'is not routable' - activemodel: errors: messages: invalid_email_address: 'does not appear to be a valid e-mail address' email_address_not_routable: 'is not routable' diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 26c7afc..31b9aa7 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,12 +1,6 @@ pl: - activerecord: - errors: - messages: - invalid_email_address: 'nieprawidłowy adres e-mail' - email_address_not_routable: 'jest nieosiągalny' - activemodel: errors: messages: invalid_email_address: 'nieprawidłowy adres e-mail' email_address_not_routable: 'jest nieosiągalny' diff --git a/lib/validates_email_format_of.rb b/lib/validates_email_format_of.rb index 1c56ba3..1b73eb4 100644 --- a/lib/validates_email_format_of.rb +++ b/lib/validates_email_format_of.rb @@ -1,141 +1,139 @@ # encoding: utf-8 require 'validates_email_format_of/version' module ValidatesEmailFormatOf def self.load_i18n_locales require 'i18n' I18n.load_path += Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml'))) end require 'resolv' - MessageScope = defined?(ActiveModel) ? :activemodel : :activerecord - LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/ def self.validate_email_domain(email) domain = email.match(/\@(.+)/)[1] Resolv::DNS.open do |dns| @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) + dns.getresources(domain, Resolv::DNS::Resource::IN::A) end @mx.size > 0 ? true : false end # Validates whether the specified value is a valid email address. Returns nil if the value is valid, otherwise returns an array # containing one or more validation error messages. # # Configuration options: # * <tt>message</tt> - A custom error message (default is: "does not appear to be valid") # * <tt>check_mx</tt> - Check for MX records (default is false) # * <tt>mx_message</tt> - A custom error message when an MX record validation fails (default is: "is not routable.") # * <tt>with</tt> The regex to use for validating the format of the email address (deprecated) # * <tt>local_length</tt> Maximum number of characters allowed in the local part (default is 64) # * <tt>domain_length</tt> Maximum number of characters allowed in the domain part (default is 255) def self.validate_email_format(email, options={}) - default_options = { :message => I18n.t(:invalid_email_address, :scope => [MessageScope, :errors, :messages], :default => 'does not appear to be valid'), + default_options = { :message => I18n.t(:invalid_email_address, :scope => [:activemodel, :errors, :messages], :default => 'does not appear to be valid'), :check_mx => false, - :mx_message => I18n.t(:email_address_not_routable, :scope => [MessageScope, :errors, :messages], :default => 'is not routable'), + :mx_message => I18n.t(:email_address_not_routable, :scope => [:activemodel, :errors, :messages], :default => 'is not routable'), :domain_length => 255, :local_length => 64 } opts = options.merge(default_options) {|key, old, new| old} # merge the default options into the specified options, retaining all specified options email = email.strip if email begin domain, local = email.reverse.split('@', 2) rescue return [ opts[:message] ] end # need local and domain parts return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty? # check lengths return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length] local.reverse! domain.reverse! if opts.has_key?(:with) # holdover from versions <= 1.4.7 return [ opts[:message] ] unless email =~ opts[:with] else return [ opts[:message] ] unless self.validate_local_part_syntax(local) and self.validate_domain_part_syntax(domain) end if opts[:check_mx] and !self.validate_email_domain(email) return [ opts[:mx_message] ] end return nil # represents no validation errors end def self.validate_local_part_syntax(local) in_quoted_pair = false in_quoted_string = false (0..local.length-1).each do |i| ord = local[i].ord # accept anything if it's got a backslash before it if in_quoted_pair in_quoted_pair = false next end # backslash signifies the start of a quoted pair if ord == 92 and i < local.length - 1 return false if not in_quoted_string # must be in quoted string per http://www.rfc-editor.org/errata_search.php?rfc=3696 in_quoted_pair = true next end # double quote delimits quoted strings if ord == 34 in_quoted_string = !in_quoted_string next end next if local[i,1] =~ /[a-z0-9]/i next if local[i,1] =~ LocalPartSpecialChars # period must be followed by something if ord == 46 return false if i == 0 or i == local.length - 1 # can't be first or last char next unless local[i+1].ord == 46 # can't be followed by a period end return false end return false if in_quoted_string # unbalanced quotes return true end def self.validate_domain_part_syntax(domain) parts = domain.downcase.split('.', -1) return false if parts.length <= 1 # Only one domain part # Empty parts (double period) or invalid chars return false if parts.any? { |part| part.nil? or part.empty? or not part =~ /\A[[:alnum:]\-]+\Z/ or part[0,1] == '-' or part[-1,1] == '-' # hyphen at beginning or end of part } # ipv4 return true if parts.length == 4 and parts.all? { |part| part =~ /\A[0-9]+\Z/ and part.to_i.between?(0, 255) } return false if parts[-1].length < 2 or not parts[-1] =~ /[a-z\-]/ # TLD is too short or does not contain a char or hyphen return true end end require 'validates_email_format_of/active_model' if defined?(::ActiveModel) require 'validates_email_format_of/railtie' if defined?(::Rails)
validates-email-format-of/validates_email_format_of
08ccfc8630422cce8224255192d5fc1465f05981
added more Ruby versions to travis config
diff --git a/.travis.yml b/.travis.yml index 3df8274..4276332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,18 @@ rvm: - 1.8.7 - 1.9.2 - 1.9.3 + - 2.0.0 + - 2.1.2 - jruby - ree gemfile: - Gemfile - gemfiles/active_model_2_1 - gemfiles/active_model_3_0 - gemfiles/active_model_3_1 - gemfiles/active_model_3_2 - gemfiles/active_model_4_0 - gemfiles/active_model_4_1 install: bundle install script: bundle exec rspec
validates-email-format-of/validates_email_format_of
e7dd8780b8728c054b668fab6ecb52eacfb4edcf
added explicit install command to travis
diff --git a/.travis.yml b/.travis.yml index 6ee5336..3df8274 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,16 @@ rvm: - 1.8.7 - 1.9.2 - 1.9.3 - jruby - ree gemfile: - Gemfile - gemfiles/active_model_2_1 - gemfiles/active_model_3_0 - gemfiles/active_model_3_1 - gemfiles/active_model_3_2 - gemfiles/active_model_4_0 - gemfiles/active_model_4_1 +install: bundle install script: bundle exec rspec
validates-email-format-of/validates_email_format_of
1308723e1441b9b29a039550d458aa93357fb5b2
removed require_relative from spec so it can be tested with Ruby 1.8.7
diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb index 63e5373..15431f5 100644 --- a/spec/validates_email_format_of_spec.rb +++ b/spec/validates_email_format_of_spec.rb @@ -1,33 +1,33 @@ -require_relative "spec_helper" +require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper" require "validates_email_format_of" describe ValidatesEmailFormatOf do before(:all) do described_class.load_i18n_locales I18n.enforce_available_locales = false end subject do |example| if defined?(ActiveModel) user = Class.new do def initialize(email) @email = email end attr_reader :email include ActiveModel::Validations validates_email_format_of :email, example.example_group_instance.options end example.example_group_instance.class::User = user user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages else ValidatesEmailFormatOf::validate_email_format(email, options) end end let(:options) { {} } let(:email) { |example| example.example_group.description } describe "no_at_symbol" do it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } end describe "user1@gmail.com" do it { should_not have_errors_on_email } end end
validates-email-format-of/validates_email_format_of
8eb29dc050fcb7faa58253c816ecc5a023935124
explicitly told travis to use rspec
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e948cd3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +pkg +test/debug.log +rdoc +Gemfile.lock +*.gem +*.sqlite3 +*.swp +.ruby-version diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..0912718 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--order random diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6ee5336 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +rvm: + - 1.8.7 + - 1.9.2 + - 1.9.3 + - jruby + - ree +gemfile: + - Gemfile + - gemfiles/active_model_2_1 + - gemfiles/active_model_3_0 + - gemfiles/active_model_3_1 + - gemfiles/active_model_3_2 + - gemfiles/active_model_4_0 + - gemfiles/active_model_4_1 +script: bundle exec rspec diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..c80ee36 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "http://rubygems.org" + +gemspec diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..107bae6 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2006-11 Alex Dunae + +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, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..096c8bf --- /dev/null +++ b/README.rdoc @@ -0,0 +1,93 @@ += validates_email_format_of Gem and Rails Plugin + +Validate e-mail addresses against RFC 2822 and RFC 3696. + +== Installation + +Installing as a gem: + + gem install validates_email_format_of + +Installing as a Ruby on Rails 2 plugin: + + ./script/plugin install http://github.com/alexdunae/validates_email_format_of.git + +Or in your Rails 3 Gemfile + + gem 'validates_email_format_of', :git => 'git://github.com/alexdunae/validates_email_format_of.git' + + +== Usage + + class Person < ActiveRecord::Base + validates_email_format_of :email + end + + # Rails 3 + class Person < ActiveRecord::Base + validates :email, :email_format => {:message => 'is not looking good'} + end + +As of version 1.4, it's possible to run e-mail validation tests (including MX +checks) without using ActiveRecord or even touching a database. The +<tt>validate_email_format</tt> method will return <tt>nil</tt> on a valid +e-mail address or an array of error messages for invalid addresses. + + results = ValidatesEmailFormatOf::validate_email_format(email, options) + + if results.nil? + # success! + else + puts results.join(', ') + end + + +=== Options + + :message + String. A custom error message (default is: "does not appear to be a valid e-mail address") + :on + Symbol. Specifies when this validation is active (default is :save, other options :create, :update) + :allow_nil + Boolean. Allow nil values (default is false) + :allow_blank + Boolean. Allow blank values (default is false) + :check_mx + Boolean. Check domain for a valid MX record (default is false) + :if + Specifies a method, proc or string to call to determine if the validation should occur + (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The method, + proc or string should return or evaluate to a true or false value. + :unless + See :if option. + :local_length + Maximum number of characters allowed in the local part (default is 64) + :domain_length + Maximum number of characters allowed in the domain part (default is 255) + + +== Testing + +To execute the unit tests run <tt>rake test</tt>. + +The unit tests for this plugin use an in-memory sqlite3 database. + +Tested in Ruby 1.8.7, 1.9.2, 1.9.3-rc1, JRuby and REE 1.8.7. + +== Resources + +* https://github.com/alexdunae/validates_email_format_of + +== Credits + +Written by Alex Dunae (dunae.ca), 2006-11. + +Many thanks to the plugin's recent contributors: https://github.com/alexdunae/validates_email_format_of/contributors + +Thanks to Francis Hwang (http://fhwang.net/) at Diversion Media for creating the 1.1 update. + +Thanks to Travis Sinnott for creating the 1.3 update. + +Thanks to Denis Ahearn at Riverock Technologies (http://www.riverocktech.com/) for creating the 1.4 update. + +Thanks to George Anderson (http://github.com/george) and 'history' (http://github.com/history) for creating the 1.4.1 update. diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..0869768 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,12 @@ +en: + activerecord: + errors: + messages: + invalid_email_address: 'does not appear to be a valid e-mail address' + email_address_not_routable: 'is not routable' + + activemodel: + errors: + messages: + invalid_email_address: 'does not appear to be a valid e-mail address' + email_address_not_routable: 'is not routable' diff --git a/config/locales/pl.yml b/config/locales/pl.yml new file mode 100644 index 0000000..26c7afc --- /dev/null +++ b/config/locales/pl.yml @@ -0,0 +1,12 @@ +pl: + activerecord: + errors: + messages: + invalid_email_address: 'nieprawidłowy adres e-mail' + email_address_not_routable: 'jest nieosiągalny' + + activemodel: + errors: + messages: + invalid_email_address: 'nieprawidłowy adres e-mail' + email_address_not_routable: 'jest nieosiągalny' diff --git a/gemfiles/active_model_2_1 b/gemfiles/active_model_2_1 new file mode 100644 index 0000000..736aa95 --- /dev/null +++ b/gemfiles/active_model_2_1 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 2.1.0' diff --git a/gemfiles/active_model_3_0 b/gemfiles/active_model_3_0 new file mode 100644 index 0000000..736aa95 --- /dev/null +++ b/gemfiles/active_model_3_0 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 2.1.0' diff --git a/gemfiles/active_model_3_1 b/gemfiles/active_model_3_1 new file mode 100644 index 0000000..1b9894e --- /dev/null +++ b/gemfiles/active_model_3_1 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 3.1.0' diff --git a/gemfiles/active_model_3_2 b/gemfiles/active_model_3_2 new file mode 100644 index 0000000..e2c9597 --- /dev/null +++ b/gemfiles/active_model_3_2 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 3.2.0' diff --git a/gemfiles/active_model_3_3 b/gemfiles/active_model_3_3 new file mode 100644 index 0000000..bd153a2 --- /dev/null +++ b/gemfiles/active_model_3_3 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'active_model', '= 3.3.0' diff --git a/gemfiles/active_model_4_0 b/gemfiles/active_model_4_0 new file mode 100644 index 0000000..9236dd7 --- /dev/null +++ b/gemfiles/active_model_4_0 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 4.0.0' diff --git a/gemfiles/active_model_4_1 b/gemfiles/active_model_4_1 new file mode 100644 index 0000000..b97fab6 --- /dev/null +++ b/gemfiles/active_model_4_1 @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gemspec + +gem 'activemodel', '= 4.1.0' diff --git a/lib/validates_email_format_of.rb b/lib/validates_email_format_of.rb new file mode 100644 index 0000000..1c56ba3 --- /dev/null +++ b/lib/validates_email_format_of.rb @@ -0,0 +1,141 @@ +# encoding: utf-8 +require 'validates_email_format_of/version' + +module ValidatesEmailFormatOf + def self.load_i18n_locales + require 'i18n' + I18n.load_path += Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml'))) + end + + require 'resolv' + + MessageScope = defined?(ActiveModel) ? :activemodel : :activerecord + + LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/ + + def self.validate_email_domain(email) + domain = email.match(/\@(.+)/)[1] + Resolv::DNS.open do |dns| + @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) + dns.getresources(domain, Resolv::DNS::Resource::IN::A) + end + @mx.size > 0 ? true : false + end + + # Validates whether the specified value is a valid email address. Returns nil if the value is valid, otherwise returns an array + # containing one or more validation error messages. + # + # Configuration options: + # * <tt>message</tt> - A custom error message (default is: "does not appear to be valid") + # * <tt>check_mx</tt> - Check for MX records (default is false) + # * <tt>mx_message</tt> - A custom error message when an MX record validation fails (default is: "is not routable.") + # * <tt>with</tt> The regex to use for validating the format of the email address (deprecated) + # * <tt>local_length</tt> Maximum number of characters allowed in the local part (default is 64) + # * <tt>domain_length</tt> Maximum number of characters allowed in the domain part (default is 255) + def self.validate_email_format(email, options={}) + default_options = { :message => I18n.t(:invalid_email_address, :scope => [MessageScope, :errors, :messages], :default => 'does not appear to be valid'), + :check_mx => false, + :mx_message => I18n.t(:email_address_not_routable, :scope => [MessageScope, :errors, :messages], :default => 'is not routable'), + :domain_length => 255, + :local_length => 64 + } + opts = options.merge(default_options) {|key, old, new| old} # merge the default options into the specified options, retaining all specified options + + email = email.strip if email + + begin + domain, local = email.reverse.split('@', 2) + rescue + return [ opts[:message] ] + end + + # need local and domain parts + return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty? + + # check lengths + return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length] + + local.reverse! + domain.reverse! + + if opts.has_key?(:with) # holdover from versions <= 1.4.7 + return [ opts[:message] ] unless email =~ opts[:with] + else + return [ opts[:message] ] unless self.validate_local_part_syntax(local) and self.validate_domain_part_syntax(domain) + end + + if opts[:check_mx] and !self.validate_email_domain(email) + return [ opts[:mx_message] ] + end + + return nil # represents no validation errors + end + + + def self.validate_local_part_syntax(local) + in_quoted_pair = false + in_quoted_string = false + + (0..local.length-1).each do |i| + ord = local[i].ord + + # accept anything if it's got a backslash before it + if in_quoted_pair + in_quoted_pair = false + next + end + + # backslash signifies the start of a quoted pair + if ord == 92 and i < local.length - 1 + return false if not in_quoted_string # must be in quoted string per http://www.rfc-editor.org/errata_search.php?rfc=3696 + in_quoted_pair = true + next + end + + # double quote delimits quoted strings + if ord == 34 + in_quoted_string = !in_quoted_string + next + end + + next if local[i,1] =~ /[a-z0-9]/i + next if local[i,1] =~ LocalPartSpecialChars + + # period must be followed by something + if ord == 46 + return false if i == 0 or i == local.length - 1 # can't be first or last char + next unless local[i+1].ord == 46 # can't be followed by a period + end + + return false + end + + return false if in_quoted_string # unbalanced quotes + + return true + end + + def self.validate_domain_part_syntax(domain) + parts = domain.downcase.split('.', -1) + + return false if parts.length <= 1 # Only one domain part + + # Empty parts (double period) or invalid chars + return false if parts.any? { + |part| + part.nil? or + part.empty? or + not part =~ /\A[[:alnum:]\-]+\Z/ or + part[0,1] == '-' or part[-1,1] == '-' # hyphen at beginning or end of part + } + + # ipv4 + return true if parts.length == 4 and parts.all? { |part| part =~ /\A[0-9]+\Z/ and part.to_i.between?(0, 255) } + + return false if parts[-1].length < 2 or not parts[-1] =~ /[a-z\-]/ # TLD is too short or does not contain a char or hyphen + + return true + end +end + +require 'validates_email_format_of/active_model' if defined?(::ActiveModel) +require 'validates_email_format_of/railtie' if defined?(::Rails) diff --git a/lib/validates_email_format_of/active_model.rb b/lib/validates_email_format_of/active_model.rb new file mode 100644 index 0000000..bf834fc --- /dev/null +++ b/lib/validates_email_format_of/active_model.rb @@ -0,0 +1,19 @@ +require 'validates_email_format_of' + +module ActiveModel + module Validations + class EmailFormatValidator < EachValidator + def validate_each(record, attribute, value) + (ValidatesEmailFormatOf::validate_email_format(value, options) || []).each do |error| + record.errors.add(attribute, error) + end + end + end + + module HelperMethods + def validates_email_format_of(*attr_names) + validates_with EmailFormatValidator, _merge_attributes(attr_names) + end + end + end +end diff --git a/lib/validates_email_format_of/railtie.rb b/lib/validates_email_format_of/railtie.rb new file mode 100644 index 0000000..6937342 --- /dev/null +++ b/lib/validates_email_format_of/railtie.rb @@ -0,0 +1,7 @@ +module ValidatesEmailFormatOf + class Railtie < Rails::Railtie + initializer 'validates_email_format_of.load_i18n_locales' do |app| + ValidatesEmailFormatOf::load_i18n_locales + end + end +end diff --git a/lib/validates_email_format_of/version.rb b/lib/validates_email_format_of/version.rb new file mode 100644 index 0000000..f88aff5 --- /dev/null +++ b/lib/validates_email_format_of/version.rb @@ -0,0 +1,3 @@ +module ValidatesEmailFormatOf + VERSION = '4.0.0' +end diff --git a/rakefile.rb b/rakefile.rb new file mode 100644 index 0000000..f0fb986 --- /dev/null +++ b/rakefile.rb @@ -0,0 +1,29 @@ +require 'bundler' +Bundler::GemHelper.install_tasks + +require 'rake/testtask' +require 'rdoc/task' + +desc 'Default: run unit tests.' +task :default => [:clean_log, :test] + +desc 'Remove the old log file' +task :clean_log do + "rm -f #{File.dirname(__FILE__)}/test/debug.log" if File.exists?(File.dirname(__FILE__) + '/test/debug.log') +end + +desc 'Test the validates_email_format_of plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.pattern = FileList['test/**/*_test.rb'] + t.verbose = true +end + +desc 'Generate documentation for the validates_email_format_of plugin and gem.' +RDoc::Task.new do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'validates_email_format_of plugin and gem' + rdoc.options << '--line-numbers --inline-source' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..f37dab1 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,22 @@ +require 'active_model' if Gem.loaded_specs.keys.include?('activemodel') + +RSpec::Matchers.define :have_errors_on_email do + match do |actual| + expect(actual).not_to be_nil, "#{actual} should not be nil" + expect(actual).not_to be_empty, "#{actual} should not be empty" + expect(actual.size).to eq(@reasons.size), "#{actual} should have #{@reasons.size} elements" + @reasons.each do |reason| + reason = "#{"Email " if defined?(ActiveModel)}#{reason}" + expect(actual).to include(reason), "#{actual} should contain #{reason}" + end + end + chain :because do |reason| + (@reasons ||= []) << reason + end + chain :and_because do |reason| + (@reasons ||= []) << reason + end + match_when_negated do |actual| + expect(actual).to (defined?(ActiveModel) ? be_empty : be_nil) + end +end diff --git a/spec/validates_email_format_of_spec.rb b/spec/validates_email_format_of_spec.rb new file mode 100644 index 0000000..63e5373 --- /dev/null +++ b/spec/validates_email_format_of_spec.rb @@ -0,0 +1,33 @@ +require_relative "spec_helper" +require "validates_email_format_of" + +describe ValidatesEmailFormatOf do + before(:all) do + described_class.load_i18n_locales + I18n.enforce_available_locales = false + end + subject do |example| + if defined?(ActiveModel) + user = Class.new do + def initialize(email) + @email = email + end + attr_reader :email + include ActiveModel::Validations + validates_email_format_of :email, example.example_group_instance.options + end + example.example_group_instance.class::User = user + user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages + else + ValidatesEmailFormatOf::validate_email_format(email, options) + end + end + let(:options) { {} } + let(:email) { |example| example.example_group.description } + describe "no_at_symbol" do + it { should have_errors_on_email.because("does not appear to be a valid e-mail address") } + end + describe "user1@gmail.com" do + it { should_not have_errors_on_email } + end +end diff --git a/test/fixtures/person.rb b/test/fixtures/person.rb new file mode 100644 index 0000000..ab207de --- /dev/null +++ b/test/fixtures/person.rb @@ -0,0 +1,32 @@ +require 'validates_email_format_of' + +module ValidatesEmailFormatOf + class Base + include ActiveModel::Model + attr_accessor :email + end +end + +class Person < ValidatesEmailFormatOf::Base + validates_email_format_of :email, + :on => :create, + :message => 'fails with custom message', + :allow_nil => true +end + +class PersonForbidNil < ValidatesEmailFormatOf::Base + validates_email_format_of :email, + :on => :create, + :allow_nil => false +end + +class MxRecord < ValidatesEmailFormatOf::Base + validates_email_format_of :email, + :on => :create, + :check_mx => true +end + +class Shorthand < ValidatesEmailFormatOf::Base + validates :email, :email_format => { :message => 'fails with shorthand message' }, + :length => { :maximum => 1 } +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..9865e3c --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,34 @@ +$:.unshift(File.dirname(__FILE__)) +$:.unshift(File.dirname(__FILE__) + '/../lib') + +require 'bundler/setup' +require 'minitest/autorun' + +require 'active_model' +require "validates_email_format_of" + +if ActiveSupport.const_defined?(:TestCase) + TEST_CASE = ActiveSupport::TestCase +else + TEST_CASE = Test::Unit::TestCase +end + +Dir.glob("#{File.dirname(__FILE__)}/fixtures/*.rb") { |f| require f } + +class Resolv::DNS + # Stub for MX record checks. + # + # If subdomain equals either 'mx' or 'a' returns that kind of record + # otherwise returns no match. + def getresources(name, typeclass) + stub = name.split('.').first + case stub + when 'mx' + [Resolv::DNS::Resource::IN::MX.new(10, '127.0.0.1')] + when 'a' + [Resolv::DNS::Resource::IN::A.new('127.0.0.1')] + else + [] + end + end +end diff --git a/test/validates_email_format_of_test.rb b/test/validates_email_format_of_test.rb new file mode 100644 index 0000000..3f36f27 --- /dev/null +++ b/test/validates_email_format_of_test.rb @@ -0,0 +1,203 @@ +# -*- encoding : utf-8 -*- +require File.expand_path(File.dirname(__FILE__) + '/test_helper') + +class ValidatesEmailFormatOfTest < TEST_CASE + def setup + @valid_email = 'valid@example.com' + @invalid_email = 'invalid@example.' + end + + def test_without_activerecord + assert_valid(@valid_email) + assert_invalid(@invalid_email) + end + + def test_should_allow_valid_email_addresses + ['valid@example.com', + 'Valid@test.example.com', + 'valid+valid123@test.example.com', + 'valid_valid123@test.example.com', + 'valid-valid+123@test.example.co.uk', + 'valid-valid+1.23@test.example.com.au', + 'valid@example.co.uk', + 'v@example.com', + 'valid@example.ca', + 'valid_@example.com', + 'valid123.456@example.org', + 'valid123.456@example.travel', + 'valid123.456@example.museum', + 'valid@example.mobi', + 'valid@example.info', + 'valid-@example.com', + 'fake@p-t.k12.ok.us', + # allow single character domain parts + 'valid@mail.x.example.com', + 'valid@x.com', + 'valid@example.w-dash.sch.uk', + # from RFC 3696, page 6 + 'customer/department=shipping@example.com', + '$A12345@example.com', + '!def!xyz%abc@example.com', + '_somename@example.com', + # apostrophes + "test'test@example.com", + # international domain names + 'test@xn--bcher-kva.ch', + 'test@example.xn--0zwm56d', + 'test@192.192.192.1' + ].each do |email| + assert_valid(email) + end + end + + def test_should_not_allow_invalid_email_addresses + ['invalid@example-com', + # period can not start local part + '.invalid@example.com', + # period can not end local part + 'invalid.@example.com', + # period can not appear twice consecutively in local part + 'invali..d@example.com', + # should not allow underscores in domain names + 'invalid@ex_mple.com', + 'invalid@e..example.com', + 'invalid@p-t..example.com', + 'invalid@example.com.', + 'invalid@example.com_', + 'invalid@example.com-', + 'invalid-example.com', + 'invalid@example.b#r.com', + 'invalid@example.c', + 'invali d@example.com', + # TLD can not be only numeric + 'invalid@example.123', + # unclosed quote + "\"a-17180061943-10618354-1993365053@example.com", + # too many special chars used to cause the regexp to hang + "-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@foo", + 'invalidexample.com', + # should not allow special chars after a period in the domain + 'local@sub.)domain.com', + 'local@sub.#domain.com', + # one at a time + "foo@example.com\nexample@gmail.com", + 'invalid@example.', + "\"foo\\\\\"\"@bar.com", + "foo@mail.com\r\nfoo@mail.com", + '@example.com', + 'foo@', + 'foo', + 'Iñtërnâtiônàlizætiøn@hasnt.happened.to.email' + ].each do |email| + assert_invalid(email) + end + end + + # from http://www.rfc-editor.org/errata_search.php?rfc=3696 + def test_should_allow_quoted_characters + ['"Abc\@def"@example.com', + '"Fred\ Bloggs"@example.com', + '"Joe.\\Blow"@example.com', + ].each do |email| + assert_valid(email) + end + end + + def test_should_required_balanced_quoted_characters + assert_valid(%!"example\\\\\\""@example.com!) + assert_valid(%!"example\\\\"@example.com!) + assert_invalid(%!"example\\\\""example.com!) + end + + # from http://tools.ietf.org/html/rfc3696, page 5 + # corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696 + def test_should_not_allow_escaped_characters_without_quotes + ['Fred\ Bloggs_@example.com', + 'Abc\@def+@example.com', + 'Joe.\\Blow@example.com' + ].each do |email| + assert_invalid(email) + end + end + + def test_should_check_length_limits + ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com', + 'test@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' + ].each do |email| + assert_invalid(email) + end + end + + def test_overriding_length_checks + assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :local_length => 1) + assert_not_nil ValidatesEmailFormatOf::validate_email_format('valid@example.com', :domain_length => 1) + end + + def test_validating_with_custom_regexp + assert_nil ValidatesEmailFormatOf::validate_email_format('012345@789', :with => /[0-9]+\@[0-9]+/) + end + + def test_should_allow_custom_error_message + p = create_person(:email => @invalid_email) + save_fails(p) + assert_equal 'fails with custom message', p.errors[:email].first + end + + def test_should_allow_nil + p = create_person(:email => nil) + save_passes(p) + + p = PersonForbidNil.new(:email => nil) + save_fails(p) + end + + def test_check_valid_mx + pmx = MxRecord.new(:email => 'test@mx.example.com') + save_passes(pmx) + end + + def test_check_invalid_mx + pmx = MxRecord.new(:email => 'test@nomx.example.com') + save_fails(pmx) + end + + def test_check_mx_fallback_to_a + pmx = MxRecord.new(:email => 'test@a.example.com') + save_passes(pmx) + end + + def test_shorthand + s = Shorthand.new(:email => 'invalid') + assert s.invalid? + assert_equal 2, s.errors[:email].size + assert s.errors[:email].any? { |err| err =~ /fails with shorthand message/ } + end + + def test_frozen_string + assert_valid(" #{@valid_email} ".freeze) + assert_invalid(" #{@invalid_email} ".freeze) + end + + protected + def create_person(params) + ::Person.new(params) + end + + def assert_valid(email) + assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid" + end + + def assert_invalid(email) + assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid" + end + + def save_passes(p) + assert p.valid?, " #{p.email} should pass" + assert p.errors[:email].empty? && !p.errors.include?(:email) + end + + def save_fails(p) + assert !p.valid?, " #{p.email} should fail" + assert_equal 1, p.errors[:email].size + end +end diff --git a/validates_email_format_of.gemspec b/validates_email_format_of.gemspec new file mode 100644 index 0000000..248f355 --- /dev/null +++ b/validates_email_format_of.gemspec @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +$:.unshift File.expand_path('../lib', __FILE__) +require 'validates_email_format_of/version' + +spec = Gem::Specification.new do |s| + s.name = 'validates_email_format_of' + s.version = ValidatesEmailFormatOf::VERSION + s.summary = 'Validate e-mail addresses against RFC 2822 and RFC 3696.' + s.description = s.summary + s.authors = ['Alex Dunae', 'Isaac Betesh'] + s.email = ['code@dunae.ca', 'iybetesh@gmail.com'] + s.homepage = 'https://github.com/validates-email-format-of/validates_email_format_of' + s.license = 'MIT' + s.test_files = s.files.grep(%r{^test/}) + s.files = `git ls-files`.split($/) + s.require_paths = ['lib'] + + s.add_dependency 'i18n' + s.add_development_dependency 'bundler' + s.add_development_dependency 'rspec' +end
otherdave/othervim
9b5ac9d77deb3a8b9fb561738dccc1ec0927628c
Use my new default directory
diff --git a/vimrc b/vimrc index 8cf1e56..5762aef 100755 --- a/vimrc +++ b/vimrc @@ -1,495 +1,495 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: David Stahl " http://otherdave.com - otherdave@gmail.com " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc if MySys() == "mac" - map <leader>e :e! ~/dev/othervim/vimrc<cr> + map <leader>e :e! ~/dev/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source ~/dev/othervim/vimrc elseif MySys() == "windows" map <leader>e :e! c:/dev/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc elseif MySys() == "linux" map <leader>e :e! ~/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source ~/othervim.git/vimrc endif imap jk <Esc> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case (smartcase) " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= " Always have line numbers set nu """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set t_Co=256 set background=dark colorscheme solarized else set background=dark colorscheme desert endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
9cb8f7c19da83697ca2a7cac41ca2ed0807300bb
removing plugins I dont use
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim deleted file mode 100755 index 6411b1d..0000000 --- a/plugin/NERD_tree.vim +++ /dev/null @@ -1,4059 +0,0 @@ -" ============================================================================ -" File: NERD_tree.vim -" Description: vim global plugin that provides a nice tree explorer -" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com> -" Last Change: 1 December, 2009 -" License: This program is free software. It comes without any warranty, -" to the extent permitted by applicable law. You can redistribute -" it and/or modify it under the terms of the Do What The Fuck You -" Want To Public License, Version 2, as published by Sam Hocevar. -" See http://sam.zoy.org/wtfpl/COPYING for more details. -" -" ============================================================================ -let s:NERD_tree_version = '4.1.0' - -" SECTION: Script init stuff {{{1 -"============================================================ -if exists("loaded_nerd_tree") - finish -endif -if v:version < 700 - echoerr "NERDTree: this plugin requires vim >= 7. DOWNLOAD IT! You'll thank me later!" - finish -endif -let loaded_nerd_tree = 1 - -"for line continuation - i.e dont want C in &cpo -let s:old_cpo = &cpo -set cpo&vim - -"Function: s:initVariable() function {{{2 -"This function is used to initialise a given variable to a given value. The -"variable is only initialised if it does not exist prior -" -"Args: -"var: the name of the var to be initialised -"value: the value to initialise var to -" -"Returns: -"1 if the var is set, 0 otherwise -function! s:initVariable(var, value) - if !exists(a:var) - exec 'let ' . a:var . ' = ' . "'" . a:value . "'" - return 1 - endif - return 0 -endfunction - -"SECTION: Init variable calls and other random constants {{{2 -call s:initVariable("g:NERDChristmasTree", 1) -call s:initVariable("g:NERDTreeAutoCenter", 1) -call s:initVariable("g:NERDTreeAutoCenterThreshold", 3) -call s:initVariable("g:NERDTreeCaseSensitiveSort", 0) -call s:initVariable("g:NERDTreeChDirMode", 0) -if !exists("g:NERDTreeIgnore") - let g:NERDTreeIgnore = ['\~$'] -endif -call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks') -call s:initVariable("g:NERDTreeHighlightCursorline", 1) -call s:initVariable("g:NERDTreeHijackNetrw", 1) -call s:initVariable("g:NERDTreeMouseMode", 1) -call s:initVariable("g:NERDTreeNotificationThreshold", 100) -call s:initVariable("g:NERDTreeQuitOnOpen", 0) -call s:initVariable("g:NERDTreeShowBookmarks", 0) -call s:initVariable("g:NERDTreeShowFiles", 1) -call s:initVariable("g:NERDTreeShowHidden", 0) -call s:initVariable("g:NERDTreeShowLineNumbers", 0) -call s:initVariable("g:NERDTreeSortDirs", 1) - -if !exists("g:NERDTreeSortOrder") - let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$'] -else - "if there isnt a * in the sort sequence then add one - if count(g:NERDTreeSortOrder, '*') < 1 - call add(g:NERDTreeSortOrder, '*') - endif -endif - -"we need to use this number many times for sorting... so we calculate it only -"once here -let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*') - -if !exists('g:NERDTreeStatusline') - - "the exists() crap here is a hack to stop vim spazzing out when - "loading a session that was created with an open nerd tree. It spazzes - "because it doesnt store b:NERDTreeRoot (its a b: var, and its a hash) - let g:NERDTreeStatusline = "%{exists('b:NERDTreeRoot')?b:NERDTreeRoot.path.str():''}" - -endif -call s:initVariable("g:NERDTreeWinPos", "left") -call s:initVariable("g:NERDTreeWinSize", 31) - -let s:running_windows = has("win16") || has("win32") || has("win64") - -"init the shell commands that will be used to copy nodes, and remove dir trees -" -"Note: the space after the command is important -if s:running_windows - call s:initVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ') -else - call s:initVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ') - call s:initVariable("g:NERDTreeCopyCmd", 'cp -r ') -endif - - -"SECTION: Init variable calls for key mappings {{{2 -call s:initVariable("g:NERDTreeMapActivateNode", "o") -call s:initVariable("g:NERDTreeMapChangeRoot", "C") -call s:initVariable("g:NERDTreeMapChdir", "cd") -call s:initVariable("g:NERDTreeMapCloseChildren", "X") -call s:initVariable("g:NERDTreeMapCloseDir", "x") -call s:initVariable("g:NERDTreeMapDeleteBookmark", "D") -call s:initVariable("g:NERDTreeMapMenu", "m") -call s:initVariable("g:NERDTreeMapHelp", "?") -call s:initVariable("g:NERDTreeMapJumpFirstChild", "K") -call s:initVariable("g:NERDTreeMapJumpLastChild", "J") -call s:initVariable("g:NERDTreeMapJumpNextSibling", "<C-j>") -call s:initVariable("g:NERDTreeMapJumpParent", "p") -call s:initVariable("g:NERDTreeMapJumpPrevSibling", "<C-k>") -call s:initVariable("g:NERDTreeMapJumpRoot", "P") -call s:initVariable("g:NERDTreeMapOpenExpl", "e") -call s:initVariable("g:NERDTreeMapOpenInTab", "t") -call s:initVariable("g:NERDTreeMapOpenInTabSilent", "T") -call s:initVariable("g:NERDTreeMapOpenRecursively", "O") -call s:initVariable("g:NERDTreeMapOpenSplit", "i") -call s:initVariable("g:NERDTreeMapOpenVSplit", "s") -call s:initVariable("g:NERDTreeMapPreview", "g" . NERDTreeMapActivateNode) -call s:initVariable("g:NERDTreeMapPreviewSplit", "g" . NERDTreeMapOpenSplit) -call s:initVariable("g:NERDTreeMapPreviewVSplit", "g" . NERDTreeMapOpenVSplit) -call s:initVariable("g:NERDTreeMapQuit", "q") -call s:initVariable("g:NERDTreeMapRefresh", "r") -call s:initVariable("g:NERDTreeMapRefreshRoot", "R") -call s:initVariable("g:NERDTreeMapToggleBookmarks", "B") -call s:initVariable("g:NERDTreeMapToggleFiles", "F") -call s:initVariable("g:NERDTreeMapToggleFilters", "f") -call s:initVariable("g:NERDTreeMapToggleHidden", "I") -call s:initVariable("g:NERDTreeMapToggleZoom", "A") -call s:initVariable("g:NERDTreeMapUpdir", "u") -call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U") - -"SECTION: Script level variable declaration{{{2 -if s:running_windows - let s:escape_chars = " `\|\"#%&,?()\*^<>" -else - let s:escape_chars = " \\`\|\"#%&,?()\*^<>" -endif -let s:NERDTreeBufName = 'NERD_tree_' - -let s:tree_wid = 2 -let s:tree_markup_reg = '^[ `|]*[\-+~]' -let s:tree_up_dir_line = '.. (up a dir)' - -"the number to add to the nerd tree buffer name to make the buf name unique -let s:next_buffer_number = 1 - -" SECTION: Commands {{{1 -"============================================================ -"init the command that users start the nerd tree with -command! -n=? -complete=dir -bar NERDTree :call s:initNerdTree('<args>') -command! -n=? -complete=dir -bar NERDTreeToggle :call s:toggle('<args>') -command! -n=0 -bar NERDTreeClose :call s:closeTreeIfOpen() -command! -n=1 -complete=customlist,s:completeBookmarks -bar NERDTreeFromBookmark call s:initNerdTree('<args>') -command! -n=0 -bar NERDTreeMirror call s:initNerdTreeMirror() -command! -n=0 -bar NERDTreeFind call s:findAndRevealPath() -" SECTION: Auto commands {{{1 -"============================================================ -augroup NERDTree - "Save the cursor position whenever we close the nerd tree - exec "autocmd BufWinLeave ". s:NERDTreeBufName ."* call <SID>saveScreenState()" - "cache bookmarks when vim loads - autocmd VimEnter * call s:Bookmark.CacheBookmarks(0) - - "load all nerdtree plugins after vim starts - autocmd VimEnter * runtime! nerdtree_plugin/**/*.vim -augroup END - -if g:NERDTreeHijackNetrw - augroup NERDTreeHijackNetrw - autocmd VimEnter * silent! autocmd! FileExplorer - au BufEnter,VimEnter * call s:checkForBrowse(expand("<amatch>")) - augroup END -endif - -"SECTION: Classes {{{1 -"============================================================ -"CLASS: Bookmark {{{2 -"============================================================ -let s:Bookmark = {} -" FUNCTION: Bookmark.activate() {{{3 -function! s:Bookmark.activate() - if self.path.isDirectory - call self.toRoot() - else - if self.validate() - let n = s:TreeFileNode.New(self.path) - call n.open() - endif - endif -endfunction -" FUNCTION: Bookmark.AddBookmark(name, path) {{{3 -" Class method to add a new bookmark to the list, if a previous bookmark exists -" with the same name, just update the path for that bookmark -function! s:Bookmark.AddBookmark(name, path) - for i in s:Bookmark.Bookmarks() - if i.name ==# a:name - let i.path = a:path - return - endif - endfor - call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path)) - call s:Bookmark.Sort() -endfunction -" Function: Bookmark.Bookmarks() {{{3 -" Class method to get all bookmarks. Lazily initializes the bookmarks global -" variable -function! s:Bookmark.Bookmarks() - if !exists("g:NERDTreeBookmarks") - let g:NERDTreeBookmarks = [] - endif - return g:NERDTreeBookmarks -endfunction -" Function: Bookmark.BookmarkExistsFor(name) {{{3 -" class method that returns 1 if a bookmark with the given name is found, 0 -" otherwise -function! s:Bookmark.BookmarkExistsFor(name) - try - call s:Bookmark.BookmarkFor(a:name) - return 1 - catch /^NERDTree.BookmarkNotFoundError/ - return 0 - endtry -endfunction -" Function: Bookmark.BookmarkFor(name) {{{3 -" Class method to get the bookmark that has the given name. {} is return if no -" bookmark is found -function! s:Bookmark.BookmarkFor(name) - for i in s:Bookmark.Bookmarks() - if i.name ==# a:name - return i - endif - endfor - throw "NERDTree.BookmarkNotFoundError: no bookmark found for name: \"". a:name .'"' -endfunction -" Function: Bookmark.BookmarkNames() {{{3 -" Class method to return an array of all bookmark names -function! s:Bookmark.BookmarkNames() - let names = [] - for i in s:Bookmark.Bookmarks() - call add(names, i.name) - endfor - return names -endfunction -" FUNCTION: Bookmark.CacheBookmarks(silent) {{{3 -" Class method to read all bookmarks from the bookmarks file intialize -" bookmark objects for each one. -" -" Args: -" silent - dont echo an error msg if invalid bookmarks are found -function! s:Bookmark.CacheBookmarks(silent) - if filereadable(g:NERDTreeBookmarksFile) - let g:NERDTreeBookmarks = [] - let g:NERDTreeInvalidBookmarks = [] - let bookmarkStrings = readfile(g:NERDTreeBookmarksFile) - let invalidBookmarksFound = 0 - for i in bookmarkStrings - - "ignore blank lines - if i != '' - - let name = substitute(i, '^\(.\{-}\) .*$', '\1', '') - let path = substitute(i, '^.\{-} \(.*\)$', '\1', '') - - try - let bookmark = s:Bookmark.New(name, s:Path.New(path)) - call add(g:NERDTreeBookmarks, bookmark) - catch /^NERDTree.InvalidArgumentsError/ - call add(g:NERDTreeInvalidBookmarks, i) - let invalidBookmarksFound += 1 - endtry - endif - endfor - if invalidBookmarksFound - call s:Bookmark.Write() - if !a:silent - call s:echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.") - endif - endif - call s:Bookmark.Sort() - endif -endfunction -" FUNCTION: Bookmark.compareTo(otherbookmark) {{{3 -" Compare these two bookmarks for sorting purposes -function! s:Bookmark.compareTo(otherbookmark) - return a:otherbookmark.name < self.name -endfunction -" FUNCTION: Bookmark.ClearAll() {{{3 -" Class method to delete all bookmarks. -function! s:Bookmark.ClearAll() - for i in s:Bookmark.Bookmarks() - call i.delete() - endfor - call s:Bookmark.Write() -endfunction -" FUNCTION: Bookmark.delete() {{{3 -" Delete this bookmark. If the node for this bookmark is under the current -" root, then recache bookmarks for its Path object -function! s:Bookmark.delete() - let node = {} - try - let node = self.getNode(1) - catch /^NERDTree.BookmarkedNodeNotFoundError/ - endtry - call remove(s:Bookmark.Bookmarks(), index(s:Bookmark.Bookmarks(), self)) - if !empty(node) - call node.path.cacheDisplayString() - endif - call s:Bookmark.Write() -endfunction -" FUNCTION: Bookmark.getNode(searchFromAbsoluteRoot) {{{3 -" Gets the treenode for this bookmark -" -" Args: -" searchFromAbsoluteRoot: specifies whether we should search from the current -" tree root, or the highest cached node -function! s:Bookmark.getNode(searchFromAbsoluteRoot) - let searchRoot = a:searchFromAbsoluteRoot ? s:TreeDirNode.AbsoluteTreeRoot() : b:NERDTreeRoot - let targetNode = searchRoot.findNode(self.path) - if empty(targetNode) - throw "NERDTree.BookmarkedNodeNotFoundError: no node was found for bookmark: " . self.name - endif - return targetNode -endfunction -" FUNCTION: Bookmark.GetNodeForName(name, searchFromAbsoluteRoot) {{{3 -" Class method that finds the bookmark with the given name and returns the -" treenode for it. -function! s:Bookmark.GetNodeForName(name, searchFromAbsoluteRoot) - let bookmark = s:Bookmark.BookmarkFor(a:name) - return bookmark.getNode(a:searchFromAbsoluteRoot) -endfunction -" FUNCTION: Bookmark.GetSelected() {{{3 -" returns the Bookmark the cursor is over, or {} -function! s:Bookmark.GetSelected() - let line = getline(".") - let name = substitute(line, '^>\(.\{-}\) .\+$', '\1', '') - if name != line - try - return s:Bookmark.BookmarkFor(name) - catch /^NERDTree.BookmarkNotFoundError/ - return {} - endtry - endif - return {} -endfunction - -" Function: Bookmark.InvalidBookmarks() {{{3 -" Class method to get all invalid bookmark strings read from the bookmarks -" file -function! s:Bookmark.InvalidBookmarks() - if !exists("g:NERDTreeInvalidBookmarks") - let g:NERDTreeInvalidBookmarks = [] - endif - return g:NERDTreeInvalidBookmarks -endfunction -" FUNCTION: Bookmark.mustExist() {{{3 -function! s:Bookmark.mustExist() - if !self.path.exists() - call s:Bookmark.CacheBookmarks(1) - throw "NERDTree.BookmarkPointsToInvalidLocationError: the bookmark \"". - \ self.name ."\" points to a non existing location: \"". self.path.str() - endif -endfunction -" FUNCTION: Bookmark.New(name, path) {{{3 -" Create a new bookmark object with the given name and path object -function! s:Bookmark.New(name, path) - if a:name =~ ' ' - throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name - endif - - let newBookmark = copy(self) - let newBookmark.name = a:name - let newBookmark.path = a:path - return newBookmark -endfunction -" FUNCTION: Bookmark.openInNewTab(options) {{{3 -" Create a new bookmark object with the given name and path object -function! s:Bookmark.openInNewTab(options) - let currentTab = tabpagenr() - if self.path.isDirectory - tabnew - call s:initNerdTree(self.name) - else - exec "tabedit " . bookmark.path.str({'format': 'Edit'}) - endif - - if has_key(a:options, 'stayInCurrentTab') - exec "tabnext " . currentTab - endif -endfunction -" Function: Bookmark.setPath(path) {{{3 -" makes this bookmark point to the given path -function! s:Bookmark.setPath(path) - let self.path = a:path -endfunction -" Function: Bookmark.Sort() {{{3 -" Class method that sorts all bookmarks -function! s:Bookmark.Sort() - let CompareFunc = function("s:compareBookmarks") - call sort(s:Bookmark.Bookmarks(), CompareFunc) -endfunction -" Function: Bookmark.str() {{{3 -" Get the string that should be rendered in the view for this bookmark -function! s:Bookmark.str() - let pathStrMaxLen = winwidth(s:getTreeWinNum()) - 4 - len(self.name) - if &nu - let pathStrMaxLen = pathStrMaxLen - &numberwidth - endif - - let pathStr = self.path.str({'format': 'UI'}) - if len(pathStr) > pathStrMaxLen - let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen) - endif - return '>' . self.name . ' ' . pathStr -endfunction -" FUNCTION: Bookmark.toRoot() {{{3 -" Make the node for this bookmark the new tree root -function! s:Bookmark.toRoot() - if self.validate() - try - let targetNode = self.getNode(1) - catch /^NERDTree.BookmarkedNodeNotFoundError/ - let targetNode = s:TreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path) - endtry - call targetNode.makeRoot() - call s:renderView() - call targetNode.putCursorHere(0, 0) - endif -endfunction -" FUNCTION: Bookmark.ToRoot(name) {{{3 -" Make the node for this bookmark the new tree root -function! s:Bookmark.ToRoot(name) - let bookmark = s:Bookmark.BookmarkFor(a:name) - call bookmark.toRoot() -endfunction - - -"FUNCTION: Bookmark.validate() {{{3 -function! s:Bookmark.validate() - if self.path.exists() - return 1 - else - call s:Bookmark.CacheBookmarks(1) - call s:renderView() - call s:echo(self.name . "now points to an invalid location. See :help NERDTreeInvalidBookmarks for info.") - return 0 - endif -endfunction - -" Function: Bookmark.Write() {{{3 -" Class method to write all bookmarks to the bookmarks file -function! s:Bookmark.Write() - let bookmarkStrings = [] - for i in s:Bookmark.Bookmarks() - call add(bookmarkStrings, i.name . ' ' . i.path.str()) - endfor - - "add a blank line before the invalid ones - call add(bookmarkStrings, "") - - for j in s:Bookmark.InvalidBookmarks() - call add(bookmarkStrings, j) - endfor - call writefile(bookmarkStrings, g:NERDTreeBookmarksFile) -endfunction -"CLASS: KeyMap {{{2 -"============================================================ -let s:KeyMap = {} -"FUNCTION: KeyMap.All() {{{3 -function! s:KeyMap.All() - if !exists("s:keyMaps") - let s:keyMaps = [] - endif - return s:keyMaps -endfunction - -"FUNCTION: KeyMap.BindAll() {{{3 -function! s:KeyMap.BindAll() - for i in s:KeyMap.All() - call i.bind() - endfor -endfunction - -"FUNCTION: KeyMap.bind() {{{3 -function! s:KeyMap.bind() - exec "nnoremap <silent> <buffer> ". self.key ." :call ". self.callback ."()<cr>" -endfunction - -"FUNCTION: KeyMap.Create(options) {{{3 -function! s:KeyMap.Create(options) - let newKeyMap = copy(self) - let newKeyMap.key = a:options['key'] - let newKeyMap.quickhelpText = a:options['quickhelpText'] - let newKeyMap.callback = a:options['callback'] - call add(s:KeyMap.All(), newKeyMap) -endfunction -"CLASS: MenuController {{{2 -"============================================================ -let s:MenuController = {} -"FUNCTION: MenuController.New(menuItems) {{{3 -"create a new menu controller that operates on the given menu items -function! s:MenuController.New(menuItems) - let newMenuController = copy(self) - if a:menuItems[0].isSeparator() - let newMenuController.menuItems = a:menuItems[1:-1] - else - let newMenuController.menuItems = a:menuItems - endif - return newMenuController -endfunction - -"FUNCTION: MenuController.showMenu() {{{3 -"start the main loop of the menu and get the user to choose/execute a menu -"item -function! s:MenuController.showMenu() - call self._saveOptions() - - try - let self.selection = 0 - - let done = 0 - while !done - redraw! - call self._echoPrompt() - let key = nr2char(getchar()) - let done = self._handleKeypress(key) - endwhile - finally - call self._restoreOptions() - endtry - - if self.selection != -1 - let m = self._current() - call m.execute() - endif -endfunction - -"FUNCTION: MenuController._echoPrompt() {{{3 -function! s:MenuController._echoPrompt() - echo "NERDTree Menu. Use j/k/enter and the shortcuts indicated" - echo "==========================================================" - - for i in range(0, len(self.menuItems)-1) - if self.selection == i - echo "> " . self.menuItems[i].text - else - echo " " . self.menuItems[i].text - endif - endfor -endfunction - -"FUNCTION: MenuController._current(key) {{{3 -"get the MenuItem that is curently selected -function! s:MenuController._current() - return self.menuItems[self.selection] -endfunction - -"FUNCTION: MenuController._handleKeypress(key) {{{3 -"change the selection (if appropriate) and return 1 if the user has made -"their choice, 0 otherwise -function! s:MenuController._handleKeypress(key) - if a:key == 'j' - call self._cursorDown() - elseif a:key == 'k' - call self._cursorUp() - elseif a:key == nr2char(27) "escape - let self.selection = -1 - return 1 - elseif a:key == "\r" || a:key == "\n" "enter and ctrl-j - return 1 - else - let index = self._nextIndexFor(a:key) - if index != -1 - let self.selection = index - if len(self._allIndexesFor(a:key)) == 1 - return 1 - endif - endif - endif - - return 0 -endfunction - -"FUNCTION: MenuController._allIndexesFor(shortcut) {{{3 -"get indexes to all menu items with the given shortcut -function! s:MenuController._allIndexesFor(shortcut) - let toReturn = [] - - for i in range(0, len(self.menuItems)-1) - if self.menuItems[i].shortcut == a:shortcut - call add(toReturn, i) - endif - endfor - - return toReturn -endfunction - -"FUNCTION: MenuController._nextIndexFor(shortcut) {{{3 -"get the index to the next menu item with the given shortcut, starts from the -"current cursor location and wraps around to the top again if need be -function! s:MenuController._nextIndexFor(shortcut) - for i in range(self.selection+1, len(self.menuItems)-1) - if self.menuItems[i].shortcut == a:shortcut - return i - endif - endfor - - for i in range(0, self.selection) - if self.menuItems[i].shortcut == a:shortcut - return i - endif - endfor - - return -1 -endfunction - -"FUNCTION: MenuController._setCmdheight() {{{3 -"sets &cmdheight to whatever is needed to display the menu -function! s:MenuController._setCmdheight() - let &cmdheight = len(self.menuItems) + 3 -endfunction - -"FUNCTION: MenuController._saveOptions() {{{3 -"set any vim options that are required to make the menu work (saving their old -"values) -function! s:MenuController._saveOptions() - let self._oldLazyredraw = &lazyredraw - let self._oldCmdheight = &cmdheight - set nolazyredraw - call self._setCmdheight() -endfunction - -"FUNCTION: MenuController._restoreOptions() {{{3 -"restore the options we saved in _saveOptions() -function! s:MenuController._restoreOptions() - let &cmdheight = self._oldCmdheight - let &lazyredraw = self._oldLazyredraw -endfunction - -"FUNCTION: MenuController._cursorDown() {{{3 -"move the cursor to the next menu item, skipping separators -function! s:MenuController._cursorDown() - let done = 0 - while !done - if self.selection < len(self.menuItems)-1 - let self.selection += 1 - else - let self.selection = 0 - endif - - if !self._current().isSeparator() - let done = 1 - endif - endwhile -endfunction - -"FUNCTION: MenuController._cursorUp() {{{3 -"move the cursor to the previous menu item, skipping separators -function! s:MenuController._cursorUp() - let done = 0 - while !done - if self.selection > 0 - let self.selection -= 1 - else - let self.selection = len(self.menuItems)-1 - endif - - if !self._current().isSeparator() - let done = 1 - endif - endwhile -endfunction - -"CLASS: MenuItem {{{2 -"============================================================ -let s:MenuItem = {} -"FUNCTION: MenuItem.All() {{{3 -"get all top level menu items -function! s:MenuItem.All() - if !exists("s:menuItems") - let s:menuItems = [] - endif - return s:menuItems -endfunction - -"FUNCTION: MenuItem.AllEnabled() {{{3 -"get all top level menu items that are currently enabled -function! s:MenuItem.AllEnabled() - let toReturn = [] - for i in s:MenuItem.All() - if i.enabled() - call add(toReturn, i) - endif - endfor - return toReturn -endfunction - -"FUNCTION: MenuItem.Create(options) {{{3 -"make a new menu item and add it to the global list -function! s:MenuItem.Create(options) - let newMenuItem = copy(self) - - let newMenuItem.text = a:options['text'] - let newMenuItem.shortcut = a:options['shortcut'] - let newMenuItem.children = [] - - let newMenuItem.isActiveCallback = -1 - if has_key(a:options, 'isActiveCallback') - let newMenuItem.isActiveCallback = a:options['isActiveCallback'] - endif - - let newMenuItem.callback = -1 - if has_key(a:options, 'callback') - let newMenuItem.callback = a:options['callback'] - endif - - if has_key(a:options, 'parent') - call add(a:options['parent'].children, newMenuItem) - else - call add(s:MenuItem.All(), newMenuItem) - endif - - return newMenuItem -endfunction - -"FUNCTION: MenuItem.CreateSeparator(options) {{{3 -"make a new separator menu item and add it to the global list -function! s:MenuItem.CreateSeparator(options) - let standard_options = { 'text': '--------------------', - \ 'shortcut': -1, - \ 'callback': -1 } - let options = extend(a:options, standard_options, "force") - - return s:MenuItem.Create(options) -endfunction - -"FUNCTION: MenuItem.CreateSubmenu(options) {{{3 -"make a new submenu and add it to global list -function! s:MenuItem.CreateSubmenu(options) - let standard_options = { 'callback': -1 } - let options = extend(a:options, standard_options, "force") - - return s:MenuItem.Create(options) -endfunction - -"FUNCTION: MenuItem.enabled() {{{3 -"return 1 if this menu item should be displayed -" -"delegates off to the isActiveCallback, and defaults to 1 if no callback was -"specified -function! s:MenuItem.enabled() - if self.isActiveCallback != -1 - return {self.isActiveCallback}() - endif - return 1 -endfunction - -"FUNCTION: MenuItem.execute() {{{3 -"perform the action behind this menu item, if this menuitem has children then -"display a new menu for them, otherwise deletegate off to the menuitem's -"callback -function! s:MenuItem.execute() - if len(self.children) - let mc = s:MenuController.New(self.children) - call mc.showMenu() - else - if self.callback != -1 - call {self.callback}() - endif - endif -endfunction - -"FUNCTION: MenuItem.isSeparator() {{{3 -"return 1 if this menuitem is a separator -function! s:MenuItem.isSeparator() - return self.callback == -1 && self.children == [] -endfunction - -"FUNCTION: MenuItem.isSubmenu() {{{3 -"return 1 if this menuitem is a submenu -function! s:MenuItem.isSubmenu() - return self.callback == -1 && !empty(self.children) -endfunction - -"CLASS: TreeFileNode {{{2 -"This class is the parent of the TreeDirNode class and constitures the -"'Component' part of the composite design pattern between the treenode -"classes. -"============================================================ -let s:TreeFileNode = {} -"FUNCTION: TreeFileNode.activate(forceKeepWinOpen) {{{3 -function! s:TreeFileNode.activate(forceKeepWinOpen) - call self.open() - if !a:forceKeepWinOpen - call s:closeTreeIfQuitOnOpen() - end -endfunction -"FUNCTION: TreeFileNode.bookmark(name) {{{3 -"bookmark this node with a:name -function! s:TreeFileNode.bookmark(name) - try - let oldMarkedNode = s:Bookmark.GetNodeForName(a:name, 1) - call oldMarkedNode.path.cacheDisplayString() - catch /^NERDTree.BookmarkNotFoundError/ - endtry - - call s:Bookmark.AddBookmark(a:name, self.path) - call self.path.cacheDisplayString() - call s:Bookmark.Write() -endfunction -"FUNCTION: TreeFileNode.cacheParent() {{{3 -"initializes self.parent if it isnt already -function! s:TreeFileNode.cacheParent() - if empty(self.parent) - let parentPath = self.path.getParent() - if parentPath.equals(self.path) - throw "NERDTree.CannotCacheParentError: already at root" - endif - let self.parent = s:TreeFileNode.New(parentPath) - endif -endfunction -"FUNCTION: TreeFileNode.compareNodes {{{3 -"This is supposed to be a class level method but i cant figure out how to -"get func refs to work from a dict.. -" -"A class level method that compares two nodes -" -"Args: -"n1, n2: the 2 nodes to compare -function! s:compareNodes(n1, n2) - return a:n1.path.compareTo(a:n2.path) -endfunction - -"FUNCTION: TreeFileNode.clearBoomarks() {{{3 -function! s:TreeFileNode.clearBoomarks() - for i in s:Bookmark.Bookmarks() - if i.path.equals(self.path) - call i.delete() - end - endfor - call self.path.cacheDisplayString() -endfunction -"FUNCTION: TreeFileNode.copy(dest) {{{3 -function! s:TreeFileNode.copy(dest) - call self.path.copy(a:dest) - let newPath = s:Path.New(a:dest) - let parent = b:NERDTreeRoot.findNode(newPath.getParent()) - if !empty(parent) - call parent.refresh() - endif - return parent.findNode(newPath) -endfunction - -"FUNCTION: TreeFileNode.delete {{{3 -"Removes this node from the tree and calls the Delete method for its path obj -function! s:TreeFileNode.delete() - call self.path.delete() - call self.parent.removeChild(self) -endfunction - -"FUNCTION: TreeFileNode.displayString() {{{3 -" -"Returns a string that specifies how the node should be represented as a -"string -" -"Return: -"a string that can be used in the view to represent this node -function! s:TreeFileNode.displayString() - return self.path.displayString() -endfunction - -"FUNCTION: TreeFileNode.equals(treenode) {{{3 -" -"Compares this treenode to the input treenode and returns 1 if they are the -"same node. -" -"Use this method instead of == because sometimes when the treenodes contain -"many children, vim seg faults when doing == -" -"Args: -"treenode: the other treenode to compare to -function! s:TreeFileNode.equals(treenode) - return self.path.str() ==# a:treenode.path.str() -endfunction - -"FUNCTION: TreeFileNode.findNode(path) {{{3 -"Returns self if this node.path.Equals the given path. -"Returns {} if not equal. -" -"Args: -"path: the path object to compare against -function! s:TreeFileNode.findNode(path) - if a:path.equals(self.path) - return self - endif - return {} -endfunction -"FUNCTION: TreeFileNode.findOpenDirSiblingWithVisibleChildren(direction) {{{3 -" -"Finds the next sibling for this node in the indicated direction. This sibling -"must be a directory and may/may not have children as specified. -" -"Args: -"direction: 0 if you want to find the previous sibling, 1 for the next sibling -" -"Return: -"a treenode object or {} if no appropriate sibling could be found -function! s:TreeFileNode.findOpenDirSiblingWithVisibleChildren(direction) - "if we have no parent then we can have no siblings - if self.parent != {} - let nextSibling = self.findSibling(a:direction) - - while nextSibling != {} - if nextSibling.path.isDirectory && nextSibling.hasVisibleChildren() && nextSibling.isOpen - return nextSibling - endif - let nextSibling = nextSibling.findSibling(a:direction) - endwhile - endif - - return {} -endfunction -"FUNCTION: TreeFileNode.findSibling(direction) {{{3 -" -"Finds the next sibling for this node in the indicated direction -" -"Args: -"direction: 0 if you want to find the previous sibling, 1 for the next sibling -" -"Return: -"a treenode object or {} if no sibling could be found -function! s:TreeFileNode.findSibling(direction) - "if we have no parent then we can have no siblings - if self.parent != {} - - "get the index of this node in its parents children - let siblingIndx = self.parent.getChildIndex(self.path) - - if siblingIndx != -1 - "move a long to the next potential sibling node - let siblingIndx = a:direction ==# 1 ? siblingIndx+1 : siblingIndx-1 - - "keep moving along to the next sibling till we find one that is valid - let numSiblings = self.parent.getChildCount() - while siblingIndx >= 0 && siblingIndx < numSiblings - - "if the next node is not an ignored node (i.e. wont show up in the - "view) then return it - if self.parent.children[siblingIndx].path.ignore() ==# 0 - return self.parent.children[siblingIndx] - endif - - "go to next node - let siblingIndx = a:direction ==# 1 ? siblingIndx+1 : siblingIndx-1 - endwhile - endif - endif - - return {} -endfunction - -"FUNCTION: TreeFileNode.getLineNum(){{{3 -"returns the line number this node is rendered on, or -1 if it isnt rendered -function! s:TreeFileNode.getLineNum() - "if the node is the root then return the root line no. - if self.isRoot() - return s:TreeFileNode.GetRootLineNum() - endif - - let totalLines = line("$") - - "the path components we have matched so far - let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')] - "the index of the component we are searching for - let curPathComponent = 1 - - let fullpath = self.path.str({'format': 'UI'}) - - - let lnum = s:TreeFileNode.GetRootLineNum() - while lnum > 0 - let lnum = lnum + 1 - "have we reached the bottom of the tree? - if lnum ==# totalLines+1 - return -1 - endif - - let curLine = getline(lnum) - - let indent = s:indentLevelFor(curLine) - if indent ==# curPathComponent - let curLine = s:stripMarkupFromLine(curLine, 1) - - let curPath = join(pathcomponents, '/') . '/' . curLine - if stridx(fullpath, curPath, 0) ==# 0 - if fullpath ==# curPath || strpart(fullpath, len(curPath)-1,1) ==# '/' - let curLine = substitute(curLine, '/ *$', '', '') - call add(pathcomponents, curLine) - let curPathComponent = curPathComponent + 1 - - if fullpath ==# curPath - return lnum - endif - endif - endif - endif - endwhile - return -1 -endfunction - -"FUNCTION: TreeFileNode.GetRootForTab(){{{3 -"get the root node for this tab -function! s:TreeFileNode.GetRootForTab() - if s:treeExistsForTab() - return getbufvar(t:NERDTreeBufName, 'NERDTreeRoot') - end - return {} -endfunction -"FUNCTION: TreeFileNode.GetRootLineNum(){{{3 -"gets the line number of the root node -function! s:TreeFileNode.GetRootLineNum() - let rootLine = 1 - while getline(rootLine) !~ '^\(/\|<\)' - let rootLine = rootLine + 1 - endwhile - return rootLine -endfunction - -"FUNCTION: TreeFileNode.GetSelected() {{{3 -"gets the treenode that the cursor is currently over -function! s:TreeFileNode.GetSelected() - try - let path = s:getPath(line(".")) - if path ==# {} - return {} - endif - return b:NERDTreeRoot.findNode(path) - catch /NERDTree/ - return {} - endtry -endfunction -"FUNCTION: TreeFileNode.isVisible() {{{3 -"returns 1 if this node should be visible according to the tree filters and -"hidden file filters (and their on/off status) -function! s:TreeFileNode.isVisible() - return !self.path.ignore() -endfunction -"FUNCTION: TreeFileNode.isRoot() {{{3 -"returns 1 if this node is b:NERDTreeRoot -function! s:TreeFileNode.isRoot() - if !s:treeExistsForBuf() - throw "NERDTree.NoTreeError: No tree exists for the current buffer" - endif - - return self.equals(b:NERDTreeRoot) -endfunction - -"FUNCTION: TreeFileNode.makeRoot() {{{3 -"Make this node the root of the tree -function! s:TreeFileNode.makeRoot() - if self.path.isDirectory - let b:NERDTreeRoot = self - else - call self.cacheParent() - let b:NERDTreeRoot = self.parent - endif - - call b:NERDTreeRoot.open() - - "change dir to the dir of the new root if instructed to - if g:NERDTreeChDirMode ==# 2 - exec "cd " . b:NERDTreeRoot.path.str({'format': 'Edit'}) - endif -endfunction -"FUNCTION: TreeFileNode.New(path) {{{3 -"Returns a new TreeNode object with the given path and parent -" -"Args: -"path: a path object representing the full filesystem path to the file/dir that the node represents -function! s:TreeFileNode.New(path) - if a:path.isDirectory - return s:TreeDirNode.New(a:path) - else - let newTreeNode = copy(self) - let newTreeNode.path = a:path - let newTreeNode.parent = {} - return newTreeNode - endif -endfunction - -"FUNCTION: TreeFileNode.open() {{{3 -"Open the file represented by the given node in the current window, splitting -"the window if needed -" -"ARGS: -"treenode: file node to open -function! s:TreeFileNode.open() - if b:NERDTreeType ==# "secondary" - exec 'edit ' . self.path.str({'format': 'Edit'}) - return - endif - - "if the file is already open in this tab then just stick the cursor in it - let winnr = bufwinnr('^' . self.path.str() . '$') - if winnr != -1 - call s:exec(winnr . "wincmd w") - - else - if !s:isWindowUsable(winnr("#")) && s:firstUsableWindow() ==# -1 - call self.openSplit() - else - try - if !s:isWindowUsable(winnr("#")) - call s:exec(s:firstUsableWindow() . "wincmd w") - else - call s:exec('wincmd p') - endif - exec ("edit " . self.path.str({'format': 'Edit'})) - catch /^Vim\%((\a\+)\)\=:E37/ - call s:putCursorInTreeWin() - throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self.path.str() ." is already open and modified." - catch /^Vim\%((\a\+)\)\=:/ - echo v:exception - endtry - endif - endif -endfunction -"FUNCTION: TreeFileNode.openSplit() {{{3 -"Open this node in a new window -function! s:TreeFileNode.openSplit() - - if b:NERDTreeType ==# "secondary" - exec "split " . self.path.str({'format': 'Edit'}) - return - endif - - " Save the user's settings for splitbelow and splitright - let savesplitbelow=&splitbelow - let savesplitright=&splitright - - " 'there' will be set to a command to move from the split window - " back to the explorer window - " - " 'back' will be set to a command to move from the explorer window - " back to the newly split window - " - " 'right' and 'below' will be set to the settings needed for - " splitbelow and splitright IF the explorer is the only window. - " - let there= g:NERDTreeWinPos ==# "left" ? "wincmd h" : "wincmd l" - let back = g:NERDTreeWinPos ==# "left" ? "wincmd l" : "wincmd h" - let right= g:NERDTreeWinPos ==# "left" - let below=0 - - " Attempt to go to adjacent window - call s:exec(back) - - let onlyOneWin = (winnr("$") ==# 1) - - " If no adjacent window, set splitright and splitbelow appropriately - if onlyOneWin - let &splitright=right - let &splitbelow=below - else - " found adjacent window - invert split direction - let &splitright=!right - let &splitbelow=!below - endif - - let splitMode = onlyOneWin ? "vertical" : "" - - " Open the new window - try - exec(splitMode." sp " . self.path.str({'format': 'Edit'})) - catch /^Vim\%((\a\+)\)\=:E37/ - call s:putCursorInTreeWin() - throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self.path.str() ." is already open and modified." - catch /^Vim\%((\a\+)\)\=:/ - "do nothing - endtry - - "resize the tree window if no other window was open before - if onlyOneWin - let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize - call s:exec(there) - exec("silent ". splitMode ." resize ". size) - call s:exec('wincmd p') - endif - - " Restore splitmode settings - let &splitbelow=savesplitbelow - let &splitright=savesplitright -endfunction -"FUNCTION: TreeFileNode.openVSplit() {{{3 -"Open this node in a new vertical window -function! s:TreeFileNode.openVSplit() - if b:NERDTreeType ==# "secondary" - exec "vnew " . self.path.str({'format': 'Edit'}) - return - endif - - let winwidth = winwidth(".") - if winnr("$")==#1 - let winwidth = g:NERDTreeWinSize - endif - - call s:exec("wincmd p") - exec "vnew " . self.path.str({'format': 'Edit'}) - - "resize the nerd tree back to the original size - call s:putCursorInTreeWin() - exec("silent vertical resize ". winwidth) - call s:exec('wincmd p') -endfunction -"FUNCTION: TreeFileNode.openInNewTab(options) {{{3 -function! s:TreeFileNode.openInNewTab(options) - let currentTab = tabpagenr() - - if !has_key(a:options, 'keepTreeOpen') - call s:closeTreeIfQuitOnOpen() - endif - - exec "tabedit " . self.path.str({'format': 'Edit'}) - - if has_key(a:options, 'stayInCurrentTab') && a:options['stayInCurrentTab'] - exec "tabnext " . currentTab - endif - -endfunction -"FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{3 -"Places the cursor on the line number this node is rendered on -" -"Args: -"isJump: 1 if this cursor movement should be counted as a jump by vim -"recurseUpward: try to put the cursor on the parent if the this node isnt -"visible -function! s:TreeFileNode.putCursorHere(isJump, recurseUpward) - let ln = self.getLineNum() - if ln != -1 - if a:isJump - mark ' - endif - call cursor(ln, col(".")) - else - if a:recurseUpward - let node = self - while node != {} && node.getLineNum() ==# -1 - let node = node.parent - call node.open() - endwhile - call s:renderView() - call node.putCursorHere(a:isJump, 0) - endif - endif -endfunction - -"FUNCTION: TreeFileNode.refresh() {{{3 -function! s:TreeFileNode.refresh() - call self.path.refresh() -endfunction -"FUNCTION: TreeFileNode.rename() {{{3 -"Calls the rename method for this nodes path obj -function! s:TreeFileNode.rename(newName) - let newName = substitute(a:newName, '\(\\\|\/\)$', '', '') - call self.path.rename(newName) - call self.parent.removeChild(self) - - let parentPath = self.path.getParent() - let newParent = b:NERDTreeRoot.findNode(parentPath) - - if newParent != {} - call newParent.createChild(self.path, 1) - call newParent.refresh() - endif -endfunction -"FUNCTION: TreeFileNode.renderToString {{{3 -"returns a string representation for this tree to be rendered in the view -function! s:TreeFileNode.renderToString() - return self._renderToString(0, 0, [], self.getChildCount() ==# 1) -endfunction - - -"Args: -"depth: the current depth in the tree for this call -"drawText: 1 if we should actually draw the line for this node (if 0 then the -"child nodes are rendered only) -"vertMap: a binary array that indicates whether a vertical bar should be draw -"for each depth in the tree -"isLastChild:true if this curNode is the last child of its parent -function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild) - let output = "" - if a:drawText ==# 1 - - let treeParts = '' - - "get all the leading spaces and vertical tree parts for this line - if a:depth > 1 - for j in a:vertMap[0:-2] - if j ==# 1 - let treeParts = treeParts . '| ' - else - let treeParts = treeParts . ' ' - endif - endfor - endif - - "get the last vertical tree part for this line which will be different - "if this node is the last child of its parent - if a:isLastChild - let treeParts = treeParts . '`' - else - let treeParts = treeParts . '|' - endif - - - "smack the appropriate dir/file symbol on the line before the file/dir - "name itself - if self.path.isDirectory - if self.isOpen - let treeParts = treeParts . '~' - else - let treeParts = treeParts . '+' - endif - else - let treeParts = treeParts . '-' - endif - let line = treeParts . self.displayString() - - let output = output . line . "\n" - endif - - "if the node is an open dir, draw its children - if self.path.isDirectory ==# 1 && self.isOpen ==# 1 - - let childNodesToDraw = self.getVisibleChildren() - if len(childNodesToDraw) > 0 - - "draw all the nodes children except the last - let lastIndx = len(childNodesToDraw)-1 - if lastIndx > 0 - for i in childNodesToDraw[0:lastIndx-1] - let output = output . i._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 1), 0) - endfor - endif - - "draw the last child, indicating that it IS the last - let output = output . childNodesToDraw[lastIndx]._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 0), 1) - endif - endif - - return output -endfunction -"CLASS: TreeDirNode {{{2 -"This class is a child of the TreeFileNode class and constitutes the -"'Composite' part of the composite design pattern between the treenode -"classes. -"============================================================ -let s:TreeDirNode = copy(s:TreeFileNode) -"FUNCTION: TreeDirNode.AbsoluteTreeRoot(){{{3 -"class method that returns the highest cached ancestor of the current root -function! s:TreeDirNode.AbsoluteTreeRoot() - let currentNode = b:NERDTreeRoot - while currentNode.parent != {} - let currentNode = currentNode.parent - endwhile - return currentNode -endfunction -"FUNCTION: TreeDirNode.activate(forceKeepWinOpen) {{{3 -unlet s:TreeDirNode.activate -function! s:TreeDirNode.activate(forceKeepWinOpen) - call self.toggleOpen() - call s:renderView() - call self.putCursorHere(0, 0) -endfunction -"FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{3 -"Adds the given treenode to the list of children for this node -" -"Args: -"-treenode: the node to add -"-inOrder: 1 if the new node should be inserted in sorted order -function! s:TreeDirNode.addChild(treenode, inOrder) - call add(self.children, a:treenode) - let a:treenode.parent = self - - if a:inOrder - call self.sortChildren() - endif -endfunction - -"FUNCTION: TreeDirNode.close() {{{3 -"Closes this directory -function! s:TreeDirNode.close() - let self.isOpen = 0 -endfunction - -"FUNCTION: TreeDirNode.closeChildren() {{{3 -"Closes all the child dir nodes of this node -function! s:TreeDirNode.closeChildren() - for i in self.children - if i.path.isDirectory - call i.close() - call i.closeChildren() - endif - endfor -endfunction - -"FUNCTION: TreeDirNode.createChild(path, inOrder) {{{3 -"Instantiates a new child node for this node with the given path. The new -"nodes parent is set to this node. -" -"Args: -"path: a Path object that this node will represent/contain -"inOrder: 1 if the new node should be inserted in sorted order -" -"Returns: -"the newly created node -function! s:TreeDirNode.createChild(path, inOrder) - let newTreeNode = s:TreeFileNode.New(a:path) - call self.addChild(newTreeNode, a:inOrder) - return newTreeNode -endfunction - -"FUNCTION: TreeDirNode.findNode(path) {{{3 -"Will find one of the children (recursively) that has the given path -" -"Args: -"path: a path object -unlet s:TreeDirNode.findNode -function! s:TreeDirNode.findNode(path) - if a:path.equals(self.path) - return self - endif - if stridx(a:path.str(), self.path.str(), 0) ==# -1 - return {} - endif - - if self.path.isDirectory - for i in self.children - let retVal = i.findNode(a:path) - if retVal != {} - return retVal - endif - endfor - endif - return {} -endfunction -"FUNCTION: TreeDirNode.getChildCount() {{{3 -"Returns the number of children this node has -function! s:TreeDirNode.getChildCount() - return len(self.children) -endfunction - -"FUNCTION: TreeDirNode.getChild(path) {{{3 -"Returns child node of this node that has the given path or {} if no such node -"exists. -" -"This function doesnt not recurse into child dir nodes -" -"Args: -"path: a path object -function! s:TreeDirNode.getChild(path) - if stridx(a:path.str(), self.path.str(), 0) ==# -1 - return {} - endif - - let index = self.getChildIndex(a:path) - if index ==# -1 - return {} - else - return self.children[index] - endif - -endfunction - -"FUNCTION: TreeDirNode.getChildByIndex(indx, visible) {{{3 -"returns the child at the given index -"Args: -"indx: the index to get the child from -"visible: 1 if only the visible children array should be used, 0 if all the -"children should be searched. -function! s:TreeDirNode.getChildByIndex(indx, visible) - let array_to_search = a:visible? self.getVisibleChildren() : self.children - if a:indx > len(array_to_search) - throw "NERDTree.InvalidArgumentsError: Index is out of bounds." - endif - return array_to_search[a:indx] -endfunction - -"FUNCTION: TreeDirNode.getChildIndex(path) {{{3 -"Returns the index of the child node of this node that has the given path or -"-1 if no such node exists. -" -"This function doesnt not recurse into child dir nodes -" -"Args: -"path: a path object -function! s:TreeDirNode.getChildIndex(path) - if stridx(a:path.str(), self.path.str(), 0) ==# -1 - return -1 - endif - - "do a binary search for the child - let a = 0 - let z = self.getChildCount() - while a < z - let mid = (a+z)/2 - let diff = a:path.compareTo(self.children[mid].path) - - if diff ==# -1 - let z = mid - elseif diff ==# 1 - let a = mid+1 - else - return mid - endif - endwhile - return -1 -endfunction - -"FUNCTION: TreeDirNode.GetSelected() {{{3 -"Returns the current node if it is a dir node, or else returns the current -"nodes parent -unlet s:TreeDirNode.GetSelected -function! s:TreeDirNode.GetSelected() - let currentDir = s:TreeFileNode.GetSelected() - if currentDir != {} && !currentDir.isRoot() - if currentDir.path.isDirectory ==# 0 - let currentDir = currentDir.parent - endif - endif - return currentDir -endfunction -"FUNCTION: TreeDirNode.getVisibleChildCount() {{{3 -"Returns the number of visible children this node has -function! s:TreeDirNode.getVisibleChildCount() - return len(self.getVisibleChildren()) -endfunction - -"FUNCTION: TreeDirNode.getVisibleChildren() {{{3 -"Returns a list of children to display for this node, in the correct order -" -"Return: -"an array of treenodes -function! s:TreeDirNode.getVisibleChildren() - let toReturn = [] - for i in self.children - if i.path.ignore() ==# 0 - call add(toReturn, i) - endif - endfor - return toReturn -endfunction - -"FUNCTION: TreeDirNode.hasVisibleChildren() {{{3 -"returns 1 if this node has any childre, 0 otherwise.. -function! s:TreeDirNode.hasVisibleChildren() - return self.getVisibleChildCount() != 0 -endfunction - -"FUNCTION: TreeDirNode._initChildren() {{{3 -"Removes all childen from this node and re-reads them -" -"Args: -"silent: 1 if the function should not echo any "please wait" messages for -"large directories -" -"Return: the number of child nodes read -function! s:TreeDirNode._initChildren(silent) - "remove all the current child nodes - let self.children = [] - - "get an array of all the files in the nodes dir - let dir = self.path - let globDir = dir.str({'format': 'Glob'}) - let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') - let files = split(filesStr, "\n") - - if !a:silent && len(files) > g:NERDTreeNotificationThreshold - call s:echo("Please wait, caching a large dir ...") - endif - - let invalidFilesFound = 0 - for i in files - - "filter out the .. and . directories - "Note: we must match .. AND ../ cos sometimes the globpath returns - "../ for path with strange chars (eg $) - if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$' - - "put the next file in a new node and attach it - try - let path = s:Path.New(i) - call self.createChild(path, 0) - catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ - let invalidFilesFound += 1 - endtry - endif - endfor - - call self.sortChildren() - - if !a:silent && len(files) > g:NERDTreeNotificationThreshold - call s:echo("Please wait, caching a large dir ... DONE (". self.getChildCount() ." nodes cached).") - endif - - if invalidFilesFound - call s:echoWarning(invalidFilesFound . " file(s) could not be loaded into the NERD tree") - endif - return self.getChildCount() -endfunction -"FUNCTION: TreeDirNode.New(path) {{{3 -"Returns a new TreeNode object with the given path and parent -" -"Args: -"path: a path object representing the full filesystem path to the file/dir that the node represents -unlet s:TreeDirNode.New -function! s:TreeDirNode.New(path) - if a:path.isDirectory != 1 - throw "NERDTree.InvalidArgumentsError: A TreeDirNode object must be instantiated with a directory Path object." - endif - - let newTreeNode = copy(self) - let newTreeNode.path = a:path - - let newTreeNode.isOpen = 0 - let newTreeNode.children = [] - - let newTreeNode.parent = {} - - return newTreeNode -endfunction -"FUNCTION: TreeDirNode.open() {{{3 -"Reads in all this nodes children -" -"Return: the number of child nodes read -unlet s:TreeDirNode.open -function! s:TreeDirNode.open() - let self.isOpen = 1 - if self.children ==# [] - return self._initChildren(0) - else - return 0 - endif -endfunction - -" FUNCTION: TreeDirNode.openExplorer() {{{3 -" opens an explorer window for this node in the previous window (could be a -" nerd tree or a netrw) -function! s:TreeDirNode.openExplorer() - let oldwin = winnr() - call s:exec('wincmd p') - if oldwin ==# winnr() || (&modified && s:bufInWindows(winbufnr(winnr())) < 2) - call s:exec('wincmd p') - call self.openSplit() - else - exec ("silent edit " . self.path.str({'format': 'Edit'})) - endif -endfunction -"FUNCTION: TreeDirNode.openInNewTab(options) {{{3 -unlet s:TreeDirNode.openInNewTab -function! s:TreeDirNode.openInNewTab(options) - let currentTab = tabpagenr() - - if !has_key(a:options, 'keepTreeOpen') || !a:options['keepTreeOpen'] - call s:closeTreeIfQuitOnOpen() - endif - - tabnew - call s:initNerdTree(self.path.str()) - - if has_key(a:options, 'stayInCurrentTab') && a:options['stayInCurrentTab'] - exec "tabnext " . currentTab - endif -endfunction -"FUNCTION: TreeDirNode.openRecursively() {{{3 -"Opens this treenode and all of its children whose paths arent 'ignored' -"because of the file filters. -" -"This method is actually a wrapper for the OpenRecursively2 method which does -"the work. -function! s:TreeDirNode.openRecursively() - call self._openRecursively2(1) -endfunction - -"FUNCTION: TreeDirNode._openRecursively2() {{{3 -"Opens this all children of this treenode recursively if either: -" *they arent filtered by file filters -" *a:forceOpen is 1 -" -"Args: -"forceOpen: 1 if this node should be opened regardless of file filters -function! s:TreeDirNode._openRecursively2(forceOpen) - if self.path.ignore() ==# 0 || a:forceOpen - let self.isOpen = 1 - if self.children ==# [] - call self._initChildren(1) - endif - - for i in self.children - if i.path.isDirectory ==# 1 - call i._openRecursively2(0) - endif - endfor - endif -endfunction - -"FUNCTION: TreeDirNode.refresh() {{{3 -unlet s:TreeDirNode.refresh -function! s:TreeDirNode.refresh() - call self.path.refresh() - - "if this node was ever opened, refresh its children - if self.isOpen || !empty(self.children) - "go thru all the files/dirs under this node - let newChildNodes = [] - let invalidFilesFound = 0 - let dir = self.path - let globDir = dir.str({'format': 'Glob'}) - let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') - let files = split(filesStr, "\n") - for i in files - "filter out the .. and . directories - "Note: we must match .. AND ../ cos sometimes the globpath returns - "../ for path with strange chars (eg $) - if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$' - - try - "create a new path and see if it exists in this nodes children - let path = s:Path.New(i) - let newNode = self.getChild(path) - if newNode != {} - call newNode.refresh() - call add(newChildNodes, newNode) - - "the node doesnt exist so create it - else - let newNode = s:TreeFileNode.New(path) - let newNode.parent = self - call add(newChildNodes, newNode) - endif - - - catch /^NERDTree.InvalidArgumentsError/ - let invalidFilesFound = 1 - endtry - endif - endfor - - "swap this nodes children out for the children we just read/refreshed - let self.children = newChildNodes - call self.sortChildren() - - if invalidFilesFound - call s:echoWarning("some files could not be loaded into the NERD tree") - endif - endif -endfunction - -"FUNCTION: TreeDirNode.reveal(path) {{{3 -"reveal the given path, i.e. cache and open all treenodes needed to display it -"in the UI -function! s:TreeDirNode.reveal(path) - if !a:path.isUnder(self.path) - throw "NERDTree.InvalidArgumentsError: " . a:path.str() . " should be under " . self.path.str() - endif - - call self.open() - - if self.path.equals(a:path.getParent()) - let n = self.findNode(a:path) - call s:renderView() - call n.putCursorHere(1,0) - return - endif - - let p = a:path - while !p.getParent().equals(self.path) - let p = p.getParent() - endwhile - - let n = self.findNode(p) - call n.reveal(a:path) -endfunction -"FUNCTION: TreeDirNode.removeChild(treenode) {{{3 -" -"Removes the given treenode from this nodes set of children -" -"Args: -"treenode: the node to remove -" -"Throws a NERDTree.ChildNotFoundError if the given treenode is not found -function! s:TreeDirNode.removeChild(treenode) - for i in range(0, self.getChildCount()-1) - if self.children[i].equals(a:treenode) - call remove(self.children, i) - return - endif - endfor - - throw "NERDTree.ChildNotFoundError: child node was not found" -endfunction - -"FUNCTION: TreeDirNode.sortChildren() {{{3 -" -"Sorts the children of this node according to alphabetical order and the -"directory priority. -" -function! s:TreeDirNode.sortChildren() - let CompareFunc = function("s:compareNodes") - call sort(self.children, CompareFunc) -endfunction - -"FUNCTION: TreeDirNode.toggleOpen() {{{3 -"Opens this directory if it is closed and vice versa -function! s:TreeDirNode.toggleOpen() - if self.isOpen ==# 1 - call self.close() - else - call self.open() - endif -endfunction - -"FUNCTION: TreeDirNode.transplantChild(newNode) {{{3 -"Replaces the child of this with the given node (where the child node's full -"path matches a:newNode's fullpath). The search for the matching node is -"non-recursive -" -"Arg: -"newNode: the node to graft into the tree -function! s:TreeDirNode.transplantChild(newNode) - for i in range(0, self.getChildCount()-1) - if self.children[i].equals(a:newNode) - let self.children[i] = a:newNode - let a:newNode.parent = self - break - endif - endfor -endfunction -"============================================================ -"CLASS: Path {{{2 -"============================================================ -let s:Path = {} -"FUNCTION: Path.AbsolutePathFor(str) {{{3 -function! s:Path.AbsolutePathFor(str) - let prependCWD = 0 - if s:running_windows - let prependCWD = a:str !~ '^.:\(\\\|\/\)' - else - let prependCWD = a:str !~ '^/' - endif - - let toReturn = a:str - if prependCWD - let toReturn = getcwd() . s:Path.Slash() . a:str - endif - - return toReturn -endfunction -"FUNCTION: Path.bookmarkNames() {{{3 -function! s:Path.bookmarkNames() - if !exists("self._bookmarkNames") - call self.cacheDisplayString() - endif - return self._bookmarkNames -endfunction -"FUNCTION: Path.cacheDisplayString() {{{3 -function! s:Path.cacheDisplayString() - let self.cachedDisplayString = self.getLastPathComponent(1) - - if self.isExecutable - let self.cachedDisplayString = self.cachedDisplayString . '*' - endif - - let self._bookmarkNames = [] - for i in s:Bookmark.Bookmarks() - if i.path.equals(self) - call add(self._bookmarkNames, i.name) - endif - endfor - if !empty(self._bookmarkNames) - let self.cachedDisplayString .= ' {' . join(self._bookmarkNames) . '}' - endif - - if self.isSymLink - let self.cachedDisplayString .= ' -> ' . self.symLinkDest - endif - - if self.isReadOnly - let self.cachedDisplayString .= ' [RO]' - endif -endfunction -"FUNCTION: Path.changeToDir() {{{3 -function! s:Path.changeToDir() - let dir = self.str({'format': 'Cd'}) - if self.isDirectory ==# 0 - let dir = self.getParent().str({'format': 'Cd'}) - endif - - try - execute "cd " . dir - call s:echo("CWD is now: " . getcwd()) - catch - throw "NERDTree.PathChangeError: cannot change CWD to " . dir - endtry -endfunction - -"FUNCTION: Path.compareTo() {{{3 -" -"Compares this Path to the given path and returns 0 if they are equal, -1 if -"this Path is "less than" the given path, or 1 if it is "greater". -" -"Args: -"path: the path object to compare this to -" -"Return: -"1, -1 or 0 -function! s:Path.compareTo(path) - let thisPath = self.getLastPathComponent(1) - let thatPath = a:path.getLastPathComponent(1) - - "if the paths are the same then clearly we return 0 - if thisPath ==# thatPath - return 0 - endif - - let thisSS = self.getSortOrderIndex() - let thatSS = a:path.getSortOrderIndex() - - "compare the sort sequences, if they are different then the return - "value is easy - if thisSS < thatSS - return -1 - elseif thisSS > thatSS - return 1 - else - "if the sort sequences are the same then compare the paths - "alphabetically - let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath - if pathCompare - return -1 - else - return 1 - endif - endif -endfunction - -"FUNCTION: Path.Create(fullpath) {{{3 -" -"Factory method. -" -"Creates a path object with the given path. The path is also created on the -"filesystem. If the path already exists, a NERDTree.Path.Exists exception is -"thrown. If any other errors occur, a NERDTree.Path exception is thrown. -" -"Args: -"fullpath: the full filesystem path to the file/dir to create -function! s:Path.Create(fullpath) - "bail if the a:fullpath already exists - if isdirectory(a:fullpath) || filereadable(a:fullpath) - throw "NERDTree.CreatePathError: Directory Exists: '" . a:fullpath . "'" - endif - - try - - "if it ends with a slash, assume its a dir create it - if a:fullpath =~ '\(\\\|\/\)$' - "whack the trailing slash off the end if it exists - let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '') - - call mkdir(fullpath, 'p') - - "assume its a file and create - else - call writefile([], a:fullpath) - endif - catch - throw "NERDTree.CreatePathError: Could not create path: '" . a:fullpath . "'" - endtry - - return s:Path.New(a:fullpath) -endfunction - -"FUNCTION: Path.copy(dest) {{{3 -" -"Copies the file/dir represented by this Path to the given location -" -"Args: -"dest: the location to copy this dir/file to -function! s:Path.copy(dest) - if !s:Path.CopyingSupported() - throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS" - endif - - let dest = s:Path.WinToUnixPath(a:dest) - - let cmd = g:NERDTreeCopyCmd . " " . self.str() . " " . dest - let success = system(cmd) - if success != 0 - throw "NERDTree.CopyError: Could not copy ''". self.str() ."'' to: '" . a:dest . "'" - endif -endfunction - -"FUNCTION: Path.CopyingSupported() {{{3 -" -"returns 1 if copying is supported for this OS -function! s:Path.CopyingSupported() - return exists('g:NERDTreeCopyCmd') -endfunction - - -"FUNCTION: Path.copyingWillOverwrite(dest) {{{3 -" -"returns 1 if copy this path to the given location will cause files to -"overwritten -" -"Args: -"dest: the location this path will be copied to -function! s:Path.copyingWillOverwrite(dest) - if filereadable(a:dest) - return 1 - endif - - if isdirectory(a:dest) - let path = s:Path.JoinPathStrings(a:dest, self.getLastPathComponent(0)) - if filereadable(path) - return 1 - endif - endif -endfunction - -"FUNCTION: Path.delete() {{{3 -" -"Deletes the file represented by this path. -"Deletion of directories is not supported -" -"Throws NERDTree.Path.Deletion exceptions -function! s:Path.delete() - if self.isDirectory - - let cmd = g:NERDTreeRemoveDirCmd . self.str({'escape': 1}) - let success = system(cmd) - - if v:shell_error != 0 - throw "NERDTree.PathDeletionError: Could not delete directory: '" . self.str() . "'" - endif - else - let success = delete(self.str()) - if success != 0 - throw "NERDTree.PathDeletionError: Could not delete file: '" . self.str() . "'" - endif - endif - - "delete all bookmarks for this path - for i in self.bookmarkNames() - let bookmark = s:Bookmark.BookmarkFor(i) - call bookmark.delete() - endfor -endfunction - -"FUNCTION: Path.displayString() {{{3 -" -"Returns a string that specifies how the path should be represented as a -"string -function! s:Path.displayString() - if self.cachedDisplayString ==# "" - call self.cacheDisplayString() - endif - - return self.cachedDisplayString -endfunction -"FUNCTION: Path.extractDriveLetter(fullpath) {{{3 -" -"If running windows, cache the drive letter for this path -function! s:Path.extractDriveLetter(fullpath) - if s:running_windows - let self.drive = substitute(a:fullpath, '\(^[a-zA-Z]:\).*', '\1', '') - else - let self.drive = '' - endif - -endfunction -"FUNCTION: Path.exists() {{{3 -"return 1 if this path points to a location that is readable or is a directory -function! s:Path.exists() - let p = self.str() - return filereadable(p) || isdirectory(p) -endfunction -"FUNCTION: Path.getDir() {{{3 -" -"Returns this path if it is a directory, else this paths parent. -" -"Return: -"a Path object -function! s:Path.getDir() - if self.isDirectory - return self - else - return self.getParent() - endif -endfunction -"FUNCTION: Path.getParent() {{{3 -" -"Returns a new path object for this paths parent -" -"Return: -"a new Path object -function! s:Path.getParent() - if s:running_windows - let path = self.drive . '\' . join(self.pathSegments[0:-2], '\') - else - let path = '/'. join(self.pathSegments[0:-2], '/') - endif - - return s:Path.New(path) -endfunction -"FUNCTION: Path.getLastPathComponent(dirSlash) {{{3 -" -"Gets the last part of this path. -" -"Args: -"dirSlash: if 1 then a trailing slash will be added to the returned value for -"directory nodes. -function! s:Path.getLastPathComponent(dirSlash) - if empty(self.pathSegments) - return '' - endif - let toReturn = self.pathSegments[-1] - if a:dirSlash && self.isDirectory - let toReturn = toReturn . '/' - endif - return toReturn -endfunction - -"FUNCTION: Path.getSortOrderIndex() {{{3 -"returns the index of the pattern in g:NERDTreeSortOrder that this path matches -function! s:Path.getSortOrderIndex() - let i = 0 - while i < len(g:NERDTreeSortOrder) - if self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i] - return i - endif - let i = i + 1 - endwhile - return s:NERDTreeSortStarIndex -endfunction - -"FUNCTION: Path.ignore() {{{3 -"returns true if this path should be ignored -function! s:Path.ignore() - let lastPathComponent = self.getLastPathComponent(0) - - "filter out the user specified paths to ignore - if b:NERDTreeIgnoreEnabled - for i in g:NERDTreeIgnore - if lastPathComponent =~ i - return 1 - endif - endfor - endif - - "dont show hidden files unless instructed to - if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.' - return 1 - endif - - if b:NERDTreeShowFiles ==# 0 && self.isDirectory ==# 0 - return 1 - endif - - return 0 -endfunction - -"FUNCTION: Path.isUnder(path) {{{3 -"return 1 if this path is somewhere under the given path in the filesystem. -" -"a:path should be a dir -function! s:Path.isUnder(path) - if a:path.isDirectory == 0 - return 0 - endif - - let this = self.str() - let that = a:path.str() - return stridx(this, that . s:Path.Slash()) == 0 -endfunction - -"FUNCTION: Path.JoinPathStrings(...) {{{3 -function! s:Path.JoinPathStrings(...) - let components = [] - for i in a:000 - let components = extend(components, split(i, '/')) - endfor - return '/' . join(components, '/') -endfunction - -"FUNCTION: Path.equals() {{{3 -" -"Determines whether 2 path objects are "equal". -"They are equal if the paths they represent are the same -" -"Args: -"path: the other path obj to compare this with -function! s:Path.equals(path) - return self.str() ==# a:path.str() -endfunction - -"FUNCTION: Path.New() {{{3 -"The Constructor for the Path object -function! s:Path.New(path) - let newPath = copy(self) - - call newPath.readInfoFromDisk(s:Path.AbsolutePathFor(a:path)) - - let newPath.cachedDisplayString = "" - - return newPath -endfunction - -"FUNCTION: Path.Slash() {{{3 -"return the slash to use for the current OS -function! s:Path.Slash() - return s:running_windows ? '\' : '/' -endfunction - -"FUNCTION: Path.readInfoFromDisk(fullpath) {{{3 -" -" -"Throws NERDTree.Path.InvalidArguments exception. -function! s:Path.readInfoFromDisk(fullpath) - call self.extractDriveLetter(a:fullpath) - - let fullpath = s:Path.WinToUnixPath(a:fullpath) - - if getftype(fullpath) ==# "fifo" - throw "NERDTree.InvalidFiletypeError: Cant handle FIFO files: " . a:fullpath - endif - - let self.pathSegments = split(fullpath, '/') - - let self.isReadOnly = 0 - if isdirectory(a:fullpath) - let self.isDirectory = 1 - elseif filereadable(a:fullpath) - let self.isDirectory = 0 - let self.isReadOnly = filewritable(a:fullpath) ==# 0 - else - throw "NERDTree.InvalidArgumentsError: Invalid path = " . a:fullpath - endif - - let self.isExecutable = 0 - if !self.isDirectory - let self.isExecutable = getfperm(a:fullpath) =~ 'x' - endif - - "grab the last part of the path (minus the trailing slash) - let lastPathComponent = self.getLastPathComponent(0) - - "get the path to the new node with the parent dir fully resolved - let hardPath = resolve(self.strTrunk()) . '/' . lastPathComponent - - "if the last part of the path is a symlink then flag it as such - let self.isSymLink = (resolve(hardPath) != hardPath) - if self.isSymLink - let self.symLinkDest = resolve(fullpath) - - "if the link is a dir then slap a / on the end of its dest - if isdirectory(self.symLinkDest) - - "we always wanna treat MS windows shortcuts as files for - "simplicity - if hardPath !~ '\.lnk$' - - let self.symLinkDest = self.symLinkDest . '/' - endif - endif - endif -endfunction - -"FUNCTION: Path.refresh() {{{3 -function! s:Path.refresh() - call self.readInfoFromDisk(self.str()) - call self.cacheDisplayString() -endfunction - -"FUNCTION: Path.rename() {{{3 -" -"Renames this node on the filesystem -function! s:Path.rename(newPath) - if a:newPath ==# '' - throw "NERDTree.InvalidArgumentsError: Invalid newPath for renaming = ". a:newPath - endif - - let success = rename(self.str(), a:newPath) - if success != 0 - throw "NERDTree.PathRenameError: Could not rename: '" . self.str() . "'" . 'to:' . a:newPath - endif - call self.readInfoFromDisk(a:newPath) - - for i in self.bookmarkNames() - let b = s:Bookmark.BookmarkFor(i) - call b.setPath(copy(self)) - endfor - call s:Bookmark.Write() -endfunction - -"FUNCTION: Path.str() {{{3 -" -"Returns a string representation of this Path -" -"Takes an optional dictionary param to specify how the output should be -"formatted. -" -"The dict may have the following keys: -" 'format' -" 'escape' -" 'truncateTo' -" -"The 'format' key may have a value of: -" 'Cd' - a string to be used with the :cd command -" 'Edit' - a string to be used with :e :sp :new :tabedit etc -" 'UI' - a string used in the NERD tree UI -" -"The 'escape' key, if specified will cause the output to be escaped with -"shellescape() -" -"The 'truncateTo' key causes the resulting string to be truncated to the value -"'truncateTo' maps to. A '<' char will be prepended. -function! s:Path.str(...) - let options = a:0 ? a:1 : {} - let toReturn = "" - - if has_key(options, 'format') - let format = options['format'] - if has_key(self, '_strFor' . format) - exec 'let toReturn = self._strFor' . format . '()' - else - raise 'NERDTree.UnknownFormatError: unknown format "'. format .'"' - endif - else - let toReturn = self._str() - endif - - if has_key(options, 'escape') && options['escape'] - let toReturn = shellescape(toReturn) - endif - - if has_key(options, 'truncateTo') - let limit = options['truncateTo'] - if len(toReturn) > limit - let toReturn = "<" . strpart(toReturn, len(toReturn) - limit + 1) - endif - endif - - return toReturn -endfunction - -"FUNCTION: Path._strForUI() {{{3 -function! s:Path._strForUI() - let toReturn = '/' . join(self.pathSegments, '/') - if self.isDirectory && toReturn != '/' - let toReturn = toReturn . '/' - endif - return toReturn -endfunction - -"FUNCTION: Path._strForCd() {{{3 -" -" returns a string that can be used with :cd -function! s:Path._strForCd() - return escape(self.str(), s:escape_chars) -endfunction -"FUNCTION: Path._strForEdit() {{{3 -" -"Return: the string for this path that is suitable to be used with the :edit -"command -function! s:Path._strForEdit() - let p = self.str({'format': 'UI'}) - let cwd = getcwd() - - if s:running_windows - let p = tolower(self.str()) - let cwd = tolower(getcwd()) - endif - - let p = escape(p, s:escape_chars) - - let cwd = cwd . s:Path.Slash() - - "return a relative path if we can - if stridx(p, cwd) ==# 0 - let p = strpart(p, strlen(cwd)) - endif - - if p ==# '' - let p = '.' - endif - - return p - -endfunction -"FUNCTION: Path._strForGlob() {{{3 -function! s:Path._strForGlob() - let lead = s:Path.Slash() - - "if we are running windows then slap a drive letter on the front - if s:running_windows - let lead = self.drive . '\' - endif - - let toReturn = lead . join(self.pathSegments, s:Path.Slash()) - - if !s:running_windows - let toReturn = escape(toReturn, s:escape_chars) - endif - return toReturn -endfunction -"FUNCTION: Path._str() {{{3 -" -"Gets the string path for this path object that is appropriate for the OS. -"EG, in windows c:\foo\bar -" in *nix /foo/bar -function! s:Path._str() - let lead = s:Path.Slash() - - "if we are running windows then slap a drive letter on the front - if s:running_windows - let lead = self.drive . '\' - endif - - return lead . join(self.pathSegments, s:Path.Slash()) -endfunction - -"FUNCTION: Path.strTrunk() {{{3 -"Gets the path without the last segment on the end. -function! s:Path.strTrunk() - return self.drive . '/' . join(self.pathSegments[0:-2], '/') -endfunction - -"FUNCTION: Path.WinToUnixPath(pathstr){{{3 -"Takes in a windows path and returns the unix equiv -" -"A class level method -" -"Args: -"pathstr: the windows path to convert -function! s:Path.WinToUnixPath(pathstr) - if !s:running_windows - return a:pathstr - endif - - let toReturn = a:pathstr - - "remove the x:\ of the front - let toReturn = substitute(toReturn, '^.*:\(\\\|/\)\?', '/', "") - - "convert all \ chars to / - let toReturn = substitute(toReturn, '\', '/', "g") - - return toReturn -endfunction - -" SECTION: General Functions {{{1 -"============================================================ -"FUNCTION: s:bufInWindows(bnum){{{2 -"[[STOLEN FROM VTREEEXPLORER.VIM]] -"Determine the number of windows open to this buffer number. -"Care of Yegappan Lakshman. Thanks! -" -"Args: -"bnum: the subject buffers buffer number -function! s:bufInWindows(bnum) - let cnt = 0 - let winnum = 1 - while 1 - let bufnum = winbufnr(winnum) - if bufnum < 0 - break - endif - if bufnum ==# a:bnum - let cnt = cnt + 1 - endif - let winnum = winnum + 1 - endwhile - - return cnt -endfunction " >>> -"FUNCTION: s:checkForBrowse(dir) {{{2 -"inits a secondary nerd tree in the current buffer if appropriate -function! s:checkForBrowse(dir) - if a:dir != '' && isdirectory(a:dir) - call s:initNerdTreeInPlace(a:dir) - endif -endfunction -"FUNCTION: s:compareBookmarks(first, second) {{{2 -"Compares two bookmarks -function! s:compareBookmarks(first, second) - return a:first.compareTo(a:second) -endfunction - -" FUNCTION: s:completeBookmarks(A,L,P) {{{2 -" completion function for the bookmark commands -function! s:completeBookmarks(A,L,P) - return filter(s:Bookmark.BookmarkNames(), 'v:val =~ "^' . a:A . '"') -endfunction -" FUNCTION: s:exec(cmd) {{{2 -" same as :exec cmd but eventignore=all is set for the duration -function! s:exec(cmd) - let old_ei = &ei - set ei=all - exec a:cmd - let &ei = old_ei -endfunction -" FUNCTION: s:findAndRevealPath() {{{2 -function! s:findAndRevealPath() - try - let p = s:Path.New(expand("%")) - catch /^NERDTree.InvalidArgumentsError/ - call s:echo("no file for the current buffer") - return - endtry - - if !s:treeExistsForTab() - call s:initNerdTree(p.getParent().str()) - else - if !p.isUnder(s:TreeFileNode.GetRootForTab().path) - call s:initNerdTree(p.getParent().str()) - else - if !s:isTreeOpen() - call s:toggle("") - endif - endif - endif - call s:putCursorInTreeWin() - call b:NERDTreeRoot.reveal(p) -endfunction -"FUNCTION: s:initNerdTree(name) {{{2 -"Initialise the nerd tree for this tab. The tree will start in either the -"given directory, or the directory associated with the given bookmark -" -"Args: -"name: the name of a bookmark or a directory -function! s:initNerdTree(name) - let path = {} - if s:Bookmark.BookmarkExistsFor(a:name) - let path = s:Bookmark.BookmarkFor(a:name).path - else - let dir = a:name ==# '' ? getcwd() : a:name - - "hack to get an absolute path if a relative path is given - if dir =~ '^\.' - let dir = getcwd() . s:Path.Slash() . dir - endif - let dir = resolve(dir) - - try - let path = s:Path.New(dir) - catch /^NERDTree.InvalidArgumentsError/ - call s:echo("No bookmark or directory found for: " . a:name) - return - endtry - endif - if !path.isDirectory - let path = path.getParent() - endif - - "if instructed to, then change the vim CWD to the dir the NERDTree is - "inited in - if g:NERDTreeChDirMode != 0 - call path.changeToDir() - endif - - if s:treeExistsForTab() - if s:isTreeOpen() - call s:closeTree() - endif - unlet t:NERDTreeBufName - endif - - let newRoot = s:TreeDirNode.New(path) - call newRoot.open() - - call s:createTreeWin() - let b:treeShowHelp = 0 - let b:NERDTreeIgnoreEnabled = 1 - let b:NERDTreeShowFiles = g:NERDTreeShowFiles - let b:NERDTreeShowHidden = g:NERDTreeShowHidden - let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks - let b:NERDTreeRoot = newRoot - - let b:NERDTreeType = "primary" - - call s:renderView() - call b:NERDTreeRoot.putCursorHere(0, 0) -endfunction - -"FUNCTION: s:initNerdTreeInPlace(dir) {{{2 -function! s:initNerdTreeInPlace(dir) - try - let path = s:Path.New(a:dir) - catch /^NERDTree.InvalidArgumentsError/ - call s:echo("Invalid directory name:" . a:name) - return - endtry - - "we want the directory buffer to disappear when we do the :edit below - setlocal bufhidden=wipe - - let previousBuf = expand("#") - - "we need a unique name for each secondary tree buffer to ensure they are - "all independent - exec "silent edit " . s:nextBufferName() - - let b:NERDTreePreviousBuf = bufnr(previousBuf) - - let b:NERDTreeRoot = s:TreeDirNode.New(path) - call b:NERDTreeRoot.open() - - "throwaway buffer options - setlocal noswapfile - setlocal buftype=nofile - setlocal bufhidden=hide - setlocal nowrap - setlocal foldcolumn=0 - setlocal nobuflisted - setlocal nospell - if g:NERDTreeShowLineNumbers - setlocal nu - else - setlocal nonu - endif - - iabc <buffer> - - if g:NERDTreeHighlightCursorline - setlocal cursorline - endif - - call s:setupStatusline() - - let b:treeShowHelp = 0 - let b:NERDTreeIgnoreEnabled = 1 - let b:NERDTreeShowFiles = g:NERDTreeShowFiles - let b:NERDTreeShowHidden = g:NERDTreeShowHidden - let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks - - let b:NERDTreeType = "secondary" - - call s:bindMappings() - setfiletype nerdtree - " syntax highlighting - if has("syntax") && exists("g:syntax_on") - call s:setupSyntaxHighlighting() - endif - - call s:renderView() -endfunction -" FUNCTION: s:initNerdTreeMirror() {{{2 -function! s:initNerdTreeMirror() - - "get the names off all the nerd tree buffers - let treeBufNames = [] - for i in range(1, tabpagenr("$")) - let nextName = s:tabpagevar(i, 'NERDTreeBufName') - if nextName != -1 && (!exists("t:NERDTreeBufName") || nextName != t:NERDTreeBufName) - call add(treeBufNames, nextName) - endif - endfor - let treeBufNames = s:unique(treeBufNames) - - "map the option names (that the user will be prompted with) to the nerd - "tree buffer names - let options = {} - let i = 0 - while i < len(treeBufNames) - let bufName = treeBufNames[i] - let treeRoot = getbufvar(bufName, "NERDTreeRoot") - let options[i+1 . '. ' . treeRoot.path.str() . ' (buf name: ' . bufName . ')'] = bufName - let i = i + 1 - endwhile - - "work out which tree to mirror, if there is more than 1 then ask the user - let bufferName = '' - if len(keys(options)) > 1 - let choices = ["Choose a tree to mirror"] - let choices = extend(choices, sort(keys(options))) - let choice = inputlist(choices) - if choice < 1 || choice > len(options) || choice ==# '' - return - endif - - let bufferName = options[sort(keys(options))[choice-1]] - elseif len(keys(options)) ==# 1 - let bufferName = values(options)[0] - else - call s:echo("No trees to mirror") - return - endif - - if s:treeExistsForTab() && s:isTreeOpen() - call s:closeTree() - endif - - let t:NERDTreeBufName = bufferName - call s:createTreeWin() - exec 'buffer ' . bufferName - if !&hidden - call s:renderView() - endif -endfunction -" FUNCTION: s:nextBufferName() {{{2 -" returns the buffer name for the next nerd tree -function! s:nextBufferName() - let name = s:NERDTreeBufName . s:next_buffer_number - let s:next_buffer_number += 1 - return name -endfunction -" FUNCTION: s:tabpagevar(tabnr, var) {{{2 -function! s:tabpagevar(tabnr, var) - let currentTab = tabpagenr() - let old_ei = &ei - set ei=all - - exec "tabnext " . a:tabnr - let v = -1 - if exists('t:' . a:var) - exec 'let v = t:' . a:var - endif - exec "tabnext " . currentTab - - let &ei = old_ei - - return v -endfunction -" Function: s:treeExistsForBuffer() {{{2 -" Returns 1 if a nerd tree root exists in the current buffer -function! s:treeExistsForBuf() - return exists("b:NERDTreeRoot") -endfunction -" Function: s:treeExistsForTab() {{{2 -" Returns 1 if a nerd tree root exists in the current tab -function! s:treeExistsForTab() - return exists("t:NERDTreeBufName") -endfunction -" Function: s:unique(list) {{{2 -" returns a:list without duplicates -function! s:unique(list) - let uniqlist = [] - for elem in a:list - if index(uniqlist, elem) ==# -1 - let uniqlist += [elem] - endif - endfor - return uniqlist -endfunction -" SECTION: Public API {{{1 -"============================================================ -let g:NERDTreePath = s:Path -let g:NERDTreeDirNode = s:TreeDirNode -let g:NERDTreeFileNode = s:TreeFileNode -let g:NERDTreeBookmark = s:Bookmark - -function! NERDTreeAddMenuItem(options) - call s:MenuItem.Create(a:options) -endfunction - -function! NERDTreeAddMenuSeparator(...) - let opts = a:0 ? a:1 : {} - call s:MenuItem.CreateSeparator(opts) -endfunction - -function! NERDTreeAddSubmenu(options) - return s:MenuItem.Create(a:options) -endfunction - -function! NERDTreeAddKeyMap(options) - call s:KeyMap.Create(a:options) -endfunction - -function! NERDTreeRender() - call s:renderView() -endfunction - -" SECTION: View Functions {{{1 -"============================================================ -"FUNCTION: s:centerView() {{{2 -"centers the nerd tree window around the cursor (provided the nerd tree -"options permit) -function! s:centerView() - if g:NERDTreeAutoCenter - let current_line = winline() - let lines_to_top = current_line - let lines_to_bottom = winheight(s:getTreeWinNum()) - current_line - if lines_to_top < g:NERDTreeAutoCenterThreshold || lines_to_bottom < g:NERDTreeAutoCenterThreshold - normal! zz - endif - endif -endfunction -"FUNCTION: s:closeTree() {{{2 -"Closes the primary NERD tree window for this tab -function! s:closeTree() - if !s:isTreeOpen() - throw "NERDTree.NoTreeFoundError: no NERDTree is open" - endif - - if winnr("$") != 1 - call s:exec(s:getTreeWinNum() . " wincmd w") - close - call s:exec("wincmd p") - else - close - endif -endfunction - -"FUNCTION: s:closeTreeIfOpen() {{{2 -"Closes the NERD tree window if it is open -function! s:closeTreeIfOpen() - if s:isTreeOpen() - call s:closeTree() - endif -endfunction -"FUNCTION: s:closeTreeIfQuitOnOpen() {{{2 -"Closes the NERD tree window if the close on open option is set -function! s:closeTreeIfQuitOnOpen() - if g:NERDTreeQuitOnOpen && s:isTreeOpen() - call s:closeTree() - endif -endfunction -"FUNCTION: s:createTreeWin() {{{2 -"Inits the NERD tree window. ie. opens it, sizes it, sets all the local -"options etc -function! s:createTreeWin() - "create the nerd tree window - let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright " - let splitSize = g:NERDTreeWinSize - - if !exists('t:NERDTreeBufName') - let t:NERDTreeBufName = s:nextBufferName() - silent! exec splitLocation . 'vertical ' . splitSize . ' new' - silent! exec "edit " . t:NERDTreeBufName - else - silent! exec splitLocation . 'vertical ' . splitSize . ' split' - silent! exec "buffer " . t:NERDTreeBufName - endif - - setlocal winfixwidth - - "throwaway buffer options - setlocal noswapfile - setlocal buftype=nofile - setlocal nowrap - setlocal foldcolumn=0 - setlocal nobuflisted - setlocal nospell - if g:NERDTreeShowLineNumbers - setlocal nu - else - setlocal nonu - endif - - iabc <buffer> - - if g:NERDTreeHighlightCursorline - setlocal cursorline - endif - - call s:setupStatusline() - - call s:bindMappings() - setfiletype nerdtree - " syntax highlighting - if has("syntax") && exists("g:syntax_on") - call s:setupSyntaxHighlighting() - endif -endfunction - -"FUNCTION: s:dumpHelp {{{2 -"prints out the quick help -function! s:dumpHelp() - let old_h = @h - if b:treeShowHelp ==# 1 - let @h= "\" NERD tree (" . s:NERD_tree_version . ") quickhelp~\n" - let @h=@h."\" ============================\n" - let @h=@h."\" File node mappings~\n" - let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n" - let @h=@h."\" <CR>,\n" - if b:NERDTreeType ==# "primary" - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n" - else - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in current window\n" - endif - if b:NERDTreeType ==# "primary" - let @h=@h."\" ". g:NERDTreeMapPreview .": preview\n" - endif - let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" - let @h=@h."\" middle-click,\n" - let @h=@h."\" ". g:NERDTreeMapOpenSplit .": open split\n" - let @h=@h."\" ". g:NERDTreeMapPreviewSplit .": preview split\n" - let @h=@h."\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n" - let @h=@h."\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n" - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Directory node mappings~\n" - let @h=@h."\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n" - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open & close node\n" - let @h=@h."\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n" - let @h=@h."\" ". g:NERDTreeMapCloseDir .": close parent of node\n" - let @h=@h."\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n" - let @h=@h."\" current node recursively\n" - let @h=@h."\" middle-click,\n" - let @h=@h."\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n" - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Bookmark table mappings~\n" - let @h=@h."\" double-click,\n" - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open bookmark\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" - let @h=@h."\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n" - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Tree navigation mappings~\n" - let @h=@h."\" ". g:NERDTreeMapJumpRoot .": go to root\n" - let @h=@h."\" ". g:NERDTreeMapJumpParent .": go to parent\n" - let @h=@h."\" ". g:NERDTreeMapJumpFirstChild .": go to first child\n" - let @h=@h."\" ". g:NERDTreeMapJumpLastChild .": go to last child\n" - let @h=@h."\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n" - let @h=@h."\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n" - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Filesystem mappings~\n" - let @h=@h."\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n" - let @h=@h."\" selected dir\n" - let @h=@h."\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n" - let @h=@h."\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n" - let @h=@h."\" but leave old root open\n" - let @h=@h."\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n" - let @h=@h."\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n" - let @h=@h."\" ". g:NERDTreeMapMenu .": Show menu\n" - let @h=@h."\" ". g:NERDTreeMapChdir .":change the CWD to the\n" - let @h=@h."\" selected dir\n" - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Tree filtering mappings~\n" - let @h=@h."\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (b:NERDTreeShowHidden ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleFilters .": file filters (" . (b:NERDTreeIgnoreEnabled ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleFiles .": files (" . (b:NERDTreeShowFiles ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (b:NERDTreeShowBookmarks ? "on" : "off") . ")\n" - - "add quickhelp entries for each custom key map - if len(s:KeyMap.All()) - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Custom mappings~\n" - for i in s:KeyMap.All() - let @h=@h."\" ". i.key .": ". i.quickhelpText ."\n" - endfor - endif - - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Other mappings~\n" - let @h=@h."\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n" - let @h=@h."\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n" - let @h=@h."\" the NERDTree window\n" - let @h=@h."\" ". g:NERDTreeMapHelp .": toggle help\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Bookmark commands~\n" - let @h=@h."\" :Bookmark <name>\n" - let @h=@h."\" :BookmarkToRoot <name>\n" - let @h=@h."\" :RevealBookmark <name>\n" - let @h=@h."\" :OpenBookmark <name>\n" - let @h=@h."\" :ClearBookmarks [<names>]\n" - let @h=@h."\" :ClearAllBookmarks\n" - else - let @h="\" Press ". g:NERDTreeMapHelp ." for help\n" - endif - - silent! put h - - let @h = old_h -endfunction -"FUNCTION: s:echo {{{2 -"A wrapper for :echo. Appends 'NERDTree:' on the front of all messages -" -"Args: -"msg: the message to echo -function! s:echo(msg) - redraw - echomsg "NERDTree: " . a:msg -endfunction -"FUNCTION: s:echoWarning {{{2 -"Wrapper for s:echo, sets the message type to warningmsg for this message -"Args: -"msg: the message to echo -function! s:echoWarning(msg) - echohl warningmsg - call s:echo(a:msg) - echohl normal -endfunction -"FUNCTION: s:echoError {{{2 -"Wrapper for s:echo, sets the message type to errormsg for this message -"Args: -"msg: the message to echo -function! s:echoError(msg) - echohl errormsg - call s:echo(a:msg) - echohl normal -endfunction -"FUNCTION: s:firstUsableWindow(){{{2 -"find the window number of the first normal window -function! s:firstUsableWindow() - let i = 1 - while i <= winnr("$") - let bnum = winbufnr(i) - if bnum != -1 && getbufvar(bnum, '&buftype') ==# '' - \ && !getwinvar(i, '&previewwindow') - \ && (!getbufvar(bnum, '&modified') || &hidden) - return i - endif - - let i += 1 - endwhile - return -1 -endfunction -"FUNCTION: s:getPath(ln) {{{2 -"Gets the full path to the node that is rendered on the given line number -" -"Args: -"ln: the line number to get the path for -" -"Return: -"A path if a node was selected, {} if nothing is selected. -"If the 'up a dir' line was selected then the path to the parent of the -"current root is returned -function! s:getPath(ln) - let line = getline(a:ln) - - let rootLine = s:TreeFileNode.GetRootLineNum() - - "check to see if we have the root node - if a:ln == rootLine - return b:NERDTreeRoot.path - endif - - " in case called from outside the tree - if line !~ '^ *[|`]' || line =~ '^$' - return {} - endif - - if line ==# s:tree_up_dir_line - return b:NERDTreeRoot.path.getParent() - endif - - let indent = s:indentLevelFor(line) - - "remove the tree parts and the leading space - let curFile = s:stripMarkupFromLine(line, 0) - - let wasdir = 0 - if curFile =~ '/$' - let wasdir = 1 - let curFile = substitute(curFile, '/\?$', '/', "") - endif - - let dir = "" - let lnum = a:ln - while lnum > 0 - let lnum = lnum - 1 - let curLine = getline(lnum) - let curLineStripped = s:stripMarkupFromLine(curLine, 1) - - "have we reached the top of the tree? - if lnum == rootLine - let dir = b:NERDTreeRoot.path.str({'format': 'UI'}) . dir - break - endif - if curLineStripped =~ '/$' - let lpindent = s:indentLevelFor(curLine) - if lpindent < indent - let indent = indent - 1 - - let dir = substitute (curLineStripped,'^\\', "", "") . dir - continue - endif - endif - endwhile - let curFile = b:NERDTreeRoot.path.drive . dir . curFile - let toReturn = s:Path.New(curFile) - return toReturn -endfunction - -"FUNCTION: s:getTreeWinNum() {{{2 -"gets the nerd tree window number for this tab -function! s:getTreeWinNum() - if exists("t:NERDTreeBufName") - return bufwinnr(t:NERDTreeBufName) - else - return -1 - endif -endfunction -"FUNCTION: s:indentLevelFor(line) {{{2 -function! s:indentLevelFor(line) - return match(a:line, '[^ \-+~`|]') / s:tree_wid -endfunction -"FUNCTION: s:isTreeOpen() {{{2 -function! s:isTreeOpen() - return s:getTreeWinNum() != -1 -endfunction -"FUNCTION: s:isWindowUsable(winnumber) {{{2 -"Returns 0 if opening a file from the tree in the given window requires it to -"be split, 1 otherwise -" -"Args: -"winnumber: the number of the window in question -function! s:isWindowUsable(winnumber) - "gotta split if theres only one window (i.e. the NERD tree) - if winnr("$") ==# 1 - return 0 - endif - - let oldwinnr = winnr() - call s:exec(a:winnumber . "wincmd p") - let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow') - let modified = &modified - call s:exec(oldwinnr . "wincmd p") - - "if its a special window e.g. quickfix or another explorer plugin then we - "have to split - if specialWindow - return 0 - endif - - if &hidden - return 1 - endif - - return !modified || s:bufInWindows(winbufnr(a:winnumber)) >= 2 -endfunction - -" FUNCTION: s:jumpToChild(direction) {{{2 -" Args: -" direction: 0 if going to first child, 1 if going to last -function! s:jumpToChild(direction) - let currentNode = s:TreeFileNode.GetSelected() - if currentNode ==# {} || currentNode.isRoot() - call s:echo("cannot jump to " . (a:direction ? "last" : "first") . " child") - return - end - let dirNode = currentNode.parent - let childNodes = dirNode.getVisibleChildren() - - let targetNode = childNodes[0] - if a:direction - let targetNode = childNodes[len(childNodes) - 1] - endif - - if targetNode.equals(currentNode) - let siblingDir = currentNode.parent.findOpenDirSiblingWithVisibleChildren(a:direction) - if siblingDir != {} - let indx = a:direction ? siblingDir.getVisibleChildCount()-1 : 0 - let targetNode = siblingDir.getChildByIndex(indx, 1) - endif - endif - - call targetNode.putCursorHere(1, 0) - - call s:centerView() -endfunction - - -"FUNCTION: s:promptToDelBuffer(bufnum, msg){{{2 -"prints out the given msg and, if the user responds by pushing 'y' then the -"buffer with the given bufnum is deleted -" -"Args: -"bufnum: the buffer that may be deleted -"msg: a message that will be echoed to the user asking them if they wish to -" del the buffer -function! s:promptToDelBuffer(bufnum, msg) - echo a:msg - if nr2char(getchar()) ==# 'y' - exec "silent bdelete! " . a:bufnum - endif -endfunction - -"FUNCTION: s:putCursorOnBookmarkTable(){{{2 -"Places the cursor at the top of the bookmarks table -function! s:putCursorOnBookmarkTable() - if !b:NERDTreeShowBookmarks - throw "NERDTree.IllegalOperationError: cant find bookmark table, bookmarks arent active" - endif - - let rootNodeLine = s:TreeFileNode.GetRootLineNum() - - let line = 1 - while getline(line) !~ '^>-\+Bookmarks-\+$' - let line = line + 1 - if line >= rootNodeLine - throw "NERDTree.BookmarkTableNotFoundError: didnt find the bookmarks table" - endif - endwhile - call cursor(line, 0) -endfunction - -"FUNCTION: s:putCursorInTreeWin(){{{2 -"Places the cursor in the nerd tree window -function! s:putCursorInTreeWin() - if !s:isTreeOpen() - throw "NERDTree.InvalidOperationError: cant put cursor in NERD tree window, no window exists" - endif - - call s:exec(s:getTreeWinNum() . "wincmd w") -endfunction - -"FUNCTION: s:renderBookmarks {{{2 -function! s:renderBookmarks() - - call setline(line(".")+1, ">----------Bookmarks----------") - call cursor(line(".")+1, col(".")) - - for i in s:Bookmark.Bookmarks() - call setline(line(".")+1, i.str()) - call cursor(line(".")+1, col(".")) - endfor - - call setline(line(".")+1, '') - call cursor(line(".")+1, col(".")) -endfunction -"FUNCTION: s:renderView {{{2 -"The entry function for rendering the tree -function! s:renderView() - setlocal modifiable - - "remember the top line of the buffer and the current line so we can - "restore the view exactly how it was - let curLine = line(".") - let curCol = col(".") - let topLine = line("w0") - - "delete all lines in the buffer (being careful not to clobber a register) - silent 1,$delete _ - - call s:dumpHelp() - - "delete the blank line before the help and add one after it - call setline(line(".")+1, "") - call cursor(line(".")+1, col(".")) - - if b:NERDTreeShowBookmarks - call s:renderBookmarks() - endif - - "add the 'up a dir' line - call setline(line(".")+1, s:tree_up_dir_line) - call cursor(line(".")+1, col(".")) - - "draw the header line - let header = b:NERDTreeRoot.path.str({'format': 'UI', 'truncateTo': winwidth(0)}) - call setline(line(".")+1, header) - call cursor(line(".")+1, col(".")) - - "draw the tree - let old_o = @o - let @o = b:NERDTreeRoot.renderToString() - silent put o - let @o = old_o - - "delete the blank line at the top of the buffer - silent 1,1delete _ - - "restore the view - let old_scrolloff=&scrolloff - let &scrolloff=0 - call cursor(topLine, 1) - normal! zt - call cursor(curLine, curCol) - let &scrolloff = old_scrolloff - - setlocal nomodifiable -endfunction - -"FUNCTION: s:renderViewSavingPosition {{{2 -"Renders the tree and ensures the cursor stays on the current node or the -"current nodes parent if it is no longer available upon re-rendering -function! s:renderViewSavingPosition() - let currentNode = s:TreeFileNode.GetSelected() - - "go up the tree till we find a node that will be visible or till we run - "out of nodes - while currentNode != {} && !currentNode.isVisible() && !currentNode.isRoot() - let currentNode = currentNode.parent - endwhile - - call s:renderView() - - if currentNode != {} - call currentNode.putCursorHere(0, 0) - endif -endfunction -"FUNCTION: s:restoreScreenState() {{{2 -" -"Sets the screen state back to what it was when s:saveScreenState was last -"called. -" -"Assumes the cursor is in the NERDTree window -function! s:restoreScreenState() - if !exists("b:NERDTreeOldTopLine") || !exists("b:NERDTreeOldPos") || !exists("b:NERDTreeOldWindowSize") - return - endif - exec("silent vertical resize ".b:NERDTreeOldWindowSize) - - let old_scrolloff=&scrolloff - let &scrolloff=0 - call cursor(b:NERDTreeOldTopLine, 0) - normal! zt - call setpos(".", b:NERDTreeOldPos) - let &scrolloff=old_scrolloff -endfunction - -"FUNCTION: s:saveScreenState() {{{2 -"Saves the current cursor position in the current buffer and the window -"scroll position -function! s:saveScreenState() - let win = winnr() - try - call s:putCursorInTreeWin() - let b:NERDTreeOldPos = getpos(".") - let b:NERDTreeOldTopLine = line("w0") - let b:NERDTreeOldWindowSize = winwidth("") - call s:exec(win . "wincmd w") - catch /^NERDTree.InvalidOperationError/ - endtry -endfunction - -"FUNCTION: s:setupStatusline() {{{2 -function! s:setupStatusline() - if g:NERDTreeStatusline != -1 - let &l:statusline = g:NERDTreeStatusline - endif -endfunction -"FUNCTION: s:setupSyntaxHighlighting() {{{2 -function! s:setupSyntaxHighlighting() - "treeFlags are syntax items that should be invisible, but give clues as to - "how things should be highlighted - syn match treeFlag #\~# - syn match treeFlag #\[RO\]# - - "highlighting for the .. (up dir) line at the top of the tree - execute "syn match treeUp #". s:tree_up_dir_line ."#" - - "highlighting for the ~/+ symbols for the directory nodes - syn match treeClosable #\~\<# - syn match treeClosable #\~\.# - syn match treeOpenable #+\<# - syn match treeOpenable #+\.#he=e-1 - - "highlighting for the tree structural parts - syn match treePart #|# - syn match treePart #`# - syn match treePartFile #[|`]-#hs=s+1 contains=treePart - - "quickhelp syntax elements - syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1 - syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1 - syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag - syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey - syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey - syn match treeHelpCommand #" :.\{-}\>#hs=s+3 - syn match treeHelp #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand - - "highlighting for readonly files - syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile - - "highlighting for sym links - syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash - - "highlighing for directory nodes and file nodes - syn match treeDirSlash #/# - syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable - syn match treeExecFile #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark - syn match treeFile #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile - syn match treeFile #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile - syn match treeCWD #^/.*$# - - "highlighting for bookmarks - syn match treeBookmark # {.*}#hs=s+1 - - "highlighting for the bookmarks table - syn match treeBookmarksLeader #^># - syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader - syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader - syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader - - if g:NERDChristmasTree - hi def link treePart Special - hi def link treePartFile Type - hi def link treeFile Normal - hi def link treeExecFile Title - hi def link treeDirSlash Identifier - hi def link treeClosable Type - else - hi def link treePart Normal - hi def link treePartFile Normal - hi def link treeFile Normal - hi def link treeClosable Title - endif - - hi def link treeBookmarksHeader statement - hi def link treeBookmarksLeader ignore - hi def link treeBookmarkName Identifier - hi def link treeBookmark normal - - hi def link treeHelp String - hi def link treeHelpKey Identifier - hi def link treeHelpCommand Identifier - hi def link treeHelpTitle Macro - hi def link treeToggleOn Question - hi def link treeToggleOff WarningMsg - - hi def link treeDir Directory - hi def link treeUp Directory - hi def link treeCWD Statement - hi def link treeLink Macro - hi def link treeOpenable Title - hi def link treeFlag ignore - hi def link treeRO WarningMsg - hi def link treeBookmark Statement - - hi def link NERDTreeCurrentNode Search -endfunction - -"FUNCTION: s:stripMarkupFromLine(line, removeLeadingSpaces){{{2 -"returns the given line with all the tree parts stripped off -" -"Args: -"line: the subject line -"removeLeadingSpaces: 1 if leading spaces are to be removed (leading spaces = -"any spaces before the actual text of the node) -function! s:stripMarkupFromLine(line, removeLeadingSpaces) - let line = a:line - "remove the tree parts and the leading space - let line = substitute (line, s:tree_markup_reg,"","") - - "strip off any read only flag - let line = substitute (line, ' \[RO\]', "","") - - "strip off any bookmark flags - let line = substitute (line, ' {[^}]*}', "","") - - "strip off any executable flags - let line = substitute (line, '*\ze\($\| \)', "","") - - let wasdir = 0 - if line =~ '/$' - let wasdir = 1 - endif - let line = substitute (line,' -> .*',"","") " remove link to - if wasdir ==# 1 - let line = substitute (line, '/\?$', '/', "") - endif - - if a:removeLeadingSpaces - let line = substitute (line, '^ *', '', '') - endif - - return line -endfunction - -"FUNCTION: s:toggle(dir) {{{2 -"Toggles the NERD tree. I.e the NERD tree is open, it is closed, if it is -"closed it is restored or initialized (if it doesnt exist) -" -"Args: -"dir: the full path for the root node (is only used if the NERD tree is being -"initialized. -function! s:toggle(dir) - if s:treeExistsForTab() - if !s:isTreeOpen() - call s:createTreeWin() - if !&hidden - call s:renderView() - endif - call s:restoreScreenState() - else - call s:closeTree() - endif - else - call s:initNerdTree(a:dir) - endif -endfunction -"SECTION: Interface bindings {{{1 -"============================================================ -"FUNCTION: s:activateNode(forceKeepWindowOpen) {{{2 -"If the current node is a file, open it in the previous window (or a new one -"if the previous is modified). If it is a directory then it is opened. -" -"args: -"forceKeepWindowOpen - dont close the window even if NERDTreeQuitOnOpen is set -function! s:activateNode(forceKeepWindowOpen) - if getline(".") ==# s:tree_up_dir_line - return s:upDir(0) - endif - - let treenode = s:TreeFileNode.GetSelected() - if treenode != {} - call treenode.activate(a:forceKeepWindowOpen) - else - let bookmark = s:Bookmark.GetSelected() - if !empty(bookmark) - call bookmark.activate() - endif - endif -endfunction - -"FUNCTION: s:bindMappings() {{{2 -function! s:bindMappings() - " set up mappings and commands for this buffer - nnoremap <silent> <buffer> <middlerelease> :call <SID>handleMiddleMouse()<cr> - nnoremap <silent> <buffer> <leftrelease> <leftrelease>:call <SID>checkForActivate()<cr> - nnoremap <silent> <buffer> <2-leftmouse> :call <SID>activateNode(0)<cr> - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapActivateNode . " :call <SID>activateNode(0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenSplit ." :call <SID>openEntrySplit(0,0)<cr>" - exec "nnoremap <silent> <buffer> <cr> :call <SID>activateNode(0)<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreview ." :call <SID>previewNode(0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewSplit ." :call <SID>previewNode(1)<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenVSplit ." :call <SID>openEntrySplit(1,0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewVSplit ." :call <SID>previewNode(2)<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenRecursively ." :call <SID>openNodeRecursively()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapUpdirKeepOpen ." :call <SID>upDir(1)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapUpdir ." :call <SID>upDir(0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapChangeRoot ." :call <SID>chRoot()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapChdir ." :call <SID>chCwd()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapQuit ." :call <SID>closeTreeWindow()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefreshRoot ." :call <SID>refreshRoot()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefresh ." :call <SID>refreshCurrent()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapHelp ." :call <SID>displayHelp()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleZoom ." :call <SID>toggleZoom()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleHidden ." :call <SID>toggleShowHidden()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleFilters ." :call <SID>toggleIgnoreFilter()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleFiles ." :call <SID>toggleShowFiles()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleBookmarks ." :call <SID>toggleShowBookmarks()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapCloseDir ." :call <SID>closeCurrentDir()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapCloseChildren ." :call <SID>closeChildren()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapMenu ." :call <SID>showMenu()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpParent ." :call <SID>jumpToParent()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpNextSibling ." :call <SID>jumpToSibling(1)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpPrevSibling ." :call <SID>jumpToSibling(0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpFirstChild ." :call <SID>jumpToFirstChild()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpLastChild ." :call <SID>jumpToLastChild()<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpRoot ." :call <SID>jumpToRoot()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>" - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTabSilent ." :call <SID>openInNewTab(1)<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenExpl ." :call <SID>openExplorer()<cr>" - - exec "nnoremap <silent> <buffer> ". g:NERDTreeMapDeleteBookmark ." :call <SID>deleteBookmark()<cr>" - - "bind all the user custom maps - call s:KeyMap.BindAll() - - command! -buffer -nargs=1 Bookmark :call <SID>bookmarkNode('<args>') - command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 RevealBookmark :call <SID>revealBookmark('<args>') - command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 OpenBookmark :call <SID>openBookmark('<args>') - command! -buffer -complete=customlist,s:completeBookmarks -nargs=* ClearBookmarks call <SID>clearBookmarks('<args>') - command! -buffer -complete=customlist,s:completeBookmarks -nargs=+ BookmarkToRoot call s:Bookmark.ToRoot('<args>') - command! -buffer -nargs=0 ClearAllBookmarks call s:Bookmark.ClearAll() <bar> call <SID>renderView() - command! -buffer -nargs=0 ReadBookmarks call s:Bookmark.CacheBookmarks(0) <bar> call <SID>renderView() - command! -buffer -nargs=0 WriteBookmarks call s:Bookmark.Write() -endfunction - -" FUNCTION: s:bookmarkNode(name) {{{2 -" Associate the current node with the given name -function! s:bookmarkNode(name) - let currentNode = s:TreeFileNode.GetSelected() - if currentNode != {} - try - call currentNode.bookmark(a:name) - call s:renderView() - catch /^NERDTree.IllegalBookmarkNameError/ - call s:echo("bookmark names must not contain spaces") - endtry - else - call s:echo("select a node first") - endif -endfunction -"FUNCTION: s:checkForActivate() {{{2 -"Checks if the click should open the current node, if so then activate() is -"called (directories are automatically opened if the symbol beside them is -"clicked) -function! s:checkForActivate() - let currentNode = s:TreeFileNode.GetSelected() - if currentNode != {} - let startToCur = strpart(getline(line(".")), 0, col(".")) - let char = strpart(startToCur, strlen(startToCur)-1, 1) - - "if they clicked a dir, check if they clicked on the + or ~ sign - "beside it - if currentNode.path.isDirectory - if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]' - call s:activateNode(0) - return - endif - endif - - if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3 - if char !~ s:tree_markup_reg && startToCur !~ '\/$' - call s:activateNode(0) - return - endif - endif - endif -endfunction - -" FUNCTION: s:chCwd() {{{2 -function! s:chCwd() - let treenode = s:TreeFileNode.GetSelected() - if treenode ==# {} - call s:echo("Select a node first") - return - endif - - try - call treenode.path.changeToDir() - catch /^NERDTree.PathChangeError/ - call s:echoWarning("could not change cwd") - endtry -endfunction - -" FUNCTION: s:chRoot() {{{2 -" changes the current root to the selected one -function! s:chRoot() - let treenode = s:TreeFileNode.GetSelected() - if treenode ==# {} - call s:echo("Select a node first") - return - endif - - call treenode.makeRoot() - call s:renderView() - call b:NERDTreeRoot.putCursorHere(0, 0) -endfunction - -" FUNCTION: s:clearBookmarks(bookmarks) {{{2 -function! s:clearBookmarks(bookmarks) - if a:bookmarks ==# '' - let currentNode = s:TreeFileNode.GetSelected() - if currentNode != {} - call currentNode.clearBoomarks() - endif - else - for name in split(a:bookmarks, ' ') - let bookmark = s:Bookmark.BookmarkFor(name) - call bookmark.delete() - endfor - endif - call s:renderView() -endfunction -" FUNCTION: s:closeChildren() {{{2 -" closes all childnodes of the current node -function! s:closeChildren() - let currentNode = s:TreeDirNode.GetSelected() - if currentNode ==# {} - call s:echo("Select a node first") - return - endif - - call currentNode.closeChildren() - call s:renderView() - call currentNode.putCursorHere(0, 0) -endfunction -" FUNCTION: s:closeCurrentDir() {{{2 -" closes the parent dir of the current node -function! s:closeCurrentDir() - let treenode = s:TreeFileNode.GetSelected() - if treenode ==# {} - call s:echo("Select a node first") - return - endif - - let parent = treenode.parent - if parent ==# {} || parent.isRoot() - call s:echo("cannot close tree root") - else - call treenode.parent.close() - call s:renderView() - call treenode.parent.putCursorHere(0, 0) - endif -endfunction -" FUNCTION: s:closeTreeWindow() {{{2 -" close the tree window -function! s:closeTreeWindow() - if b:NERDTreeType ==# "secondary" && b:NERDTreePreviousBuf != -1 - exec "buffer " . b:NERDTreePreviousBuf - else - if winnr("$") > 1 - call s:closeTree() - else - call s:echo("Cannot close last window") - endif - endif -endfunction -" FUNCTION: s:deleteBookmark() {{{2 -" if the cursor is on a bookmark, prompt to delete -function! s:deleteBookmark() - let bookmark = s:Bookmark.GetSelected() - if bookmark ==# {} - call s:echo("Put the cursor on a bookmark") - return - endif - - echo "Are you sure you wish to delete the bookmark:\n\"" . bookmark.name . "\" (yN):" - - if nr2char(getchar()) ==# 'y' - try - call bookmark.delete() - call s:renderView() - redraw - catch /^NERDTree/ - call s:echoWarning("Could not remove bookmark") - endtry - else - call s:echo("delete aborted" ) - endif - -endfunction - -" FUNCTION: s:displayHelp() {{{2 -" toggles the help display -function! s:displayHelp() - let b:treeShowHelp = b:treeShowHelp ? 0 : 1 - call s:renderView() - call s:centerView() -endfunction - -" FUNCTION: s:handleMiddleMouse() {{{2 -function! s:handleMiddleMouse() - let curNode = s:TreeFileNode.GetSelected() - if curNode ==# {} - call s:echo("Put the cursor on a node first" ) - return - endif - - if curNode.path.isDirectory - call s:openExplorer() - else - call s:openEntrySplit(0,0) - endif -endfunction - - -" FUNCTION: s:jumpToFirstChild() {{{2 -" wrapper for the jump to child method -function! s:jumpToFirstChild() - call s:jumpToChild(0) -endfunction - -" FUNCTION: s:jumpToLastChild() {{{2 -" wrapper for the jump to child method -function! s:jumpToLastChild() - call s:jumpToChild(1) -endfunction - -" FUNCTION: s:jumpToParent() {{{2 -" moves the cursor to the parent of the current node -function! s:jumpToParent() - let currentNode = s:TreeFileNode.GetSelected() - if !empty(currentNode) - if !empty(currentNode.parent) - call currentNode.parent.putCursorHere(1, 0) - call s:centerView() - else - call s:echo("cannot jump to parent") - endif - else - call s:echo("put the cursor on a node first") - endif -endfunction - -" FUNCTION: s:jumpToRoot() {{{2 -" moves the cursor to the root node -function! s:jumpToRoot() - call b:NERDTreeRoot.putCursorHere(1, 0) - call s:centerView() -endfunction - -" FUNCTION: s:jumpToSibling() {{{2 -" moves the cursor to the sibling of the current node in the given direction -" -" Args: -" forward: 1 if the cursor should move to the next sibling, 0 if it should -" move back to the previous sibling -function! s:jumpToSibling(forward) - let currentNode = s:TreeFileNode.GetSelected() - if !empty(currentNode) - let sibling = currentNode.findSibling(a:forward) - - if !empty(sibling) - call sibling.putCursorHere(1, 0) - call s:centerView() - endif - else - call s:echo("put the cursor on a node first") - endif -endfunction - -" FUNCTION: s:openBookmark(name) {{{2 -" put the cursor on the given bookmark and, if its a file, open it -function! s:openBookmark(name) - try - let targetNode = s:Bookmark.GetNodeForName(a:name, 0) - call targetNode.putCursorHere(0, 1) - redraw! - catch /^NERDTree.BookmarkedNodeNotFoundError/ - call s:echo("note - target node is not cached") - let bookmark = s:Bookmark.BookmarkFor(a:name) - let targetNode = s:TreeFileNode.New(bookmark.path) - endtry - if targetNode.path.isDirectory - call targetNode.openExplorer() - else - call targetNode.open() - endif -endfunction -" FUNCTION: s:openEntrySplit(vertical, forceKeepWindowOpen) {{{2 -"Opens the currently selected file from the explorer in a -"new window -" -"args: -"forceKeepWindowOpen - dont close the window even if NERDTreeQuitOnOpen is set -function! s:openEntrySplit(vertical, forceKeepWindowOpen) - let treenode = s:TreeFileNode.GetSelected() - if treenode != {} - if a:vertical - call treenode.openVSplit() - else - call treenode.openSplit() - endif - if !a:forceKeepWindowOpen - call s:closeTreeIfQuitOnOpen() - endif - else - call s:echo("select a node first") - endif -endfunction - -" FUNCTION: s:openExplorer() {{{2 -function! s:openExplorer() - let treenode = s:TreeDirNode.GetSelected() - if treenode != {} - call treenode.openExplorer() - else - call s:echo("select a node first") - endif -endfunction - -" FUNCTION: s:openInNewTab(stayCurrentTab) {{{2 -" Opens the selected node or bookmark in a new tab -" Args: -" stayCurrentTab: if 1 then vim will stay in the current tab, if 0 then vim -" will go to the tab where the new file is opened -function! s:openInNewTab(stayCurrentTab) - let target = s:TreeFileNode.GetSelected() - if target == {} - let target = s:Bookmark.GetSelected() - endif - - if target != {} - call target.openInNewTab({'stayInCurrentTab': a:stayCurrentTab}) - endif -endfunction - -" FUNCTION: s:openNodeRecursively() {{{2 -function! s:openNodeRecursively() - let treenode = s:TreeFileNode.GetSelected() - if treenode ==# {} || treenode.path.isDirectory ==# 0 - call s:echo("Select a directory node first" ) - else - call s:echo("Recursively opening node. Please wait...") - call treenode.openRecursively() - call s:renderView() - redraw - call s:echo("Recursively opening node. Please wait... DONE") - endif - -endfunction - -"FUNCTION: s:previewNode() {{{2 -"Args: -" openNewWin: if 0, use the previous window, if 1 open in new split, if 2 -" open in a vsplit -function! s:previewNode(openNewWin) - let currentBuf = bufnr("") - if a:openNewWin > 0 - call s:openEntrySplit(a:openNewWin ==# 2,1) - else - call s:activateNode(1) - end - call s:exec(bufwinnr(currentBuf) . "wincmd w") -endfunction - -" FUNCTION: s:revealBookmark(name) {{{2 -" put the cursor on the node associate with the given name -function! s:revealBookmark(name) - try - let targetNode = s:Bookmark.GetNodeForName(a:name, 0) - call targetNode.putCursorHere(0, 1) - catch /^NERDTree.BookmarkNotFoundError/ - call s:echo("Bookmark isnt cached under the current root") - endtry -endfunction -" FUNCTION: s:refreshRoot() {{{2 -" Reloads the current root. All nodes below this will be lost and the root dir -" will be reloaded. -function! s:refreshRoot() - call s:echo("Refreshing the root node. This could take a while...") - call b:NERDTreeRoot.refresh() - call s:renderView() - redraw - call s:echo("Refreshing the root node. This could take a while... DONE") -endfunction - -" FUNCTION: s:refreshCurrent() {{{2 -" refreshes the root for the current node -function! s:refreshCurrent() - let treenode = s:TreeDirNode.GetSelected() - if treenode ==# {} - call s:echo("Refresh failed. Select a node first") - return - endif - - call s:echo("Refreshing node. This could take a while...") - call treenode.refresh() - call s:renderView() - redraw - call s:echo("Refreshing node. This could take a while... DONE") -endfunction -" FUNCTION: s:showMenu() {{{2 -function! s:showMenu() - let curNode = s:TreeFileNode.GetSelected() - if curNode ==# {} - call s:echo("Put the cursor on a node first" ) - return - endif - - let mc = s:MenuController.New(s:MenuItem.AllEnabled()) - call mc.showMenu() -endfunction - -" FUNCTION: s:toggleIgnoreFilter() {{{2 -" toggles the use of the NERDTreeIgnore option -function! s:toggleIgnoreFilter() - let b:NERDTreeIgnoreEnabled = !b:NERDTreeIgnoreEnabled - call s:renderViewSavingPosition() - call s:centerView() -endfunction - -" FUNCTION: s:toggleShowBookmarks() {{{2 -" toggles the display of bookmarks -function! s:toggleShowBookmarks() - let b:NERDTreeShowBookmarks = !b:NERDTreeShowBookmarks - if b:NERDTreeShowBookmarks - call s:renderView() - call s:putCursorOnBookmarkTable() - else - call s:renderViewSavingPosition() - endif - call s:centerView() -endfunction -" FUNCTION: s:toggleShowFiles() {{{2 -" toggles the display of hidden files -function! s:toggleShowFiles() - let b:NERDTreeShowFiles = !b:NERDTreeShowFiles - call s:renderViewSavingPosition() - call s:centerView() -endfunction - -" FUNCTION: s:toggleShowHidden() {{{2 -" toggles the display of hidden files -function! s:toggleShowHidden() - let b:NERDTreeShowHidden = !b:NERDTreeShowHidden - call s:renderViewSavingPosition() - call s:centerView() -endfunction - -" FUNCTION: s:toggleZoom() {{2 -" zoom (maximize/minimize) the NERDTree window -function! s:toggleZoom() - if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed - let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize - exec "silent vertical resize ". size - let b:NERDTreeZoomed = 0 - else - exec "vertical resize" - let b:NERDTreeZoomed = 1 - endif -endfunction - -"FUNCTION: s:upDir(keepState) {{{2 -"moves the tree up a level -" -"Args: -"keepState: 1 if the current root should be left open when the tree is -"re-rendered -function! s:upDir(keepState) - let cwd = b:NERDTreeRoot.path.str({'format': 'UI'}) - if cwd ==# "/" || cwd =~ '^[^/]..$' - call s:echo("already at top dir") - else - if !a:keepState - call b:NERDTreeRoot.close() - endif - - let oldRoot = b:NERDTreeRoot - - if empty(b:NERDTreeRoot.parent) - let path = b:NERDTreeRoot.path.getParent() - let newRoot = s:TreeDirNode.New(path) - call newRoot.open() - call newRoot.transplantChild(b:NERDTreeRoot) - let b:NERDTreeRoot = newRoot - else - let b:NERDTreeRoot = b:NERDTreeRoot.parent - endif - - if g:NERDTreeChDirMode ==# 2 - call b:NERDTreeRoot.path.changeToDir() - endif - - call s:renderView() - call oldRoot.putCursorHere(0, 0) - endif -endfunction - - -"reset &cpo back to users setting -let &cpo = s:old_cpo - -" vim: set sw=4 sts=4 et fdm=marker: diff --git a/plugin/bufexplorer.vim b/plugin/bufexplorer.vim deleted file mode 100755 index 0e3d336..0000000 --- a/plugin/bufexplorer.vim +++ /dev/null @@ -1,1144 +0,0 @@ -"============================================================================== -" Copyright: Copyright (C) 2001-2010 Jeff Lanzarotta -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" bufexplorer.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damages -" resulting from the use of this software. -" Name Of File: bufexplorer.vim -" Description: Buffer Explorer Vim Plugin -" Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com) -" Last Changed: Friday, 12 Feb 2010 -" Version: See g:bufexplorer_version for version number. -" Usage: This file should reside in the plugin directory and be -" automatically sourced. -" -" You may use the default keymappings of -" -" <Leader>be - Opens BE. -" <Leader>bs - Opens horizontally window BE. -" <Leader>bv - Opens vertically window BE. -" -" Or you can use -" -" ":BufExplorer" - Opens BE. -" ":BufExplorerHorizontalSplit" - Opens horizontally window BE. -" ":BufExplorerVerticalSplit" - Opens vertically window BE. -" -" For more help see supplied documentation. -" History: See supplied documentation. -"============================================================================== - -" Exit quickly if already running or when 'compatible' is set. {{{1 -if exists("g:bufexplorer_version") || &cp - finish -endif -"1}}} - -" Version number -let g:bufexplorer_version = "7.2.6" - -" Check for Vim version 700 or greater {{{1 -if v:version < 700 - echo "Sorry, bufexplorer ".g:bufexplorer_version."\nONLY runs with Vim 7.0 and greater." - finish -endif - -" Public Interface {{{1 -if maparg("<Leader>be") =~ 'BufExplorer' - nunmap <Leader>be -endif - -if maparg("<Leader>bs") =~ 'BufExplorerHorizontalSplit' - nunmap <Leader>bs -endif - -if maparg("<Leader>bv") =~ 'BufExplorerVerticalSplit' - nunmap <Leader>bv -endif - -nmap <script> <silent> <unique> <Leader>be :BufExplorer<CR> -nmap <script> <silent> <unique> <Leader>bs :BufExplorerHorizontalSplit<CR> -nmap <script> <silent> <unique> <Leader>bv :BufExplorerVerticalSplit<CR> - -" Create commands {{{1 -command! BufExplorer :call StartBufExplorer(has ("gui") ? "drop" : "hide edit") -command! BufExplorerHorizontalSplit :call BufExplorerHorizontalSplit() -command! BufExplorerVerticalSplit :call BufExplorerVerticalSplit() - -" BESet {{{1 -function! s:BESet(var, default) - if !exists(a:var) - if type(a:default) - exec "let" a:var "=" string(a:default) - else - exec "let" a:var "=" a:default - endif - - return 1 - endif - - return 0 -endfunction - -" BEReset {{{1 -function! s:BEReset() - " Build initial MRUList. This makes sure all the files specified on the - " command line are picked up correctly. - let s:MRUList = range(1, bufnr('$')) - - " Initialize one tab space array, ignore zero-based tabpagenr - " since all tabpagenr's start at 1. - " -1 signifies this is the first time we are referencing this - " tabpagenr. - let s:tabSpace = [ [-1], [-1] ] -endfunction - -" Setup the autocommands that handle the MRUList and other stuff. {{{1 -" This is only done once when Vim starts up. -augroup BufExplorerVimEnter - autocmd! - autocmd VimEnter * call s:BESetup() -augroup END - -" BESetup {{{1 -function! s:BESetup() - call s:BEReset() - - " Now that the MRUList is created, add the other autocmds. - augroup BufExplorer - " Deleting autocommands in case the script is reloaded - autocmd! - autocmd TabEnter * call s:BETabEnter() - autocmd BufNew * call s:BEAddBuffer() - autocmd BufEnter * call s:BEActivateBuffer() - - autocmd BufWipeOut * call s:BEDeactivateBuffer(1) - autocmd BufDelete * call s:BEDeactivateBuffer(0) - - autocmd BufWinEnter \[BufExplorer\] call s:BEInitialize() - autocmd BufWinLeave \[BufExplorer\] call s:BECleanup() - autocmd SessionLoadPost * call s:BEReset() - augroup END - - " Remove the VimEnter event as it is no longer needed - augroup SelectBufVimEnter - autocmd! - augroup END -endfunction - -" BETabEnter {{{1 -function! s:BETabEnter() - " Make s:tabSpace 1-based - if empty(s:tabSpace) || len(s:tabSpace) < (tabpagenr() + 1) - call add(s:tabSpace, [-1]) - endif -endfunction - -" BEAddBuffer {{{1 -function! s:BEAddBuffer() - if !exists('s:raw_buffer_listing') || empty(s:raw_buffer_listing) - silent let s:raw_buffer_listing = s:BEGetBufferInfo(0) - else - " We cannot use :buffers! or :ls! to gather information - " about this buffer since it was only just added. - " Any changes to the buffer (setlocal buftype, ...) - " happens after this event fires. - " - " So we will indicate the :buffers! command must be re-run. - " This should help with the performance of the plugin. - - " There are some checks which can be performed - " before deciding to refresh the buffer list. - let bufnr = expand('<abuf>') + 0 - - if s:BEIgnoreBuffer(bufnr) == 1 - return - else - let s:refreshBufferList = 1 - endif - endif - - call s:BEActivateBuffer() -endfunction - -" ActivateBuffer {{{1 -function! s:BEActivateBuffer() - let b = bufnr("%") - let l = get(s:tabSpace, tabpagenr(), []) - - if s:BEIgnoreBuffer(b) == 1 - return - endif - - if !empty(l) && l[0] == '-1' - " The first time we add a tab Vim uses the current - " buffer as it's starting page, even though we are about - " to edit a new page (BufEnter triggers after), so - " remove the -1 entry indicating we have covered this case. - let l = [] - let s:tabSpace[tabpagenr()] = l - elseif empty(l) || index(l, b) == -1 - " Add new buffer to this tab buffer list - let l = add(l, b) - let s:tabSpace[tabpagenr()] = l - - if g:bufExplorerOnlyOneTab == 1 - " If a buffer can only be available in 1 tab page - " ensure this buffer is not present in any other tabs - let tabidx = 1 - while tabidx < len(s:tabSpace) - if tabidx != tabpagenr() - let bufidx = index(s:tabSpace[tabidx], b) - if bufidx != -1 - call remove(s:tabSpace[tabidx], bufidx) - endif - endif - let tabidx = tabidx + 1 - endwhile - endif - endif - - call s:BEMRUPush(b) - - if exists('s:raw_buffer_listing') && !empty(s:raw_buffer_listing) - " Check if the buffer exists, but was deleted previously - " Careful use of ' and " so we do not have to escape all the \'s - " Regex: ^\s*bu\> - " ^ - Starting at the beginning of the string - " \s* - optional whitespace - " b - Vim's buffer number - " u\> - the buffer must be unlisted - let shortlist = filter(copy(s:raw_buffer_listing), "v:val.attributes =~ '".'^\s*'.b.'u\>'."'") - - if !empty(shortlist) - " If it is unlisted (ie deleted), but now we editing it again - " rebuild the buffer list. - let s:refreshBufferList = 1 - endif - endif -endfunction - -" BEDeactivateBuffer {{{1 -function! s:BEDeactivateBuffer(remove) - let _bufnr = str2nr(expand("<abuf>")) - - call s:BEMRUPop(_bufnr) - - if a:remove -"XXX moved above call s:BEMRUPop(_bufnr) - call s:BEDeleteBufferListing(_bufnr) - else - if ! s:BEIgnoreBuffer(_bufnr) == 1 - " If the buffer is unlisted, refresh the list. - let s:refreshBufferList = 1 - endif - endif -endfunction - -" BEMRUPop {{{1 -function! s:BEMRUPop(buf) - call filter(s:MRUList, 'v:val != '.a:buf) -endfunction - -" BEMRUPush {{{1 -function! s:BEMRUPush(buf) - if s:BEIgnoreBuffer(a:buf) == 1 - return - endif - - " Remove the buffer number from the list if it already exists. - call s:BEMRUPop(a:buf) - - " Add the buffer number to the head of the list. - call insert(s:MRUList,a:buf) -endfunction - -" BEInitialize {{{1 -function! s:BEInitialize() - let s:_insertmode = &insertmode - set noinsertmode - - let s:_showcmd = &showcmd - set noshowcmd - - let s:_cpo = &cpo - set cpo&vim - - let s:_report = &report - let &report = 10000 - - let s:_list = &list - set nolist - - setlocal nonumber - setlocal foldcolumn=0 - setlocal nofoldenable - setlocal cursorline - setlocal nospell - setlocal nobuflisted - - let s:running = 1 -endfunction - -" BEIgnoreBuffer -function! s:BEIgnoreBuffer(buf) - " Check to see if this buffer should be ignore by BufExplorer. - - " Skip temporary buffers with buftype set. - if empty(getbufvar(a:buf, "&buftype") == 0) - return 1 - endif - - " Skip unlisted buffers. - if buflisted(a:buf) == 0 - return 1 - endif - - " Skip buffers with no name. - if empty(bufname(a:buf)) == 1 - return 1 - endif - - " Do not add the BufExplorer window to the list. - if fnamemodify(bufname(a:buf), ":t") == s:name - return 1 - endif - - if index(s:MRU_Exclude_List, bufname(a:buf)) >= 0 - return 1 - end - - return 0 -endfunction - -" BECleanup {{{1 -function! s:BECleanup() - let &insertmode = s:_insertmode - let &showcmd = s:_showcmd - let &cpo = s:_cpo - let &report = s:_report - let &list = s:_list - let s:running = 0 - let s:splitMode = "" - - delmarks! -endfunction - -" BufExplorerHorizontalSplit {{{1 -function! BufExplorerHorizontalSplit() - let s:splitMode = "sp" - exec "BufExplorer" -endfunction - -" BufExplorerVerticalSplit {{{1 -function! BufExplorerVerticalSplit() - let s:splitMode = "vsp" - exec "BufExplorer" -endfunction - -" StartBufExplorer {{{1 -function! StartBufExplorer(open) - let name = s:name - - if !has("win32") - " On non-Windows boxes, escape the name so that is shows up correctly. - let name = escape(name, "[]") - endif - - " Make sure there is only one explorer open at a time. - if s:running == 1 - " Go to the open buffer. - if has("gui") - exec "drop" name - endif - - return - endif - - " Add zero to ensure the variable is treated as a Number. - let s:originBuffer = bufnr("%") + 0 - - if !exists('s:raw_buffer_listing') || - \ empty(s:raw_buffer_listing) || - \ s:refreshBufferList == 1 - silent let s:raw_buffer_listing = s:BEGetBufferInfo(0) - endif - - let copy = copy(s:raw_buffer_listing) - - if (g:bufExplorerShowUnlisted == 0) - call filter(copy, 'v:val.attributes !~ "u"') - endif - - " We may have to split the current window. - if (s:splitMode != "") - " Save off the original settings. - let [_splitbelow, _splitright] = [&splitbelow, &splitright] - - " Set the setting to ours. - let [&splitbelow, &splitright] = [g:bufExplorerSplitBelow, g:bufExplorerSplitRight] - - " Do it. - exe 'keepalt '.s:splitMode - - " Restore the original settings. - let [&splitbelow, &splitright] = [_splitbelow, _splitright] - endif - - if !exists("b:displayMode") || b:displayMode != "winmanager" - " Do not use keepalt when opening bufexplorer to allow the buffer that we are - " leaving to become the new alternate buffer - exec "silent keepjumps ".a:open." ".name - endif - - call s:BEDisplayBufferList() -endfunction - -" BEDisplayBufferList {{{1 -function! s:BEDisplayBufferList() - " Do not set bufhidden since it wipes out - " the data if we switch away from the buffer - " using CTRL-^ - setlocal buftype=nofile - setlocal modifiable - setlocal noswapfile - setlocal nowrap - - " Delete all previous lines to the black hole register - call cursor(1,1) - exec 'silent! normal! "_dG' - - call s:BESetupSyntax() - call s:BEMapKeys() - call setline(1, s:BECreateHelp()) - call s:BEBuildBufferList() - call cursor(s:firstBufferLine, 1) - - if !g:bufExplorerResize - normal! zz - endif - - setlocal nomodifiable -endfunction - -" BEMapKeys {{{1 -function! s:BEMapKeys() - if exists("b:displayMode") && b:displayMode == "winmanager" - nnoremap <buffer> <silent> <tab> :call <SID>BESelectBuffer("tab")<cr> - endif - - nnoremap <buffer> <silent> <F1> :call <SID>BEToggleHelp()<cr> - nnoremap <buffer> <silent> <2-leftmouse> :call <SID>BESelectBuffer()<cr> - nnoremap <buffer> <silent> <cr> :call <SID>BESelectBuffer()<cr> - nnoremap <buffer> <silent> o :call <SID>BESelectBuffer()<cr> - nnoremap <buffer> <silent> t :call <SID>BESelectBuffer("tab")<cr> - nnoremap <buffer> <silent> <s-cr> :call <SID>BESelectBuffer("tab")<cr> - - nnoremap <buffer> <silent> d :call <SID>BERemoveBuffer("delete", "n")<cr> - xnoremap <buffer> <silent> d :call <SID>BERemoveBuffer("delete", "v")<cr> - nnoremap <buffer> <silent> D :call <SID>BERemoveBuffer("wipe", "n")<cr> - xnoremap <buffer> <silent> D :call <SID>BERemoveBuffer("wipe", "v")<cr> - -"XXX nnoremap <buffer> <silent> d :call <SID>BERemoveBuffer("wipe", "n")<cr> -"XXX xnoremap <buffer> <silent> d :call <SID>BERemoveBuffer("wipe", "v")<cr> -"XXX nnoremap <buffer> <silent> D :call <SID>BERemoveBuffer("delete", "n")<cr> -"XXX xnoremap <buffer> <silent> D :call <SID>BERemoveBuffer("delete", "v")<cr> - - nnoremap <buffer> <silent> m :call <SID>BEMRUListShow()<cr> - nnoremap <buffer> <silent> p :call <SID>BEToggleSplitOutPathName()<cr> - nnoremap <buffer> <silent> q :call <SID>BEClose()<cr> - nnoremap <buffer> <silent> r :call <SID>BESortReverse()<cr> - nnoremap <buffer> <silent> R :call <SID>BEToggleShowRelativePath()<cr> - nnoremap <buffer> <silent> s :call <SID>BESortSelect()<cr> - nnoremap <buffer> <silent> S :call <SID>BEReverseSortSelect()<cr> - nnoremap <buffer> <silent> u :call <SID>BEToggleShowUnlisted()<cr> - nnoremap <buffer> <silent> f :call <SID>BEToggleFindActive()<cr> - nnoremap <buffer> <silent> T :call <SID>BEToggleShowTabBuffer()<cr> - nnoremap <buffer> <silent> B :call <SID>BEToggleOnlyOneTab()<cr> - - for k in ["G", "n", "N", "L", "M", "H"] - exec "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<cr>" - endfor -endfunction - -" BESetupSyntax {{{1 -function! s:BESetupSyntax() - if has("syntax") - syn match bufExplorerHelp "^\".*" contains=bufExplorerSortBy,bufExplorerMapping,bufExplorerTitle,bufExplorerSortType,bufExplorerToggleSplit,bufExplorerToggleOpen - syn match bufExplorerOpenIn "Open in \w\+ window" contained - syn match bufExplorerSplit "\w\+ split" contained - syn match bufExplorerSortBy "Sorted by .*" contained contains=bufExplorerOpenIn,bufExplorerSplit - syn match bufExplorerMapping "\" \zs.\+\ze :" contained - syn match bufExplorerTitle "Buffer Explorer.*" contained - syn match bufExplorerSortType "'\w\{-}'" contained - syn match bufExplorerBufNbr /^\s*\d\+/ - syn match bufExplorerToggleSplit "toggle split type" contained - syn match bufExplorerToggleOpen "toggle open mode" contained - syn match bufExplorerModBuf /^\s*\d\+.\{4}+.*/ - syn match bufExplorerLockedBuf /^\s*\d\+.\{3}[\-=].*/ - syn match bufExplorerHidBuf /^\s*\d\+.\{2}h.*/ - syn match bufExplorerActBuf /^\s*\d\+.\{2}a.*/ - syn match bufExplorerCurBuf /^\s*\d\+.%.*/ - syn match bufExplorerAltBuf /^\s*\d\+.#.*/ - syn match bufExplorerUnlBuf /^\s*\d\+u.*/ - - hi def link bufExplorerBufNbr Number - hi def link bufExplorerMapping NonText - hi def link bufExplorerHelp Special - hi def link bufExplorerOpenIn Identifier - hi def link bufExplorerSortBy String - hi def link bufExplorerSplit NonText - hi def link bufExplorerTitle NonText - hi def link bufExplorerSortType bufExplorerSortBy - hi def link bufExplorerToggleSplit bufExplorerSplit - hi def link bufExplorerToggleOpen bufExplorerOpenIn - - hi def link bufExplorerActBuf Identifier - hi def link bufExplorerAltBuf String - hi def link bufExplorerCurBuf Type - hi def link bufExplorerHidBuf Constant - hi def link bufExplorerLockedBuf Special - hi def link bufExplorerModBuf Exception - hi def link bufExplorerUnlBuf Comment - endif -endfunction - -" BEToggleHelp {{{1 -function! s:BEToggleHelp() - let g:bufExplorerDetailedHelp = !g:bufExplorerDetailedHelp - - setlocal modifiable - - " Save position. - normal! ma - - " Remove old header. - if (s:firstBufferLine > 1) - exec "keepjumps 1,".(s:firstBufferLine - 1) "d _" - endif - - call append(0, s:BECreateHelp()) - - silent! normal! g`a - delmarks a - - setlocal nomodifiable - - if exists("b:displayMode") && b:displayMode == "winmanager" - call WinManagerForceReSize("BufExplorer") - endif -endfunction - -" BEGetHelpStatus {{{1 -function! s:BEGetHelpStatus() - let ret = '" Sorted by '.((g:bufExplorerReverseSort == 1) ? "reverse " : "").g:bufExplorerSortBy - let ret .= ' | '.((g:bufExplorerFindActive == 0) ? "Don't " : "")."Locate buffer" - let ret .= ((g:bufExplorerShowUnlisted == 0) ? "" : " | Show unlisted") - let ret .= ((g:bufExplorerShowTabBuffer == 0) ? "" : " | Show buffers/tab") - let ret .= ((g:bufExplorerOnlyOneTab == 1) ? "" : " | One tab / buffer") - let ret .= ' | '.((g:bufExplorerShowRelativePath == 0) ? "Absolute" : "Relative") - let ret .= ' '.((g:bufExplorerSplitOutPathName == 0) ? "Full" : "Split")." path" - - return ret -endfunction - -" BECreateHelp {{{1 -function! s:BECreateHelp() - if g:bufExplorerDefaultHelp == 0 && g:bufExplorerDetailedHelp == 0 - let s:firstBufferLine = 1 - return [] - endif - - let header = [] - - if g:bufExplorerDetailedHelp == 1 - call add(header, '" Buffer Explorer ('.g:bufexplorer_version.')') - call add(header, '" --------------------------') - call add(header, '" <F1> : toggle this help') - call add(header, '" <enter> or o or Mouse-Double-Click : open buffer under cursor') - call add(header, '" <shift-enter> or t : open buffer in another tab') - call add(header, '" d : delete buffer') - call add(header, '" D : wipe buffer') - call add(header, '" f : toggle find active buffer') - call add(header, '" p : toggle spliting of file and path name') - call add(header, '" q : quit') - call add(header, '" r : reverse sort') - call add(header, '" R : toggle showing relative or full paths') - call add(header, '" s : cycle thru "sort by" fields '.string(s:sort_by).'') - call add(header, '" S : reverse cycle thru "sort by" fields') - call add(header, '" T : toggle if to show only buffers for this tab or not') - call add(header, '" u : toggle showing unlisted buffers') - else - call add(header, '" Press <F1> for Help') - endif - - if (!exists("b:displayMode") || b:displayMode != "winmanager") || (b:displayMode == "winmanager" && g:bufExplorerDetailedHelp == 1) - call add(header, s:BEGetHelpStatus()) - call add(header, '"=') - endif - - let s:firstBufferLine = len(header) + 1 - - return header -endfunction - -" BEGetBufferInfo {{{1 -function! s:BEGetBufferInfo(bufnr) - redir => bufoutput - buffers! - redir END - - if (a:bufnr > 0) - " Since we are only interested in this specified buffer - " remove the other buffers listed - let bufoutput = substitute(bufoutput."\n", '^.*\n\(\s*'.a:bufnr.'\>.\{-}\)\n.*', '\1', '') - endif - - let [all, allwidths, listedwidths] = [[], {}, {}] - - for n in keys(s:types) - let allwidths[n] = [] - let listedwidths[n] = [] - endfor - - for buf in split(bufoutput, '\n') - let bits = split(buf, '"') - let b = {"attributes": bits[0], "line": substitute(bits[2], '\s*', '', '')} - - for [key, val] in items(s:types) - let b[key] = fnamemodify(bits[1], val) - endfor - - if getftype(b.fullname) == "dir" && g:bufExplorerShowDirectories == 1 - let b.shortname = "<DIRECTORY>" - endif - - call add(all, b) - - for n in keys(s:types) - call add(allwidths[n], len(b[n])) - - if b.attributes !~ "u" - call add(listedwidths[n], len(b[n])) - endif - endfor - endfor - - let [s:allpads, s:listedpads] = [{}, {}] - - for n in keys(s:types) - let s:allpads[n] = repeat(' ', max(allwidths[n])) - let s:listedpads[n] = repeat(' ', max(listedwidths[n])) - endfor - - let s:refreshBufferList = 0 - - return all -endfunction - -" BEBuildBufferList {{{1 -function! s:BEBuildBufferList() - let lines = [] - - " Loop through every buffer. - for buf in s:raw_buffer_listing - if (!g:bufExplorerShowUnlisted && buf.attributes =~ "u") - " Skip unlisted buffers if we are not to show them. - continue - endif - if (g:bufExplorerShowTabBuffer) - let show_buffer = 0 - for bufnr in s:tabSpace[tabpagenr()] - if (buf.attributes =~ '^\s*'.bufnr.'\>') - " Only buffers shown on the current tabpagenr - let show_buffer = 1 - break - endif - endfor - if show_buffer == 0 - continue - endif - endif - - let line = buf.attributes." " - - if g:bufExplorerSplitOutPathName - let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path" - let path = buf[type] - let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname - let line .= buf.shortname." ".strpart(pad.path, len(buf.shortname)) - else - let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname" - let path = buf[type] - let line .= path - endif - - let pads = (g:bufExplorerShowUnlisted) ? s:allpads : s:listedpads - - if !empty(pads[type]) - let line .= strpart(pads[type], len(path))." " - endif - - let line .= buf.line - - call add(lines, line) - endfor - - call setline(s:firstBufferLine, lines) - - call s:BESortListing() -endfunction - -" BESelectBuffer {{{1 -function! s:BESelectBuffer(...) - " Sometimes messages are not cleared when we get here so it looks like an error has - " occurred when it really has not. - echo "" - - " Are we on a line with a file name? - if line('.') < s:firstBufferLine - exec "normal! \<cr>" - return - endif - - let _bufNbr = str2nr(getline('.')) - - " Check and see if we are running BE via WinManager. - if exists("b:displayMode") && b:displayMode == "winmanager" - let bufname = expand("#"._bufNbr.":p") - - if (a:0 == 1) && (a:1 == "tab") - call WinManagerFileEdit(bufname, 1) - else - call WinManagerFileEdit(bufname, 0) - endif - - return - endif - - if bufexists(_bufNbr) - if bufnr("#") == _bufNbr - return s:BEClose() - endif - - " Are we suppose to open the selected buffer in a tab? - if (a:0 == 1) && (a:1 == "tab") - " Yes, we are to open the selected buffer in a tab. - - " Restore [BufExplorer] buffer. - exec "keepjumps silent buffer!".s:originBuffer - - " Get the tab number where this buffer is located at. - let tabNbr = s:BEGetTabNbr(_bufNbr) - - " Was the tab found? - if tabNbr == 0 - " _bufNbr is not opened in any tabs. Open a new tab with the selected buffer in it. - exec "999tab split +buffer" . _bufNbr - else - " The _bufNbr is already opened in tab, go to that tab. - exec tabNbr . "tabnext" - - " Focus window. - exec s:BEGetWinNbr(tabNbr, _bufNbr) . "wincmd w" - endif - else - "No, the use did not ask to open the selected buffer in a tab. - - " Are we suppose to move to the tab where this active buffer is? - if bufloaded(_bufNbr) && g:bufExplorerFindActive - " Close the BE window. - call s:BEClose() - - " Get the tab number where this buffer is located at. - let tabNbr = s:BEGetTabNbr(_bufNbr) - - " Was the tab found? - if tabNbr != 0 - " The buffer is located in a tab. Go to that tab number. - exec tabNbr . "tabnext" - else - " Nope, the buffer is not in a tab, simple switch to that buffer. - let bufname = expand("#"._bufNbr.":p") - exec bufname ? "drop ".escape(bufname, " ") : "buffer "._bufNbr - endif - endif - - " Switch to the buffer. - exec "keepalt keepjumps silent b!" _bufNbr - endif - - " Make the buffer 'listed' again. - call setbufvar(_bufNbr, "&buflisted", "1") - else - call s:BEError("Sorry, that buffer no longer exists, please select another") - call s:BEDeleteBuffer(_bufNbr, "wipe") - endif -endfunction - -" BEDeleteBufferListing {{{1 -function! s:BEDeleteBufferListing(buf) - if exists('s:raw_buffer_listing') && !empty(s:raw_buffer_listing) - " Delete the buffer from the raw buffer list. - " Careful use of ' and " so we do not have to escape all the \'s - " Regex: ^\s*\(10\|20\)\> - " ^ - Starting at the beginning of the string - " \s* - optional whitespace - " \(10\|20\) - either a 10 or a 20 - " \> - end of word (so it can't make 100 or 201) - call filter(s:raw_buffer_listing, "v:val.attributes !~ '".'^\s*\('.substitute(a:buf, ' ', '\\|', 'g').'\)\>'."'") - endif -endfunction - -" BERemoveBuffer {{{1 -function! s:BERemoveBuffer(type, mode) range - " Are we on a line with a file name? - if line('.') < s:firstBufferLine - return - endif - - " These commands are to temporarily suspend the activity of winmanager. - if exists("b:displayMode") && b:displayMode == "winmanager" - call WinManagerSuspendAUs() - endif - - let _bufNbrs = '' - - for lineNum in range(a:firstline, a:lastline) - let line = getline(lineNum) - - if line =~ '^\s*\(\d\+\)' - " Regex: ^\s*\(10\|20\)\> - " ^ - Starting at the beginning of the string - " \s* - optional whitespace - " \zs - start the match here - " \d\+ - any digits - " \> - end of word (so it can't make 100 or 201) - let bufNbr = matchstr(line, '^\s*\zs\d\+\>') - - " Add 0 to bufNbr to ensure Vim treats it as a Number - " for use with the getbufvar() function - if bufNbr !~ '^\d\+$' || getbufvar(bufNbr+0, '&modified') != 0 - call s:BEError("Sorry, no write since last change for buffer ".bufNbr.", unable to delete") - else - let _bufNbrs = _bufNbrs . (_bufNbrs==''?'':' '). bufNbr - endif - endif - endfor - - " Okay, everything is good, delete or wipe the buffers. - call s:BEDeleteBuffer(_bufNbrs, a:type) - - " Reactivate winmanager autocommand activity. - if exists("b:displayMode") && b:displayMode == "winmanager" - call WinManagerForceReSize("BufExplorer") - call WinManagerResumeAUs() - endif -endfunction - -" BEDeleteBuffer {{{1 -function! s:BEDeleteBuffer(bufNbr, mode) - " This routine assumes that the buffer to be removed is on the current line. - try - if a:mode == "wipe" - exe "bwipe" a:bufNbr - else - exe "bdelete" a:bufNbr - endif - - setlocal modifiable - - " Remove each of the lines beginning with the buffer numbers we are removing - " Regex: ^\s*\(10\|20\)\> - " ^ - Starting at the beginning of the string - " \s* - optional whitespace - " \(10\|20\) - either a 10 or a 20 - " \> - end of word (so it can't make 100 or 201) - exec 'silent! g/^\s*\('.substitute(a:bufNbr, ' ', '\\|', 'g').'\)\>/d_' - - setlocal nomodifiable - - call s:BEDeleteBufferListing(a:bufNbr) - catch - call s:BEError(v:exception) - endtry -endfunction - -" BEClose {{{1 -function! s:BEClose() - " Get only the listed buffers. - let listed = filter(copy(s:MRUList), "buflisted(v:val)") - - " If we needed to split the main window, close the split one. - if (s:splitMode != "") - exec "wincmd c" - endif - - if len(listed) == 0 - exe "enew" - else - for b in reverse(listed[0:1]) - exec "keepjumps silent b ".b - endfor - endif -endfunction - -" BEToggleSplitOutPathName {{{1 -function! s:BEToggleSplitOutPathName() - let g:bufExplorerSplitOutPathName = !g:bufExplorerSplitOutPathName - call s:BERebuildBufferList() - call s:BEUpdateHelpStatus() -endfunction - -" BEToggleShowRelativePath {{{1 -function! s:BEToggleShowRelativePath() - let g:bufExplorerShowRelativePath = !g:bufExplorerShowRelativePath - call s:BERebuildBufferList() - call s:BEUpdateHelpStatus() -endfunction - -" BEToggleShowUnlisted {{{1 -function! s:BEToggleShowUnlisted() - let g:bufExplorerShowUnlisted = !g:bufExplorerShowUnlisted - let num_bufs = s:BERebuildBufferList(g:bufExplorerShowUnlisted == 0) - call s:BEUpdateHelpStatus() -endfunction - -" BEToggleFindActive {{{1 -function! s:BEToggleFindActive() - let g:bufExplorerFindActive = !g:bufExplorerFindActive - call s:BEUpdateHelpStatus() -endfunction - -" BEToggleShowTabBuffer {{{1 -function! s:BEToggleShowTabBuffer() - let g:bufExplorerShowTabBuffer = !g:bufExplorerShowTabBuffer - call s:BEDisplayBufferList() -endfunction - -" BEToggleOnlyOneTab {{{1 -function! s:BEToggleOnlyOneTab() - let g:bufExplorerOnlyOneTab = !g:bufExplorerOnlyOneTab - call s:BEDisplayBufferList() -endfunction - -" BERebuildBufferList {{{1 -function! s:BERebuildBufferList(...) - setlocal modifiable - - let curPos = getpos('.') - - if a:0 - " Clear the list first. - exec "keepjumps ".s:firstBufferLine.',$d "_' - endif - - let num_bufs = s:BEBuildBufferList() - - call setpos('.', curPos) - - setlocal nomodifiable - - return num_bufs -endfunction - -" BEUpdateHelpStatus {{{1 -function! s:BEUpdateHelpStatus() - setlocal modifiable - - let text = s:BEGetHelpStatus() - call setline(s:firstBufferLine - 2, text) - - setlocal nomodifiable -endfunction - -" BEMRUCmp {{{1 -function! s:BEMRUCmp(line1, line2) - return index(s:MRUList, str2nr(a:line1)) - index(s:MRUList, str2nr(a:line2)) -endfunction - -" BESortReverse {{{1 -function! s:BESortReverse() - let g:bufExplorerReverseSort = !g:bufExplorerReverseSort - - call s:BEReSortListing() -endfunction - -" BESortSelect {{{1 -function! s:BESortSelect() - let g:bufExplorerSortBy = get(s:sort_by, index(s:sort_by, g:bufExplorerSortBy) + 1, s:sort_by[0]) - - call s:BEReSortListing() -endfunction - -" BEReverseSortSelect {{{1 -function! s:BEReverseSortSelect() - let g:bufExplorerSortBy = get(s:sort_by, (index(s:sort_by, g:bufExplorerSortBy) + len(s:sort_by) - 1) % len(s:sort_by), s:sort_by[0]) - - call s:BEReSortListing() -endfunction - -" BEReSortListing {{{1 -function! s:BEReSortListing() - setlocal modifiable - - let curPos = getpos('.') - - call s:BESortListing() - call s:BEUpdateHelpStatus() - - call setpos('.', curPos) - - setlocal nomodifiable -endfunction - -" BESortListing {{{1 -function! s:BESortListing() - let sort = s:firstBufferLine.",$sort".((g:bufExplorerReverseSort == 1) ? "!": "") - - if g:bufExplorerSortBy == "number" - " Easiest case. - exec sort 'n' - elseif g:bufExplorerSortBy == "name" - if g:bufExplorerSplitOutPathName - exec sort 'ir /\d.\{7}\zs\f\+\ze/' - else - exec sort 'ir /\zs[^\/\\]\+\ze\s*line/' - endif - elseif g:bufExplorerSortBy == "fullpath" - if g:bufExplorerSplitOutPathName - " Sort twice - first on the file name then on the path. - exec sort 'ir /\d.\{7}\zs\f\+\ze/' - endif - - exec sort 'ir /\zs\f\+\ze\s\+line/' - elseif g:bufExplorerSortBy == "extension" - exec sort 'ir /\.\zs\w\+\ze\s/' - elseif g:bufExplorerSortBy == "mru" - let l = getline(s:firstBufferLine, "$") - - call sort(l, "<SID>BEMRUCmp") - - if g:bufExplorerReverseSort - call reverse(l) - endif - - call setline(s:firstBufferLine, l) - endif -endfunction - -" BEMRUListShow {{{1 -function! s:BEMRUListShow() - echomsg "MRUList=".string(s:MRUList) -endfunction - -" BEError {{{1 -function! s:BEError(msg) - echohl ErrorMsg | echo a:msg | echohl none -endfunction - -" BEWarning {{{1 -function! s:BEWarning(msg) - echohl WarningMsg | echo a:msg | echohl none -endfunction - -" GetTabNbr {{{1 -function! s:BEGetTabNbr(bufNbr) - " Searching buffer bufno, in tabs. - for i in range(tabpagenr("$")) - if index(tabpagebuflist(i + 1), a:bufNbr) != -1 - return i + 1 - endif - endfor - - return 0 -endfunction - -" GetWinNbr" {{{1 -function! s:BEGetWinNbr(tabNbr, bufNbr) - " window number in tabpage. - return index(tabpagebuflist(a:tabNbr), a:bufNbr) + 1 -endfunction - -" Winmanager Integration {{{1 -let g:BufExplorer_title = "\[Buf\ List\]" -call s:BESet("g:bufExplorerResize", 1) -call s:BESet("g:bufExplorerMaxHeight", 25) " Handles dynamic resizing of the window. - -" Function to start display. Set the mode to 'winmanager' for this buffer. -" This is to figure out how this plugin was called. In a standalone fashion -" or by winmanager. -function! BufExplorer_Start() - let b:displayMode = "winmanager" - call StartBufExplorer("e") -endfunction - -" Returns whether the display is okay or not. -function! BufExplorer_IsValid() - return 0 -endfunction - -" Handles dynamic refreshing of the window. -function! BufExplorer_Refresh() - let b:displayMode = "winmanager" - call StartBufExplorer("e") -endfunction - -function! BufExplorer_ReSize() - if !g:bufExplorerResize - return - endif - - let nlines = min([line("$"), g:bufExplorerMaxHeight]) - - exe nlines." wincmd _" - - " The following lines restore the layout so that the last file line is also - " the last window line. Sometimes, when a line is deleted, although the - " window size is exactly equal to the number of lines in the file, some of - " the lines are pushed up and we see some lagging '~'s. - let pres = getpos(".") - - exe $ - - let _scr = &scrolloff - let &scrolloff = 0 - - normal! z- - - let &scrolloff = _scr - - call setpos(".", pres) -endfunction - -" Default values {{{1 -call s:BESet("g:bufExplorerDefaultHelp", 1) " Show default help? -call s:BESet("g:bufExplorerDetailedHelp", 0) " Show detailed help? -call s:BESet("g:bufExplorerFindActive", 1) " When selecting an active buffer, take you to the window where it is active? -call s:BESet("g:bufExplorerReverseSort", 0) " sort reverse? -call s:BESet("g:bufExplorerShowDirectories", 1) " (Dir's are added by commands like ':e .') -call s:BESet("g:bufExplorerShowRelativePath", 0) " Show listings with relative or absolute paths? -call s:BESet("g:bufExplorerShowUnlisted", 0) " Show unlisted buffers? -call s:BESet("g:bufExplorerSortBy", "mru") " Sorting methods are in s:sort_by: -call s:BESet("g:bufExplorerSplitOutPathName", 1) " Split out path and file name? -call s:BESet("g:bufExplorerSplitRight", &splitright) " Should vertical splits be on the right or left of current window? -call s:BESet("g:bufExplorerSplitBelow", &splitbelow) " Should horizontal splits be below or above current window? -call s:BESet("g:bufExplorerShowTabBuffer", 0) " Show only buffer(s) for this tab? -call s:BESet("g:bufExplorerOnlyOneTab", 1) " If ShowTabBuffer = 1, only store the most recent tab for this buffer. - -" Global variables {{{1 -call s:BEReset() -let s:running = 0 -let s:sort_by = ["number", "name", "fullpath", "mru", "extension"] -let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'} -let s:originBuffer = 0 -let s:splitMode = "" -let s:name = '[BufExplorer]' -let s:refreshBufferList = 1 -let s:MRU_Exclude_List = ["[BufExplorer]","__MRU_Files__"] -"1}}} - -" vim:ft=vim foldmethod=marker sw=2 diff --git a/plugin/minibufexpl.vim b/plugin/minibufexpl.vim deleted file mode 100755 index 4e78063..0000000 --- a/plugin/minibufexpl.vim +++ /dev/null @@ -1,1838 +0,0 @@ -" Mini Buffer Explorer <minibufexpl.vim> -" -" HINT: Type zR if you don't know how to use folds -" -" Script Info and Documentation {{{ -"============================================================================= -" Copyright: Copyright (C) 2002 & 2003 Bindu Wavell -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" minibufexplorer.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damamges -" resulting from the use of this software. -" -" Name Of File: minibufexpl.vim -" Description: Mini Buffer Explorer Vim Plugin -" Maintainer: Bindu Wavell <bindu@wavell.net> -" URL: http://vim.sourceforge.net/scripts/script.php?script_id=159 -" Last Change: Sunday, June 21, 2004 -" Version: 6.3.2 -" Derived from Jeff Lanzarotta's bufexplorer.vim version 6.0.7 -" Jeff can be reached at (jefflanzarotta@yahoo.com) and the -" original plugin can be found at: -" http://lanzarotta.tripod.com/vim/plugin/6/bufexplorer.vim.zip -" -" Usage: Normally, this file should reside in the plugins -" directory and be automatically sourced. If not, you must -" manually source this file using ':source minibufexplorer.vim'. -" -" You may use the default keymappings of -" -" <Leader>mbe - Opens MiniBufExplorer -" -" or you may want to add something like the following -" key mapping to your _vimrc/.vimrc file. -" -" map <Leader>b :MiniBufExplorer<cr> -" -" However, in most cases you won't need any key-bindings at all. -" -" <Leader> is usually backslash so type "\mbe" (quickly) to open -" the -MiniBufExplorer- window. -" -" Other keymappings include: <Leader>mbc to close the Explorer -" window, <Leader>mbu to force the Explorer to Update and -" <Leader>mbt to toggle the Explorer window; it will open if -" closed or close if open. Each of these key bindings can be -" overridden (see the notes on <Leader>mbe above.) -" -" You can map these additional commands as follows: -" -" map <Leader>c :CMiniBufExplorer<cr> -" map <Leader>u :UMiniBufExplorer<cr> -" map <Leader>t :TMiniBufExplorer<cr> -" -" NOTE: you can change the key binding used in these mappings -" so that they fit with your configuration of vim. -" -" You can also call each of these features by typing the -" following in command mode: -" -" :MiniBufExplorer " Open and/or goto Explorer -" :CMiniBufExplorer " Close the Explorer if it's open -" :UMiniBufExplorer " Update Explorer without navigating -" :TMiniBufExplorer " Toggle the Explorer window open and -" closed. -" -" To control where the new split window goes relative to the -" current window, use the setting: -" -" let g:miniBufExplSplitBelow=0 " Put new window above -" " current or on the -" " left for vertical split -" let g:miniBufExplSplitBelow=1 " Put new window below -" " current or on the -" " right for vertical split -" -" The default for this is read from the &splitbelow VIM option. -" -" By default we are now (as of 6.0.2) forcing the -MiniBufExplorer- -" window to open up at the edge of the screen. You can turn this -" off by setting the following variable in your .vimrc: -" -" let g:miniBufExplSplitToEdge = 0 -" -" If you would like a vertical explorer you can assign the column -" width (in characters) you want for your explorer window with the -" following .vimrc variable (this was introduced in 6.3.0): -" -" let g:miniBufExplVSplit = 20 " column width in chars -" -" IN HORIZONTAL MODE: -" It is now (as of 6.1.1) possible to set a maximum height for -" the -MiniBufExplorer- window. You can set the max height by -" letting the following variable in your .vimrc: -" -" let g:miniBufExplMaxSize = <max lines: defualt 0> -" -" setting this to 0 will mean the window gets as big as -" needed to fit all your buffers. -" -" NOTE: This was g:miniBufExplMaxHeight before 6.3.0; the old -" setting is backwards compatible if you don't use MaxSize. -" -" As of 6.2.2 it is possible to set a minimum height for the -" -MiniBufExplorer- window. You can set the min height by -" letting the following variable in your .vimrc: -" -" let g:miniBufExplMinSize = <min height: default 1> -" -" NOTE: This was g:miniBufExplMinHeight before 6.3.0; the old -" setting is backwards compatible if you don't use MinSize. -" -" IN VERTICAL MODE: (as of 6.3.0) -" By default the vertical explorer has a fixed width. If you put: -" -" let g:miniBufExplMaxSize = <max width: default 0> -" -" into your .vimrc then MBE will attempt to set the width of the -" MBE window to be as wide as your widest tab. The width will not -" exceed MaxSize even if you have wider tabs. -" -" Accepting the default value of 0 for this will give you a fixed -" width MBE window. -" -" You can specify a MinSize for the vertical explorer window by -" putting the following in your .vimrc: -" -" let g:miniBufExplMinSize = <min width: default 1> -" -" This will have no effect unless you also specivy MaxSize. -" -" By default we are now (as of 6.0.1) turning on the MoreThanOne -" option. This stops the -MiniBufExplorer- from opening -" automatically until more than one eligible buffer is available. -" You can turn this feature off by setting the following variable -" in your .vimrc: -" -" let g:miniBufExplorerMoreThanOne=1 -" -" (The following enhancement is as of 6.2.2) -" Setting this to 0 will cause the MBE window to be loaded even -" if no buffers are available. Setting it to 1 causes the MBE -" window to be loaded as soon as an eligible buffer is read. You -" can also set it to larger numbers. So if you set it to 4 for -" example the MBE window wouldn't auto-open until 4 eligibles -" buffers had been loaded. This is nice for folks that don't -" want an MBE window unless they are editing more than two or -" three buffers. -" -" To enable the optional mapping of Control + Vim Direction Keys -" [hjkl] to window movement commands, you can put the following into -" your .vimrc: -" -" let g:miniBufExplMapWindowNavVim = 1 -" -" To enable the optional mapping of Control + Arrow Keys to window -" movement commands, you can put the following into your .vimrc: -" -" let g:miniBufExplMapWindowNavArrows = 1 -" -" To enable the optional mapping of <C-TAB> and <C-S-TAB> to a -" function that will bring up the next or previous buffer in the -" current window, you can put the following into your .vimrc: -" -" let g:miniBufExplMapCTabSwitchBufs = 1 -" -" To enable the optional mapping of <C-TAB> and <C-S-TAB> to mappings -" that will move to the next and previous (respectively) window, you -" can put the following into your .vimrc: -" -" let g:miniBufExplMapCTabSwitchWindows = 1 -" -" -" NOTE: If you set the ...TabSwitchBufs AND ...TabSwitchWindows, -" ...TabSwitchBufs will be enabled and ...TabSwitchWindows -" will not. -" -" As of MBE 6.3.0, you can put the following into your .vimrc: -" -" let g:miniBufExplUseSingleClick = 1 -" -" If you would like to single click on tabs rather than double -" clicking on them to goto the selected buffer. -" -" NOTE: If you use the single click option in taglist.vim you may -" need to get an updated version that includes a patch I -" provided to allow both explorers to provide single click -" buffer selection. -" -" It is possible to customize the the highlighting for the tabs in -" the MBE by configuring the following highlighting groups: -" -" MBENormal - for buffers that have NOT CHANGED and -" are NOT VISIBLE. -" MBEChanged - for buffers that HAVE CHANGED and are -" NOT VISIBLE -" MBEVisibleNormal - buffers that have NOT CHANGED and are -" VISIBLE -" MBEVisibleChanged - buffers that have CHANGED and are VISIBLE -" -" You can either link to an existing highlighting group by -" adding a command like: -" -" hi link MBEVisibleChanged Error -" -" to your .vimrc or you can specify exact foreground and background -" colors using the following syntax: -" -" hi MBEChanged guibg=darkblue ctermbg=darkblue termbg=white -" -" NOTE: If you set a colorscheme in your .vimrc you should do it -" BEFORE updating the MBE highlighting groups. -" -" If you use other explorers like TagList you can (As of 6.2.8) put: -" -" let g:miniBufExplModSelTarget = 1 -" -" into your .vimrc in order to force MBE to try to place selected -" buffers into a window that does not have a nonmodifiable buffer. -" The upshot of this should be that if you go into MBE and select -" a buffer, the buffer should not show up in a window that is -" hosting an explorer. -" -" There is a VIM bug that can cause buffers to show up without -" their highlighting. The following setting will cause MBE to -" try and turn highlighting back on (introduced in 6.3.1): -" -" let g:miniBufExplForceSyntaxEnable = 1 -" -" MBE has had a basic debugging capability for quite some time. -" However, it has not been very friendly in the past. As of 6.0.8, -" you can put one of each of the following into your .vimrc: -" -" let g:miniBufExplorerDebugLevel = 0 " MBE serious errors output -" let g:miniBufExplorerDebugLevel = 4 " MBE all errors output -" let g:miniBufExplorerDebugLevel = 10 " MBE reports everything -" -" You can also set a DebugMode to cause output to be target as -" follows (default is mode 3): -" -" let g:miniBufExplorerDebugMode = 0 " Errors will show up in -" " a vim window -" let g:miniBufExplorerDebugMode = 1 " Uses VIM's echo function -" " to display on the screen -" let g:miniBufExplorerDebugMode = 2 " Writes to a file -" " MiniBufExplorer.DBG -" let g:miniBufExplorerDebugMode = 3 " Store output in global: -" " g:miniBufExplorerDebugOutput -" -" Or if you are able to start VIM, you might just perform these -" at a command prompt right before you do the operation that is -" failing. -" -" History: Moved to end of file -" -" Known Issues: When debugging is turned on and set to output to a window, there -" are some cases where the window is opened more than once, there -" are other cases where an old debug window can be lost. -" -" Several MBE commands can break the window history so <C-W>[pnw] -" might not take you to the expected window. -" -" Todo: Add the ability to specify a regexp for eligible buffers -" allowing the ability to filter out certain buffers that -" you don't want to control from MBE -" -"============================================================================= -" }}} - -" Startup Check -" -" Has this plugin already been loaded? {{{ -" -if exists('loaded_minibufexplorer') - finish -endif -let loaded_minibufexplorer = 1 -" }}} - -" Mappings and Commands -" -" MBE Keyboard Mappings {{{ -" If we don't already have keyboard mappings for MBE then create them -" -if !hasmapto('<Plug>MiniBufExplorer') - map <unique> <Leader>mbe <Plug>MiniBufExplorer -endif -if !hasmapto('<Plug>CMiniBufExplorer') - map <unique> <Leader>mbc <Plug>CMiniBufExplorer -endif -if !hasmapto('<Plug>UMiniBufExplorer') - map <unique> <Leader>mbu <Plug>UMiniBufExplorer -endif -if !hasmapto('<Plug>TMiniBufExplorer') - map <unique> <Leader>mbt <Plug>TMiniBufExplorer -endif - -" }}} -" MBE <Script> internal map {{{ -" -noremap <unique> <script> <Plug>MiniBufExplorer :call <SID>StartExplorer(1, -1)<CR>:<BS> -noremap <unique> <script> <Plug>CMiniBufExplorer :call <SID>StopExplorer(1)<CR>:<BS> -noremap <unique> <script> <Plug>UMiniBufExplorer :call <SID>AutoUpdate(-1)<CR>:<BS> -noremap <unique> <script> <Plug>TMiniBufExplorer :call <SID>ToggleExplorer()<CR>:<BS> - -" }}} -" MBE commands {{{ -" -if !exists(':MiniBufExplorer') - command! MiniBufExplorer call <SID>StartExplorer(1, -1) -endif -if !exists(':CMiniBufExplorer') - command! CMiniBufExplorer call <SID>StopExplorer(1) -endif -if !exists(':UMiniBufExplorer') - command! UMiniBufExplorer call <SID>AutoUpdate(-1) -endif -if !exists(':TMiniBufExplorer') - command! TMiniBufExplorer call <SID>ToggleExplorer() -endif -if !exists(':MBEbn') - command! MBEbn call <SID>CycleBuffer(1) -endif -if !exists(':MBEbp') - command! MBEbp call <SID>CycleBuffer(0) -endif " }}} - -" Global Configuration Variables -" -" Debug Level {{{ -" -" 0 = no logging -" 1=5 = errors ; 1 is the most important -" 5-9 = info ; 5 is the most important -" 10 = Entry/Exit -if !exists('g:miniBufExplorerDebugLevel') - let g:miniBufExplorerDebugLevel = 0 -endif - -" }}} -" Debug Mode {{{ -" -" 0 = debug to a window -" 1 = use vim's echo facility -" 2 = write to a file named MiniBufExplorer.DBG -" in the directory where vim was started -" THIS IS VERY SLOW -" 3 = Write into g:miniBufExplorerDebugOutput -" global variable [This is the default] -if !exists('g:miniBufExplorerDebugMode') - let g:miniBufExplorerDebugMode = 3 -endif - -" }}} -" Allow auto update? {{{ -" -" We start out with this off for startup, but once vim is running we -" turn this on. -if !exists('g:miniBufExplorerAutoUpdate') - let g:miniBufExplorerAutoUpdate = 0 -endif - -" }}} -" MoreThanOne? {{{ -" Display Mini Buf Explorer when there are 'More Than One' eligible buffers -" -if !exists('g:miniBufExplorerMoreThanOne') - let g:miniBufExplorerMoreThanOne = 2 -endif - -" }}} -" Split below/above/left/right? {{{ -" When opening a new -MiniBufExplorer- window, split the new windows below or -" above the current window? 1 = below, 0 = above. -" -if !exists('g:miniBufExplSplitBelow') - let g:miniBufExplSplitBelow = &splitbelow -endif - -" }}} -" Split to edge? {{{ -" When opening a new -MiniBufExplorer- window, split the new windows to the -" full edge? 1 = yes, 0 = no. -" -if !exists('g:miniBufExplSplitToEdge') - let g:miniBufExplSplitToEdge = 1 -endif - -" }}} -" MaxHeight (depreciated) {{{ -" When sizing the -MiniBufExplorer- window, assign a maximum window height. -" 0 = size to fit all buffers, otherwise the value is number of lines for -" buffer. [Depreciated use g:miniBufExplMaxSize] -" -if !exists('g:miniBufExplMaxHeight') - let g:miniBufExplMaxHeight = 0 -endif - -" }}} -" MaxSize {{{ -" Same as MaxHeight but also works for vertical splits if specified with a -" vertical split then vertical resizing will be performed. If left at 0 -" then the number of columns in g:miniBufExplVSplit will be used as a -" static window width. -if !exists('g:miniBufExplMaxSize') - let g:miniBufExplMaxSize = g:miniBufExplMaxHeight -endif - -" }}} -" MinHeight (depreciated) {{{ -" When sizing the -MiniBufExplorer- window, assign a minumum window height. -" the value is minimum number of lines for buffer. Setting this to zero can -" cause strange height behavior. The default value is 1 [Depreciated use -" g:miniBufExplMinSize] -" -if !exists('g:miniBufExplMinHeight') - let g:miniBufExplMinHeight = 1 -endif - -" }}} -" MinSize {{{ -" Same as MinHeight but also works for vertical splits. For vertical splits, -" this is ignored unless g:miniBufExplMax(Size|Height) are specified. -if !exists('g:miniBufExplMinSize') - let g:miniBufExplMinSize = g:miniBufExplMinHeight -endif - -" }}} -" Horizontal or Vertical explorer? {{{ -" For folks that like vertical explorers, I'm caving in and providing for -" veritcal splits. If this is set to 0 then the current horizontal -" splitting logic will be run. If however you want a vertical split, -" assign the width (in characters) you wish to assign to the MBE window. -" -if !exists('g:miniBufExplVSplit') - let g:miniBufExplVSplit = 0 -endif - -" }}} -" TabWrap? {{{ -" By default line wrap is used (possibly breaking a tab name between two -" lines.) Turning this option on (setting it to 1) can take more screen -" space, but will make sure that each tab is on one and only one line. -" -if !exists('g:miniBufExplTabWrap') - let g:miniBufExplTabWrap = 0 -endif - -" }}} -" Extended window navigation commands? {{{ -" Global flag to turn extended window navigation commands on or off -" enabled = 1, dissabled = 0 -" -if !exists('g:miniBufExplMapWindowNav') - " This is for backwards compatibility and may be removed in a - " later release, please use the ...NavVim and/or ...NavArrows - " settings. - let g:miniBufExplMapWindowNav = 0 -endif -if !exists('g:miniBufExplMapWindowNavVim') - let g:miniBufExplMapWindowNavVim = 0 -endif -if !exists('g:miniBufExplMapWindowNavArrows') - let g:miniBufExplMapWindowNavArrows = 0 -endif -if !exists('g:miniBufExplMapCTabSwitchBufs') - let g:miniBufExplMapCTabSwitchBufs = 0 -endif -" Notice: that if CTabSwitchBufs is turned on then -" we turn off CTabSwitchWindows. -if g:miniBufExplMapCTabSwitchBufs == 1 || !exists('g:miniBufExplMapCTabSwitchWindows') - let g:miniBufExplMapCTabSwitchWindows = 0 -endif - -" -" If we have enabled control + vim direction key remapping -" then perform the remapping -" -" Notice: I left g:miniBufExplMapWindowNav in for backward -" compatibility. Eventually this mapping will be removed so -" please use the newer g:miniBufExplMapWindowNavVim setting. -if g:miniBufExplMapWindowNavVim || g:miniBufExplMapWindowNav - noremap <C-J> <C-W>j - noremap <C-K> <C-W>k - noremap <C-H> <C-W>h - noremap <C-L> <C-W>l -endif - -" -" If we have enabled control + arrow key remapping -" then perform the remapping -" -if g:miniBufExplMapWindowNavArrows - noremap <C-Down> <C-W>j - noremap <C-Up> <C-W>k - noremap <C-Left> <C-W>h - noremap <C-Right> <C-W>l -endif - -" If we have enabled <C-TAB> and <C-S-TAB> to switch buffers -" in the current window then perform the remapping -" -if g:miniBufExplMapCTabSwitchBufs - noremap <C-TAB> :call <SID>CycleBuffer(1)<CR>:<BS> - noremap <C-S-TAB> :call <SID>CycleBuffer(0)<CR>:<BS> -endif - -" -" If we have enabled <C-TAB> and <C-S-TAB> to switch windows -" then perform the remapping -" -if g:miniBufExplMapCTabSwitchWindows - noremap <C-TAB> <C-W>w - noremap <C-S-TAB> <C-W>W -endif - -" }}} -" Modifiable Select Target {{{ -" -if !exists('g:miniBufExplModSelTarget') - let g:miniBufExplModSelTarget = 0 -endif - -"}}} -" Force Syntax Enable {{{ -" -if !exists('g:miniBufExplForceSyntaxEnable') - let g:miniBufExplForceSyntaxEnable = 0 -endif - -" }}} -" Single/Double Click? {{{ -" flag that can be set to 1 in a users .vimrc to allow -" single click switching of tabs. By default we use -" double click for tab selection. -" -if !exists('g:miniBufExplUseSingleClick') - let g:miniBufExplUseSingleClick = 0 -endif - -" -" attempt to perform single click mapping, it would be much -" nicer if we could nnoremap <buffer> ... however vim does -" not fire the <buffer> <leftmouse> when you use the mouse -" to enter a buffer. -" -if g:miniBufExplUseSingleClick == 1 - let s:clickmap = ':if bufname("%") == "-MiniBufExplorer-" <bar> call <SID>MBEClick() <bar> endif <CR>' - if maparg('<LEFTMOUSE>', 'n') == '' - " no mapping for leftmouse - exec ':nnoremap <silent> <LEFTMOUSE> <LEFTMOUSE>' . s:clickmap - else - " we have a mapping - let g:miniBufExplDoneClickSave = 1 - let s:m = ':nnoremap <silent> <LEFTMOUSE> <LEFTMOUSE>' - let s:m = s:m . substitute(substitute(maparg('<LEFTMOUSE>', 'n'), '|', '<bar>', 'g'), '\c^<LEFTMOUSE>', '', '') - let s:m = s:m . s:clickmap - exec s:m - endif -endif " }}} - -" Variables used internally -" -" Script/Global variables {{{ -" Global used to store the buffer list so we don't update the -" UI unless the list has changed. -if !exists('g:miniBufExplBufList') - let g:miniBufExplBufList = '' -endif - -" Variable used as a mutex so that we don't do lots -" of AutoUpdates at the same time. -if !exists('g:miniBufExplInAutoUpdate') - let g:miniBufExplInAutoUpdate = 0 -endif - -" In debug mode 3 this variable will hold the debug output -if !exists('g:miniBufExplorerDebugOutput') - let g:miniBufExplorerDebugOutput = '' -endif - -" In debug mode 3 this variable will hold the debug output -if !exists('g:miniBufExplForceDisplay') - let g:miniBufExplForceDisplay = 0 -endif - -" Variable used to pass maxTabWidth info between functions -let s:maxTabWidth = 0 - -" Variable used to count debug output lines -let s:debugIndex = 0 - - -" }}} -" Setup an autocommand group and some autocommands {{{ -" that keep our explorer updated automatically. -" -augroup MiniBufExplorer -autocmd MiniBufExplorer BufDelete * call <SID>DEBUG('-=> BufDelete AutoCmd', 10) |call <SID>AutoUpdate(expand('<abuf>')) -autocmd MiniBufExplorer BufEnter * call <SID>DEBUG('-=> BufEnter AutoCmd', 10) |call <SID>AutoUpdate(-1) -autocmd MiniBufExplorer VimEnter * call <SID>DEBUG('-=> VimEnter AutoCmd', 10) |let g:miniBufExplorerAutoUpdate = 1 |call <SID>AutoUpdate(-1) -" }}} - -" Functions -" -" StartExplorer - Sets up our explorer and causes it to be displayed {{{ -" -function! <SID>StartExplorer(sticky, delBufNum) - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering StartExplorer()' ,10) - call <SID>DEBUG('===========================',10) - - if a:sticky == 1 - let g:miniBufExplorerAutoUpdate = 1 - endif - - " Store the current buffer - let l:curBuf = bufnr('%') - - " Prevent a report of our actions from showing up. - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - call <SID>FindCreateWindow('-MiniBufExplorer-', -1, 1, 1) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('StartExplorer called in invalid window',1) - let &report = l:save_rep - let &showcmd = l:save_sc - return - endif - - " !!! We may want to make the following optional -- Bindu - " New windows don't cause all windows to be resized to equal sizes - set noequalalways - " !!! We may want to make the following optional -- Bindu - " We don't want the mouse to change focus without a click - set nomousefocus - - " If folks turn numbering and columns on by default we will turn - " them off for the MBE window - setlocal foldcolumn=0 - setlocal nonumber - - if has("syntax") - syn clear - syn match MBENormal '\[[^\]]*\]' - syn match MBEChanged '\[[^\]]*\]+' - syn match MBEVisibleNormal '\[[^\]]*\]\*+\=' - syn match MBEVisibleChanged '\[[^\]]*\]\*+' - - if !exists("g:did_minibufexplorer_syntax_inits") - let g:did_minibufexplorer_syntax_inits = 1 - hi def link MBENormal Comment - hi def link MBEChanged String - hi def link MBEVisibleNormal Special - hi def link MBEVisibleChanged Special - endif - endif - - " If you press return in the -MiniBufExplorer- then try - " to open the selected buffer in the previous window. - nnoremap <buffer> <CR> :call <SID>MBESelectBuffer()<CR>:<BS> - " If you DoubleClick in the -MiniBufExplorer- then try - " to open the selected buffer in the previous window. - nnoremap <buffer> <2-LEFTMOUSE> :call <SID>MBEDoubleClick()<CR>:<BS> - " If you press d in the -MiniBufExplorer- then try to - " delete the selected buffer. - nnoremap <buffer> d :call <SID>MBEDeleteBuffer()<CR>:<BS> - " If you press w in the -MiniBufExplorer- then switch back - " to the previous window. - nnoremap <buffer> p :wincmd p<CR>:<BS> - " The following allow us to use regular movement keys to - " scroll in a wrapped single line buffer - nnoremap <buffer> j gj - nnoremap <buffer> k gk - nnoremap <buffer> <down> gj - nnoremap <buffer> <up> gk - " The following allows for quicker moving between buffer - " names in the [MBE] window it also saves the last-pattern - " and restores it. - nnoremap <buffer> <TAB> :call search('\[[0-9]*:[^\]]*\]')<CR>:<BS> - nnoremap <buffer> <S-TAB> :call search('\[[0-9]*:[^\]]*\]','b')<CR>:<BS> - - call <SID>DisplayBuffers(a:delBufNum) - - if (l:curBuf != -1) - call search('\['.l:curBuf.':'.expand('#'.l:curBuf.':t').'\]') - else - call <SID>DEBUG('No current buffer to search for',9) - endif - - let &report = l:save_rep - let &showcmd = l:save_sc - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed StartExplorer()' ,10) - call <SID>DEBUG('===========================',10) - -endfunction - -" }}} -" StopExplorer - Looks for our explorer and closes the window if it is open {{{ -" -function! <SID>StopExplorer(sticky) - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering StopExplorer()' ,10) - call <SID>DEBUG('===========================',10) - - if a:sticky == 1 - let g:miniBufExplorerAutoUpdate = 0 - endif - - let l:winNum = <SID>FindWindow('-MiniBufExplorer-', 1) - - if l:winNum != -1 - exec l:winNum.' wincmd w' - silent! close - wincmd p - endif - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed StopExplorer()' ,10) - call <SID>DEBUG('===========================',10) - -endfunction - -" }}} -" ToggleExplorer - Looks for our explorer and opens/closes the window {{{ -" -function! <SID>ToggleExplorer() - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering ToggleExplorer()' ,10) - call <SID>DEBUG('===========================',10) - - let g:miniBufExplorerAutoUpdate = 0 - - let l:winNum = <SID>FindWindow('-MiniBufExplorer-', 1) - - if l:winNum != -1 - call <SID>StopExplorer(1) - else - call <SID>StartExplorer(1, -1) - wincmd p - endif - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed ToggleExplorer()' ,10) - call <SID>DEBUG('===========================',10) - -endfunction - -" }}} -" FindWindow - Return the window number of a named buffer {{{ -" If none is found then returns -1. -" -function! <SID>FindWindow(bufName, doDebug) - if a:doDebug - call <SID>DEBUG('Entering FindWindow()',10) - endif - - " Try to find an existing window that contains - " our buffer. - let l:bufNum = bufnr(a:bufName) - if l:bufNum != -1 - if a:doDebug - call <SID>DEBUG('Found buffer ('.a:bufName.'): '.l:bufNum,9) - endif - let l:winNum = bufwinnr(l:bufNum) - else - let l:winNum = -1 - endif - - return l:winNum - -endfunction - -" }}} -" FindCreateWindow - Attempts to find a window for a named buffer. {{{ -" -" If it is found then moves there. Otherwise creates a new window and -" configures it and moves there. -" -" forceEdge, -1 use defaults, 0 below, 1 above -" isExplorer, 0 no, 1 yes -" doDebug, 0 no, 1 yes -" -function! <SID>FindCreateWindow(bufName, forceEdge, isExplorer, doDebug) - if a:doDebug - call <SID>DEBUG('Entering FindCreateWindow('.a:bufName.')',10) - endif - - " Save the user's split setting. - let l:saveSplitBelow = &splitbelow - - " Set to our new values. - let &splitbelow = g:miniBufExplSplitBelow - - " Try to find an existing explorer window - let l:winNum = <SID>FindWindow(a:bufName, a:doDebug) - - " If found goto the existing window, otherwise - " split open a new window. - if l:winNum != -1 - if a:doDebug - call <SID>DEBUG('Found window ('.a:bufName.'): '.l:winNum,9) - endif - exec l:winNum.' wincmd w' - let l:winFound = 1 - else - - if g:miniBufExplSplitToEdge == 1 || a:forceEdge >= 0 - - let l:edge = &splitbelow - if a:forceEdge >= 0 - let l:edge = a:forceEdge - endif - - if l:edge - if g:miniBufExplVSplit == 0 - exec 'bo sp '.a:bufName - else - exec 'bo vsp '.a:bufName - endif - else - if g:miniBufExplVSplit == 0 - exec 'to sp '.a:bufName - else - exec 'to vsp '.a:bufName - endif - endif - else - if g:miniBufExplVSplit == 0 - exec 'sp '.a:bufName - else - " &splitbelow doesn't affect vertical splits - " so we have to do this explicitly.. ugh. - if &splitbelow - exec 'rightb vsp '.a:bufName - else - exec 'vsp '.a:bufName - endif - endif - endif - - let g:miniBufExplForceDisplay = 1 - - " Try to find an existing explorer window - let l:winNum = <SID>FindWindow(a:bufName, a:doDebug) - if l:winNum != -1 - if a:doDebug - call <SID>DEBUG('Created and then found window ('.a:bufName.'): '.l:winNum,9) - endif - exec l:winNum.' wincmd w' - else - if a:doDebug - call <SID>DEBUG('FindCreateWindow failed to create window ('.a:bufName.').',1) - endif - return - endif - - if a:isExplorer - " Turn off the swapfile, set the buffer type so that it won't get written, - " and so that it will get deleted when it gets hidden and turn on word wrap. - setlocal noswapfile - setlocal buftype=nofile - setlocal bufhidden=delete - if g:miniBufExplVSplit == 0 - setlocal wrap - else - setlocal nowrap - exec('setlocal winwidth='.g:miniBufExplMinSize) - endif - endif - - if a:doDebug - call <SID>DEBUG('Window ('.a:bufName.') created: '.winnr(),9) - endif - - endif - - " Restore the user's split setting. - let &splitbelow = l:saveSplitBelow - -endfunction - -" }}} -" DisplayBuffers - Wrapper for getting MBE window shown {{{ -" -" Makes sure we are in our explorer, then erases the current buffer and turns -" it into a mini buffer explorer window. -" -function! <SID>DisplayBuffers(delBufNum) - call <SID>DEBUG('Entering DisplayBuffers()',10) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('DisplayBuffers called in invalid window',1) - return - endif - - " We need to be able to modify the buffer - setlocal modifiable - - call <SID>ShowBuffers(a:delBufNum) - call <SID>ResizeWindow() - - normal! zz - - " Prevent the buffer from being modified. - setlocal nomodifiable - set nobuflisted - -endfunction - -" }}} -" Resize Window - Set width/height of MBE window {{{ -" -" Makes sure we are in our explorer, then sets the height/width for our explorer -" window so that we can fit all of our information without taking extra lines. -" -function! <SID>ResizeWindow() - call <SID>DEBUG('Entering ResizeWindow()',10) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('ResizeWindow called in invalid window',1) - return - endif - - let l:width = winwidth('.') - - " Horizontal Resize - if g:miniBufExplVSplit == 0 - - if g:miniBufExplTabWrap == 0 - let l:length = strlen(getline('.')) - let l:height = 0 - if (l:width == 0) - let l:height = winheight('.') - else - let l:height = (l:length / l:width) - " handle truncation from div - if (l:length % l:width) != 0 - let l:height = l:height + 1 - endif - endif - else - exec("setlocal textwidth=".l:width) - normal gg - normal gq} - normal G - let l:height = line('.') - normal gg - endif - - " enforce max window height - if g:miniBufExplMaxSize != 0 - if g:miniBufExplMaxSize < l:height - let l:height = g:miniBufExplMaxSize - endif - endif - - " enfore min window height - if l:height < g:miniBufExplMinSize || l:height == 0 - let l:height = g:miniBufExplMinSize - endif - - call <SID>DEBUG('ResizeWindow to '.l:height.' lines',9) - - exec('resize '.l:height) - - " Vertical Resize - else - - if g:miniBufExplMaxSize != 0 - let l:newWidth = s:maxTabWidth - if l:newWidth > g:miniBufExplMaxSize - let l:newWidth = g:miniBufExplMaxSize - endif - if l:newWidth < g:miniBufExplMinSize - let l:newWidth = g:miniBufExplMinSize - endif - else - let l:newWidth = g:miniBufExplVSplit - endif - - if l:width != l:newWidth - call <SID>DEBUG('ResizeWindow to '.l:newWidth.' columns',9) - exec('vertical resize '.l:newWidth) - endif - - endif - -endfunction - -" }}} -" ShowBuffers - Clear current buffer and put the MBE text into it {{{ -" -" Makes sure we are in our explorer, then adds a list of all modifiable -" buffers to the current buffer. Special marks are added for buffers that -" are in one or more windows (*) and buffers that have been modified (+) -" -function! <SID>ShowBuffers(delBufNum) - call <SID>DEBUG('Entering ShowBuffers()',10) - - let l:ListChanged = <SID>BuildBufferList(a:delBufNum, 1) - - if (l:ListChanged == 1 || g:miniBufExplForceDisplay) - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - " Delete all lines in buffer. - 1,$d _ - - " Goto the end of the buffer put the buffer list - " and then delete the extra trailing blank line - $ - put! =g:miniBufExplBufList - $ d _ - - let g:miniBufExplForceDisplay = 0 - - let &report = l:save_rep - let &showcmd = l:save_sc - else - call <SID>DEBUG('Buffer list not update since there was no change',9) - endif - -endfunction - -" }}} -" Max - Returns the max of two numbers {{{ -" -function! <SID>Max(argOne, argTwo) - if a:argOne > a:argTwo - return a:argOne - else - return a:argTwo - endif -endfunction - -" }}} -" BuildBufferList - Build the text for the MBE window {{{ -" -" Creates the buffer list string and returns 1 if it is different than -" last time this was called and 0 otherwise. -" -function! <SID>BuildBufferList(delBufNum, updateBufList) - call <SID>DEBUG('Entering BuildBufferList()',10) - - let l:NBuffers = bufnr('$') " Get the number of the last buffer. - let l:i = 0 " Set the buffer index to zero. - - let l:fileNames = '' - let l:maxTabWidth = 0 - - " Loop through every buffer less than the total number of buffers. - while(l:i <= l:NBuffers) - let l:i = l:i + 1 - - " If we have a delBufNum and it is the current - " buffer then ignore the current buffer. - " Otherwise, continue. - if (a:delBufNum == -1 || l:i != a:delBufNum) - " Make sure the buffer in question is listed. - if(getbufvar(l:i, '&buflisted') == 1) - " Get the name of the buffer. - let l:BufName = bufname(l:i) - " Check to see if the buffer is a blank or not. If the buffer does have - " a name, process it. - if(strlen(l:BufName)) - " Only show modifiable buffers (The idea is that we don't - " want to show Explorers) - if (getbufvar(l:i, '&modifiable') == 1 && BufName != '-MiniBufExplorer-') - - " Get filename & Remove []'s & ()'s - let l:shortBufName = fnamemodify(l:BufName, ":t") - let l:shortBufName = substitute(l:shortBufName, '[][()]', '', 'g') - let l:tab = '['.l:i.':'.l:shortBufName.']' - - " If the buffer is open in a window mark it - if bufwinnr(l:i) != -1 - let l:tab = l:tab . '*' - endif - - " If the buffer is modified then mark it - if(getbufvar(l:i, '&modified') == 1) - let l:tab = l:tab . '+' - endif - - let l:maxTabWidth = <SID>Max(strlen(l:tab), l:maxTabWidth) - let l:fileNames = l:fileNames.l:tab - - " If horizontal and tab wrap is turned on we need to add spaces - if g:miniBufExplVSplit == 0 - if g:miniBufExplTabWrap != 0 - let l:fileNames = l:fileNames.' ' - endif - " If not horizontal we need a newline - else - let l:fileNames = l:fileNames . "\n" - endif - endif - endif - endif - endif - endwhile - - if (g:miniBufExplBufList != l:fileNames) - if (a:updateBufList) - let g:miniBufExplBufList = l:fileNames - let s:maxTabWidth = l:maxTabWidth - endif - return 1 - else - return 0 - endif - -endfunction - -" }}} -" HasEligibleBuffers - Are there enough MBE eligible buffers to open the MBE window? {{{ -" -" Returns 1 if there are any buffers that can be displayed in a -" mini buffer explorer. Otherwise returns 0. If delBufNum is -" any non -1 value then don't include that buffer in the list -" of eligible buffers. -" -function! <SID>HasEligibleBuffers(delBufNum) - call <SID>DEBUG('Entering HasEligibleBuffers()',10) - - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - let l:NBuffers = bufnr('$') " Get the number of the last buffer. - let l:i = 0 " Set the buffer index to zero. - let l:found = 0 " No buffer found - - if (g:miniBufExplorerMoreThanOne > 1) - call <SID>DEBUG('More Than One mode turned on',6) - endif - let l:needed = g:miniBufExplorerMoreThanOne - - " Loop through every buffer less than the total number of buffers. - while(l:i <= l:NBuffers && l:found < l:needed) - let l:i = l:i + 1 - - " If we have a delBufNum and it is the current - " buffer then ignore the current buffer. - " Otherwise, continue. - if (a:delBufNum == -1 || l:i != a:delBufNum) - " Make sure the buffer in question is listed. - if (getbufvar(l:i, '&buflisted') == 1) - " Get the name of the buffer. - let l:BufName = bufname(l:i) - " Check to see if the buffer is a blank or not. If the buffer does have - " a name, process it. - if (strlen(l:BufName)) - " Only show modifiable buffers (The idea is that we don't - " want to show Explorers) - if ((getbufvar(l:i, '&modifiable') == 1) && (BufName != '-MiniBufExplorer-')) - - let l:found = l:found + 1 - - endif - endif - endif - endif - endwhile - - let &report = l:save_rep - let &showcmd = l:save_sc - - call <SID>DEBUG('HasEligibleBuffers found '.l:found.' eligible buffers of '.l:needed.' needed',6) - - return (l:found >= l:needed) - -endfunction - -" }}} -" Auto Update - Function called by auto commands for auto updating the MBE {{{ -" -" IF auto update is turned on AND -" we are in a real buffer AND -" we have enough eligible buffers THEN -" Update our explorer and get back to the current window -" -" If we get a buffer number for a buffer that -" is being deleted, we need to make sure and -" remove the buffer from the list of eligible -" buffers in case we are down to one eligible -" buffer, in which case we will want to close -" the MBE window. -" -function! <SID>AutoUpdate(delBufNum) - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering AutoUpdate('.a:delBufNum.') : '.bufnr('%').' : '.bufname('%'),10) - call <SID>DEBUG('===========================',10) - - if (g:miniBufExplInAutoUpdate == 1) - call <SID>DEBUG('AutoUpdate recursion stopped',9) - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Terminated AutoUpdate()' ,10) - call <SID>DEBUG('===========================',10) - return - else - let g:miniBufExplInAutoUpdate = 1 - endif - - " Don't bother autoupdating the MBE window - if (bufname('%') == '-MiniBufExplorer-') - " If this is the only buffer left then toggle the buffer - if (winbufnr(2) == -1) - call <SID>CycleBuffer(1) - call <SID>DEBUG('AutoUpdate does not run for cycled windows', 9) - else - call <SID>DEBUG('AutoUpdate does not run for the MBE window', 9) - endif - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Terminated AutoUpdate()' ,10) - call <SID>DEBUG('===========================',10) - - let g:miniBufExplInAutoUpdate = 0 - return - - endif - - if (a:delBufNum != -1) - call <SID>DEBUG('AutoUpdate will make sure that buffer '.a:delBufNum.' is not included in the buffer list.', 5) - endif - - " Only allow updates when the AutoUpdate flag is set - " this allows us to stop updates on startup. - if g:miniBufExplorerAutoUpdate == 1 - " Only show MiniBufExplorer if we have a real buffer - if ((g:miniBufExplorerMoreThanOne == 0) || (bufnr('%') != -1 && bufname('%') != "")) - if <SID>HasEligibleBuffers(a:delBufNum) == 1 - " if we don't have a window then create one - let l:bufnr = <SID>FindWindow('-MiniBufExplorer-', 0) - if (l:bufnr == -1) - call <SID>DEBUG('About to call StartExplorer (Create MBE)', 9) - call <SID>StartExplorer(0, a:delBufNum) - else - " otherwise only update the window if the contents have - " changed - let l:ListChanged = <SID>BuildBufferList(a:delBufNum, 0) - if (l:ListChanged) - call <SID>DEBUG('About to call StartExplorer (Update MBE)', 9) - call <SID>StartExplorer(0, a:delBufNum) - endif - endif - - " go back to the working buffer - if (bufname('%') == '-MiniBufExplorer-') - wincmd p - endif - else - call <SID>DEBUG('Failed in eligible check', 9) - call <SID>StopExplorer(0) - endif - - " VIM sometimes turns syntax highlighting off, - " we can force it on, but this may cause weird - " behavior so this is an optional hack to force - " syntax back on when we enter a buffer - if g:miniBufExplForceSyntaxEnable - call <SID>DEBUG('Enable Syntax', 9) - exec 'syntax enable' - endif - - else - call <SID>DEBUG('No buffers loaded...',9) - endif - else - call <SID>DEBUG('AutoUpdates are turned off, terminating',9) - endif - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed AutoUpdate()' ,10) - call <SID>DEBUG('===========================',10) - - let g:miniBufExplInAutoUpdate = 0 - -endfunction - -" }}} -" GetSelectedBuffer - From the MBE window, return the bufnum for buf under cursor {{{ -" -" If we are in our explorer window then return the buffer number -" for the buffer under the cursor. -" -function! <SID>GetSelectedBuffer() - call <SID>DEBUG('Entering GetSelectedBuffer()',10) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('GetSelectedBuffer called in invalid window',1) - return -1 - endif - - let l:save_reg = @" - let @" = "" - normal ""yi[ - if @" != "" - let l:retv = substitute(@",'\([0-9]*\):.*', '\1', '') + 0 - let @" = l:save_reg - return l:retv - else - let @" = l:save_reg - return -1 - endif - -endfunction - -" }}} -" MBESelectBuffer - From the MBE window, open buffer under the cursor {{{ -" -" If we are in our explorer, then we attempt to open the buffer under the -" cursor in the previous window. -" -function! <SID>MBESelectBuffer() - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering MBESelectBuffer()' ,10) - call <SID>DEBUG('===========================',10) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('MBESelectBuffer called in invalid window',1) - return - endif - - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - let l:bufnr = <SID>GetSelectedBuffer() - let l:resize = 0 - - if(l:bufnr != -1) " If the buffer exists. - - let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate - let g:miniBufExplorerAutoUpdate = 0 - " Switch to the previous window - wincmd p - - " If we are in the buffer explorer or in a nonmodifiable buffer with - " g:miniBufExplModSelTarget set then try another window (a few times) - if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) - wincmd w - if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) - wincmd w - if bufname('%') == '-MiniBufExplorer-' || (g:miniBufExplModSelTarget == 1 && getbufvar(bufnr('%'), '&modifiable') == 0) - wincmd w - " The following handles the case where -MiniBufExplorer- - " is the only window left. We need to resize so we don't - " end up with a 1 or two line buffer. - if bufname('%') == '-MiniBufExplorer-' - let l:resize = 1 - endif - endif - endif - endif - - exec('b! '.l:bufnr) - if (l:resize) - resize - endif - let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate - call <SID>AutoUpdate(-1) - - endif - - let &report = l:save_rep - let &showcmd = l:save_sc - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed MBESelectBuffer()',10) - call <SID>DEBUG('===========================',10) - -endfunction - -" }}} -" MBEDeleteBuffer - From the MBE window, delete selected buffer from list {{{ -" -" After making sure that we are in our explorer, This will delete the buffer -" under the cursor. If the buffer under the cursor is being displayed in a -" window, this routine will attempt to get different buffers into the -" windows that will be affected so that windows don't get removed. -" -function! <SID>MBEDeleteBuffer() - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Entering MBEDeleteBuffer()' ,10) - call <SID>DEBUG('===========================',10) - - " Make sure we are in our window - if bufname('%') != '-MiniBufExplorer-' - call <SID>DEBUG('MBEDeleteBuffer called in invalid window',1) - return - endif - - let l:curLine = line('.') - let l:curCol = virtcol('.') - let l:selBuf = <SID>GetSelectedBuffer() - let l:selBufName = bufname(l:selBuf) - - if l:selBufName == 'MiniBufExplorer.DBG' && g:miniBufExplorerDebugLevel > 0 - call <SID>DEBUG('MBEDeleteBuffer will not delete the debug window, when debugging is turned on.',1) - return - endif - - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - - if l:selBuf != -1 - - " Don't want auto updates while we are processing a delete - " request. - let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate - let g:miniBufExplorerAutoUpdate = 0 - - " Save previous window so that if we show a buffer after - " deleting. The show will come up in the correct window. - wincmd p - let l:prevWin = winnr() - let l:prevWinBuf = winbufnr(winnr()) - - call <SID>DEBUG('Previous window: '.l:prevWin.' buffer in window: '.l:prevWinBuf,5) - call <SID>DEBUG('Selected buffer is <'.l:selBufName.'>['.l:selBuf.']',5) - - " If buffer is being displayed in a window then - " move window to a different buffer before - " deleting this one. - let l:winNum = (bufwinnr(l:selBufName) + 0) - " while we have windows that contain our buffer - while l:winNum != -1 - call <SID>DEBUG('Buffer '.l:selBuf.' is being displayed in window: '.l:winNum,5) - - " move to window that contains our selected buffer - exec l:winNum.' wincmd w' - - call <SID>DEBUG('We are now in window: '.winnr().' which contains buffer: '.bufnr('%').' and should contain buffer: '.l:selBuf,5) - - let l:origBuf = bufnr('%') - call <SID>CycleBuffer(1) - let l:curBuf = bufnr('%') - - call <SID>DEBUG('Window now contains buffer: '.bufnr('%').' which should not be: '.l:selBuf,5) - - if l:origBuf == l:curBuf - " we wrapped so we are going to have to delete a buffer - " that is in an open window. - let l:winNum = -1 - else - " see if we have anymore windows with our selected buffer - let l:winNum = (bufwinnr(l:selBufName) + 0) - endif - endwhile - - " Attempt to restore previous window - call <SID>DEBUG('Restoring previous window to: '.l:prevWin,5) - exec l:prevWin.' wincmd w' - - " Try to get back to the -MiniBufExplorer- window - let l:winNum = bufwinnr(bufnr('-MiniBufExplorer-')) - if l:winNum != -1 - exec l:winNum.' wincmd w' - call <SID>DEBUG('Got to -MiniBufExplorer- window: '.winnr(),5) - else - call <SID>DEBUG('Unable to get to -MiniBufExplorer- window',1) - endif - - " Delete the buffer selected. - call <SID>DEBUG('About to delete buffer: '.l:selBuf,5) - exec('silent! bd '.l:selBuf) - - let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate - call <SID>DisplayBuffers(-1) - call cursor(l:curLine, l:curCol) - - endif - - let &report = l:save_rep - let &showcmd = l:save_sc - - call <SID>DEBUG('===========================',10) - call <SID>DEBUG('Completed MBEDeleteBuffer()',10) - call <SID>DEBUG('===========================',10) - -endfunction - -" }}} -" MBEClick - Handle mouse double click {{{ -" -function! s:MBEClick() - call <SID>DEBUG('Entering MBEClick()',10) - call <SID>MBESelectBuffer() -endfunction - -" -" MBEDoubleClick - Double click with the mouse. -" -function! s:MBEDoubleClick() - call <SID>DEBUG('Entering MBEDoubleClick()',10) - call <SID>MBESelectBuffer() -endfunction - -" }}} -" CycleBuffer - Cycle Through Buffers {{{ -" -" Move to next or previous buffer in the current window. If there -" are no more modifiable buffers then stay on the current buffer. -" can be called with no parameters in which case the buffers are -" cycled forward. Otherwise a single argument is accepted, if -" it's 0 then the buffers are cycled backwards, otherwise they -" are cycled forward. -" -function! <SID>CycleBuffer(forward) - - " The following hack handles the case where we only have one - " window open and it is too small - let l:saveAutoUpdate = g:miniBufExplorerAutoUpdate - if (winbufnr(2) == -1) - resize - let g:miniBufExplorerAutoUpdate = 0 - endif - - " Change buffer (keeping track of before and after buffers) - let l:origBuf = bufnr('%') - if (a:forward == 1) - bn! - else - bp! - endif - let l:curBuf = bufnr('%') - - " Skip any non-modifiable buffers, but don't cycle forever - " This should stop us from stopping in any of the [Explorers] - while getbufvar(l:curBuf, '&modifiable') == 0 && l:origBuf != l:curBuf - if (a:forward == 1) - bn! - else - bp! - endif - let l:curBuf = bufnr('%') - endwhile - - let g:miniBufExplorerAutoUpdate = l:saveAutoUpdate - if (l:saveAutoUpdate == 1) - call <SID>AutoUpdate(-1) - endif - -endfunction - -" }}} -" DEBUG - Display debug output when debugging is turned on {{{ -" -" Thanks to Charles E. Campbell, Jr. PhD <cec@NgrOyphSon.gPsfAc.nMasa.gov> -" for Decho.vim which was the inspiration for this enhanced debugging -" capability. -" -function! <SID>DEBUG(msg, level) - - if g:miniBufExplorerDebugLevel >= a:level - - " Prevent a report of our actions from showing up. - let l:save_rep = &report - let l:save_sc = &showcmd - let &report = 10000 - set noshowcmd - - " Debug output to a buffer - if g:miniBufExplorerDebugMode == 0 - " Save the current window number so we can come back here - let l:prevWin = winnr() - wincmd p - let l:prevPrevWin = winnr() - wincmd p - - " Get into the debug window or create it if needed - call <SID>FindCreateWindow('MiniBufExplorer.DBG', 1, 0, 0) - - " Make sure we really got to our window, if not we - " will display a confirm dialog and turn debugging - " off so that we won't break things even more. - if bufname('%') != 'MiniBufExplorer.DBG' - call confirm('Error in window debugging code. Dissabling MiniBufExplorer debugging.', 'OK') - let g:miniBufExplorerDebugLevel = 0 - endif - - " Write Message to DBG buffer - let res=append("$",s:debugIndex.':'.a:level.':'.a:msg) - norm G - "set nomodified - - " Return to original window - exec l:prevPrevWin.' wincmd w' - exec l:prevWin.' wincmd w' - " Debug output using VIM's echo facility - elseif g:miniBufExplorerDebugMode == 1 - echo s:debugIndex.':'.a:level.':'.a:msg - " Debug output to a file -- VERY SLOW!!! - " should be OK on UNIX and Win32 (not the 95/98 variants) - elseif g:miniBufExplorerDebugMode == 2 - if has('system') || has('fork') - if has('win32') && !has('win95') - let l:result = system("cmd /c 'echo ".s:debugIndex.':'.a:level.':'.a:msg." >> MiniBufExplorer.DBG'") - endif - if has('unix') - let l:result = system("echo '".s:debugIndex.':'.a:level.':'.a:msg." >> MiniBufExplorer.DBG'") - endif - else - call confirm('Error in file writing version of the debugging code, vim not compiled with system or fork. Dissabling MiniBufExplorer debugging.', 'OK') - let g:miniBufExplorerDebugLevel = 0 - endif - elseif g:miniBufExplorerDebugMode == 3 - let g:miniBufExplorerDebugOutput = g:miniBufExplorerDebugOutput."\n".s:debugIndex.':'.a:level.':'.a:msg - endif - let s:debugIndex = s:debugIndex + 1 - - let &report = l:save_rep - let &showcmd = l:save_sc - - endif - -endfunc " }}} - -" MBE Script History {{{ -"============================================================================= -" -" History: 6.3.2 o For some reason there was still a call to StopExplorer -" with 2 params. Very old bug. I know I fixed before, -" any way many thanks to Jason Mills for reporting this! -" 6.3.1 o Include folds in source so that it's easier to -" navigate. -" o Added g:miniBufExplForceSyntaxEnable setting for folks -" that want a :syntax enable to be called when we enter -" buffers. This can resolve issues caused by a vim bug -" where buffers show up without highlighting when another -" buffer has been closed, quit, wiped or deleted. -" 6.3.0 o Added an option to allow single click (rather than -" the default double click) to select buffers in the -" MBE window. This feature was requested by AW Law -" and was inspired by taglist.vim. Note that you will -" need the latest version of taglist.vim if you want to -" use MBE and taglist both with singleclick turned on. -" Also thanks to AW Law for pointing out that you can -" make an Explorer not be listed in a standard :ls. -" o Added the ability to have your tabs show up in a -" vertical window rather than the standard horizontal -" one. Just let g:miniBufExplVSplit = <width> in your -" .vimrc and your will get this functionality. -" o If you use the vertical explorer and you want it to -" autosize then let g:miniBufExplMaxSize = <max width> -" in your .vimrc. You may use the MinSize letting in -" addition to the MaxLetting if you don't want a super -" thin window. -" o g:miniBufExplMaxHeight was renamed g:miniBufExplMaxSize -" g:miniBufExplMinHeight was renamed g:miniBufExplMinSize -" the old settings are backwards compatible if you don't -" use the new settings, but they are depreciated. -" 6.2.8 o Add an option to stop MBE from targeting non-modifiable -" buffers when switching buffers. Thanks to AW Law for -" the inspiration for this. This may not work if a user -" has lots of explorer/help windows open. -" 6.2.7 o Very minor bug fix for people who want to set -" loaded_minibufexplorer in their .vimrc in order to -" stop MBE from loading. 99.99% of users do not need -" this update. -" 6.2.6 o Moved history to end of source file -" o Updated highlighting documentation -" o Created global commands MBEbn and MBEbp that can be -" used in mappings if folks want to cycle buffers while -" skipping non-eligible buffers. -" 6.2.5 o Added <Leader>mbt key mapping which will toggle -" the MBE window. I map this to F3 in my .vimrc -" with "map <F3> :TMiniBufExplorer<CR>" which -" means I can easily close the MBE window when I'm -" not using it and get it back when I want it. -" o Changed default debug mode to 3 (write to global -" g:miniBufExplorerDebugOutput) -" o Made a pass through the documentation to clarify -" serveral issues and provide more complete docs -" for mappings and commands. -" 6.2.4 o Because of the autocommand switch (see 6.2.0) it -" was possible to remove the restriction on the -" :set hidden option. It is now possible to use -" this option with MBE. -" 6.2.3 o Added miniBufExplTabWrap option. It is turned -" off by default. When turned on spaces are added -" between tabs and gq} is issued to perform line -" formatting. This won't work very well if filenames -" contain spaces. It would be pretty easy to write -" my own formatter, but I'm too lazy, so if someone -" really needs that feature I'll add it :) -" 6.2.2 o Changed the way the g:miniBufExplorerMoreThanOne -" global is handled. You can set this to the number -" of eligible buffers you want to be loaded before -" the MBE window is loaded. Setting it to 0 causes -" the MBE window to be opened even if there are no -" buffers. Setting it to 4 causes the window to stay -" closed until the 4th eligible buffer is loaded. -" o Added a MinHeight option. This is nice if you want -" the MBE window to always take the same amount of -" space. For example set MaxSize and MinSize to 2 -" and set MoreThanOne to 0 and you will always have -" a 2 row (plus the ruler :) MBE window. -" NOTE: in 6.3.0 we started using MinSize instead of -" Minheight. This will still work if MinSize is not -" specified, but it is depreciated. Use MinSize instead. -" o I now setlocal foldcomun=0 and nonumber in the MBE -" window. This is for those of you that like to have -" these options turned on locally. I'm assuming noone -" outthere wants foldcolumns and line numbers in the -" MBE window? :) -" o Fixed a bug where an empty MBE window was taking half -" of the screen (partly why the MinHeight option was -" added.) -" 6.2.1 o If MBE is the only window (because of :bd for example) -" and there are still eligible buffers then one of them -" will be displayed. -" o The <Leader>mbe mapping now highlights the buffer from -" the current window. -" o The delete ('d') binding in the MBE window now restors -" the cursor position, which can help if you want to -" delete several buffers in a row that are not at the -" beginning of the buffer list. -" o Added a new key binding ('p') in the MBE window to -" switch to the previous window (last edit window) -" 6.2.0 o Major overhaul of autocommand and list updating code, -" we now have much better handling of :bd (which is the -" most requested feature.) As well as resolving other -" issues where the buffer list would not be updated -" automatically. The old version tried to trap specific -" events, this one just updates frequently, but it keeps -" track and only changes the screen if there has been -" a change. -" o Added g:miniBufExplMaxHeight variable so you can keep -" the -MiniBufExplorer- window small when you have lots -" of buffers (or buffers with long names :) -" NOTE: in 6.3.0 we started using MaxSize instead of -" MaxHeight. This will still work if MaxSize is not -" specified, but it is depreciated. Use MaxSize instead. -" o Improvement to internal syntax highlighting code -" I renamed the syntax group names. Anyone who has -" figured out how to use them already shouldn't have -" any trouble with the new Nameing :) -" o Added debug mode 3 which writes to a global variable -" this is fast and doesn't mess with the buffer/window -" lists. -" 6.1.0 o <Leader>mbc was failing because I was calling one of -" my own functions with the wrong number of args. :( -" Thanks to Gerry Patterson for finding this! -" This code is very stable (although it has some -" idiocyncracies.) -" 6.0.9 o Double clicking tabs was overwriting the cliboard -" register on MS Windows. Thanks to Shoeb Bhinderwala -" for reporting this issue. -" 6.0.8 o Apparently some VIM builds are having a hard time with -" line continuation in scripts so the few that were here -" have been removed. -" o Generalized FindExplorer and FindCreateExplorer so -" that they can be used for the debug window. Renaming -" to FindWindow and FindCreateWindow. -" o Updated debugging code so that debug output is put into -" a buffer which can then be written to disk or emailed -" to me when someone is having a major issue. Can also -" write directly to a file (VERY SLOWLY) on UNIX or Win32 -" (not 95 or 98 at the moment) or use VIM's echo function -" to display the output to the screen. -" o Several people have had issues when the hidden option -" is turned on. So I have put in several checks to make -" sure folks know this if they try to use MBE with this -" option set. -" 6.0.7 o Handling BufDelete autocmd so that the UI updates -" properly when using :bd (rather than going through -" the MBE UI.) -" o The AutoUpdate code will now close the MBE window when -" there is a single eligible buffer available. -" This has the usefull side effect of stopping the MBE -" window from blocking the VIM session open when you close -" the last buffer. -" o Added functions, commands and maps to close & update -" the MBE window (<leader>mbc and <leader>mbu.) -" o Made MBE open/close state be sticky if set through -" StartExplorer(1) or StopExplorer(1), which are -" called from the standard mappings. So if you close -" the mbe window with \mbc it won't be automatically -" opened again unless you do a \mbe (or restart VIM). -" o Removed spaces between "tabs" (even more mini :) -" o Simplified MBE tab processing -" 6.0.6 o Fixed register overwrite bug found by Sébastien Pierre -" 6.0.5 o Fixed an issue with window sizing when we run out of -" buffers. -" o Fixed some weird commenting bugs. -" o Added more optional fancy window/buffer navigation: -" o You can turn on the capability to use control and the -" arrow keys to move between windows. -" o You can turn on the ability to use <C-TAB> and -" <C-S-TAB> to open the next and previous (respectively) -" buffer in the current window. -" o You can turn on the ability to use <C-TAB> and -" <C-S-TAB> to switch windows (forward and backwards -" respectively.) -" 6.0.4 o Added optional fancy window navigation: -" o Holding down control and pressing a vim direction -" [hjkl] will switch windows in the indicated direction. -" 6.0.3 o Changed buffer name to -MiniBufExplorer- to resolve -" Issue in filename pattern matching on Windows. -" 6.0.2 o 2 Changes requested by Suresh Govindachar: -" o Added SplitToEdge option and set it on by default -" o Added tab and shift-tab mappings in [MBE] window -" 6.0.1 o Added MoreThanOne option and set it on by default -" MiniBufExplorer will not automatically open until -" more than one eligible buffers are opened. This -" reduces cluter when you are only working on a -" single file. -" NOTE: See change log for 6.2.2 for more details about -" this feature -" 6.0.0 o Initial Release on November 20, 2001 -" -"============================================================================= -" }}} -" vim:ft=vim:fdm=marker:ff=unix:nowrap:tabstop=4:shiftwidth=4:softtabstop=4:smarttab:shiftround:expandtab diff --git a/plugin/repeat.vim b/plugin/repeat.vim deleted file mode 100755 index e6ec409..0000000 --- a/plugin/repeat.vim +++ /dev/null @@ -1,72 +0,0 @@ -" repeat.vim - Let the repeat command repeat plugin maps -" Maintainer: Tim Pope -" Version: 1.0 - -" Installation: -" Place in either ~/.vim/plugin/repeat.vim (to load at start up) or -" ~/.vim/autoload/repeat.vim (to load automatically as needed). -" -" Developers: -" Basic usage is as follows: -" -" silent! call repeat#set("\<Plug>MappingToRepeatCommand",3) -" -" The first argument is the mapping that will be invoked when the |.| key is -" pressed. Typically, it will be the same as the mapping the user invoked. -" This sequence will be stuffed into the input queue literally. Thus you must -" encode special keys by prefixing them with a backslash inside double quotes. -" -" The second argument is the default count. This is the number that will be -" prefixed to the mapping if no explicit numeric argument was given. The -" value of the v:count variable is usually correct and it will be used if the -" second parameter is omitted. If your mapping doesn't accept a numeric -" argument and you never want to receive one, pass a value of -1. -" -" Make sure to call the repeat#set function _after_ making changes to the -" file. - -if exists("g:loaded_repeat") || &cp || v:version < 700 - finish -endif -let g:loaded_repeat = 1 - -let g:repeat_tick = -1 - -function! repeat#set(sequence,...) - silent exe "norm! \"=''\<CR>p" - let g:repeat_sequence = a:sequence - let g:repeat_count = a:0 ? a:1 : v:count - let g:repeat_tick = b:changedtick -endfunction - -function! s:repeat(count) - if g:repeat_tick == b:changedtick - let c = g:repeat_count - let s = g:repeat_sequence - let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : '')) - call feedkeys(cnt . s) - else - call feedkeys((a:count ? a:count : '') . '.', 'n') - endif -endfunction - -function! s:wrap(command,count) - let preserve = (g:repeat_tick == b:changedtick) - exe 'norm! '.(a:count ? a:count : '').a:command - if preserve - let g:repeat_tick = b:changedtick - endif -endfunction - -nnoremap <silent> . :<C-U>call <SID>repeat(v:count)<CR> -nnoremap <silent> u :<C-U>call <SID>wrap('u',v:count)<CR> -nnoremap <silent> U :<C-U>call <SID>wrap('U',v:count)<CR> -nnoremap <silent> <C-R> :<C-U>call <SID>wrap("\<Lt>C-R>",v:count)<CR> - -augroup repeatPlugin - autocmd! - autocmd BufLeave,BufWritePre,BufReadPre * let g:repeat_tick = (g:repeat_tick == b:changedtick || g:repeat_tick == 0) ? 0 : -1 - autocmd BufEnter,BufWritePost * if g:repeat_tick == 0|let g:repeat_tick = b:changedtick|endif -augroup END - -" vim:set ft=vim et sw=4 sts=4: diff --git a/vimrc b/vimrc index 6f121df..d7057cd 100755 --- a/vimrc +++ b/vimrc @@ -1,520 +1,520 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: David Stahl " http://otherdave.com - otherdave@gmail.com " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc if MySys() == "mac" - map <leader>e :e! ~/othervim.git/vimrc<cr> - autocmd! bufwritepost vimrc source ~/othervim.git/vimrc + map <leader>e :e! ~/dev/othervim/vimrc<cr> + autocmd! bufwritepost vimrc source ~/dev/othervim/vimrc elseif MySys() == "windows" map <leader>e :e! c:/dev/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc elseif MySys() == "linux" map <leader>e :e! ~/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source ~/othervim.git/vimrc endif map <leader>s :e! ~/Desktop/status.txt<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case (smartcase) " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= " Always have line numbers set nu """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set t_Co=256 set background=dark colorscheme solarized else set background=dark colorscheme desert endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
b771a3166888ed28f34986722272f2fed8af32fc
Add Vimroom and change the background to "dark".
diff --git a/plugin/vimroom.vim b/plugin/vimroom.vim new file mode 100644 index 0000000..0e8076a --- /dev/null +++ b/plugin/vimroom.vim @@ -0,0 +1,199 @@ +"============================================================================== +"File: vimroom.vim +"Description: Vaguely emulates a writeroom-like environment in Vim by +" splitting the current window in such a way as to center a column +" of user-specified width, wrap the text, and break lines. +"Maintainer: Mike West <mike@mikewest.org> +"Version: 0.7 +"Last Change: 2010-10-31 +"License: BSD <../LICENSE.markdown> +"============================================================================== + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugin Configuration +" + +" The typical start to any vim plugin: If the plugin has already been loaded, +" exit as quickly as possible. +if exists( "g:loaded_vimroom_plugin" ) + finish +endif +let g:loaded_vimroom_plugin = 1 + +" The desired column width. Defaults to 80: +if !exists( "g:vimroom_width" ) + let g:vimroom_width = 80 +endif + +" The minimum sidebar size. Defaults to 5: +if !exists( "g:vimroom_min_sidebar_width" ) + let g:vimroom_min_sidebar_width = 5 +endif + +" The sidebar height. Defaults to 3: +if !exists( "g:vimroom_sidebar_height" ) + let g:vimroom_sidebar_height = 3 +endif + +" The background color. Defaults to "black" +if !exists( "g:vimroom_background" ) + let g:vimroom_background = "black" +endif + +" The "scrolloff" value: how many lines should be kept visible above and below +" the cursor at all times? Defaults to 999 (which centers your cursor in the +" active window). +if !exists( "g:vimroom_scrolloff" ) + let g:vimroom_scrolloff = 999 +endif + +" Should Vimroom map navigational keys (`<Up>`, `<Down>`, `j`, `k`) to navigate +" "display" lines instead of "logical" lines (which makes it much simpler to deal +" with wrapped lines). Defaults to `1` (on). Set to `0` if you'd prefer not to +" run the mappings. +if !exists( "g:vimroom_navigation_keys" ) + let g:vimroom_navigation_keys = 1 +endif + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugin Code +" + +" Given the desired column width, and minimum sidebar width, determine +" the minimum window width necessary for splitting to make sense +let s:minwidth = g:vimroom_width + ( g:vimroom_min_sidebar_width * 2 ) + +" Save the current color scheme for reset later +let s:scheme = "" +if exists( "g:colors_name" ) + let s:scheme = g:colors_name +endif + +" Save the current scrolloff value for reset later +let s:save_scrolloff = "" +if exists( "&scrolloff" ) + let s:save_scrolloff = &scrolloff +end + +" Save the current `laststatus` value for reset later +let s:save_laststatus = "" +if exists( "&laststatus" ) + let s:save_laststatus = &laststatus +endif + +" Save the current `textwidth` value for reset later +let s:save_textwidth = "" +if exists( "&textwidth" ) + let s:save_textwidth = &textwidth +endif + +" We're currently in nonvimroomized state +let s:active = 0 + +function! s:is_the_screen_wide_enough() + return winwidth( winnr() ) >= s:minwidth +endfunction + +function! s:sidebar_size() + return ( winwidth( winnr() ) - g:vimroom_width - 2 ) / 2 +endfunction + +function! <SID>VimroomToggle() + if s:active == 1 + let s:active = 0 + " Close all other windows + only + " Reset color scheme (or clear new colors, if no scheme is set) + if s:scheme != "" + exec( "colorscheme " . s:scheme ) + else + hi clear + endif + " Reset `scrolloff` and `laststatus` + if s:save_scrolloff != "" + exec( "set scrolloff=" . s:save_scrolloff ) + endif + if s:save_laststatus != "" + exec( "set laststatus=" . s:save_laststatus ) + endif + if s:save_textwidth != "" + exec( "set textwidth=" . s:save_textwidth ) + endif + " Remove wrapping and linebreaks + set nowrap + set nolinebreak + else + if s:is_the_screen_wide_enough() + let s:active = 1 + let s:sidebar = s:sidebar_size() + " Turn off status bar + if s:save_laststatus != "" + set laststatus=0 + endif + " Create the left sidebar + exec( "silent leftabove " . s:sidebar . "vsplit new" ) + set noma + set nocursorline + wincmd l + " Create the right sidebar + exec( "silent rightbelow " . s:sidebar . "vsplit new" ) + set noma + set nocursorline + wincmd h + if g:vimroom_sidebar_height + " Create the top sidebar + exec( "silent leftabove " . g:vimroom_sidebar_height . "split new" ) + set noma + set nocursorline + wincmd j + " Create the bottom sidebar + exec( "silent rightbelow " . g:vimroom_sidebar_height . "split new" ) + set noma + set nocursorline + wincmd k + endif + " Setup wrapping, line breaking, and push the cursor down + set wrap + set linebreak + if s:save_textwidth != "" + exec( "set textwidth=".g:vimroom_width ) + endif + if s:save_scrolloff != "" + exec( "set scrolloff=".g:vimroom_scrolloff ) + endif + + " Setup navigation over "display lines", not "logical lines" if + " mappings for the navigation keys don't already exist. + if g:vimroom_navigation_keys + try + noremap <unique> <silent> <Up> g<Up> + noremap <unique> <silent> <Down> g<Down> + noremap <unique> <silent> k gk + noremap <unique> <silent> j gj + inoremap <unique> <silent> <Up> <C-o>g<Up> + inoremap <unique> <silent> <Down> <C-o>g<Down> + catch /E227:/ + echo "Navigational key mappings already exist." + endtry + endif + + " Hide distracting visual elements + exec( "hi VertSplit ctermbg=" . g:vimroom_background . " ctermfg=" . g:vimroom_background . " guifg=" . g:vimroom_background . " guibg=" . g:vimroom_background ) + exec( "hi NonText ctermbg=" . g:vimroom_background . " ctermfg=" . g:vimroom_background . " guifg=" . g:vimroom_background . " guibg=" . g:vimroom_background ) + exec( "hi StatusLine ctermbg=" . g:vimroom_background . " ctermfg=" . g:vimroom_background . " guifg=" . g:vimroom_background . " guibg=" . g:vimroom_background ) + exec( "hi StatusLineNC ctermbg=" . g:vimroom_background . " ctermfg=" . g:vimroom_background . " guifg=" . g:vimroom_background . " guibg=" . g:vimroom_background ) + set fillchars+=vert:\ + endif + endif +endfunction + +" Create a mapping for the `VimroomToggle` function +noremap <silent> <Plug>VimroomToggle :call <SID>VimroomToggle()<CR> + +" Create a `VimroomToggle` command: +command -nargs=0 VimroomToggle call <SID>VimroomToggle() + +" If no mapping exists, map it to `<Leader>V`. +if !hasmapto( '<Plug>VimroomToggle' ) + nmap <silent> <Leader>V <Plug>VimroomToggle +endif diff --git a/vimrc b/vimrc index 0739c86..6f121df 100755 --- a/vimrc +++ b/vimrc @@ -1,521 +1,520 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: David Stahl " http://otherdave.com - otherdave@gmail.com " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc if MySys() == "mac" map <leader>e :e! ~/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source ~/othervim.git/vimrc elseif MySys() == "windows" map <leader>e :e! c:/dev/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc elseif MySys() == "linux" map <leader>e :e! ~/othervim.git/vimrc<cr> autocmd! bufwritepost vimrc source ~/othervim.git/vimrc endif map <leader>s :e! ~/Desktop/status.txt<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case (smartcase) " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= " Always have line numbers set nu """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T - set background=light set t_Co=256 - set background=light + set background=dark colorscheme solarized else set background=dark colorscheme desert endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
56614d209af8624edb6ea30edfe95fab74e5b455
Fix mac/windows/linux issues
diff --git a/vimrc b/vimrc index 2d22d3f..0739c86 100755 --- a/vimrc +++ b/vimrc @@ -1,589 +1,521 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Maintainer: amix the lucky stiff -" http://amix.dk - amix@amix.dk +" Maintainer: David Stahl +" http://otherdave.com - otherdave@gmail.com " -" Version: 3.3 - 21/01/10 01:05:46 -" -" Blog_post: -" http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc -" Syntax_highlighted: -" http://amix.dk/vim/vimrc.html -" Raw_version: -" http://amix.dk/vim/vimrc.txt -" -" How_to_Install: -" $ mkdir ~/.vim_runtime -" $ svn co svn://orangoo.com/vim ~/.vim_runtime -" $ cat ~/.vim_runtime/install.sh -" $ sh ~/.vim_runtime/install.sh <system> -" <sytem> can be `mac`, `linux` or `windows` -" -" How_to_Upgrade: -" $ svn update ~/.vim_runtime -" -" Sections: -" -> General -" -> VIM user interface -" -> Colors and Fonts -" -> Files and backups -" -> Text, tab and indent related -" -> Visual mode related -" -> Command mode related -" -> Moving around, tabs and buffers -" -> Statusline -" -> Parenthesis/bracket expanding -" -> General Abbrevs -" -> Editing mappings -" -" -> Cope -" -> Minibuffer plugin -" -> Omni complete functions -" -> Python section -" -> JavaScript section -" -" Plugins_Included: -" > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159 -" Makes it easy to get an overview of buffers: -" info -> :e ~/.vim_runtime/plugin/minibufexpl.vim -" -" > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 -" Makes it easy to switch between buffers: -" info -> :help bufExplorer -" -" > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234 -" Emacs's killring, useful when using the clipboard: -" info -> :help yankring -" -" > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697 -" Makes it easy to work with surrounding text: -" info -> :help surround -" -" > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540 -" Snippets for many languages (similar to TextMate's): -" info -> :help snipMate -" -" > fuzzyfinder - http://www.vim.org/scripts/script.php?script_id=1984 -" Find files fast (similar to TextMate's feature): -" info -> :help fuzzyfinder@en -" -" Revisions: -" > 3.3: Added syntax highlighting for Mako mako.vim -" > 3.2: Turned on python_highlight_all for better syntax -" highlighting for Python -" > 3.1: Added revisions ;) and bufexplorer.vim -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc -map <leader>e :e! c:/dev/othervim.git/vimrc<cr> - -map <leader>s :e! ~/Desktop/status.txt<cr> +if MySys() == "mac" + map <leader>e :e! ~/othervim.git/vimrc<cr> + autocmd! bufwritepost vimrc source ~/othervim.git/vimrc +elseif MySys() == "windows" + map <leader>e :e! c:/dev/othervim.git/vimrc<cr> + autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc +elseif MySys() == "linux" + map <leader>e :e! ~/othervim.git/vimrc<cr> + autocmd! bufwritepost vimrc source ~/othervim.git/vimrc +endif -" When vimrc is edited, reload it -autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc +map <leader>s :e! ~/Desktop/status.txt<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l -" ignore case if search term is all lower case. +" ignore case if search term is all lower case (smartcase) " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= +" Always have line numbers +set nu """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set background=light set t_Co=256 set background=light colorscheme solarized - - set nu else set background=dark colorscheme desert - - set nonu endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
ac6863de3adfcb9b4b16c9b3566298355b421e9a
dark & desert for terminal
diff --git a/vimrc b/vimrc index 3938be1..2d22d3f 100755 --- a/vimrc +++ b/vimrc @@ -1,589 +1,589 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: amix the lucky stiff " http://amix.dk - amix@amix.dk " " Version: 3.3 - 21/01/10 01:05:46 " " Blog_post: " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc " Syntax_highlighted: " http://amix.dk/vim/vimrc.html " Raw_version: " http://amix.dk/vim/vimrc.txt " " How_to_Install: " $ mkdir ~/.vim_runtime " $ svn co svn://orangoo.com/vim ~/.vim_runtime " $ cat ~/.vim_runtime/install.sh " $ sh ~/.vim_runtime/install.sh <system> " <sytem> can be `mac`, `linux` or `windows` " " How_to_Upgrade: " $ svn update ~/.vim_runtime " " Sections: " -> General " -> VIM user interface " -> Colors and Fonts " -> Files and backups " -> Text, tab and indent related " -> Visual mode related " -> Command mode related " -> Moving around, tabs and buffers " -> Statusline " -> Parenthesis/bracket expanding " -> General Abbrevs " -> Editing mappings " " -> Cope " -> Minibuffer plugin " -> Omni complete functions " -> Python section " -> JavaScript section " " Plugins_Included: " > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159 " Makes it easy to get an overview of buffers: " info -> :e ~/.vim_runtime/plugin/minibufexpl.vim " " > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 " Makes it easy to switch between buffers: " info -> :help bufExplorer " " > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234 " Emacs's killring, useful when using the clipboard: " info -> :help yankring " " > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697 " Makes it easy to work with surrounding text: " info -> :help surround " " > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540 " Snippets for many languages (similar to TextMate's): " info -> :help snipMate " " > fuzzyfinder - http://www.vim.org/scripts/script.php?script_id=1984 " Find files fast (similar to TextMate's feature): " info -> :help fuzzyfinder@en " " Revisions: " > 3.3: Added syntax highlighting for Mako mako.vim " > 3.2: Turned on python_highlight_all for better syntax " highlighting for Python " > 3.1: Added revisions ;) and bufexplorer.vim " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc map <leader>e :e! c:/dev/othervim.git/vimrc<cr> map <leader>s :e! ~/Desktop/status.txt<cr> " When vimrc is edited, reload it autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case. " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set background=light set t_Co=256 set background=light colorscheme solarized set nu else - set background=light + set background=dark colorscheme desert set nonu endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
943c59336381d9cff3522d35454d97eccc305d84
Set non-gui windows to light background and desert colorscheme
diff --git a/vimrc b/vimrc index ea5a4fb..3938be1 100755 --- a/vimrc +++ b/vimrc @@ -1,589 +1,589 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: amix the lucky stiff " http://amix.dk - amix@amix.dk " " Version: 3.3 - 21/01/10 01:05:46 " " Blog_post: " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc " Syntax_highlighted: " http://amix.dk/vim/vimrc.html " Raw_version: " http://amix.dk/vim/vimrc.txt " " How_to_Install: " $ mkdir ~/.vim_runtime " $ svn co svn://orangoo.com/vim ~/.vim_runtime " $ cat ~/.vim_runtime/install.sh " $ sh ~/.vim_runtime/install.sh <system> " <sytem> can be `mac`, `linux` or `windows` " " How_to_Upgrade: " $ svn update ~/.vim_runtime " " Sections: " -> General " -> VIM user interface " -> Colors and Fonts " -> Files and backups " -> Text, tab and indent related " -> Visual mode related " -> Command mode related " -> Moving around, tabs and buffers " -> Statusline " -> Parenthesis/bracket expanding " -> General Abbrevs " -> Editing mappings " " -> Cope " -> Minibuffer plugin " -> Omni complete functions " -> Python section " -> JavaScript section " " Plugins_Included: " > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159 " Makes it easy to get an overview of buffers: " info -> :e ~/.vim_runtime/plugin/minibufexpl.vim " " > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 " Makes it easy to switch between buffers: " info -> :help bufExplorer " " > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234 " Emacs's killring, useful when using the clipboard: " info -> :help yankring " " > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697 " Makes it easy to work with surrounding text: " info -> :help surround " " > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540 " Snippets for many languages (similar to TextMate's): " info -> :help snipMate " " > fuzzyfinder - http://www.vim.org/scripts/script.php?script_id=1984 " Find files fast (similar to TextMate's feature): " info -> :help fuzzyfinder@en " " Revisions: " > 3.3: Added syntax highlighting for Mako mako.vim " > 3.2: Turned on python_highlight_all for better syntax " highlighting for Python " > 3.1: Added revisions ;) and bufexplorer.vim " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 " Go nocompatible set nocompatible " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc map <leader>e :e! c:/dev/othervim.git/vimrc<cr> map <leader>s :e! ~/Desktop/status.txt<cr> " When vimrc is edited, reload it autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case. " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set background=light set t_Co=256 set background=light colorscheme solarized set nu else - set background=dark - colorscheme solarized + set background=light + colorscheme desert set nonu endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ "inoremap $1 ()<esc>i "inoremap $2 []<esc>i "inoremap $3 {}<esc>i "inoremap $4 {<esc>o}<esc>O "inoremap $q ''<esc>i "inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
otherdave/othervim
854647c0dad74561c859c9851cb8a1b062a73d25
commented out some mappings for () and {} that I never used
diff --git a/_gvimrc b/_gvimrc old mode 100644 new mode 100755 diff --git a/colors/darkspectrum.vim b/colors/darkspectrum.vim old mode 100644 new mode 100755 diff --git a/colors/davepuff.vim b/colors/davepuff.vim old mode 100644 new mode 100755 diff --git a/colors/inkpot.vim b/colors/inkpot.vim old mode 100644 new mode 100755 diff --git a/colors/moria.vim b/colors/moria.vim old mode 100644 new mode 100755 diff --git a/colors/solarized.vim b/colors/solarized.vim old mode 100644 new mode 100755 diff --git a/colors/synic.vim b/colors/synic.vim old mode 100644 new mode 100755 diff --git a/colors/vividchalk.vim b/colors/vividchalk.vim old mode 100644 new mode 100755 diff --git a/colors/wombat.vim b/colors/wombat.vim old mode 100644 new mode 100755 diff --git a/colors/xoria256.vim b/colors/xoria256.vim old mode 100644 new mode 100755 diff --git a/colors/zenburn.vim b/colors/zenburn.vim old mode 100644 new mode 100755 diff --git a/compiler/eruby.vim b/compiler/eruby.vim old mode 100644 new mode 100755 diff --git a/compiler/ruby.vim b/compiler/ruby.vim old mode 100644 new mode 100755 diff --git a/compiler/rubyunit.vim b/compiler/rubyunit.vim old mode 100644 new mode 100755 diff --git a/compiler/tex.vim b/compiler/tex.vim old mode 100644 new mode 100755 diff --git a/doc/NERD_commenter.txt b/doc/NERD_commenter.txt old mode 100644 new mode 100755 diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt old mode 100644 new mode 100755 diff --git a/doc/bufexplorer.txt b/doc/bufexplorer.txt old mode 100644 new mode 100755 diff --git a/doc/imaps.txt b/doc/imaps.txt old mode 100644 new mode 100755 diff --git a/doc/javacomplete.txt b/doc/javacomplete.txt old mode 100644 new mode 100755 diff --git a/doc/lookupfile.txt b/doc/lookupfile.txt old mode 100644 new mode 100755 diff --git a/doc/project.txt b/doc/project.txt old mode 100644 new mode 100755 diff --git a/doc/surround.txt b/doc/surround.txt old mode 100644 new mode 100755 diff --git a/doc/tags b/doc/tags old mode 100644 new mode 100755 diff --git a/dot.vimrc b/dot.vimrc old mode 100644 new mode 100755 diff --git a/ftdetect/gtd.vim b/ftdetect/gtd.vim old mode 100644 new mode 100755 diff --git a/ftdetect/ruby.vim b/ftdetect/ruby.vim old mode 100644 new mode 100755 diff --git a/ftplugin/bib_latexSuite.vim b/ftplugin/bib_latexSuite.vim old mode 100644 new mode 100755 diff --git a/ftplugin/eruby.vim b/ftplugin/eruby.vim old mode 100644 new mode 100755 diff --git a/ftplugin/gtd.vim b/ftplugin/gtd.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/bibtex.vim b/ftplugin/latex-suite/bibtex.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/bibtools.py b/ftplugin/latex-suite/bibtools.py old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/brackets.vim b/ftplugin/latex-suite/brackets.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/compiler.vim b/ftplugin/latex-suite/compiler.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/custommacros.vim b/ftplugin/latex-suite/custommacros.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/diacritics.vim b/ftplugin/latex-suite/diacritics.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/dictionaries/SIunits b/ftplugin/latex-suite/dictionaries/SIunits old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/dictionaries/dictionary b/ftplugin/latex-suite/dictionaries/dictionary old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/elementmacros.vim b/ftplugin/latex-suite/elementmacros.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/envmacros.vim b/ftplugin/latex-suite/envmacros.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/folding.vim b/ftplugin/latex-suite/folding.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/macros/example b/ftplugin/latex-suite/macros/example old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/main.vim b/ftplugin/latex-suite/main.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/mathmacros-utf.vim b/ftplugin/latex-suite/mathmacros-utf.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/mathmacros.vim b/ftplugin/latex-suite/mathmacros.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/multicompile.vim b/ftplugin/latex-suite/multicompile.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/outline.py b/ftplugin/latex-suite/outline.py old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages.vim b/ftplugin/latex-suite/packages.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/SIunits b/ftplugin/latex-suite/packages/SIunits old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/accents b/ftplugin/latex-suite/packages/accents old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/acromake b/ftplugin/latex-suite/packages/acromake old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/afterpage b/ftplugin/latex-suite/packages/afterpage old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/alltt b/ftplugin/latex-suite/packages/alltt old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/amsmath b/ftplugin/latex-suite/packages/amsmath old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/amsthm b/ftplugin/latex-suite/packages/amsthm old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/amsxtra b/ftplugin/latex-suite/packages/amsxtra old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/arabic b/ftplugin/latex-suite/packages/arabic old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/array b/ftplugin/latex-suite/packages/array old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/babel b/ftplugin/latex-suite/packages/babel old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/bar b/ftplugin/latex-suite/packages/bar old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/bm b/ftplugin/latex-suite/packages/bm old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/bophook b/ftplugin/latex-suite/packages/bophook old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/boxedminipage b/ftplugin/latex-suite/packages/boxedminipage old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/caption2 b/ftplugin/latex-suite/packages/caption2 old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/cases b/ftplugin/latex-suite/packages/cases old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/ccaption b/ftplugin/latex-suite/packages/ccaption old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/changebar b/ftplugin/latex-suite/packages/changebar old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/chapterbib b/ftplugin/latex-suite/packages/chapterbib old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/cite b/ftplugin/latex-suite/packages/cite old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/color b/ftplugin/latex-suite/packages/color old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/comma b/ftplugin/latex-suite/packages/comma old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/deleq b/ftplugin/latex-suite/packages/deleq old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/drftcite b/ftplugin/latex-suite/packages/drftcite old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/dropping b/ftplugin/latex-suite/packages/dropping old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/enumerate b/ftplugin/latex-suite/packages/enumerate old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/eqlist b/ftplugin/latex-suite/packages/eqlist old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/eqparbox b/ftplugin/latex-suite/packages/eqparbox old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/everyshi b/ftplugin/latex-suite/packages/everyshi old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/exmpl b/ftplugin/latex-suite/packages/exmpl old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/flafter b/ftplugin/latex-suite/packages/flafter old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/float b/ftplugin/latex-suite/packages/float old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/floatflt b/ftplugin/latex-suite/packages/floatflt old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/fn2end b/ftplugin/latex-suite/packages/fn2end old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/footmisc b/ftplugin/latex-suite/packages/footmisc old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/geometry b/ftplugin/latex-suite/packages/geometry old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/german b/ftplugin/latex-suite/packages/german old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/graphicx b/ftplugin/latex-suite/packages/graphicx old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/graphpap b/ftplugin/latex-suite/packages/graphpap old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/harpoon b/ftplugin/latex-suite/packages/harpoon old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/hhline b/ftplugin/latex-suite/packages/hhline old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/histogram b/ftplugin/latex-suite/packages/histogram old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/hyperref b/ftplugin/latex-suite/packages/hyperref old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/ifthen b/ftplugin/latex-suite/packages/ifthen old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/inputenc b/ftplugin/latex-suite/packages/inputenc old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/letterspace b/ftplugin/latex-suite/packages/letterspace old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/lineno b/ftplugin/latex-suite/packages/lineno old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/longtable b/ftplugin/latex-suite/packages/longtable old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/lscape b/ftplugin/latex-suite/packages/lscape old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/manyfoot b/ftplugin/latex-suite/packages/manyfoot old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/moreverb b/ftplugin/latex-suite/packages/moreverb old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/multibox b/ftplugin/latex-suite/packages/multibox old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/multicol b/ftplugin/latex-suite/packages/multicol old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/newalg b/ftplugin/latex-suite/packages/newalg old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/ngerman b/ftplugin/latex-suite/packages/ngerman old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/numprint b/ftplugin/latex-suite/packages/numprint old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/oldstyle b/ftplugin/latex-suite/packages/oldstyle old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/outliner b/ftplugin/latex-suite/packages/outliner old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/overcite b/ftplugin/latex-suite/packages/overcite old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/parallel b/ftplugin/latex-suite/packages/parallel old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/plain b/ftplugin/latex-suite/packages/plain old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/plates b/ftplugin/latex-suite/packages/plates old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/polski b/ftplugin/latex-suite/packages/polski old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/psgo b/ftplugin/latex-suite/packages/psgo old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/schedule b/ftplugin/latex-suite/packages/schedule old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/textfit b/ftplugin/latex-suite/packages/textfit old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/times b/ftplugin/latex-suite/packages/times old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/tipa b/ftplugin/latex-suite/packages/tipa old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/ulem b/ftplugin/latex-suite/packages/ulem old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/url b/ftplugin/latex-suite/packages/url old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/verbatim b/ftplugin/latex-suite/packages/verbatim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/packages/version b/ftplugin/latex-suite/packages/version old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/projecttemplate.vim b/ftplugin/latex-suite/projecttemplate.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/pytools.py b/ftplugin/latex-suite/pytools.py old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/smartspace.vim b/ftplugin/latex-suite/smartspace.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/templates.vim b/ftplugin/latex-suite/templates.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/templates/IEEEtran.tex b/ftplugin/latex-suite/templates/IEEEtran.tex old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/templates/article.tex b/ftplugin/latex-suite/templates/article.tex old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/templates/report.tex b/ftplugin/latex-suite/templates/report.tex old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/templates/report_two_column.tex b/ftplugin/latex-suite/templates/report_two_column.tex old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/texmenuconf.vim b/ftplugin/latex-suite/texmenuconf.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/texproject.vim b/ftplugin/latex-suite/texproject.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/texrc b/ftplugin/latex-suite/texrc old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/texviewer.vim b/ftplugin/latex-suite/texviewer.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/version.vim b/ftplugin/latex-suite/version.vim old mode 100644 new mode 100755 diff --git a/ftplugin/latex-suite/wizardfuncs.vim b/ftplugin/latex-suite/wizardfuncs.vim old mode 100644 new mode 100755 diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim old mode 100644 new mode 100755 diff --git a/ftplugin/tex/brackets.vim b/ftplugin/tex/brackets.vim old mode 100644 new mode 100755 diff --git a/ftplugin/tex/texviewer.vim b/ftplugin/tex/texviewer.vim old mode 100644 new mode 100755 diff --git a/ftplugin/tex_latexSuite.vim b/ftplugin/tex_latexSuite.vim old mode 100644 new mode 100755 diff --git a/indent/eruby.vim b/indent/eruby.vim old mode 100644 new mode 100755 diff --git a/indent/java.vim b/indent/java.vim old mode 100644 new mode 100755 diff --git a/indent/ruby.vim b/indent/ruby.vim old mode 100644 new mode 100755 diff --git a/indent/tex.vim b/indent/tex.vim old mode 100644 new mode 100755 diff --git a/ltags b/ltags old mode 100644 new mode 100755 diff --git a/myfiletypes.vim b/myfiletypes.vim old mode 100644 new mode 100755 diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim old mode 100644 new mode 100755 diff --git a/plugin/bufexplorer.vim b/plugin/bufexplorer.vim old mode 100644 new mode 100755 diff --git a/plugin/minibufexpl.vim b/plugin/minibufexpl.vim old mode 100644 new mode 100755 diff --git a/plugin/repeat.vim b/plugin/repeat.vim old mode 100644 new mode 100755 diff --git a/plugin/surround.vim b/plugin/surround.vim old mode 100644 new mode 100755 diff --git a/syntax/asciidoc.vim b/syntax/asciidoc.vim old mode 100644 new mode 100755 diff --git a/syntax/eruby.vim b/syntax/eruby.vim old mode 100644 new mode 100755 diff --git a/syntax/gtd.vim b/syntax/gtd.vim old mode 100644 new mode 100755 diff --git a/syntax/mib.vim b/syntax/mib.vim old mode 100644 new mode 100755 diff --git a/syntax/proto.vim b/syntax/proto.vim old mode 100644 new mode 100755 diff --git a/syntax/python.vim b/syntax/python.vim old mode 100644 new mode 100755 diff --git a/syntax/ruby.vim b/syntax/ruby.vim old mode 100644 new mode 100755 diff --git a/vimrc b/vimrc old mode 100644 new mode 100755 index 6f72f0a..ea5a4fb --- a/vimrc +++ b/vimrc @@ -1,586 +1,589 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Maintainer: amix the lucky stiff " http://amix.dk - amix@amix.dk " " Version: 3.3 - 21/01/10 01:05:46 " " Blog_post: " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc " Syntax_highlighted: " http://amix.dk/vim/vimrc.html " Raw_version: " http://amix.dk/vim/vimrc.txt " " How_to_Install: " $ mkdir ~/.vim_runtime " $ svn co svn://orangoo.com/vim ~/.vim_runtime " $ cat ~/.vim_runtime/install.sh " $ sh ~/.vim_runtime/install.sh <system> " <sytem> can be `mac`, `linux` or `windows` " " How_to_Upgrade: " $ svn update ~/.vim_runtime " " Sections: " -> General " -> VIM user interface " -> Colors and Fonts " -> Files and backups " -> Text, tab and indent related " -> Visual mode related " -> Command mode related " -> Moving around, tabs and buffers " -> Statusline " -> Parenthesis/bracket expanding " -> General Abbrevs " -> Editing mappings " " -> Cope " -> Minibuffer plugin " -> Omni complete functions " -> Python section " -> JavaScript section " " Plugins_Included: " > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159 " Makes it easy to get an overview of buffers: " info -> :e ~/.vim_runtime/plugin/minibufexpl.vim " " > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 " Makes it easy to switch between buffers: " info -> :help bufExplorer " " > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234 " Emacs's killring, useful when using the clipboard: " info -> :help yankring " " > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697 " Makes it easy to work with surrounding text: " info -> :help surround " " > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540 " Snippets for many languages (similar to TextMate's): " info -> :help snipMate " " > fuzzyfinder - http://www.vim.org/scripts/script.php?script_id=1984 " Find files fast (similar to TextMate's feature): " info -> :help fuzzyfinder@en " " Revisions: " > 3.3: Added syntax highlighting for Mako mako.vim " > 3.2: Turned on python_highlight_all for better syntax " highlighting for Python " > 3.1: Added revisions ;) and bufexplorer.vim " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=300 +" Go nocompatible +set nocompatible + " Enable filetype plugin filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread " With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = "," " Fast saving nmap <leader>w :w!<cr> " Fast editing of the .vimrc map <leader>e :e! c:/dev/othervim.git/vimrc<cr> map <leader>s :e! ~/Desktop/status.txt<cr> " When vimrc is edited, reload it autocmd! bufwritepost vimrc source c:/dev/othervim.git/vimrc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7 set wildmenu "Turn on WiLd menu set ruler "Always show current position set cmdheight=2 "The commandbar height set hid "Change buffer - without saving " Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l " ignore case if search term is all lower case. " requires ignorecase too set ignorecase set smartcase set hlsearch "Highlight search things set incsearch "Make search act like search in modern browsers set magic "Set magic on, for regular expressions set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink " No sound on errors set noerrorbells set novisualbell set t_vb= """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syntax enable "Enable syntax hl set noanti if MySys() == "mac" set guifont=EnvyCodeR:h12.00 set shell=/bin/bash elseif MySys() == "windows" set gfn=Envy_Code_R:h10.00 elseif MySys() == "linux" set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 set shell=/bin/bash endif if has("gui_running") set guioptions-=T set background=light set t_Co=256 set background=light colorscheme solarized set nu else set background=dark colorscheme solarized set nonu endif set encoding=utf8 try lang en_US catch endtry set ffs=unix,mac,dos "Default file types """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files and backups """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab set lbr set tw=500 set ai "Auto indent set si "Smart indet set wrap "Wrap lines map <leader>t2 :setlocal shiftwidth=2<cr> map <leader>t4 :setlocal shiftwidth=4<cr> map <leader>t8 :setlocal shiftwidth=4<cr> """""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR> " When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left> function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr> " $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr> " Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U> cnoremap <C-P> <Up> cnoremap <C-N> <Down> " Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $ func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let g:cmd = getcmdline() if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "") endif if g:cmd == g:cmd_edited if MySys() == "linux" || MySys() == "mac" let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") else let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "") endif endif return g:cmd_edited endfunc func! CurrentFileDir(cmd) return a:cmd . " " . expand("%:p:h") . "/" endfunc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Map space to / (search) and c-space to ? (backgwards search) map <space> / map <c-space> ? map <silent> <leader><cr> :noh<cr> " Smart way to move btw. windows map <C-j> <C-W>j map <C-k> <C-W>k map <C-h> <C-W>h map <C-l> <C-W>l " Close the current buffer map <leader>bd :Bclose<cr> " Close all the buffers map <leader>ba :1,300 bd!<cr> " Use the arrows to something usefull map <right> :bn<cr> map <left> :bp<cr> " Tab configuration map <leader>tn :tabnew %<cr> map <leader>te :tabedit map <leader>tc :tabclose<cr> map <leader>tm :tabmove " Move betweent tabs with alt-Tab map <M-tab> :tabnext<cr> map <leader>tn :tabnext<cr> map <S-M-tab> :tabprevious<cr> map <leader>tp :tabprevious<cr> " When pressing <leader>cd switch to the directory of the open buffer map <leader>cd :cd %:p:h<cr> command! Bclose call <SID>BufcloseCloseIt() function! <SID>BufcloseCloseIt() let l:currentBufNum = bufnr("%") let l:alternateBufNum = bufnr("#") if buflisted(l:alternateBufNum) buffer # else bnext endif if bufnr("%") == l:currentBufNum new endif if buflisted(l:currentBufNum) execute("bdelete! ".l:currentBufNum) endif endfunction " Specify the behavior when switching between buffers try set switchbuf=usetab set stal=2 catch endtry """""""""""""""""""""""""""""" " => Statusline """""""""""""""""""""""""""""" " Always hide the statusline set laststatus=2 " Format the statusline set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c function! CurDir() let curdir = substitute(getcwd(), '/Users/dave/', "~/", "g") return curdir endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Parenthesis/bracket expanding """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vnoremap $1 <esc>`>a)<esc>`<i(<esc> vnoremap $2 <esc>`>a]<esc>`<i[<esc> vnoremap $3 <esc>`>a}<esc>`<i{<esc> vnoremap $$ <esc>`>a"<esc>`<i"<esc> vnoremap $q <esc>`>a'<esc>`<i'<esc> vnoremap $e <esc>`>a"<esc>`<i"<esc> " Map auto complete of (, ", ', [ -inoremap $1 ()<esc>i -inoremap $2 []<esc>i -inoremap $3 {}<esc>i -inoremap $4 {<esc>o}<esc>O -inoremap $q ''<esc>i -inoremap $e ""<esc>i +"inoremap $1 ()<esc>i +"inoremap $2 []<esc>i +"inoremap $3 {}<esc>i +"inoremap $4 {<esc>o}<esc>O +"inoremap $q ''<esc>i +"inoremap $e ""<esc>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Abbrevs """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" iab xdate <c-r>=strftime("%Y%m%d %H:%M:%S - %A")<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Remap VIM 0 map 0 ^ "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z if MySys() == "mac" nmap <D-j> <M-j> nmap <D-k> <M-k> vmap <D-j> <M-j> vmap <D-k> <M-k> endif "Delete trailing white space, useful for Python ;) func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr> """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 """""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1 let g:bufExplorerSortBy = "name" autocmd BufRead,BufNew :call UMiniBufExplorer map <leader>u :TMiniBufExplorer<cr>:TMiniBufExplorer<cr> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr> "Shortcuts using <leader> map <leader>sn ]s map <leader>sp [s map <leader>sa zg map <leader>s? z= """""""""""""""""""""""""""""" " => XML section """""""""""""""""""""""""""""" function! ReadXmlFile() let filename=expand("<afile>") let size=getfsize(filename) " If the file is huge, don't turn on the syntax highlighting if size >= 3000000 set syntax= else set syntax=xml endif endfunction "au FileType xml syntax off au BufReadPost *.xml :call ReadXmlFile() """""""""""""""""""""""""""""" " => Python section """""""""""""""""""""""""""""" au FileType python set nocindent let python_highlight_all = 1 au FileType python syn keyword pythonDecorator True None False self au BufNewFile,BufRead *.jinja set syntax=htmljinja au BufNewFile,BufRead *.mako set ft=mako au FileType python inoremap <buffer> $r return au FileType python inoremap <buffer> $i import au FileType python inoremap <buffer> $p print au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi au FileType python map <buffer> <leader>1 /class au FileType python map <buffer> <leader>2 /def au FileType python map <buffer> <leader>C ?class au FileType python map <buffer> <leader>D ?def """""""""""""""""""""""""""""" " => JavaScript section """"""""""""""""""""""""""""""" "au FileType javascript call JavaScriptFold() au FileType javascript setl fen au FileType javascript setl nocindent au FileType javascript imap <c-t> AJS.log();<esc>hi au FileType javascript imap <c-a> alert();<esc>hi au FileType javascript inoremap <buffer> $r return au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend function! FoldText() return substitute(getline(v:foldstart), '{.*', '{...}', '') endfunction setl foldtext=FoldText() endfunction """""""""""""""""""""""""""""" " => Fuzzy finder """""""""""""""""""""""""""""" try call fuf#defineLaunchCommand('FufCWD', 'file', 'fnamemodify(getcwd(), ''%:p:h'')') map <leader>t :FufCWD **/<CR> catch endtry """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm "Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr>
codereflection/clientAccountLocking
6ce245ae16c919abebeba40099f5c806dee4491e
Fixing references
diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index ef8d27d..11a9004 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -1,78 +1,81 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{0B42552A-3BA8-473D-8A70-268C11441788}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>UnitTests</RootNamespace> <AssemblyName>UnitTests</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Autofac"> - <HintPath>..\..\..\..\..\..\..\OSS\moq-contrib\Source\bin\Debug\Autofac.dll</HintPath> - </Reference> <Reference Include="Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\..\..\..\OSS\moq-contrib\Source\bin\Debug\Moq.dll</HintPath> </Reference> - <Reference Include="Moq.Contrib"> - <HintPath>..\..\..\..\..\..\..\OSS\moq-contrib\Source\bin\Debug\Moq.Contrib.dll</HintPath> + <Reference Include="Moq.Contrib, Version=0.1.3211.31914, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>lib\Moq.Contrib.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Web" /> <Reference Include="System.Web.Abstractions" /> <Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Routing" /> <Reference Include="System.Web.Services" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> <Reference Include="xunit"> <HintPath>..\..\..\..\..\..\..\Library\xUnit.net\xunit-1.5\xunit.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Compile Include="StateManagerTests.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SearchEngineServiceTest.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\ClientAccountLockingTest\ClientAccountLockingTest.csproj"> <Project>{7A3831F4-A63D-479F-9877-0E2C4BF5FF92}</Project> <Name>ClientAccountLockingTest</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="lib\Moq.Contrib.dll" /> + <Content Include="lib\Moq.dll" /> + <Content Include="lib\xunit.dll" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> \ No newline at end of file diff --git a/UnitTests/lib/Moq.Contrib.dll b/UnitTests/lib/Moq.Contrib.dll new file mode 100644 index 0000000..3642f93 Binary files /dev/null and b/UnitTests/lib/Moq.Contrib.dll differ diff --git a/UnitTests/lib/Moq.dll b/UnitTests/lib/Moq.dll new file mode 100644 index 0000000..483aaa0 Binary files /dev/null and b/UnitTests/lib/Moq.dll differ diff --git a/UnitTests/lib/xunit.dll b/UnitTests/lib/xunit.dll new file mode 100644 index 0000000..7ccc14b Binary files /dev/null and b/UnitTests/lib/xunit.dll differ
codereflection/clientAccountLocking
b336837da4d4f37c5717ad3f9b70681fcfae2ad9
Adding ClientAccountLock class and tests
diff --git a/ClientAccountLockingTest/ClientAccount.cs b/ClientAccountLockingTest/ClientAccount.cs index a7a7580..d8b5b05 100644 --- a/ClientAccountLockingTest/ClientAccount.cs +++ b/ClientAccountLockingTest/ClientAccount.cs @@ -1,12 +1,12 @@ using System; namespace ClientAccountLockingTest { public class LockedClientAccount { public int ClientAccountId { get; set; } public string ClientName { get; set; } public DateTime ProcessingStarted { get; set; } public string MethodCalled { get; set; } } -} +} \ No newline at end of file diff --git a/ClientAccountLockingTest/ClientAccountLock.cs b/ClientAccountLockingTest/ClientAccountLock.cs new file mode 100644 index 0000000..c7de9db --- /dev/null +++ b/ClientAccountLockingTest/ClientAccountLock.cs @@ -0,0 +1,33 @@ +using System; + +namespace ClientAccountLockingTest +{ + public class ClientAccountLock : LockedClientAccount, IDisposable + { + + public ClientAccountLock() + { + throw new NotImplementedException("Not implemented by design. Parameterless constructor only exists for seralization compatibility."); + } + + /// <summary> + /// Initializes a new instance of the ClientAccountLock class. + /// </summary> + public ClientAccountLock(int id) + { + var stackTrace = new System.Diagnostics.StackTrace(); + + var callingMethod = stackTrace.GetFrame(1).GetMethod().Name; + + base.ClientAccountId = id; + base.MethodCalled = callingMethod; + + StateManager.LockClientAccount(this); + } + + public void Dispose() + { + StateManager.UnlockClientAccount(base.ClientAccountId); + } + } +} diff --git a/ClientAccountLockingTest/ClientAccountLockingTest.csproj b/ClientAccountLockingTest/ClientAccountLockingTest.csproj index ae6ac4b..1118ea3 100644 --- a/ClientAccountLockingTest/ClientAccountLockingTest.csproj +++ b/ClientAccountLockingTest/ClientAccountLockingTest.csproj @@ -1,125 +1,126 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{7A3831F4-A63D-479F-9877-0E2C4BF5FF92}</ProjectGuid> <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ClientAccountLockingTest</RootNamespace> <AssemblyName>ClientAccountLockingTest</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Core" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Web.Abstractions" /> <Reference Include="System.Web.Extensions" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> <Reference Include="System.Xml" /> <Reference Include="System.Configuration" /> <Reference Include="System.Web.Services" /> <Reference Include="System.EnterpriseServices" /> <Reference Include="System.Web.Mobile" /> </ItemGroup> <ItemGroup> <Content Include="ClientAccountProcessing.asmx" /> <Content Include="Global.asax" /> <Content Include="Scripts\jquery-1.4.1-vsdoc.js" /> <Content Include="Scripts\jquery-1.4.1.js" /> <Content Include="Scripts\jquery-1.4.1.min.js" /> <Content Include="Web.config"> <SubType>Designer</SubType> </Content> <Content Include="Web.Debug.config"> <DependentUpon>Web.config</DependentUpon> </Content> <Content Include="Web.Release.config"> <DependentUpon>Web.config</DependentUpon> </Content> <Content Include="WebService1.asmx" /> </ItemGroup> <ItemGroup> <Compile Include="ClientAccount.cs" /> + <Compile Include="ClientAccountLock.cs" /> <Compile Include="ClientAccountProcessing.asmx.cs"> <DependentUpon>ClientAccountProcessing.asmx</DependentUpon> <SubType>Component</SubType> </Compile> <Compile Include="Global.asax.cs"> <DependentUpon>Global.asax</DependentUpon> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DesignTimeSharedInput>True</DesignTimeSharedInput> <DependentUpon>Settings.settings</DependentUpon> </Compile> <Compile Include="StateManager.cs" /> <Compile Include="WebService1.asmx.cs"> <DependentUpon>WebService1.asmx</DependentUpon> <SubType>Component</SubType> </Compile> </ItemGroup> <ItemGroup> <Folder Include="App_Data\" /> </ItemGroup> <ItemGroup> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <ProjectExtensions> <VisualStudio> <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> <WebProjectProperties> <UseIIS>False</UseIIS> <AutoAssignPort>True</AutoAssignPort> <DevelopmentServerPort>38886</DevelopmentServerPort> <DevelopmentServerVPath>/</DevelopmentServerVPath> <IISUrl> </IISUrl> <NTLMAuthentication>False</NTLMAuthentication> <UseCustomServer>False</UseCustomServer> <CustomServerUrl> </CustomServerUrl> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> </WebProjectProperties> </FlavorProperties> </VisualStudio> </ProjectExtensions> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> \ No newline at end of file diff --git a/UnitTests/StateManagerTests.cs b/UnitTests/StateManagerTests.cs index 29dfa02..511369f 100644 --- a/UnitTests/StateManagerTests.cs +++ b/UnitTests/StateManagerTests.cs @@ -1,183 +1,225 @@ using System; using System.Reflection; using ClientAccountLockingTest; using Xunit; namespace UnitTests { public class StateManagerTests { public class when_asked_to_store_a_clientaccount { [Fact] public void the_clientaccount_is_stored_and_retrievable() { StateManager.ResetStateManager(); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; Assert.DoesNotThrow(() => StateManager.LockClientAccount(clientAccount)); Assert.DoesNotThrow(() => StateManager.GetClientAccount(clientAccount.ClientAccountId)); } [Fact] public void can_return_that_clientaccount_after_it_has_been_stored() { StateManager.ResetStateManager(); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; Assert.DoesNotThrow(() => StateManager.LockClientAccount(clientAccount)); var result = StateManager.GetClientAccount(clientAccount.ClientAccountId); Assert.Equal(clientAccount.ClientAccountId, result.ClientAccountId); Assert.Equal(clientAccount.ClientName, result.ClientName); } [Fact] public void and_that_clientaccount_is_null_an_exception_is_thrown() { StateManager.ResetStateManager(); LockedClientAccount clientAccount = null; Assert.Throws<ArgumentNullException>(() => StateManager.LockClientAccount(clientAccount)); } [Fact] public void the_method_called_should_be_retrievable_from_the_clientaccount_object() { StateManager.ResetStateManager(); var methodName = MethodBase.GetCurrentMethod().Name; Console.WriteLine("Thread ID: {0}", System.Threading.Thread.CurrentThread.ManagedThreadId); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test", MethodCalled = methodName }; StateManager.LockClientAccount(clientAccount); Assert.Equal(methodName, StateManager.GetClientAccount(123).MethodCalled); } } public class when_asked_to_retrieve_a_clientaccount_that_has_not_been_stored { [Fact] public void null_is_returned() { StateManager.ResetStateManager(); const int clientAccountId = 123; var result = StateManager.GetClientAccount(clientAccountId); Assert.Null(result); } } public class when_asked_the_lock_state_of_a_clientaccount_by_clientaccountid { [Fact] public void true_will_be_returned_for_a_client_account_that_is_locked() { StateManager.ResetStateManager(); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test", MethodCalled = "Testmethod" }; StateManager.LockClientAccount(clientAccount); Assert.True(StateManager.IsClientAccountIDLocked(123)); } [Fact] public void false_will_be_returned_for_a_client_account_that_is_not_locked() { StateManager.ResetStateManager(); Assert.False(StateManager.IsClientAccountIDLocked(123)); } [Fact] public void false_will_be_returned_when_the_statemanagers_local_state_has_not_be_initialized() { ResetStateManagersPrivateListToNull(); Assert.False(StateManager.IsClientAccountIDLocked(123)); } private static void ResetStateManagersPrivateListToNull() { var fieldInfo = typeof(StateManager).GetField("_clientAccounts"); fieldInfo.SetValue(null, null); } } public class when_asked_to_unlock_a_clientaccount_that_has_been_locked { [Fact] public void the_clientaccount_will_be_unlocked_and_no_longer_retrievable() { StateManager.ResetStateManager(); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; StateManager.LockClientAccount(clientAccount); Assert.NotNull(StateManager.GetClientAccount(clientAccount.ClientAccountId)); Assert.True(StateManager.UnlockClientAccount(clientAccount.ClientAccountId)); Assert.Null(StateManager.GetClientAccount(clientAccount.ClientAccountId)); } } public class when_asked_to_unlock_a_clientaccount_that_has_not_been_locked { [Fact] public void return_true_without_exception() { StateManager.ResetStateManager(); var clientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; var result = false; Assert.DoesNotThrow(() => result = StateManager.UnlockClientAccount(clientAccount.ClientAccountId)); Assert.True(result); } } public class when_asked_to_local_a_clientaccount_that_has_already_been_locked { [Fact] public void an_exception_will_be_thrown() { StateManager.ResetStateManager(); var lockedClientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; Assert.DoesNotThrow(() => StateManager.LockClientAccount(lockedClientAccount)); Assert.DoesNotThrow(() => StateManager.GetClientAccount(lockedClientAccount.ClientAccountId)); var newLockClientAccount = new LockedClientAccount { ClientAccountId = 123, ClientName = "Test" }; ArgumentException ex = null; ex = Assert.Throws<ArgumentException>(() => StateManager.LockClientAccount(newLockClientAccount)); Assert.True(ex.Message.IndexOf(string.Format("ClientAccountID {0} is already locked", newLockClientAccount.ClientAccountId)) > -1); } } } + public class ClientAccountLockTests + { + public class when_locking_a_clientaccount_with_the_using_statement + { + [Fact] + public void the_client_account_should_be_locked_during_and_unlocked_after() + { + StateManager.ResetStateManager(); + + using (var lockedClientAccount = new ClientAccountLock(123)) + { + Assert.NotNull(lockedClientAccount); + + Assert.True(StateManager.IsClientAccountIDLocked(lockedClientAccount.ClientAccountId)); + + var newLock = new LockedClientAccount { ClientAccountId = 123, MethodCalled = "Test" }; + + Assert.Throws<ArgumentException>(() => StateManager.LockClientAccount(newLock)); + } + + Assert.False(StateManager.IsClientAccountIDLocked(123)); + } + } + + + public class when_trying_to_lock_a_client_account_that_has_been_locked + { + [Fact] + public void an_exception_should_be_throw() + { + StateManager.ResetStateManager(); + + var lockedClientAccount = new LockedClientAccount { ClientAccountId = 123, MethodCalled = "test" }; + + StateManager.LockClientAccount(lockedClientAccount); + + var newClientAccountLockRequest = new LockedClientAccount { ClientAccountId = 123, MethodCalled = "test" }; + + Assert.Throws<ArgumentException>(() => StateManager.LockClientAccount(newClientAccountLockRequest)); + } + } + } }
codereflection/clientAccountLocking
3c5b277e222a41c4e67183201302b93b17d1008b
Increased sleep to 10 seconds
diff --git a/ClientAccountLockingTest/WebService1.asmx.cs b/ClientAccountLockingTest/WebService1.asmx.cs index 4385910..cb11c5b 100644 --- a/ClientAccountLockingTest/WebService1.asmx.cs +++ b/ClientAccountLockingTest/WebService1.asmx.cs @@ -1,82 +1,82 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace ClientAccountLockingTest { /// <summary> /// Summary description for WebService1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class MyWebService : WebService { readonly HttpContextBase _httpContext; public MyWebService() { _httpContext = new HttpContextWrapper(HttpContext.Current); } public MyWebService(HttpContextBase httpContext) { _httpContext = httpContext; } private bool IsClientAccountLocked(int clientAccountId) { if (_httpContext.Application["ClientAccounts"] == null) { return false; } var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; return lockList.Contains(clientAccountId); } public bool LockClientAccount(int clientAccountId) { if (_httpContext.Application["ClientAccounts"] == null) { _httpContext.Application.Add("ClientAccounts", new List<int>()); } var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; lockList.Add(clientAccountId); return true; } private void UnLockClientAccount(int clientAccountId) { var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; lockList.Remove(clientAccountId); } [WebMethod] public string ModifyClientAccount(int clientAccountId) { if (IsClientAccountLocked(clientAccountId) == true) { throw new ApplicationException(String.Format("ClientAccountID {0} is currently in use", clientAccountId)); } LockClientAccount(clientAccountId); - System.Threading.Thread.Sleep(1000); + System.Threading.Thread.Sleep(10000); UnLockClientAccount(clientAccountId); return "Client Account Modification Complete"; } } }
codereflection/clientAccountLocking
5ad744507f7743fa6ddb41afbb3643647cfc88d4
Renamed web service
diff --git a/ClientAccountLockingTest/WebService1.asmx b/ClientAccountLockingTest/WebService1.asmx index 57f215c..0b706be 100644 --- a/ClientAccountLockingTest/WebService1.asmx +++ b/ClientAccountLockingTest/WebService1.asmx @@ -1 +1 @@ -<%@ WebService Language="C#" CodeBehind="WebService1.asmx.cs" Class="ClientAccountLockingTest.SearchEngineService" %> +<%@ WebService Language="C#" CodeBehind="WebService1.asmx.cs" Class="ClientAccountLockingTest.MyWebService" %> diff --git a/ClientAccountLockingTest/WebService1.asmx.cs b/ClientAccountLockingTest/WebService1.asmx.cs index e9faec3..4385910 100644 --- a/ClientAccountLockingTest/WebService1.asmx.cs +++ b/ClientAccountLockingTest/WebService1.asmx.cs @@ -1,82 +1,82 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace ClientAccountLockingTest { /// <summary> /// Summary description for WebService1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] - public class SearchEngineService : WebService + public class MyWebService : WebService { readonly HttpContextBase _httpContext; - public SearchEngineService() + public MyWebService() { _httpContext = new HttpContextWrapper(HttpContext.Current); } - public SearchEngineService(HttpContextBase httpContext) + public MyWebService(HttpContextBase httpContext) { _httpContext = httpContext; } private bool IsClientAccountLocked(int clientAccountId) { if (_httpContext.Application["ClientAccounts"] == null) { return false; } var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; return lockList.Contains(clientAccountId); } public bool LockClientAccount(int clientAccountId) { if (_httpContext.Application["ClientAccounts"] == null) { _httpContext.Application.Add("ClientAccounts", new List<int>()); } var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; lockList.Add(clientAccountId); return true; } private void UnLockClientAccount(int clientAccountId) { var lockList = (List<int>)_httpContext.Application["ClientAccounts"]; lockList.Remove(clientAccountId); } [WebMethod] public string ModifyClientAccount(int clientAccountId) { if (IsClientAccountLocked(clientAccountId) == true) { throw new ApplicationException(String.Format("ClientAccountID {0} is currently in use", clientAccountId)); } LockClientAccount(clientAccountId); System.Threading.Thread.Sleep(1000); UnLockClientAccount(clientAccountId); return "Client Account Modification Complete"; } } } diff --git a/UnitTests/SearchEngineServiceTest.cs b/UnitTests/SearchEngineServiceTest.cs index c625635..4a99bad 100644 --- a/UnitTests/SearchEngineServiceTest.cs +++ b/UnitTests/SearchEngineServiceTest.cs @@ -1,61 +1,61 @@ using System; using System.Collections.Generic; using ClientAccountLockingTest; using Moq.Mvc; using Xunit; namespace UnitTests { - class SearchEngineServiceTest + class MyWebServiceTest { [Fact] public void can_add_a_value_to_the_application_object() { var mockHttpContext = new HttpContextMock(); const int clientAccountId = 123; mockHttpContext.HttpApplicationState.Setup(x => x.Add("test", clientAccountId)); mockHttpContext.HttpApplicationState.Setup(x => x["test"]).Returns(clientAccountId); mockHttpContext.Object.Application.Add("test", clientAccountId); Assert.NotNull(mockHttpContext.Object.Application); Assert.Equal(123, mockHttpContext.Object.Application["test"]); mockHttpContext.HttpApplicationState.VerifyAll(); } [Fact] public void can_call_modify_client_web_method() { var mockHttpContext = new HttpContextMock(); var clientAccountIdList = new List<int>(); mockHttpContext.HttpApplicationState.Setup(x => x["ClientAccounts"]).Returns(clientAccountIdList); - var ses = new SearchEngineService(mockHttpContext.Object); + var ses = new MyWebService(mockHttpContext.Object); Assert.Equal("Client Account Modification Complete", ses.ModifyClientAccount(0)); mockHttpContext.HttpApplicationState.VerifyAll(); } [Fact] public void throws_exception_when_trying_to_modify_an_account_that_is_already_processing() { var mockHttpContext = new HttpContextMock(); const int clientAccountId = 123; var clientAccountIdList = new List<int>() { clientAccountId }; mockHttpContext.HttpApplicationState.Setup(x => x["ClientAccounts"]).Returns((object x) => clientAccountIdList).AtMost(2); - var ses = new SearchEngineService(mockHttpContext.Object); + var ses = new MyWebService(mockHttpContext.Object); Assert.Throws<ApplicationException>(() => ses.ModifyClientAccount(clientAccountId)); mockHttpContext.HttpApplicationState.VerifyAll(); } } } \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
758f85e06344bb36973d65ea05241c2c62a6317f
Version 1.09
diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 29ab084..b6fc787 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,236 +1,236 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.08" +ModuleInfo "Version: 1.09" ModuleInfo "License: MIT" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" ModuleInfo "History: 1.09" ModuleInfo "History: Added check to prevent expiration of authToken. This allows applications to run for over 24-hours with the same TRackspaceCloudFiles object." ModuleInfo "History: TRackspaceCloudFiles.Create now accepts a third parameter 'location'. This allows authentication to either the USA or UK server." Import bah.crypto Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String Field _location:String Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: URL for data stored in the USA End Rem Const LOCATION_USA:String = "https://auth.api.rackspacecloud.com/v1.0" Rem bbdoc: Url for data stored in the UK End Rem Const LOCATION_UK:String = "https://lon.auth.api.rackspacecloud.com/v1.0" Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() location can be either the LOCATION_USA or LOCATION_UK constant End Rem Method Create:TRackspaceCloudFiles(user:String, key:String, location:String = LOCATION_USA) Self._authUser = user Self._authKey = key Self._location = location Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Local response:TRESTResponse = Self._Transport(Self._location, headers) If response.IsSuccess() Self._storageToken = response.GetHeader("X-Storage-Token") Self._storageUrl = response.GetHeader("X-Storage-Url") Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") Self._authToken = response.GetHeader("X-Auth-Token") ElseIf response.IsClientError() Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Else Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End If End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) Select response.responseCode Case 200 Local containerList:TList = New TList Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") If response.IsSuccess() Return Self.Container(name) End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") If response.IsSuccess() Return response.GetHeader("X-Account-Bytes-Used").ToLong() End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local request:TRESTRequest = New TRESTRequest request.SetProgressCallback(Self._progressCallback, Self._progressData) Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) 'Prevent expiration of authToken If response.responseCode = 401 And Self._authToken Self.Authenticate() Return Self._Transport(url, headers, requestMethod, userData) End If Return response End Method End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
5d939641319cb6242ed453d1ca7c4df20c9b63c7
Added check to prevent expiration of authToken
diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index d601ffd..29ab084 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,229 +1,236 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" ModuleInfo "Version: 1.08" ModuleInfo "License: MIT" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" ModuleInfo "History: 1.09" +ModuleInfo "History: Added check to prevent expiration of authToken. This allows applications to run for over 24-hours with the same TRackspaceCloudFiles object." ModuleInfo "History: TRackspaceCloudFiles.Create now accepts a third parameter 'location'. This allows authentication to either the USA or UK server." Import bah.crypto Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String -' Field _authTokenExpires:Int Field _location:String Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: URL for data stored in the USA End Rem Const LOCATION_USA:String = "https://auth.api.rackspacecloud.com/v1.0" Rem bbdoc: Url for data stored in the UK End Rem Const LOCATION_UK:String = "https://lon.auth.api.rackspacecloud.com/v1.0" Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() location can be either the LOCATION_USA or LOCATION_UK constant End Rem Method Create:TRackspaceCloudFiles(user:String, key:String, location:String = LOCATION_USA) Self._authUser = user Self._authKey = key Self._location = location Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Local response:TRESTResponse = Self._Transport(Self._location, headers) If response.IsSuccess() Self._storageToken = response.GetHeader("X-Storage-Token") Self._storageUrl = response.GetHeader("X-Storage-Url") Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") Self._authToken = response.GetHeader("X-Auth-Token") ElseIf response.IsClientError() Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Else Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End If End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) Select response.responseCode Case 200 Local containerList:TList = New TList Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") If response.IsSuccess() Return Self.Container(name) End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") If response.IsSuccess() Return response.GetHeader("X-Account-Bytes-Used").ToLong() End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local request:TRESTRequest = New TRESTRequest request.SetProgressCallback(Self._progressCallback, Self._progressData) Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) + + 'Prevent expiration of authToken + If response.responseCode = 401 And Self._authToken + Self.Authenticate() + Return Self._Transport(url, headers, requestMethod, userData) + End If + Return response End Method End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
ee268369e41ba955eb539c96f6a5c05f3fdcf148
Support authentication against USA or UK server
diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 820a16c..d601ffd 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,214 +1,229 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" ModuleInfo "Version: 1.08" ModuleInfo "License: MIT" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" +ModuleInfo "History: 1.09" +ModuleInfo "History: TRackspaceCloudFiles.Create now accepts a third parameter 'location'. This allows authentication to either the USA or UK server." Import bah.crypto Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int + Field _location:String Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object + + Rem + bbdoc: URL for data stored in the USA + End Rem + Const LOCATION_USA:String = "https://auth.api.rackspacecloud.com/v1.0" + + Rem + bbdoc: Url for data stored in the UK + End Rem + Const LOCATION_UK:String = "https://lon.auth.api.rackspacecloud.com/v1.0" Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() + location can be either the LOCATION_USA or LOCATION_UK constant End Rem - Method Create:TRackspaceCloudFiles(user:String, key:String) + Method Create:TRackspaceCloudFiles(user:String, key:String, location:String = LOCATION_USA) Self._authUser = user Self._authKey = key + Self._location = location Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey - Local response:TRESTResponse = Self._Transport("https://api.mosso.com/auth", headers) + Local response:TRESTResponse = Self._Transport(Self._location, headers) If response.IsSuccess() Self._storageToken = response.GetHeader("X-Storage-Token") Self._storageUrl = response.GetHeader("X-Storage-Url") Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") Self._authToken = response.GetHeader("X-Auth-Token") ElseIf response.IsClientError() Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Else Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End If End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) Select response.responseCode Case 200 Local containerList:TList = New TList Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") If response.IsSuccess() Return Self.Container(name) End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") If response.IsSuccess() Return response.GetHeader("X-Account-Bytes-Used").ToLong() End If Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local request:TRESTRequest = New TRESTRequest request.SetProgressCallback(Self._progressCallback, Self._progressData) Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) Return response End Method End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
9b403d63a9f7816915daeb7abea180696fa69424
Now making use of htbaapub.rest responseCode helper methods
diff --git a/container.bmx b/container.bmx index c041e62..c51ef1b 100644 --- a/container.bmx +++ b/container.bmx @@ -1,144 +1,138 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem Rem bbdoc: This type represents a container in Cloud Files about: End Rem Type TRackspaceCloudFilesContainer Field _name:String Field _rackspace:TRackspaceCloudFiles Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) Self._name = name Self._rackspace = rackspace Self._url = rackspace._storageUrl + "/" + name Return Self End Method Rem bbdoc: Returns the name of the container about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Returns the total number of objects in the container about: End Rem Method ObjectCount:Int() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") - Select response.responseCode - Case 204 - Return response.GetHeader("X-Container-Object-Count").ToInt() - Default - Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") - End Select - Return 0 + If response.IsSuccess() + Return response.GetHeader("X-Container-Object-Count").ToInt() + End If + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Method Rem bbdoc: Returns the total number of bytes used by objects in the container about: End Rem Method BytesUsed:Long() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") - Select response.responseCode - Case 204 - Return response.GetHeader("X-Container-Bytes-Used").ToInt() - Default - Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") - End Select - Return 0 + If response.IsSuccess() + Return response.GetHeader("X-Container-Bytes-Used").ToLong() + End If + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Method Rem bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix about: Set prefix to retrieve only the objects beginning with that name End Rem Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._rackspace._Transport(Self._url + qs, Null, "GET") Select response.responseCode Case 200 Local objectsList:TList = New TList If response.content.Length = 0 Return objectsList End If Local objects:String[] = response.content.Trim().Split("~n") For Local objectName:String = EachIn objects If objectName.Length = 0 Then Continue objectsList.AddLast(Self.FileObject(objectName)) Next 'Check if there are more objects If objectsList.Count() = limit Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) Local more:TList = Self.Objects(prefix, limit, lastObject._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFileObject = EachIn more objectsList.AddLast(c) Next End If End If Return objectsList Case 204 Return New TList Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: This returns an object about: End Rem Method FileObject:TRackspaceCloudFileObject(name:String) Return New TRackspaceCloudFileObject.Create(Self, name) End Method Rem bbdoc: Deletes the container, which should be empty about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 204 'OK Case 409 Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method End Type diff --git a/object.bmx b/object.bmx index 698fa96..950b9a5 100644 --- a/object.bmx +++ b/object.bmx @@ -1,310 +1,308 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") - Select response.responseCode - Case 404 - Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") - Case 204 - Self._SetAttributesFromResponse(response) - Default - Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") - End Select + If response.IsSuccess() + Self._SetAttributesFromResponse(response) + Else If response.IsClientError() + Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") + Else + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End If End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) - Select response.responseCode - Case 404 - Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") - Case 200 - Self._SetAttributesFromResponse(response) - If Self._etag <> MD5(response.content).ToLower() - Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") - End If - Return response.content - Default - Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") - End Select + If response.IsSuccess() + Self._SetAttributesFromResponse(response) + If Self._etag <> MD5(response.content).ToLower() + Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") + End If + Return response.content + Else If response.IsClientError() + Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") + Else + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End If End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method ' Rem ' bbdoc: Private method ' End Rem Method _PrepareMetaDataForTransfer(headerList:TList) If Self._metaData For Local key:String = EachIn Self._metaData.Keys() Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) headerList.AddLast("X-Object-Meta-" + key + ": " + content) Next End If End Method Rem bbdoc: Clear meta data about: To remove all meta data call this method before saving End Rem Method ClearMetaData() If Self._metaData Then Self._metaData.Clear() End Method Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Save changes to meta data about: Save changes to meta data done with @SetMetaData() without having to re-upload the file contents End Rem Method SaveMetaData() Local headerList:TList = New TList Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "POST") Select response.responseCode Case 202 'ok Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object doesn't exist") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") Self.ClearMetaData() For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index e998b0b..820a16c 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,222 +1,214 @@ Rem Copyright (c) 2010 Christiaan Kras 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, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. End Rem SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.07" +ModuleInfo "Version: 1.08" ModuleInfo "License: MIT" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Local response:TRESTResponse = Self._Transport("https://api.mosso.com/auth", headers) - Select response.responseCode - Case 204 - Self._storageToken = response.GetHeader("X-Storage-Token") - Self._storageUrl = response.GetHeader("X-Storage-Url") - Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") - Self._authToken = response.GetHeader("X-Auth-Token") - Case 401 - Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") - Default - Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") - End Select + If response.IsSuccess() + Self._storageToken = response.GetHeader("X-Storage-Token") + Self._storageUrl = response.GetHeader("X-Storage-Url") + Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") + Self._authToken = response.GetHeader("X-Auth-Token") + ElseIf response.IsClientError() + Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") + Else + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") + End If End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) Select response.responseCode Case 200 Local containerList:TList = New TList Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") - Select response.responseCode - Case 201 'Created - Return Self.Container(name) - Case 202 'Already exists - Return Self.Container(name) - Default - Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") - End Select + If response.IsSuccess() + Return Self.Container(name) + End If + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") - Select response.responseCode - Case 204 - Return response.GetHeader("X-Account-Bytes-Used").ToLong() - Default - Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") - End Select - Return 0 + If response.IsSuccess() + Return response.GetHeader("X-Account-Bytes-Used").ToLong() + End If + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local request:TRESTRequest = New TRESTRequest request.SetProgressCallback(Self._progressCallback, Self._progressData) Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) Return response End Method End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
d9b8a5157dbc888a0f6e5c73089a33b3ad4f53df
No more generated documetation
diff --git a/.gitignore b/.gitignore index 1e567ed..387ef66 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ *.o *.i *.s *.a *.exe *.bmx.bak examples/credentials.txt -examples/*.dll \ No newline at end of file +examples/*.dll +doc/*.html diff --git a/doc/commands.html b/doc/commands.html deleted file mode 100644 index 687b364..0000000 --- a/doc/commands.html +++ /dev/null @@ -1,335 +0,0 @@ -<html><head><title>htbaapub.rackspacecloudfiles reference</title> -<link rel=stylesheet Type=text/css href='../../../../doc/bmxstyle.css'> -</head><body> -<table width=100% cellspacing=0><tr align=center><td class=small>&nbsp;</td> -<td class=small width=1%><b>htbaapub.rackspacecloudfiles:</b></td> -<td class=small width=1%><a href=#types class=small>Types</a></td> -<td class=small width=1%><a href=#modinfo class=small>Modinfo</a></td> -<td class=small width=1%><a href='../../../../mod/htbaapub.mod/rackspacecloudfiles.mod/rackspacecloudfiles.bmx' class=small>Source</a></td> -<td class=small>&nbsp;</td></tr></table> -<h1>htbaapub.rackspacecloudfiles</h1> -<h1>Rackspace CloudFiles</h1> -<p>This module allows you to interact with your account for Rackspace Cloud Files. Cloud Files is a webservice that allows you to store content online in the cloud.</p> -<p> - -<h2>Examples</h2> -<p>Please take a look at one of the examples below.</p> -<ul> - <li><a href="../examples/example1.bmx">example1.bmx</a></li> -</ul> -<h2><a name=types></a>Types Summary</h2><table class=doc width=100%> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudBaseException>TRackspaceCloudBaseException</a></td><td class=docright> -Exception for TRackspaceCloudFiles. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObject>TRackspaceCloudFileObject</a></td><td class=docright> -This type represents an object in Cloud Files. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObjectException>TRackspaceCloudFileObjectException</a></td><td class=docright> -Exception for TRackspaceCloudFileObject. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFiles>TRackspaceCloudFiles</a></td><td class=docright> -Interface to Rackspace CloudFiles service. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainer>TRackspaceCloudFilesContainer</a></td><td class=docright> -This type represents a container in Cloud Files. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainerException>TRackspaceCloudFilesContainerException</a></td><td class=docright> -Exception for TRackspaceCloudFilesContainer. -</td></tr> -<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesException>TRackspaceCloudFilesException</a></td><td class=docright> -Exception for TRackspaceCloudFiles. -</td></tr> -</table> -<h2 - id=typesdet>Types -</h2> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudBaseException> -<tr><td class=doctop colspan=2>Type TRackspaceCloudBaseException Abstract</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudBaseException_methods></a>Methods Summary</th></tr> -<tr><td class=docleft width=1%><a href=#SetMessage>SetMessage</a></td><td class=docright> -Sets message. -</td></tr> -<tr><td class=docleft width=1%><a href=#ToString>ToString</a></td><td class=docright> -Return message. -</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=SetMessage> -<tr><td class=doctop colspan=2>Method SetMessage:TRackspaceCloudBaseException(message:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Sets message.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ToString> -<tr><td class=doctop colspan=2>Method ToString:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return message.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObject> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFileObject</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>This type represents an object in Cloud Files.</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_methods></a>Methods Summary</th></tr> -<tr><td class=docleft width=1%><a href=#ClearMetaData>ClearMetaData</a></td><td class=docright> -Clear meta data. -</td></tr> -<tr><td class=docleft width=1%><a href=#ContentType>ContentType</a></td><td class=docright> -Return the content type of an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#ETag>ETag</a></td><td class=docright> -Returns the entity tag of the object, which is its MD5. -</td></tr> -<tr><td class=docleft width=1%><a href=#Get>Get</a></td><td class=docright> -Fetches the metadata and content of an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#GetFile>GetFile</a></td><td class=docright> -Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> -</td></tr> -<tr><td class=docleft width=1%><a href=#Head>Head</a></td><td class=docright> -Fetches the metadata of the object. -</td></tr> -<tr><td class=docleft width=1%><a href=#LastModified>LastModified</a></td><td class=docright> -Return the last modified time of an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#MetaData>MetaData</a></td><td class=docright> -Return meta data. -</td></tr> -<tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> -Returns the name of the object. -</td></tr> -<tr><td class=docleft width=1%><a href=#PutFile>PutFile</a></td><td class=docright> -Creates a new object with the contents of a local file. -</td></tr> -<tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> -Deletes an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#SaveMetaData>SaveMetaData</a></td><td class=docright> -Save changes to meta data. -</td></tr> -<tr><td class=docleft width=1%><a href=#SetMetaData>SetMetaData</a></td><td class=docright> -Set meta data for an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#Size>Size</a></td><td class=docright> -Return the size of an object in bytes. -</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_functions></a>Functions Summary</th></tr> -<tr><td class=docleft width=1%><a href=#ContentTypeOf>ContentTypeOf</a></td><td class=docright> -Return content-type of a file. -</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ClearMetaData> -<tr><td class=doctop colspan=2>Method ClearMetaData()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Clear meta data.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>To remove all meta data call this method before saving.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ContentType> -<tr><td class=doctop colspan=2>Method ContentType:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return the content type of an object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ETag> -<tr><td class=doctop colspan=2>Method ETag:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the entity tag of the object, which is its MD5.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Get> -<tr><td class=doctop colspan=2>Method Get:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata and content of an object.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Returns data content.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=GetFile> -<tr><td class=doctop colspan=2>Method GetFile:String(filename:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike></td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Head> -<tr><td class=doctop colspan=2>Method Head()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata of the object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=LastModified> -<tr><td class=doctop colspan=2>Method LastModified:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return the last modified time of an object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=MetaData> -<tr><td class=doctop colspan=2>Method MetaData:TMap()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return meta data.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Returns the meta data. Don't directly edit this data structure! Use <b>SetMetaData</b>() instead!</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Name> -<tr><td class=doctop colspan=2>Method Name:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=PutFile> -<tr><td class=doctop colspan=2>Method PutFile(filename:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Creates a new object with the contents of a local file.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Remember that the max. filesize supported by Cloud Files is 5Gb.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Remove> -<tr><td class=doctop colspan=2>Method Remove()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Deletes an object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=SaveMetaData> -<tr><td class=doctop colspan=2>Method SaveMetaData()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Save changes to meta data.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Save changes to meta data done with <b>SetMetaData</b>() without having to re-upload the file contents.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=SetMetaData> -<tr><td class=doctop colspan=2>Method SetMetaData(key:String, value:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Set meta data for an object.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Remember that the key and value together shouldn't exceed 4096 bytes.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Size> -<tr><td class=doctop colspan=2>Method Size:Long()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return the size of an object in bytes.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ContentTypeOf> -<tr><td class=doctop colspan=2>Function ContentTypeOf:String(filename:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Return content-type of a file.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Decision is based on the file extension. Which is not a safe method and the list -of content types and extensions is far from complete. If no matching content type is being -found it'll return application/octet-stream.<br> -<br> -The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. -This file is IncBinned during compilation of the module.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObjectException> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFileObject.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFiles> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFiles</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Interface to Rackspace CloudFiles service.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Please note that TRackspaceCloudFiles is not thread safe (yet)</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_globals></a>Globals Summary</th></tr><tr><td colspan=2> -<a href=#CAInfo>CAInfo</a> -</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_methods></a>Methods Summary</th></tr> -<tr><td class=docleft width=1%><a href=#Authenticate>Authenticate</a></td><td class=docright> -Authenticate with the webservice. -</td></tr> -<tr><td class=docleft width=1%><a href=#Container>Container</a></td><td class=docright> -Use an existing container. -</td></tr> -<tr><td class=docleft width=1%><a href=#Containers>Containers</a></td><td class=docright> -List all the containers. -</td></tr> -<tr><td class=docleft width=1%><a href=#Create>Create</a></td><td class=docright> -Creates a TRackspaceCloudFiles object. -</td></tr> -<tr><td class=docleft width=1%><a href=#CreateContainer>CreateContainer</a></td><td class=docright> -Create a new container. -</td></tr> -<tr><td class=docleft width=1%><a href=#SetProgressCallback>SetProgressCallback</a></td><td class=docright> -Set a progress callback function to use when uploading or downloading data. -</td></tr> -<tr><td class=docleft width=1%><a href=#TotalBytesUsed>TotalBytesUsed</a></td><td class=docright> -Returns the total amount of bytes used in your Cloud Files account. -</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=CAInfo> -<tr><td class=doctop colspan=2>Global CAInfo:String</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. -This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate()</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Authenticate> -<tr><td class=doctop colspan=2>Method Authenticate()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Authenticate with the webservice.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Container> -<tr><td class=doctop colspan=2>Method Container:TRackspaceCloudFilesContainer(name:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Use an existing container.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Containers> -<tr><td class=doctop colspan=2>Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>List all the containers.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix if you want to filter out the containers not beginning with the prefix.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Create> -<tr><td class=doctop colspan=2>Method Create:TRackspaceCloudFiles(user:String, key:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Creates a TRackspaceCloudFiles object.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>This method calls Authenticate()</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=CreateContainer> -<tr><td class=doctop colspan=2>Method CreateContainer:TRackspaceCloudFilesContainer(name:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Create a new container.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=SetProgressCallback> -<tr><td class=doctop colspan=2>Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Set a progress callback function to use when uploading or downloading data.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=TotalBytesUsed> -<tr><td class=doctop colspan=2>Method TotalBytesUsed:Long()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total amount of bytes used in your Cloud Files account.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainer> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainer</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>This type represents a container in Cloud Files.</td></tr> -</table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFilesContainer_methods></a>Methods Summary</th></tr> -<tr><td class=docleft width=1%><a href=#BytesUsed>BytesUsed</a></td><td class=docright> -Returns the total number of bytes used by objects in the container. -</td></tr> -<tr><td class=docleft width=1%><a href=#FileObject>FileObject</a></td><td class=docright> -This returns an object. -</td></tr> -<tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> -Returns the name of the container. -</td></tr> -<tr><td class=docleft width=1%><a href=#ObjectCount>ObjectCount</a></td><td class=docright> -Returns the total number of objects in the container. -</td></tr> -<tr><td class=docleft width=1%><a href=#Objects>Objects</a></td><td class=docright> -Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix. -</td></tr> -<tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> -Deletes the container, which should be empty. -</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=BytesUsed> -<tr><td class=doctop colspan=2>Method BytesUsed:Long()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of bytes used by objects in the container.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=FileObject> -<tr><td class=doctop colspan=2>Method FileObject:TRackspaceCloudFileObject(name:String)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>This returns an object.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Name> -<tr><td class=doctop colspan=2>Method Name:String()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the container.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=ObjectCount> -<tr><td class=doctop colspan=2>Method ObjectCount:Int()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of objects in the container.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Objects> -<tr><td class=doctop colspan=2>Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix to retrieve only the objects beginning with that name.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=Remove> -<tr><td class=doctop colspan=2>Method Remove()</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Deletes the container, which should be empty.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainerException> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFilesContainer.</td></tr> -</table> -<br> -<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesException> -<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> -</table> -<br> -<h2 id=modinfo>Module Information</h2> -<table width=100%> -<tr><th width=1%>Name</th><td>htbaapub.rackspacecloudfiles</td></tr> -<tr><th width=1%>Version</th><td>1.06</td></tr> -<tr><th width=1%>Author</th><td>Christiaan Kras</td></tr> -<tr><th width=1%>Git repository</th><td><a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a></td></tr> -<tr><th width=1%>Rackspace Cloud Files</th><td><a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a></td></tr> -</body></html>
Htbaa/rackspacecloudfiles.mod
e86d78d9589502dd32d456e1f396ae9169eb2cda
Added license
diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..dbaaca8 --- /dev/null +++ b/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2010 Christiaan Kras + +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, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/container.bmx b/container.bmx index 4448c65..c041e62 100644 --- a/container.bmx +++ b/container.bmx @@ -1,122 +1,144 @@ +Rem + Copyright (c) 2010 Christiaan Kras + + 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, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +End Rem + Rem bbdoc: This type represents a container in Cloud Files about: End Rem Type TRackspaceCloudFilesContainer Field _name:String Field _rackspace:TRackspaceCloudFiles Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) Self._name = name Self._rackspace = rackspace Self._url = rackspace._storageUrl + "/" + name Return Self End Method Rem bbdoc: Returns the name of the container about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Returns the total number of objects in the container about: End Rem Method ObjectCount:Int() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 204 Return response.GetHeader("X-Container-Object-Count").ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns the total number of bytes used by objects in the container about: End Rem Method BytesUsed:Long() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 204 Return response.GetHeader("X-Container-Bytes-Used").ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix about: Set prefix to retrieve only the objects beginning with that name End Rem Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._rackspace._Transport(Self._url + qs, Null, "GET") Select response.responseCode Case 200 Local objectsList:TList = New TList If response.content.Length = 0 Return objectsList End If Local objects:String[] = response.content.Trim().Split("~n") For Local objectName:String = EachIn objects If objectName.Length = 0 Then Continue objectsList.AddLast(Self.FileObject(objectName)) Next 'Check if there are more objects If objectsList.Count() = limit Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) Local more:TList = Self.Objects(prefix, limit, lastObject._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFileObject = EachIn more objectsList.AddLast(c) Next End If End If Return objectsList Case 204 Return New TList Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: This returns an object about: End Rem Method FileObject:TRackspaceCloudFileObject(name:String) Return New TRackspaceCloudFileObject.Create(Self, name) End Method Rem bbdoc: Deletes the container, which should be empty about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 204 'OK Case 409 Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method End Type diff --git a/exceptions.bmx b/exceptions.bmx index 2ce4a12..8a622eb 100644 --- a/exceptions.bmx +++ b/exceptions.bmx @@ -1,39 +1,61 @@ +Rem + Copyright (c) 2010 Christiaan Kras + + 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, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +End Rem + Rem bbdoc: Exception for TRackspaceCloudFiles End Rem Type TRackspaceCloudBaseException Abstract Field message:String Rem bbdoc: Sets message End Rem Method SetMessage:TRackspaceCloudBaseException(message:String) Self.message = message Return Self End Method Rem bbdoc: Return message End Rem Method ToString:String() Return Self.message End Method End Type Rem bbdoc: Exception for TRackspaceCloudFiles End Rem Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException End Type Rem bbdoc: Exception for TRackspaceCloudFilesContainer End Rem Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException End Type Rem bbdoc: Exception for TRackspaceCloudFileObject End Rem Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException End Type diff --git a/object.bmx b/object.bmx index 8629925..698fa96 100644 --- a/object.bmx +++ b/object.bmx @@ -1,288 +1,310 @@ +Rem + Copyright (c) 2010 Christiaan Kras + + 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, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +End Rem + Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method ' Rem ' bbdoc: Private method ' End Rem Method _PrepareMetaDataForTransfer(headerList:TList) If Self._metaData For Local key:String = EachIn Self._metaData.Keys() Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) headerList.AddLast("X-Object-Meta-" + key + ": " + content) Next End If End Method Rem bbdoc: Clear meta data about: To remove all meta data call this method before saving End Rem Method ClearMetaData() If Self._metaData Then Self._metaData.Clear() End Method Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Save changes to meta data about: Save changes to meta data done with @SetMetaData() without having to re-upload the file contents End Rem Method SaveMetaData() Local headerList:TList = New TList Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "POST") Select response.responseCode Case 202 'ok Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object doesn't exist") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") Self.ClearMetaData() For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 860ed74..e998b0b 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,199 +1,222 @@ +Rem + Copyright (c) 2010 Christiaan Kras + + 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, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +End Rem + SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.06" +ModuleInfo "Version: 1.07" +ModuleInfo "License: MIT" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Local response:TRESTResponse = Self._Transport("https://api.mosso.com/auth", headers) Select response.responseCode Case 204 Self._storageToken = response.GetHeader("X-Storage-Token") Self._storageUrl = response.GetHeader("X-Storage-Url") Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") Self._authToken = response.GetHeader("X-Auth-Token") Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) Select response.responseCode Case 200 Local containerList:TList = New TList Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Select response.responseCode Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") Select response.responseCode Case 204 Return response.GetHeader("X-Account-Bytes-Used").ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local request:TRESTRequest = New TRESTRequest request.SetProgressCallback(Self._progressCallback, Self._progressData) Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) Return response End Method End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
d320ef38559a1a42e295b2940911433d9db5adff
Meta Data will be reset upon every call to TRackspaceCloudFileObject._SetAttributesFromResponse() to avoid remains of unwanted meta data
diff --git a/object.bmx b/object.bmx index 715117b..8629925 100644 --- a/object.bmx +++ b/object.bmx @@ -1,287 +1,288 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method ' Rem ' bbdoc: Private method ' End Rem Method _PrepareMetaDataForTransfer(headerList:TList) If Self._metaData For Local key:String = EachIn Self._metaData.Keys() Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) headerList.AddLast("X-Object-Meta-" + key + ": " + content) Next End If End Method Rem bbdoc: Clear meta data about: To remove all meta data call this method before saving End Rem Method ClearMetaData() If Self._metaData Then Self._metaData.Clear() End Method Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Save changes to meta data about: Save changes to meta data done with @SetMetaData() without having to re-upload the file contents End Rem Method SaveMetaData() Local headerList:TList = New TList Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "POST") Select response.responseCode Case 202 'ok Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object doesn't exist") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") + Self.ClearMetaData() For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type
Htbaa/rackspacecloudfiles.mod
de42f773b4961048784e014e1887850d1b0f1d93
Added method to clear all meta data
diff --git a/object.bmx b/object.bmx index 6985c41..715117b 100644 --- a/object.bmx +++ b/object.bmx @@ -1,279 +1,287 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method ' Rem ' bbdoc: Private method ' End Rem Method _PrepareMetaDataForTransfer(headerList:TList) If Self._metaData For Local key:String = EachIn Self._metaData.Keys() Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) headerList.AddLast("X-Object-Meta-" + key + ": " + content) Next End If End Method + Rem + bbdoc: Clear meta data + about: To remove all meta data call this method before saving + End Rem + Method ClearMetaData() + If Self._metaData Then Self._metaData.Clear() + End Method + Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Save changes to meta data about: Save changes to meta data done with @SetMetaData() without having to re-upload the file contents End Rem Method SaveMetaData() Local headerList:TList = New TList Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "POST") Select response.responseCode Case 202 'ok Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object doesn't exist") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type
Htbaa/rackspacecloudfiles.mod
b0ff9299d3ae7326f19e284faf49aaf1a65a1aba
Meta Data can be updated now separate from uploading
diff --git a/object.bmx b/object.bmx index a78679c..6985c41 100644 --- a/object.bmx +++ b/object.bmx @@ -1,255 +1,279 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method ' Rem ' bbdoc: Private method ' End Rem Method _PrepareMetaDataForTransfer(headerList:TList) If Self._metaData For Local key:String = EachIn Self._metaData.Keys() Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) headerList.AddLast("X-Object-Meta-" + key + ": " + content) Next End If End Method Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method + Rem + bbdoc: Save changes to meta data + about: Save changes to meta data done with @SetMetaData() without having to re-upload the file contents + End Rem + Method SaveMetaData() + Local headerList:TList = New TList + Self._PrepareMetaDataForTransfer(headerList) + + Local headerArray:String[] = New String[headerList.Count()] + For Local i:Int = 0 To headerArray.Length - 1 + headerArray[i] = String(headerList.ValueAtIndex(i)) + Next + + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "POST") + Select response.responseCode + Case 202 + 'ok + Case 404 + Throw New TRackspaceCloudFileObjectException.SetMessage("Object doesn't exist") + Default + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End Select + End Method + Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type
Htbaa/rackspacecloudfiles.mod
b38e2b5cfefab9cd075aa67c2b2c26faa08e6332
Added private method for preparing meta data for transfer
diff --git a/object.bmx b/object.bmx index 2107ad3..a78679c 100644 --- a/object.bmx +++ b/object.bmx @@ -1,248 +1,255 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headerList:TList = New TList headerList.AddLast("ETag: " + md5Hex.ToLower()) headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) - If Self._metaData - For Local key:String = EachIn Self._metaData.Keys() - Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) - headerList.AddLast("X-Object-Meta-" + key + ": " + content) - Next - End If + Self._PrepareMetaDataForTransfer(headerList) Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method +' Rem +' bbdoc: Private method +' End Rem + Method _PrepareMetaDataForTransfer(headerList:TList) + If Self._metaData + For Local key:String = EachIn Self._metaData.Keys() + Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) + headerList.AddLast("X-Object-Meta-" + key + ": " + content) + Next + End If + End Method + Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type
Htbaa/rackspacecloudfiles.mod
f05c96d7dc76f2fc9827edec489c65009dce236f
TRackspaceCloudFileObject.PutFile() now also updates meta data
diff --git a/object.bmx b/object.bmx index dda21ec..2107ad3 100644 --- a/object.bmx +++ b/object.bmx @@ -1,233 +1,248 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String Field _metaData:TMap ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) - Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] + + Local headerList:TList = New TList + headerList.AddLast("ETag: " + md5Hex.ToLower()) + headerList.AddLast("Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename)) - Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headers, "PUT", stream) + If Self._metaData + For Local key:String = EachIn Self._metaData.Keys() + Local content:String = TURLFunc.EncodeString(String(Self._metaData.ValueForKey(key))) + headerList.AddLast("X-Object-Meta-" + key + ": " + content) + Next + End If + + Local headerArray:String[] = New String[headerList.Count()] + For Local i:Int = 0 To headerArray.Length - 1 + headerArray[i] = String(headerList.ValueAtIndex(i)) + Next + + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headerArray, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Set meta data for an object about: Remember that the key and value together shouldn't exceed 4096 bytes End Rem Method SetMetaData(key:String, value:String) If Not Self._metaData Then Self._metaData = New TMap If key.Length + value.Length > 4096 Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") End If Self._metaData.Insert(key, value) End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method Rem bbdoc: Return meta data about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! End Rem Method MetaData:TMap() Return Self._metaData End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") For Local key:String = EachIn response.headers.Keys() If key.Contains("X-Object-Meta-") Local strippedKey:String = key[14..].Trim() Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) Self.SetMetaData(strippedKey, content) End If Next End Method End Type
Htbaa/rackspacecloudfiles.mod
4eb6f63187bd47d821a9098498ec82fce18afa8a
Meta Data of an existing object will now be read and stored inside a TMap, which can later be retrieved.
diff --git a/object.bmx b/object.bmx index c076e8a..dda21ec 100644 --- a/object.bmx +++ b/object.bmx @@ -1,203 +1,233 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String + Field _metaData:TMap + ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse(response) If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headers, "PUT", stream) Select response.responseCode Case 201 'Object created Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method + Rem + bbdoc: Set meta data for an object + about: Remember that the key and value together shouldn't exceed 4096 bytes + End Rem + Method SetMetaData(key:String, value:String) + If Not Self._metaData Then Self._metaData = New TMap + If key.Length + value.Length > 4096 + Throw New TRackspaceCloudFileObjectException.SetMessage("Length of metadata's key and value should not exceed 4096 bytes") + End If + Self._metaData.Insert(key, value) + End Method + Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method + Rem + bbdoc: Return meta data + about: Returns the meta data. Don't directly edit this data structure! Use @SetMetaData() instead! + End Rem + Method MetaData:TMap() + Return Self._metaData + End Method + ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse(response:TRESTResponse) Self._etag = response.GetHeader("Etag") Self._size = response.GetHeader("Content-Length").ToLong() Self._contentType = response.GetHeader("Content-Type") Self._lastModified = response.GetHeader("Last-Modified") + + For Local key:String = EachIn response.headers.Keys() + If key.Contains("X-Object-Meta-") + Local strippedKey:String = key[14..].Trim() + Local content:String = TURLFunc.DecodeString(String(response.GetHeader(key))) + Self.SetMetaData(strippedKey, content) + End If + Next End Method End Type
Htbaa/rackspacecloudfiles.mod
5c6a82c8cc9f9b7124aaee904f0c64eb26ec69ee
Now using htbaapub.rest to handle all the HTTP requests.
diff --git a/README b/README index 69555e2..7f0d179 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ This module allows you to interact with your account for Rackspacecloud Files. This module requires the following external modules: - * bah.libcurlssl + * htbaapub.rest (>=1.00) * bah.crypto (>=1.02) (Both BaH modules can be found at http://code.google.com/p/maxmods/) Collaborators are more then wanted to help with the Mac OSX and Linux version of the module. diff --git a/container.bmx b/container.bmx index 7094415..4448c65 100644 --- a/container.bmx +++ b/container.bmx @@ -1,118 +1,122 @@ Rem bbdoc: This type represents a container in Cloud Files about: End Rem Type TRackspaceCloudFilesContainer Field _name:String Field _rackspace:TRackspaceCloudFiles Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) Self._name = name Self._rackspace = rackspace Self._url = rackspace._storageUrl + "/" + name Return Self End Method Rem bbdoc: Returns the name of the container about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Returns the total number of objects in the container about: End Rem Method ObjectCount:Int() - Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") + Select response.responseCode Case 204 - Return String(Self._rackspace._headers.ValueForKey("X-Container-Object-Count")).ToInt() + Return response.GetHeader("X-Container-Object-Count").ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns the total number of bytes used by objects in the container about: End Rem Method BytesUsed:Long() - Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") + Select response.responseCode Case 204 - Return String(Self._rackspace._headers.ValueForKey("X-Container-Bytes-Used")).ToInt() + Return response.GetHeader("X-Container-Bytes-Used").ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix about: Set prefix to retrieve only the objects beginning with that name End Rem Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) - Select Self._rackspace._Transport(Self._url + qs, Null, "GET") + Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) + Local response:TRESTResponse = Self._rackspace._Transport(Self._url + qs, Null, "GET") + Select response.responseCode Case 200 Local objectsList:TList = New TList - If Self._rackspace._content.Length = 0 + If response.content.Length = 0 Return objectsList End If - Local objects:String[] = Self._rackspace._content.Trim().Split("~n") + Local objects:String[] = response.content.Trim().Split("~n") For Local objectName:String = EachIn objects If objectName.Length = 0 Then Continue objectsList.AddLast(Self.FileObject(objectName)) Next 'Check if there are more objects If objectsList.Count() = limit Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) Local more:TList = Self.Objects(prefix, limit, lastObject._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFileObject = EachIn more objectsList.AddLast(c) Next End If End If Return objectsList Case 204 Return New TList Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: This returns an object about: End Rem Method FileObject:TRackspaceCloudFileObject(name:String) Return New TRackspaceCloudFileObject.Create(Self, name) End Method Rem bbdoc: Deletes the container, which should be empty about: End Rem Method Remove() - Select Self._rackspace._Transport(Self._url, Null, "DELETE") + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") + Select response.responseCode Case 204 'OK Case 409 Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method End Type diff --git a/doc/commands.html b/doc/commands.html index 1024a6f..864c0e4 100644 --- a/doc/commands.html +++ b/doc/commands.html @@ -1,321 +1,303 @@ <html><head><title>htbaapub.rackspacecloudfiles reference</title> <link rel=stylesheet Type=text/css href='../../../../doc/bmxstyle.css'> </head><body> <table width=100% cellspacing=0><tr align=center><td class=small>&nbsp;</td> <td class=small width=1%><b>htbaapub.rackspacecloudfiles:</b></td> <td class=small width=1%><a href=#types class=small>Types</a></td> <td class=small width=1%><a href=#modinfo class=small>Modinfo</a></td> <td class=small width=1%><a href='../../../../mod/htbaapub.mod/rackspacecloudfiles.mod/rackspacecloudfiles.bmx' class=small>Source</a></td> <td class=small>&nbsp;</td></tr></table> <h1>htbaapub.rackspacecloudfiles</h1> <h1>Rackspace CloudFiles</h1> <p>This module allows you to interact with your account for Rackspace Cloud Files. Cloud Files is a webservice that allows you to store content online in the cloud.</p> <p> <h2>Examples</h2> <p>Please take a look at one of the examples below.</p> <ul> <li><a href="../examples/example1.bmx">example1.bmx</a></li> </ul> <h2><a name=types></a>Types Summary</h2><table class=doc width=100%> <tr><td class=docleft width=1%><a href=#TRackspaceCloudBaseException>TRackspaceCloudBaseException</a></td><td class=docright> Exception for TRackspaceCloudFiles. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObject>TRackspaceCloudFileObject</a></td><td class=docright> This type represents an object in Cloud Files. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObjectException>TRackspaceCloudFileObjectException</a></td><td class=docright> Exception for TRackspaceCloudFileObject. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFiles>TRackspaceCloudFiles</a></td><td class=docright> Interface to Rackspace CloudFiles service. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainer>TRackspaceCloudFilesContainer</a></td><td class=docright> This type represents a container in Cloud Files. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainerException>TRackspaceCloudFilesContainerException</a></td><td class=docright> Exception for TRackspaceCloudFilesContainer. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesException>TRackspaceCloudFilesException</a></td><td class=docright> Exception for TRackspaceCloudFiles. </td></tr> </table> <h2 id=typesdet>Types </h2> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudBaseException> <tr><td class=doctop colspan=2>Type TRackspaceCloudBaseException Abstract</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudBaseException_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#SetMessage>SetMessage</a></td><td class=docright> Sets message. </td></tr> <tr><td class=docleft width=1%><a href=#ToString>ToString</a></td><td class=docright> Return message. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=SetMessage> <tr><td class=doctop colspan=2>Method SetMessage:TRackspaceCloudBaseException(message:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Sets message.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ToString> <tr><td class=doctop colspan=2>Method ToString:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return message.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObject> <tr><td class=doctop colspan=2>Type TRackspaceCloudFileObject</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This type represents an object in Cloud Files.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#ContentType>ContentType</a></td><td class=docright> Return the content type of an object. </td></tr> <tr><td class=docleft width=1%><a href=#ETag>ETag</a></td><td class=docright> Returns the entity tag of the object, which is its MD5. </td></tr> <tr><td class=docleft width=1%><a href=#Get>Get</a></td><td class=docright> Fetches the metadata and content of an object. </td></tr> <tr><td class=docleft width=1%><a href=#GetFile>GetFile</a></td><td class=docright> Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> </td></tr> <tr><td class=docleft width=1%><a href=#Head>Head</a></td><td class=docright> Fetches the metadata of the object. </td></tr> <tr><td class=docleft width=1%><a href=#LastModified>LastModified</a></td><td class=docright> Return the last modified time of an object. </td></tr> <tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> Returns the name of the object. </td></tr> <tr><td class=docleft width=1%><a href=#PutFile>PutFile</a></td><td class=docright> Creates a new object with the contents of a local file. </td></tr> <tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> Deletes an object. </td></tr> <tr><td class=docleft width=1%><a href=#Size>Size</a></td><td class=docright> Return the size of an object in bytes. </td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_functions></a>Functions Summary</th></tr> <tr><td class=docleft width=1%><a href=#ContentTypeOf>ContentTypeOf</a></td><td class=docright> Return content-type of a file. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=ContentType> <tr><td class=doctop colspan=2>Method ContentType:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the content type of an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ETag> <tr><td class=doctop colspan=2>Method ETag:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the entity tag of the object, which is its MD5.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Get> <tr><td class=doctop colspan=2>Method Get:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata and content of an object.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Returns data content.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=GetFile> <tr><td class=doctop colspan=2>Method GetFile:String(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike></td></tr> </table> <table class=doc width=100% cellspacing=3 id=Head> <tr><td class=doctop colspan=2>Method Head()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata of the object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=LastModified> <tr><td class=doctop colspan=2>Method LastModified:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the last modified time of an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Name> <tr><td class=doctop colspan=2>Method Name:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=PutFile> <tr><td class=doctop colspan=2>Method PutFile(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Creates a new object with the contents of a local file.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Remember that the max. filesize supported by Cloud Files is 5Gb.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Remove> <tr><td class=doctop colspan=2>Method Remove()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Deletes an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Size> <tr><td class=doctop colspan=2>Method Size:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the size of an object in bytes.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ContentTypeOf> <tr><td class=doctop colspan=2>Function ContentTypeOf:String(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return content-type of a file.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObjectException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFileObject.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFiles> <tr><td class=doctop colspan=2>Type TRackspaceCloudFiles</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Interface to Rackspace CloudFiles service.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Please note that TRackspaceCloudFiles is not thread safe (yet)</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_globals></a>Globals Summary</th></tr><tr><td colspan=2> <a href=#CAInfo>CAInfo</a> </td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#Authenticate>Authenticate</a></td><td class=docright> Authenticate with the webservice. </td></tr> <tr><td class=docleft width=1%><a href=#Container>Container</a></td><td class=docright> Use an existing container. </td></tr> <tr><td class=docleft width=1%><a href=#Containers>Containers</a></td><td class=docright> List all the containers. </td></tr> <tr><td class=docleft width=1%><a href=#Create>Create</a></td><td class=docright> Creates a TRackspaceCloudFiles object. </td></tr> <tr><td class=docleft width=1%><a href=#CreateContainer>CreateContainer</a></td><td class=docright> Create a new container. </td></tr> <tr><td class=docleft width=1%><a href=#SetProgressCallback>SetProgressCallback</a></td><td class=docright> Set a progress callback function to use when uploading or downloading data. </td></tr> <tr><td class=docleft width=1%><a href=#TotalBytesUsed>TotalBytesUsed</a></td><td class=docright> Returns the total amount of bytes used in your Cloud Files account. </td></tr> </table> -<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_functions></a>Functions Summary</th></tr> -<tr><td class=docleft width=1%><a href=#CreateQueryString>CreateQueryString</a></td><td class=docright> -Create a query string from the given values. -</td></tr> -<tr><td class=docleft width=1%><a href=#HeaderCallback>HeaderCallback</a></td><td class=docright> -Callback for cURL to catch headers. -</td></tr> -</table> <table class=doc width=100% cellspacing=3 id=CAInfo> <tr><td class=doctop colspan=2>Global CAInfo:String</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate()</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Authenticate> <tr><td class=doctop colspan=2>Method Authenticate()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Authenticate with the webservice.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Container> <tr><td class=doctop colspan=2>Method Container:TRackspaceCloudFilesContainer(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Use an existing container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Containers> <tr><td class=doctop colspan=2>Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>List all the containers.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix if you want to filter out the containers not beginning with the prefix.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Create> <tr><td class=doctop colspan=2>Method Create:TRackspaceCloudFiles(user:String, key:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Creates a TRackspaceCloudFiles object.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>This method calls Authenticate()</td></tr> </table> <table class=doc width=100% cellspacing=3 id=CreateContainer> <tr><td class=doctop colspan=2>Method CreateContainer:TRackspaceCloudFilesContainer(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Create a new container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=SetProgressCallback> <tr><td class=doctop colspan=2>Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Set a progress callback function to use when uploading or downloading data.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=TotalBytesUsed> <tr><td class=doctop colspan=2>Method TotalBytesUsed:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total amount of bytes used in your Cloud Files account.</td></tr> </table> -<table class=doc width=100% cellspacing=3 id=CreateQueryString> -<tr><td class=doctop colspan=2>Function CreateQueryString:String(params:String[])</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Create a query string from the given values.</td></tr> -<tr><td class=docleft width=1%>Information</td><td class=docright>Expects an array with strings. Each entry should be something like var=value.</td></tr> -</table> -<table class=doc width=100% cellspacing=3 id=HeaderCallback> -<tr><td class=doctop colspan=2>Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object)</td></tr> -<tr><td class=docleft width=1%>Description</td><td class=docright>Callback for cURL to catch headers.</td></tr> -</table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainer> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainer</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This type represents a container in Cloud Files.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFilesContainer_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#BytesUsed>BytesUsed</a></td><td class=docright> Returns the total number of bytes used by objects in the container. </td></tr> <tr><td class=docleft width=1%><a href=#FileObject>FileObject</a></td><td class=docright> This returns an object. </td></tr> <tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> Returns the name of the container. </td></tr> <tr><td class=docleft width=1%><a href=#ObjectCount>ObjectCount</a></td><td class=docright> Returns the total number of objects in the container. </td></tr> <tr><td class=docleft width=1%><a href=#Objects>Objects</a></td><td class=docright> Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix. </td></tr> <tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> Deletes the container, which should be empty. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=BytesUsed> <tr><td class=doctop colspan=2>Method BytesUsed:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of bytes used by objects in the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=FileObject> <tr><td class=doctop colspan=2>Method FileObject:TRackspaceCloudFileObject(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This returns an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Name> <tr><td class=doctop colspan=2>Method Name:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ObjectCount> <tr><td class=doctop colspan=2>Method ObjectCount:Int()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of objects in the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Objects> <tr><td class=doctop colspan=2>Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix to retrieve only the objects beginning with that name.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Remove> <tr><td class=doctop colspan=2>Method Remove()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Deletes the container, which should be empty.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainerException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFilesContainer.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> </table> <br> <h2 id=modinfo>Module Information</h2> <table width=100%> <tr><th width=1%>Name</th><td>htbaapub.rackspacecloudfiles</td></tr> -<tr><th width=1%>Version</th><td>1.04</td></tr> +<tr><th width=1%>Version</th><td>1.05</td></tr> <tr><th width=1%>Author</th><td>Christiaan Kras</td></tr> -<tr><th width=1%>Special thanks to</th><td>Bruce A Henderson, Kris Kelly</td></tr> <tr><th width=1%>Git repository</th><td><a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a></td></tr> <tr><th width=1%>Rackspace Cloud Files</th><td><a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a></td></tr> </body></html> diff --git a/object.bmx b/object.bmx index 2c6ba00..c076e8a 100644 --- a/object.bmx +++ b/object.bmx @@ -1,199 +1,203 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() - Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "HEAD") + Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 - Self._SetAttributesFromResponse() + Self._SetAttributesFromResponse(response) Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() - Select Self._rackspace._Transport(Self._url, Null) + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null) + Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 - Self._SetAttributesFromResponse() - If Self._etag <> MD5(Self._rackspace._content).ToLower() + Self._SetAttributesFromResponse(response) + If Self._etag <> MD5(response.content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If - Return Self._rackspace._content + Return response.content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() - Select Self._rackspace._Transport(Self._url, Null, "DELETE") + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, Null, "DELETE") + Select response.responseCode Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] - Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) + Local response:TRESTResponse = Self._rackspace._Transport(Self._url, headers, "PUT", stream) + Select response.responseCode Case 201 'Object created - Self._SetAttributesFromResponse() + Self._SetAttributesFromResponse(response) Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method ' Rem ' bbdoc: Private method ' End Rem - Method _SetAttributesFromResponse() - Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) - Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() - Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) - Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) + Method _SetAttributesFromResponse(response:TRESTResponse) + Self._etag = response.GetHeader("Etag") + Self._size = response.GetHeader("Content-Length").ToLong() + Self._contentType = response.GetHeader("Content-Type") + Self._lastModified = response.GetHeader("Last-Modified") End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 7a04a9b..37b2336 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,351 +1,199 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.04" +ModuleInfo "Version: 1.05" ModuleInfo "Author: Christiaan Kras" -ModuleInfo "Special thanks to: Bruce A Henderson, Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/rackspacecloudfiles.mod/'>http://github.com/Htbaa/rackspacecloudfiles.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto -Import bah.libcurlssl +Import htbaapub.rest Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int - Field _headers:TMap - Field _content:String - Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String - Method New() - ?Threaded - DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." - ? - End Method - Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) - Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey - Select Self._Transport("https://api.mosso.com/auth", headers) + + Local response:TRESTResponse = Self._Transport("https://api.mosso.com/auth", headers) + + Select response.responseCode Case 204 - Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) - Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) - Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) - Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) + Self._storageToken = response.GetHeader("X-Storage-Token") + Self._storageUrl = response.GetHeader("X-Storage-Url") + Self._cdnManagementUrl = response.GetHeader("X-CDN-Management-Url") + Self._authToken = response.GetHeader("X-Auth-Token") Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) - Select Self._Transport(Self._storageUrl + qs) + Local qs:String = TURLFunc.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) + Local response:TRESTResponse = Self._Transport(Self._storageUrl + qs) + Select response.responseCode Case 200 Local containerList:TList = New TList - Local containerNames:String[] = Self._content.Split("~n") + Local containerNames:String[] = response.content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) - Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") + Local response:TRESTResponse = Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") + Select response.responseCode Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() - Select Self._Transport(Self._storageUrl, Null, "HEAD") + Local response:TRESTResponse = Self._Transport(Self._storageUrl, Null, "HEAD") + Select response.responseCode Case 204 - Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() + Return response.GetHeader("X-Account-Bytes-Used").ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem - Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) - Self._headers.Clear() - - Local curl:TCurlEasy = TCurlEasy.Create() - curl.setWriteString() - curl.setOptInt(CURLOPT_VERBOSE, 0) - curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) - curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) - curl.setOptString(CURLOPT_URL, url) - -', - 'Set progress callback if set - If Self._progressCallback <> Null - curl.setProgressCallback(Self._progressCallback, Self._progressData) - End If - - 'Use certificate bundle if set - If TRackspaceCloudFiles.CAInfo - curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) - 'Otherwise don't check if SSL certificate is valid - Else - curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) - End If - - 'Pass content - If userData - Select requestMethod - Case "POST" - curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) - curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) - Case "PUT" - curl.setOptInt(CURLOPT_UPLOAD, True) - Local stream:TStream = TStream(userData) - curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) - curl.setReadStream(stream) - End Select - End If - + Method _Transport:TRESTResponse(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If - + 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next - - curl.httpHeader(headerArray) - - curl.setHeaderCallback(Self.HeaderCallback, Self) - - Local res:Int = curl.perform() - - If TStream(userData) - TStream(userData).Close() - End If - - Local errorMessage:String - If res Then - errorMessage = CurlError(res) - End If - - Local info:TCurlInfo = curl.getInfo() - Local responseCode:Int = info.responseCode() - curl.freeLists() - curl.cleanup() - - Self._content = curl.toString() - - 'Throw exception if an error with cURL occured - If errorMessage <> Null - Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) - End If - - Return responseCode + Local request:TRESTRequest = New TRESTRequest + request.SetProgressCallback(Self._progressCallback, Self._progressData) + Local response:TRESTResponse = request.Call(url, headerArray, requestMethod, userData) + Return response End Method - - Rem - bbdoc: Callback for cURL to catch headers - End Rem - Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) - Local str:String = String.FromCString(buffer) - - Local parts:String[] = str.Split(":") - If parts.Length >= 2 - TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) - End If - - Return size - End Function - - Rem - bbdoc: Create a query string from the given values - about: Expects an array with strings. Each entry should be something like var=value - End Rem - Function CreateQueryString:String(params:String[]) - Local qs:String = "&".Join(params) - If qs.Length > 0 - Return "?" + qs - End If - Return Null - End Function -End Type -'Code below taken from the public domain -'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 -'Original author is Perturbatio/Kris Kelly -'Wrapped by Htbaa/Christiaan Kras to fit in the module -Type TURLFunc - Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) - Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" - Local s:Int - Local result:String - - For s = 0 To value.length - 1 - If ReservedChars.Find(value[s..s + 1]) > -1 Then - result:+ "%"+ TURLFunc.IntToHexString(Asc(value[s..s + 1])) - Continue - ElseIf value[s..s+1] = " " Then - If UsePlusForSpace Then result:+"+" Else result:+"%20" - Continue - ElseIf EncodeUnreserved Then - result:+ "%" + TURLFunc.IntToHexString(Asc(value[s..s + 1])) - Continue - EndIf - result:+ value[s..s + 1] - Next - - Return result - End Function - - Function DecodeString:String(EncStr:String) - Local Pos:Int = 0 - Local HexVal:String - Local Result:String - - While Pos<Len(EncStr) - If EncStr[Pos..Pos+1] = "%" Then - HexVal = EncStr[Pos+1..Pos+3] - Result:+Chr(HexToInt(HexVal)) - Pos:+3 - ElseIf EncStr[Pos..Pos+1] = "+" Then - Result:+" " - Pos:+1 - Else - Result:+EncStr[Pos..Pos + 1] - Pos:+1 - EndIf - Wend - - Return Result - End Function - - Function HexToInt:Int( HexStr:String ) - If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr - Return Int(HexStr) - End Function - - Function IntToHexString:String(val:Int, chars:Int = 2) - Local Result:String = Hex(val) - Return result[result.length-chars..] - End Function -End Type +End Type \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
4e01eee37a01ba8fadac13db48e7c8dcf2493267
added .gitignore
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e567ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.o +*.i +*.s +*.a +*.exe +*.bmx.bak +examples/credentials.txt +examples/*.dll \ No newline at end of file
Htbaa/rackspacecloudfiles.mod
a36139ceebd1a601e05154d4107913b6c90e3cd3
URL Encoding/Decoding refactoring
diff --git a/container.bmx b/container.bmx index 18ea5af..7094415 100644 --- a/container.bmx +++ b/container.bmx @@ -1,118 +1,118 @@ Rem bbdoc: This type represents a container in Cloud Files about: End Rem Type TRackspaceCloudFilesContainer Field _name:String Field _rackspace:TRackspaceCloudFiles Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) Self._name = name Self._rackspace = rackspace Self._url = rackspace._storageUrl + "/" + name Return Self End Method Rem bbdoc: Returns the name of the container about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Returns the total number of objects in the container about: End Rem Method ObjectCount:Int() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 204 Return String(Self._rackspace._headers.ValueForKey("X-Container-Object-Count")).ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns the total number of bytes used by objects in the container about: End Rem Method BytesUsed:Long() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 204 Return String(Self._rackspace._headers.ValueForKey("X-Container-Bytes-Used")).ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix about: Set prefix to retrieve only the objects beginning with that name End Rem Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Select Self._rackspace._Transport(Self._url + qs, Null, "GET") Case 200 Local objectsList:TList = New TList If Self._rackspace._content.Length = 0 Return objectsList End If Local objects:String[] = Self._rackspace._content.Trim().Split("~n") For Local objectName:String = EachIn objects If objectName.Length = 0 Then Continue objectsList.AddLast(Self.FileObject(objectName)) Next 'Check if there are more objects If objectsList.Count() = limit Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) Local more:TList = Self.Objects(prefix, limit, lastObject._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFileObject = EachIn more objectsList.AddLast(c) Next End If End If Return objectsList Case 204 Return New TList Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: This returns an object about: End Rem Method FileObject:TRackspaceCloudFileObject(name:String) Return New TRackspaceCloudFileObject.Create(Self, name) End Method Rem bbdoc: Deletes the container, which should be empty about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 204 'OK Case 409 Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method End Type diff --git a/object.bmx b/object.bmx index 8158f2e..2c6ba00 100644 --- a/object.bmx +++ b/object.bmx @@ -1,199 +1,199 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" Local parts:String[] = ExtractDir(Self._name).Split("/") For Local part:String = EachIn parts If part.Length = 0 Then Continue - Self._url:+EncodeString(part, False, False) + "/" + Self._url:+TURLFunc.EncodeString(part, False, False) + "/" Next - Self._url:+EncodeString(StripDir(Self._name), False, False) + Self._url:+TURLFunc.EncodeString(StripDir(Self._name), False, False) Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse() Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Select Self._rackspace._Transport(Self._url, Null) Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse() If Self._etag <> MD5(Self._rackspace._content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return Self._rackspace._content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) Case 201 'Object created Self._SetAttributesFromResponse() Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse() Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index a4e9fb9..52e011e 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,351 +1,351 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" ModuleInfo "Version: 1.04" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Special thanks to: Bruce A Henderson, Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import bah.libcurlssl Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _headers:TMap Field _content:String Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) Field _progressData:Object Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Method New() ?Threaded DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." ? End Method Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Select Self._Transport("https://api.mosso.com/auth", headers) Case 204 Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + TURLFunc.EncodeString(prefix, False, True), "marker=" + TURLFunc.EncodeString(marker, False, True)]) Select Self._Transport(Self._storageUrl + qs) Case 200 Local containerList:TList = New TList Local containerNames:String[] = Self._content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Select Self._Transport(Self._storageUrl, Null, "HEAD") Case 204 Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method Rem bbdoc: Set a progress callback function to use when uploading or downloading data about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information End Rem Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) Self._progressCallback = progressFunction Self._progressData = progressObject End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Self._headers.Clear() Local curl:TCurlEasy = TCurlEasy.Create() curl.setWriteString() curl.setOptInt(CURLOPT_VERBOSE, 0) curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) curl.setOptString(CURLOPT_URL, url) ', 'Set progress callback if set If Self._progressCallback <> Null curl.setProgressCallback(Self._progressCallback, Self._progressData) End If 'Use certificate bundle if set If TRackspaceCloudFiles.CAInfo curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) 'Otherwise don't check if SSL certificate is valid Else curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) End If 'Pass content If userData Select requestMethod Case "POST" curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) Case "PUT" curl.setOptInt(CURLOPT_UPLOAD, True) Local stream:TStream = TStream(userData) curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) curl.setReadStream(stream) End Select End If Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next curl.httpHeader(headerArray) curl.setHeaderCallback(Self.HeaderCallback, Self) Local res:Int = curl.perform() If TStream(userData) TStream(userData).Close() End If Local errorMessage:String If res Then errorMessage = CurlError(res) End If Local info:TCurlInfo = curl.getInfo() Local responseCode:Int = info.responseCode() curl.freeLists() curl.cleanup() Self._content = curl.toString() 'Throw exception if an error with cURL occured If errorMessage <> Null Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) End If Return responseCode End Method Rem bbdoc: Callback for cURL to catch headers End Rem Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) Local str:String = String.FromCString(buffer) Local parts:String[] = str.Split(":") If parts.Length >= 2 TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) End If Return size End Function Rem bbdoc: Create a query string from the given values about: Expects an array with strings. Each entry should be something like var=value End Rem Function CreateQueryString:String(params:String[]) Local qs:String = "&".Join(params) If qs.Length > 0 Return "?" + qs End If Return Null End Function End Type 'Code below taken from the public domain 'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 'Original author is Perturbatio/Kris Kelly - -Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) - Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" - Local s:Int - Local result:String - - For s = 0 To value.length - 1 - If ReservedChars.Find(value[s..s + 1]) > -1 Then - result:+ "%"+ IntToHexString(Asc(value[s..s + 1])) - Continue - ElseIf value[s..s+1] = " " Then - If UsePlusForSpace Then result:+"+" Else result:+"%20" - Continue - ElseIf EncodeUnreserved Then - result:+ "%" + IntToHexString(Asc(value[s..s + 1])) - Continue - EndIf - result:+ value[s..s + 1] - Next - - Return result -End Function - -Function DecodeString:String(EncStr:String) - Local Pos:Int = 0 - Local HexVal:String - Local Result:String - - While Pos<Len(EncStr) - If EncStr[Pos..Pos+1] = "%" Then - HexVal = EncStr[Pos+1..Pos+3] - Result:+Chr(HexToInt(HexVal)) - Pos:+3 - ElseIf EncStr[Pos..Pos+1] = "+" Then - Result:+" " - Pos:+1 - Else - Result:+EncStr[Pos..Pos + 1] - Pos:+1 - EndIf - Wend +'Wrapped by Htbaa/Christiaan Kras to fit in the module +Type TURLFunc + Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) + Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" + Local s:Int + Local result:String - Return Result -End Function - - -Function HexToInt:Int( HexStr:String ) - If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr - Return Int(HexStr) -End Function - - -Function IntToHexString:String(val:Int, chars:Int = 2) - Local Result:String = Hex(val) - Return result[result.length-chars..] -End Function + For s = 0 To value.length - 1 + If ReservedChars.Find(value[s..s + 1]) > -1 Then + result:+ "%"+ TURLFunc.IntToHexString(Asc(value[s..s + 1])) + Continue + ElseIf value[s..s+1] = " " Then + If UsePlusForSpace Then result:+"+" Else result:+"%20" + Continue + ElseIf EncodeUnreserved Then + result:+ "%" + TURLFunc.IntToHexString(Asc(value[s..s + 1])) + Continue + EndIf + result:+ value[s..s + 1] + Next + + Return result + End Function + + Function DecodeString:String(EncStr:String) + Local Pos:Int = 0 + Local HexVal:String + Local Result:String + + While Pos<Len(EncStr) + If EncStr[Pos..Pos+1] = "%" Then + HexVal = EncStr[Pos+1..Pos+3] + Result:+Chr(HexToInt(HexVal)) + Pos:+3 + ElseIf EncStr[Pos..Pos+1] = "+" Then + Result:+" " + Pos:+1 + Else + Result:+EncStr[Pos..Pos + 1] + Pos:+1 + EndIf + Wend + + Return Result + End Function + + Function HexToInt:Int( HexStr:String ) + If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr + Return Int(HexStr) + End Function + + Function IntToHexString:String(val:Int, chars:Int = 2) + Local Result:String = Hex(val) + Return result[result.length-chars..] + End Function +End Type
Htbaa/rackspacecloudfiles.mod
ee9324b44ff0819fac8acc862e0ce1cb8b0dd45f
Critical bugfix in creating the upload URL for TRackspaceCloudFileObject
diff --git a/object.bmx b/object.bmx index 562b84b..8158f2e 100644 --- a/object.bmx +++ b/object.bmx @@ -1,195 +1,199 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container - Local urlDirname:String = ExtractDir(Self._name) - Local urlFilename:String = EncodeString(StripDir(Self._name), False, False) - If urlDirname.Length > 0 Then urlDirname:+"/" + Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + Local parts:String[] = ExtractDir(Self._name).Split("/") + For Local part:String = EachIn parts + If part.Length = 0 Then Continue + Self._url:+EncodeString(part, False, False) + "/" + Next - Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + urlDirname + urlFilename + Self._url:+EncodeString(StripDir(Self._name), False, False) + Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse() Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Select Self._rackspace._Transport(Self._url, Null) Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse() If Self._etag <> MD5(Self._rackspace._content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return Self._rackspace._content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(stream) stream.Seek(0) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) Case 201 'Object created Self._SetAttributesFromResponse() Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse() Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) End Method End Type
Htbaa/rackspacecloudfiles.mod
baa0682b1ff5a503a090c41e9c1f6b69fd992971
It's now possible to set a progressCallback to keep track of a upload or download
diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 747e903..57cf21b 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,333 +1,351 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" ModuleInfo "Version: 1.02" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Special thanks to: Bruce A Henderson, Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import bah.libcurlssl Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _headers:TMap Field _content:String + + Field _progressCallback:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double) + Field _progressData:Object Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Method New() ?Threaded DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." ? End Method Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Select Self._Transport("https://api.mosso.com/auth", headers) Case 204 Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) Select Self._Transport(Self._storageUrl + qs) Case 200 Local containerList:TList = New TList Local containerNames:String[] = Self._content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Select Self._Transport(Self._storageUrl, Null, "HEAD") Case 204 Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method + Rem + bbdoc: Set a progress callback function to use when uploading or downloading data + about: This is passed to cURL with setProgressCallback(). See bah.libcurlssl for more information + End Rem + Method SetProgressCallback(progressFunction:Int(data:Object, dltotal:Double, dlnow:Double, ultotal:Double, ulnow:Double), progressObject:Object = Null) + Self._progressCallback = progressFunction + Self._progressData = progressObject + End Method + ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Self._headers.Clear() - + Local curl:TCurlEasy = TCurlEasy.Create() curl.setWriteString() curl.setOptInt(CURLOPT_VERBOSE, 0) curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) curl.setOptString(CURLOPT_URL, url) +', + 'Set progress callback if set + If Self._progressCallback <> Null + curl.setProgressCallback(Self._progressCallback, Self._progressData) + End If + 'Use certificate bundle if set If TRackspaceCloudFiles.CAInfo curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) 'Otherwise don't check if SSL certificate is valid Else curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) End If 'Pass content If userData Select requestMethod Case "POST" curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) Case "PUT" curl.setOptInt(CURLOPT_UPLOAD, True) Local stream:TStream = TStream(userData) curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) curl.setReadStream(stream) End Select End If Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next curl.httpHeader(headerArray) curl.setHeaderCallback(Self.HeaderCallback, Self) Local res:Int = curl.perform() If TStream(userData) TStream(userData).Close() End If Local errorMessage:String If res Then errorMessage = CurlError(res) End If Local info:TCurlInfo = curl.getInfo() Local responseCode:Int = info.responseCode() curl.freeLists() curl.cleanup() Self._content = curl.toString() 'Throw exception if an error with cURL occured If errorMessage <> Null Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) End If Return responseCode End Method Rem bbdoc: Callback for cURL to catch headers End Rem Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) Local str:String = String.FromCString(buffer) Local parts:String[] = str.Split(":") If parts.Length >= 2 TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) End If Return size End Function Rem bbdoc: Create a query string from the given values about: Expects an array with strings. Each entry should be something like var=value End Rem Function CreateQueryString:String(params:String[]) Local qs:String = "&".Join(params) If qs.Length > 0 Return "?" + qs End If Return Null End Function End Type 'Code below taken from the public domain 'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 'Original author is Perturbatio/Kris Kelly Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" Local s:Int Local result:String For s = 0 To value.length - 1 If ReservedChars.Find(value[s..s + 1]) > -1 Then result:+ "%"+ IntToHexString(Asc(value[s..s + 1])) Continue ElseIf value[s..s+1] = " " Then If UsePlusForSpace Then result:+"+" Else result:+"%20" Continue ElseIf EncodeUnreserved Then result:+ "%" + IntToHexString(Asc(value[s..s + 1])) Continue EndIf result:+ value[s..s + 1] Next Return result End Function Function DecodeString:String(EncStr:String) Local Pos:Int = 0 Local HexVal:String Local Result:String While Pos<Len(EncStr) If EncStr[Pos..Pos+1] = "%" Then HexVal = EncStr[Pos+1..Pos+3] Result:+Chr(HexToInt(HexVal)) Pos:+3 ElseIf EncStr[Pos..Pos+1] = "+" Then Result:+" " Pos:+1 Else Result:+EncStr[Pos..Pos + 1] Pos:+1 EndIf Wend Return Result End Function Function HexToInt:Int( HexStr:String ) If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr Return Int(HexStr) End Function Function IntToHexString:String(val:Int, chars:Int = 2) Local Result:String = Hex(val) Return result[result.length-chars..] End Function
Htbaa/rackspacecloudfiles.mod
68fdad8d7daf7c308f6fb4ce96fcd6030911ae75
bah.crypto version 1.02 or higher is now required since it supports generating the MD5 hash for a TStream
diff --git a/README b/README index dc035b2..69555e2 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ This module allows you to interact with your account for Rackspacecloud Files. This module requires the following external modules: * bah.libcurlssl - * bah.crypto + * bah.crypto (>=1.02) (Both BaH modules can be found at http://code.google.com/p/maxmods/) Collaborators are more then wanted to help with the Mac OSX and Linux version of the module. diff --git a/object.bmx b/object.bmx index fbe1d2b..562b84b 100644 --- a/object.bmx +++ b/object.bmx @@ -1,194 +1,195 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container Local urlDirname:String = ExtractDir(Self._name) Local urlFilename:String = EncodeString(StripDir(Self._name), False, False) If urlDirname.Length > 0 Then urlDirname:+"/" Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + urlDirname + urlFilename Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse() Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Select Self._rackspace._Transport(Self._url, Null) Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse() If Self._etag <> MD5(Self._rackspace._content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return Self._rackspace._content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) - Local md5Hex:String = MD5(LoadText(filename)) + Local md5Hex:String = MD5(stream) + stream.Seek(0) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) Case 201 'Object created Self._SetAttributesFromResponse() Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse() Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 1966ddb..747e903 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,333 +1,333 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.01" +ModuleInfo "Version: 1.02" ModuleInfo "Author: Christiaan Kras" -ModuleInfo "Special thanks to: Kris Kelly" +ModuleInfo "Special thanks to: Bruce A Henderson, Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import bah.libcurlssl Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _headers:TMap Field _content:String Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Method New() ?Threaded DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." ? End Method Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Select Self._Transport("https://api.mosso.com/auth", headers) Case 204 Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) Select Self._Transport(Self._storageUrl + qs) Case 200 Local containerList:TList = New TList Local containerNames:String[] = Self._content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Select Self._Transport(Self._storageUrl, Null, "HEAD") Case 204 Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Self._headers.Clear() Local curl:TCurlEasy = TCurlEasy.Create() curl.setWriteString() curl.setOptInt(CURLOPT_VERBOSE, 0) curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) curl.setOptString(CURLOPT_URL, url) 'Use certificate bundle if set If TRackspaceCloudFiles.CAInfo curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) 'Otherwise don't check if SSL certificate is valid Else curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) End If 'Pass content If userData Select requestMethod Case "POST" curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) Case "PUT" curl.setOptInt(CURLOPT_UPLOAD, True) Local stream:TStream = TStream(userData) curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) curl.setReadStream(stream) End Select End If Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next curl.httpHeader(headerArray) curl.setHeaderCallback(Self.HeaderCallback, Self) Local res:Int = curl.perform() If TStream(userData) TStream(userData).Close() End If Local errorMessage:String If res Then errorMessage = CurlError(res) End If Local info:TCurlInfo = curl.getInfo() Local responseCode:Int = info.responseCode() curl.freeLists() curl.cleanup() Self._content = curl.toString() 'Throw exception if an error with cURL occured If errorMessage <> Null Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) End If Return responseCode End Method Rem bbdoc: Callback for cURL to catch headers End Rem Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) Local str:String = String.FromCString(buffer) Local parts:String[] = str.Split(":") If parts.Length >= 2 TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) End If Return size End Function Rem bbdoc: Create a query string from the given values about: Expects an array with strings. Each entry should be something like var=value End Rem Function CreateQueryString:String(params:String[]) Local qs:String = "&".Join(params) If qs.Length > 0 Return "?" + qs End If Return Null End Function End Type 'Code below taken from the public domain 'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 'Original author is Perturbatio/Kris Kelly Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" Local s:Int Local result:String For s = 0 To value.length - 1 If ReservedChars.Find(value[s..s + 1]) > -1 Then result:+ "%"+ IntToHexString(Asc(value[s..s + 1])) Continue ElseIf value[s..s+1] = " " Then If UsePlusForSpace Then result:+"+" Else result:+"%20" Continue ElseIf EncodeUnreserved Then result:+ "%" + IntToHexString(Asc(value[s..s + 1])) Continue EndIf result:+ value[s..s + 1] Next Return result End Function Function DecodeString:String(EncStr:String) Local Pos:Int = 0 Local HexVal:String Local Result:String While Pos<Len(EncStr) If EncStr[Pos..Pos+1] = "%" Then HexVal = EncStr[Pos+1..Pos+3] Result:+Chr(HexToInt(HexVal)) Pos:+3 ElseIf EncStr[Pos..Pos+1] = "+" Then Result:+" " Pos:+1 Else Result:+EncStr[Pos..Pos + 1] Pos:+1 EndIf Wend Return Result End Function Function HexToInt:Int( HexStr:String ) If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr Return Int(HexStr) End Function Function IntToHexString:String(val:Int, chars:Int = 2) Local Result:String = Hex(val) Return result[result.length-chars..] End Function
Htbaa/rackspacecloudfiles.mod
2c75efc78f92f5a5796dba2b8403a5341d8ea7b1
Documentation update
diff --git a/doc/commands.html b/doc/commands.html index 5e5e0be..dbeae9c 100644 --- a/doc/commands.html +++ b/doc/commands.html @@ -1,312 +1,313 @@ <html><head><title>htbaapub.rackspacecloudfiles reference</title> <link rel=stylesheet Type=text/css href='../../../../doc/bmxstyle.css'> </head><body> <table width=100% cellspacing=0><tr align=center><td class=small>&nbsp;</td> <td class=small width=1%><b>htbaapub.rackspacecloudfiles:</b></td> <td class=small width=1%><a href=#types class=small>Types</a></td> <td class=small width=1%><a href=#modinfo class=small>Modinfo</a></td> <td class=small width=1%><a href='../../../../mod/htbaapub.mod/rackspacecloudfiles.mod/rackspacecloudfiles.bmx' class=small>Source</a></td> <td class=small>&nbsp;</td></tr></table> <h1>htbaapub.rackspacecloudfiles</h1> <h1>Rackspace CloudFiles</h1> <p>This module allows you to interact with your account for Rackspace Cloud Files. Cloud Files is a webservice that allows you to store content online in the cloud.</p> <p> <h2>Examples</h2> <p>Please take a look at one of the examples below.</p> <ul> <li><a href="../examples/example1.bmx">example1.bmx</a></li> </ul> <h2><a name=types></a>Types Summary</h2><table class=doc width=100%> <tr><td class=docleft width=1%><a href=#TRackspaceCloudBaseException>TRackspaceCloudBaseException</a></td><td class=docright> Exception for TRackspaceCloudFiles. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObject>TRackspaceCloudFileObject</a></td><td class=docright> This type represents an object in Cloud Files. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObjectException>TRackspaceCloudFileObjectException</a></td><td class=docright> Exception for TRackspaceCloudFileObject. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFiles>TRackspaceCloudFiles</a></td><td class=docright> Interface to Rackspace CloudFiles service. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainer>TRackspaceCloudFilesContainer</a></td><td class=docright> This type represents a container in Cloud Files. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainerException>TRackspaceCloudFilesContainerException</a></td><td class=docright> Exception for TRackspaceCloudFilesContainer. </td></tr> <tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesException>TRackspaceCloudFilesException</a></td><td class=docright> Exception for TRackspaceCloudFiles. </td></tr> </table> <h2 id=typesdet>Types </h2> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudBaseException> <tr><td class=doctop colspan=2>Type TRackspaceCloudBaseException Abstract</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudBaseException_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#SetMessage>SetMessage</a></td><td class=docright> Sets message. </td></tr> <tr><td class=docleft width=1%><a href=#ToString>ToString</a></td><td class=docright> Return message. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=SetMessage> <tr><td class=doctop colspan=2>Method SetMessage:TRackspaceCloudBaseException(message:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Sets message.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ToString> <tr><td class=doctop colspan=2>Method ToString:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return message.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObject> <tr><td class=doctop colspan=2>Type TRackspaceCloudFileObject</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This type represents an object in Cloud Files.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#ContentType>ContentType</a></td><td class=docright> Return the content type of an object. </td></tr> <tr><td class=docleft width=1%><a href=#ETag>ETag</a></td><td class=docright> Returns the entity tag of the object, which is its MD5. </td></tr> <tr><td class=docleft width=1%><a href=#Get>Get</a></td><td class=docright> Fetches the metadata and content of an object. </td></tr> <tr><td class=docleft width=1%><a href=#GetFile>GetFile</a></td><td class=docright> Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> </td></tr> <tr><td class=docleft width=1%><a href=#Head>Head</a></td><td class=docright> Fetches the metadata of the object. </td></tr> <tr><td class=docleft width=1%><a href=#LastModified>LastModified</a></td><td class=docright> Return the last modified time of an object. </td></tr> <tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> Returns the name of the object. </td></tr> <tr><td class=docleft width=1%><a href=#PutFile>PutFile</a></td><td class=docright> Creates a new object with the contents of a local file. </td></tr> <tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> Deletes an object. </td></tr> <tr><td class=docleft width=1%><a href=#Size>Size</a></td><td class=docright> Return the size of an object in bytes. </td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_functions></a>Functions Summary</th></tr> <tr><td class=docleft width=1%><a href=#ContentTypeOf>ContentTypeOf</a></td><td class=docright> Return content-type of a file. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=ContentType> <tr><td class=doctop colspan=2>Method ContentType:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the content type of an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ETag> <tr><td class=doctop colspan=2>Method ETag:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the entity tag of the object, which is its MD5.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Get> <tr><td class=doctop colspan=2>Method Get:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata and content of an object.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Returns data content.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=GetFile> <tr><td class=doctop colspan=2>Method GetFile:String(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike></td></tr> </table> <table class=doc width=100% cellspacing=3 id=Head> <tr><td class=doctop colspan=2>Method Head()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata of the object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=LastModified> <tr><td class=doctop colspan=2>Method LastModified:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the last modified time of an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Name> <tr><td class=doctop colspan=2>Method Name:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=PutFile> <tr><td class=doctop colspan=2>Method PutFile(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Creates a new object with the contents of a local file.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Remember that the max. filesize supported by Cloud Files is 5Gb.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Remove> <tr><td class=doctop colspan=2>Method Remove()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Deletes an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Size> <tr><td class=doctop colspan=2>Method Size:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return the size of an object in bytes.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ContentTypeOf> <tr><td class=doctop colspan=2>Function ContentTypeOf:String(filename:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Return content-type of a file.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObjectException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFileObject.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFiles> <tr><td class=doctop colspan=2>Type TRackspaceCloudFiles</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Interface to Rackspace CloudFiles service.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Please note that TRackspaceCloudFiles is not thread safe (yet)</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_globals></a>Globals Summary</th></tr><tr><td colspan=2> <a href=#CAInfo>CAInfo</a> </td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#Authenticate>Authenticate</a></td><td class=docright> Authenticate with the webservice. </td></tr> <tr><td class=docleft width=1%><a href=#Container>Container</a></td><td class=docright> Use an existing container. </td></tr> <tr><td class=docleft width=1%><a href=#Containers>Containers</a></td><td class=docright> List all the containers. </td></tr> <tr><td class=docleft width=1%><a href=#Create>Create</a></td><td class=docright> Creates a TRackspaceCloudFiles object. </td></tr> <tr><td class=docleft width=1%><a href=#CreateContainer>CreateContainer</a></td><td class=docright> Create a new container. </td></tr> <tr><td class=docleft width=1%><a href=#TotalBytesUsed>TotalBytesUsed</a></td><td class=docright> Returns the total amount of bytes used in your Cloud Files account. </td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_functions></a>Functions Summary</th></tr> <tr><td class=docleft width=1%><a href=#CreateQueryString>CreateQueryString</a></td><td class=docright> Create a query string from the given values. </td></tr> <tr><td class=docleft width=1%><a href=#HeaderCallback>HeaderCallback</a></td><td class=docright> Callback for cURL to catch headers. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=CAInfo> <tr><td class=doctop colspan=2>Global CAInfo:String</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate()</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Authenticate> <tr><td class=doctop colspan=2>Method Authenticate()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Authenticate with the webservice.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Container> <tr><td class=doctop colspan=2>Method Container:TRackspaceCloudFilesContainer(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Use an existing container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Containers> <tr><td class=doctop colspan=2>Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>List all the containers.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix if you want to filter out the containers not beginning with the prefix.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Create> <tr><td class=doctop colspan=2>Method Create:TRackspaceCloudFiles(user:String, key:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Creates a TRackspaceCloudFiles object.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>This method calls Authenticate()</td></tr> </table> <table class=doc width=100% cellspacing=3 id=CreateContainer> <tr><td class=doctop colspan=2>Method CreateContainer:TRackspaceCloudFilesContainer(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Create a new container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=TotalBytesUsed> <tr><td class=doctop colspan=2>Method TotalBytesUsed:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total amount of bytes used in your Cloud Files account.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=CreateQueryString> <tr><td class=doctop colspan=2>Function CreateQueryString:String(params:String[])</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Create a query string from the given values.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Expects an array with strings. Each entry should be something like var=value.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=HeaderCallback> <tr><td class=doctop colspan=2>Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Callback for cURL to catch headers.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainer> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainer</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This type represents a container in Cloud Files.</td></tr> </table> <table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFilesContainer_methods></a>Methods Summary</th></tr> <tr><td class=docleft width=1%><a href=#BytesUsed>BytesUsed</a></td><td class=docright> Returns the total number of bytes used by objects in the container. </td></tr> <tr><td class=docleft width=1%><a href=#FileObject>FileObject</a></td><td class=docright> This returns an object. </td></tr> <tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> Returns the name of the container. </td></tr> <tr><td class=docleft width=1%><a href=#ObjectCount>ObjectCount</a></td><td class=docright> Returns the total number of objects in the container. </td></tr> <tr><td class=docleft width=1%><a href=#Objects>Objects</a></td><td class=docright> Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix. </td></tr> <tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> Deletes the container, which should be empty. </td></tr> </table> <table class=doc width=100% cellspacing=3 id=BytesUsed> <tr><td class=doctop colspan=2>Method BytesUsed:Long()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of bytes used by objects in the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=FileObject> <tr><td class=doctop colspan=2>Method FileObject:TRackspaceCloudFileObject(name:String)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>This returns an object.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Name> <tr><td class=doctop colspan=2>Method Name:String()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=ObjectCount> <tr><td class=doctop colspan=2>Method ObjectCount:Int()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of objects in the container.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Objects> <tr><td class=doctop colspan=2>Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix.</td></tr> <tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix to retrieve only the objects beginning with that name.</td></tr> </table> <table class=doc width=100% cellspacing=3 id=Remove> <tr><td class=doctop colspan=2>Method Remove()</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Deletes the container, which should be empty.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainerException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFilesContainer.</td></tr> </table> <br> <table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesException> <tr><td class=doctop colspan=2>Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException</td></tr> <tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> </table> <br> <h2 id=modinfo>Module Information</h2> <table width=100%> <tr><th width=1%>Name</th><td>htbaapub.rackspacecloudfiles</td></tr> -<tr><th width=1%>Version</th><td>1.00</td></tr> +<tr><th width=1%>Version</th><td>1.01</td></tr> <tr><th width=1%>Author</th><td>Christiaan Kras</td></tr> +<tr><th width=1%>Special thanks to</th><td>Kris Kelly</td></tr> <tr><th width=1%>Git repository</th><td><a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a></td></tr> <tr><th width=1%>Rackspace Cloud Files</th><td><a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a></td></tr> </body></html>
Htbaa/rackspacecloudfiles.mod
224864d2f8381da31ea5bd01d57f40efcff59913
The query string in TRackspaceCloudFilesContainer.Objects() is now URL Encoded
diff --git a/container.bmx b/container.bmx index 8076783..18ea5af 100644 --- a/container.bmx +++ b/container.bmx @@ -1,118 +1,118 @@ Rem bbdoc: This type represents a container in Cloud Files about: End Rem Type TRackspaceCloudFilesContainer Field _name:String Field _rackspace:TRackspaceCloudFiles Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) Self._name = name Self._rackspace = rackspace Self._url = rackspace._storageUrl + "/" + name Return Self End Method Rem bbdoc: Returns the name of the container about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Returns the total number of objects in the container about: End Rem Method ObjectCount:Int() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 204 Return String(Self._rackspace._headers.ValueForKey("X-Container-Object-Count")).ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns the total number of bytes used by objects in the container about: End Rem Method BytesUsed:Long() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 204 Return String(Self._rackspace._headers.ValueForKey("X-Container-Bytes-Used")).ToInt() Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select Return 0 End Method Rem bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix about: Set prefix to retrieve only the objects beginning with that name End Rem Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + prefix, "marker=" + marker]) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) Select Self._rackspace._Transport(Self._url + qs, Null, "GET") Case 200 Local objectsList:TList = New TList If Self._rackspace._content.Length = 0 Return objectsList End If Local objects:String[] = Self._rackspace._content.Trim().Split("~n") For Local objectName:String = EachIn objects If objectName.Length = 0 Then Continue objectsList.AddLast(Self.FileObject(objectName)) Next 'Check if there are more objects If objectsList.Count() = limit Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) Local more:TList = Self.Objects(prefix, limit, lastObject._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFileObject = EachIn more objectsList.AddLast(c) Next End If End If Return objectsList Case 204 Return New TList Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: This returns an object about: End Rem Method FileObject:TRackspaceCloudFileObject(name:String) Return New TRackspaceCloudFileObject.Create(Self, name) End Method Rem bbdoc: Deletes the container, which should be empty about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 204 'OK Case 409 Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") Default Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") End Select End Method End Type
Htbaa/rackspacecloudfiles.mod
8e0b5f3de883ca193c38acc08f7178fcc4eb703c
The query string in TRackspaceCloudFiles.Containers() is now URL Encoded
diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 0b15f02..1966ddb 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,333 +1,333 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" ModuleInfo "Version: 1.01" ModuleInfo "Author: Christiaan Kras" ModuleInfo "Special thanks to: Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import bah.libcurlssl Import brl.linkedlist Import brl.map Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _headers:TMap Field _content:String Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Method New() ?Threaded DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." ? End Method Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Select Self._Transport("https://api.mosso.com/auth", headers) Case 204 Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) - Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + prefix, "marker=" + marker]) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + EncodeString(prefix, False, True), "marker=" + EncodeString(marker, False, True)]) Select Self._Transport(Self._storageUrl + qs) Case 200 Local containerList:TList = New TList Local containerNames:String[] = Self._content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Select Self._Transport(Self._storageUrl, Null, "HEAD") Case 204 Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Self._headers.Clear() Local curl:TCurlEasy = TCurlEasy.Create() curl.setWriteString() curl.setOptInt(CURLOPT_VERBOSE, 0) curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) curl.setOptString(CURLOPT_URL, url) 'Use certificate bundle if set If TRackspaceCloudFiles.CAInfo curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) 'Otherwise don't check if SSL certificate is valid Else curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) End If 'Pass content If userData Select requestMethod Case "POST" curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) Case "PUT" curl.setOptInt(CURLOPT_UPLOAD, True) Local stream:TStream = TStream(userData) curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) curl.setReadStream(stream) End Select End If Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next curl.httpHeader(headerArray) curl.setHeaderCallback(Self.HeaderCallback, Self) Local res:Int = curl.perform() If TStream(userData) TStream(userData).Close() End If Local errorMessage:String If res Then errorMessage = CurlError(res) End If Local info:TCurlInfo = curl.getInfo() Local responseCode:Int = info.responseCode() curl.freeLists() curl.cleanup() Self._content = curl.toString() 'Throw exception if an error with cURL occured If errorMessage <> Null Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) End If Return responseCode End Method Rem bbdoc: Callback for cURL to catch headers End Rem Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) Local str:String = String.FromCString(buffer) Local parts:String[] = str.Split(":") If parts.Length >= 2 TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) End If Return size End Function Rem bbdoc: Create a query string from the given values about: Expects an array with strings. Each entry should be something like var=value End Rem Function CreateQueryString:String(params:String[]) Local qs:String = "&".Join(params) If qs.Length > 0 Return "?" + qs End If Return Null End Function End Type 'Code below taken from the public domain 'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 'Original author is Perturbatio/Kris Kelly Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" Local s:Int Local result:String For s = 0 To value.length - 1 If ReservedChars.Find(value[s..s + 1]) > -1 Then result:+ "%"+ IntToHexString(Asc(value[s..s + 1])) Continue ElseIf value[s..s+1] = " " Then If UsePlusForSpace Then result:+"+" Else result:+"%20" Continue ElseIf EncodeUnreserved Then result:+ "%" + IntToHexString(Asc(value[s..s + 1])) Continue EndIf result:+ value[s..s + 1] Next Return result End Function Function DecodeString:String(EncStr:String) Local Pos:Int = 0 Local HexVal:String Local Result:String While Pos<Len(EncStr) If EncStr[Pos..Pos+1] = "%" Then HexVal = EncStr[Pos+1..Pos+3] Result:+Chr(HexToInt(HexVal)) Pos:+3 ElseIf EncStr[Pos..Pos+1] = "+" Then Result:+" " Pos:+1 Else Result:+EncStr[Pos..Pos + 1] Pos:+1 EndIf Wend Return Result End Function Function HexToInt:Int( HexStr:String ) If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr Return Int(HexStr) End Function Function IntToHexString:String(val:Int, chars:Int = 2) Local Result:String = Hex(val) Return result[result.length-chars..] End Function
Htbaa/rackspacecloudfiles.mod
447a1def8c6b70c0fa6bf0b3b9afff5d0d5bce49
Object filenames are now URL Encoded
diff --git a/object.bmx b/object.bmx index 996a1c3..fbe1d2b 100644 --- a/object.bmx +++ b/object.bmx @@ -1,189 +1,194 @@ Rem bbdoc: This type represents an object in Cloud Files info: End Rem Type TRackspaceCloudFileObject Field _name:String Field _contentType:String Field _etag:String Field _size:Long Field _lastModified:String Field _rackspace:TRackspaceCloudFiles Field _container:TRackspaceCloudFilesContainer Field _url:String ' Rem ' bbdoc: ' about: ' End Rem Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) Self._name = name Self._rackspace = container._rackspace Self._container = container - Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + name + + Local urlDirname:String = ExtractDir(Self._name) + Local urlFilename:String = EncodeString(StripDir(Self._name), False, False) + If urlDirname.Length > 0 Then urlDirname:+"/" + + Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + urlDirname + urlFilename Return Self End Method Rem bbdoc: Returns the name of the object about: End Rem Method Name:String() Return Self._name End Method Rem bbdoc: Fetches the metadata of the object about: End Rem Method Head() Select Self._rackspace._Transport(Self._url, Null, "HEAD") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 Self._SetAttributesFromResponse() Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Fetches the metadata and content of an object about: Returns data content End Rem Method Get:String() Select Self._rackspace._Transport(Self._url, Null) Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 200 Self._SetAttributesFromResponse() If Self._etag <> MD5(Self._rackspace._content).ToLower() Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") End If Return Self._rackspace._content Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> about: End Rem Method GetFile:String(filename:String) SaveText(Self.Get(), filename) Return filename End Method Rem bbdoc: Deletes an object about: End Rem Method Remove() Select Self._rackspace._Transport(Self._url, Null, "DELETE") Case 404 Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") Case 204 'OK Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Creates a new object with the contents of a local file about: Remember that the max. filesize supported by Cloud Files is 5Gb End Rem Method PutFile(filename:String) Local stream:TStream = ReadStream(filename) Local md5Hex:String = MD5(LoadText(filename)) Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) Case 201 'Object created Self._SetAttributesFromResponse() Case 412 Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") Case 422 Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") Default Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") End Select End Method Rem bbdoc: Return content-type of a file about: Decision is based on the file extension. Which is not a safe method and the list of content types and extensions is far from complete. If no matching content type is being found it'll return application/octet-stream.<br> <br> The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. This file is IncBinned during compilation of the module. End Rem Function ContentTypeOf:String(filename:String) Global mapping:TMap = New TMap If mapping.IsEmpty() Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") For Local line:String = EachIn strMapping Local parts:String[] = line.Split(":") Local contentType:String = parts[0] Local exts:String[] = parts[1].Split(",") For Local ext:String = EachIn exts mapping.Insert(ext, contentType.ToLower()) Next Next End If Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) If Not contentType contentType = "application/octet-stream" End If Return contentType End Function Rem bbdoc: Returns the entity tag of the object, which is its MD5 about: End Rem Method ETag:String() Return Self._etag End Method Rem bbdoc: Return the size of an object in bytes about: End Rem Method Size:Long() Return Self._size End Method Rem bbdoc: Return the content type of an object about: End Rem Method ContentType:String() Return Self._contentType End Method Rem bbdoc: Return the last modified time of an object about: End Rem Method LastModified:String() Return Self._lastModified End Method ' Rem ' bbdoc: Private method ' End Rem Method _SetAttributesFromResponse() Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) End Method End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx index 840b1b4..0b15f02 100644 --- a/rackspacecloudfiles.bmx +++ b/rackspacecloudfiles.bmx @@ -1,271 +1,333 @@ SuperStrict Rem bbdoc: htbaapub.rackspacecloudfiles EndRem Module htbaapub.rackspacecloudfiles ModuleInfo "Name: htbaapub.rackspacecloudfiles" -ModuleInfo "Version: 1.00" +ModuleInfo "Version: 1.01" ModuleInfo "Author: Christiaan Kras" +ModuleInfo "Special thanks to: Kris Kelly" ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" Import bah.crypto Import bah.libcurlssl Import brl.linkedlist Import brl.map +Import brl.retro Import brl.standardio Import brl.stream Import brl.system Include "exceptions.bmx" Include "container.bmx" Include "object.bmx" Incbin "content-types.txt" Rem bbdoc: Interface to Rackspace CloudFiles service about: Please note that TRackspaceCloudFiles is not thread safe (yet) End Rem Type TRackspaceCloudFiles Field _authUser:String Field _authKey:String Field _storageToken:String Field _storageUrl:String Field _cdnManagementUrl:String Field _authToken:String ' Field _authTokenExpires:Int Field _headers:TMap Field _content:String Rem bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() End Rem Global CAInfo:String Method New() ?Threaded DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." ? End Method Rem bbdoc: Creates a TRackspaceCloudFiles object about: This method calls Authenticate() End Rem Method Create:TRackspaceCloudFiles(user:String, key:String) Self._headers = New TMap Self._authUser = user Self._authKey = key Self.Authenticate() Return Self End Method Rem bbdoc: Authenticate with the webservice End Rem Method Authenticate() Local headers:String[2] headers[0] = "X-Auth-User: " + Self._authUser headers[1] = "X-Auth-Key: " + Self._authKey Select Self._Transport("https://api.mosso.com/auth", headers) Case 204 Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) Case 401 Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: List all the containers about: Set prefix if you want to filter out the containers not beginning with the prefix End Rem Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + prefix, "marker=" + marker]) Select Self._Transport(Self._storageUrl + qs) Case 200 Local containerList:TList = New TList Local containerNames:String[] = Self._content.Split("~n") For Local containerName:String = EachIn containerNames If containerName.Length = 0 Then Continue containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) Next 'Check if there are more containers If containerList.Count() = limit Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) Local more:TList = Self.Containers(prefix, limit, lastContainer._name) 'If the list has items then add them to the mainlist If more.Count() > 0 For Local c:TRackspaceCloudFilesContainer = EachIn more containerList.AddLast(c) Next End If End If Return containerList Case 204 Return New TList Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return Null End Method Rem bbdoc: Create a new container about: End Rem Method CreateContainer:TRackspaceCloudFilesContainer(name:String) Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") Case 201 'Created Return Self.Container(name) Case 202 'Already exists Return Self.Container(name) Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select End Method Rem bbdoc: Use an existing container about: End Rem Method Container:TRackspaceCloudFilesContainer(name:String) Return New TRackspaceCloudFilesContainer.Create(Self, name) End Method Rem bbdoc: Returns the total amount of bytes used in your Cloud Files account about: End Rem Method TotalBytesUsed:Long() Select Self._Transport(Self._storageUrl, Null, "HEAD") Case 204 Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() Default Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") End Select Return 0 End Method ' Rem ' bbdoc: Private method ' about: Used to send requests. Sets header data and content data. Returns HTTP status code ' End Rem Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) Self._headers.Clear() Local curl:TCurlEasy = TCurlEasy.Create() curl.setWriteString() curl.setOptInt(CURLOPT_VERBOSE, 0) curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) curl.setOptString(CURLOPT_URL, url) 'Use certificate bundle if set If TRackspaceCloudFiles.CAInfo curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) 'Otherwise don't check if SSL certificate is valid Else curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) End If 'Pass content If userData Select requestMethod Case "POST" curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) Case "PUT" curl.setOptInt(CURLOPT_UPLOAD, True) Local stream:TStream = TStream(userData) curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) curl.setReadStream(stream) End Select End If Local headerList:TList = New TList If headers <> Null For Local str:String = EachIn headers headerList.AddLast(str) Next End If 'Pass auth-token if available If Self._authToken headerList.AddLast("X-Auth-Token:" + Self._authToken) End If Local headerArray:String[] = New String[headerList.Count()] For Local i:Int = 0 To headerArray.Length - 1 headerArray[i] = String(headerList.ValueAtIndex(i)) Next curl.httpHeader(headerArray) curl.setHeaderCallback(Self.HeaderCallback, Self) Local res:Int = curl.perform() If TStream(userData) TStream(userData).Close() End If Local errorMessage:String If res Then errorMessage = CurlError(res) End If Local info:TCurlInfo = curl.getInfo() Local responseCode:Int = info.responseCode() curl.freeLists() curl.cleanup() Self._content = curl.toString() 'Throw exception if an error with cURL occured If errorMessage <> Null Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) End If Return responseCode End Method Rem bbdoc: Callback for cURL to catch headers End Rem Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) Local str:String = String.FromCString(buffer) Local parts:String[] = str.Split(":") If parts.Length >= 2 TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) End If Return size End Function Rem bbdoc: Create a query string from the given values about: Expects an array with strings. Each entry should be something like var=value End Rem Function CreateQueryString:String(params:String[]) Local qs:String = "&".Join(params) If qs.Length > 0 Return "?" + qs End If Return Null End Function End Type + +'Code below taken from the public domain +'http://www.blitzmax.com/codearcs/codearcs.php?code=1581 +'Original author is Perturbatio/Kris Kelly + +Function EncodeString:String(value:String, EncodeUnreserved:Int = False, UsePlusForSpace:Int = True) + Local ReservedChars:String = "!*'();:@&=+$,/?%#[]~r~n" + Local s:Int + Local result:String + + For s = 0 To value.length - 1 + If ReservedChars.Find(value[s..s + 1]) > -1 Then + result:+ "%"+ IntToHexString(Asc(value[s..s + 1])) + Continue + ElseIf value[s..s+1] = " " Then + If UsePlusForSpace Then result:+"+" Else result:+"%20" + Continue + ElseIf EncodeUnreserved Then + result:+ "%" + IntToHexString(Asc(value[s..s + 1])) + Continue + EndIf + result:+ value[s..s + 1] + Next + + Return result +End Function + +Function DecodeString:String(EncStr:String) + Local Pos:Int = 0 + Local HexVal:String + Local Result:String + + While Pos<Len(EncStr) + If EncStr[Pos..Pos+1] = "%" Then + HexVal = EncStr[Pos+1..Pos+3] + Result:+Chr(HexToInt(HexVal)) + Pos:+3 + ElseIf EncStr[Pos..Pos+1] = "+" Then + Result:+" " + Pos:+1 + Else + Result:+EncStr[Pos..Pos + 1] + Pos:+1 + EndIf + Wend + + Return Result +End Function + + +Function HexToInt:Int( HexStr:String ) + If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr + Return Int(HexStr) +End Function + + +Function IntToHexString:String(val:Int, chars:Int = 2) + Local Result:String = Hex(val) + Return result[result.length-chars..] +End Function
Htbaa/rackspacecloudfiles.mod
2d978b0b1634a0f86e69be3e1599a59fdfe16526
Mosso changed its name to Rackspacecloud so the module has been completely renamed. Version 1.00 ready!
diff --git a/README b/README new file mode 100644 index 0000000..b0a132a --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +This module allows you to interact with your account for Mosso Cloud Files. +This module requires the following external modules: + + * bah.libcurlssl + * bah.crypto + + (Both BaH modules can be found at http://code.google.com/p/maxmods/) + +Collaborators are more then wanted to help with the Mac OSX and Linux version of the module. diff --git a/container.bmx b/container.bmx new file mode 100644 index 0000000..8076783 --- /dev/null +++ b/container.bmx @@ -0,0 +1,118 @@ +Rem + bbdoc: This type represents a container in Cloud Files + about: +End Rem +Type TRackspaceCloudFilesContainer + Field _name:String + Field _rackspace:TRackspaceCloudFiles + Field _url:String + +' Rem +' bbdoc: +' about: +' End Rem + Method Create:TRackspaceCloudFilesContainer(rackspace:TRackspaceCloudFiles, name:String) + Self._name = name + Self._rackspace = rackspace + Self._url = rackspace._storageUrl + "/" + name + Return Self + End Method + + Rem + bbdoc: Returns the name of the container + about: + End Rem + Method Name:String() + Return Self._name + End Method + + Rem + bbdoc: Returns the total number of objects in the container + about: + End Rem + Method ObjectCount:Int() + Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Case 204 + Return String(Self._rackspace._headers.ValueForKey("X-Container-Object-Count")).ToInt() + Default + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") + End Select + Return 0 + End Method + + Rem + bbdoc: Returns the total number of bytes used by objects in the container + about: + End Rem + Method BytesUsed:Long() + Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Case 204 + Return String(Self._rackspace._headers.ValueForKey("X-Container-Bytes-Used")).ToInt() + Default + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") + End Select + Return 0 + End Method + + Rem + bbdoc: Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix + about: Set prefix to retrieve only the objects beginning with that name + End Rem + Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + prefix, "marker=" + marker]) + Select Self._rackspace._Transport(Self._url + qs, Null, "GET") + Case 200 + Local objectsList:TList = New TList + If Self._rackspace._content.Length = 0 + Return objectsList + End If + + Local objects:String[] = Self._rackspace._content.Trim().Split("~n") + For Local objectName:String = EachIn objects + If objectName.Length = 0 Then Continue + objectsList.AddLast(Self.FileObject(objectName)) + Next + + 'Check if there are more objects + If objectsList.Count() = limit + Local lastObject:TRackspaceCloudFileObject = TRackspaceCloudFileObject(objectsList.Last()) + Local more:TList = Self.Objects(prefix, limit, lastObject._name) + 'If the list has items then add them to the mainlist + If more.Count() > 0 + For Local c:TRackspaceCloudFileObject = EachIn more + objectsList.AddLast(c) + Next + End If + End If + + Return objectsList + Case 204 + Return New TList + Default + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") + End Select + End Method + + Rem + bbdoc: This returns an object + about: + End Rem + Method FileObject:TRackspaceCloudFileObject(name:String) + Return New TRackspaceCloudFileObject.Create(Self, name) + End Method + + Rem + bbdoc: Deletes the container, which should be empty + about: + End Rem + Method Remove() + Select Self._rackspace._Transport(Self._url, Null, "DELETE") + Case 204 + 'OK + Case 409 + Throw New TRackspaceCloudFilesContainerException.SetMessage("Container not empty!") + Default + Throw New TRackspaceCloudFilesContainerException.SetMessage("Unable to handle response") + End Select + End Method +End Type diff --git a/content-types.txt b/content-types.txt new file mode 100644 index 0000000..e57a7df --- /dev/null +++ b/content-types.txt @@ -0,0 +1,40 @@ +audio/basic:au,snd +audio/x-aiff:aif,aiff,aifc +audio/x-mpeg:mpa,abs,mpega +audio/x-mpeg-2:mp2a,mpa2 +audio/x-wav:wav +application/pdf:pdf +application/mspowerpoint:ppz +application/postscript:ai,eps,ps +application/rtf:rtf +application/vnd.ms-powerpoint:ppt +image/cgm:cgm +image/fif:fif +image/g3fax:g3f +image/gif:gif +image/ief:ief +image/jpeg:jpg,jpeg,jpe +image/png:png +image/rgb:rgb +image/tiff:tiff,tif +image/wavelet:wi +image/x-cals:mil,cal +image/x-cmu-raster:ras +image/x-cmx:cmx +image/x-ms-bmp:bmp +image/x-photo-cd:pcd +image/x-pict:pict +image/x-mgx-dsf:dsf +image/x-xbitmap:xbm +image/x-xpixmap:xpm +image/x-xwindowdump:xwd +text/css:css +text/csv:csv +text/html:html,htm +text/plain:txt,c,h,cpp,cxx,bmx,pl,pm,cgi +text/xml:xml +video/mpeg:mpeg,mpg,mpe +video/mpeg-2:mpv2,mp2v +video/quicktime:qt,mov +video/x-msvideo:avi +video/x-sgi-movie:movice \ No newline at end of file diff --git a/doc/commands.html b/doc/commands.html new file mode 100644 index 0000000..5e5e0be --- /dev/null +++ b/doc/commands.html @@ -0,0 +1,312 @@ +<html><head><title>htbaapub.rackspacecloudfiles reference</title> +<link rel=stylesheet Type=text/css href='../../../../doc/bmxstyle.css'> +</head><body> +<table width=100% cellspacing=0><tr align=center><td class=small>&nbsp;</td> +<td class=small width=1%><b>htbaapub.rackspacecloudfiles:</b></td> +<td class=small width=1%><a href=#types class=small>Types</a></td> +<td class=small width=1%><a href=#modinfo class=small>Modinfo</a></td> +<td class=small width=1%><a href='../../../../mod/htbaapub.mod/rackspacecloudfiles.mod/rackspacecloudfiles.bmx' class=small>Source</a></td> +<td class=small>&nbsp;</td></tr></table> +<h1>htbaapub.rackspacecloudfiles</h1> +<h1>Rackspace CloudFiles</h1> +<p>This module allows you to interact with your account for Rackspace Cloud Files. Cloud Files is a webservice that allows you to store content online in the cloud.</p> +<p> + +<h2>Examples</h2> +<p>Please take a look at one of the examples below.</p> +<ul> + <li><a href="../examples/example1.bmx">example1.bmx</a></li> +</ul> +<h2><a name=types></a>Types Summary</h2><table class=doc width=100%> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudBaseException>TRackspaceCloudBaseException</a></td><td class=docright> +Exception for TRackspaceCloudFiles. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObject>TRackspaceCloudFileObject</a></td><td class=docright> +This type represents an object in Cloud Files. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFileObjectException>TRackspaceCloudFileObjectException</a></td><td class=docright> +Exception for TRackspaceCloudFileObject. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFiles>TRackspaceCloudFiles</a></td><td class=docright> +Interface to Rackspace CloudFiles service. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainer>TRackspaceCloudFilesContainer</a></td><td class=docright> +This type represents a container in Cloud Files. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesContainerException>TRackspaceCloudFilesContainerException</a></td><td class=docright> +Exception for TRackspaceCloudFilesContainer. +</td></tr> +<tr><td class=docleft width=1%><a href=#TRackspaceCloudFilesException>TRackspaceCloudFilesException</a></td><td class=docright> +Exception for TRackspaceCloudFiles. +</td></tr> +</table> +<h2 + id=typesdet>Types +</h2> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudBaseException> +<tr><td class=doctop colspan=2>Type TRackspaceCloudBaseException Abstract</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudBaseException_methods></a>Methods Summary</th></tr> +<tr><td class=docleft width=1%><a href=#SetMessage>SetMessage</a></td><td class=docright> +Sets message. +</td></tr> +<tr><td class=docleft width=1%><a href=#ToString>ToString</a></td><td class=docright> +Return message. +</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=SetMessage> +<tr><td class=doctop colspan=2>Method SetMessage:TRackspaceCloudBaseException(message:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Sets message.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=ToString> +<tr><td class=doctop colspan=2>Method ToString:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Return message.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObject> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFileObject</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>This type represents an object in Cloud Files.</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_methods></a>Methods Summary</th></tr> +<tr><td class=docleft width=1%><a href=#ContentType>ContentType</a></td><td class=docright> +Return the content type of an object. +</td></tr> +<tr><td class=docleft width=1%><a href=#ETag>ETag</a></td><td class=docright> +Returns the entity tag of the object, which is its MD5. +</td></tr> +<tr><td class=docleft width=1%><a href=#Get>Get</a></td><td class=docright> +Fetches the metadata and content of an object. +</td></tr> +<tr><td class=docleft width=1%><a href=#GetFile>GetFile</a></td><td class=docright> +Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> +</td></tr> +<tr><td class=docleft width=1%><a href=#Head>Head</a></td><td class=docright> +Fetches the metadata of the object. +</td></tr> +<tr><td class=docleft width=1%><a href=#LastModified>LastModified</a></td><td class=docright> +Return the last modified time of an object. +</td></tr> +<tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> +Returns the name of the object. +</td></tr> +<tr><td class=docleft width=1%><a href=#PutFile>PutFile</a></td><td class=docright> +Creates a new object with the contents of a local file. +</td></tr> +<tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> +Deletes an object. +</td></tr> +<tr><td class=docleft width=1%><a href=#Size>Size</a></td><td class=docright> +Return the size of an object in bytes. +</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFileObject_functions></a>Functions Summary</th></tr> +<tr><td class=docleft width=1%><a href=#ContentTypeOf>ContentTypeOf</a></td><td class=docright> +Return content-type of a file. +</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=ContentType> +<tr><td class=doctop colspan=2>Method ContentType:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Return the content type of an object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=ETag> +<tr><td class=doctop colspan=2>Method ETag:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the entity tag of the object, which is its MD5.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Get> +<tr><td class=doctop colspan=2>Method Get:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata and content of an object.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Returns data content.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=GetFile> +<tr><td class=doctop colspan=2>Method GetFile:String(filename:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike></td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Head> +<tr><td class=doctop colspan=2>Method Head()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Fetches the metadata of the object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=LastModified> +<tr><td class=doctop colspan=2>Method LastModified:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Return the last modified time of an object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Name> +<tr><td class=doctop colspan=2>Method Name:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=PutFile> +<tr><td class=doctop colspan=2>Method PutFile(filename:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Creates a new object with the contents of a local file.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Remember that the max. filesize supported by Cloud Files is 5Gb.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Remove> +<tr><td class=doctop colspan=2>Method Remove()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Deletes an object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Size> +<tr><td class=doctop colspan=2>Method Size:Long()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Return the size of an object in bytes.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=ContentTypeOf> +<tr><td class=doctop colspan=2>Function ContentTypeOf:String(filename:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Return content-type of a file.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Decision is based on the file extension. Which is not a safe method and the list +of content types and extensions is far from complete. If no matching content type is being +found it'll return application/octet-stream.<br> +<br> +The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. +This file is IncBinned during compilation of the module.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFileObjectException> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFileObject.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFiles> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFiles</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Interface to Rackspace CloudFiles service.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Please note that TRackspaceCloudFiles is not thread safe (yet)</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_globals></a>Globals Summary</th></tr><tr><td colspan=2> +<a href=#CAInfo>CAInfo</a> +</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_methods></a>Methods Summary</th></tr> +<tr><td class=docleft width=1%><a href=#Authenticate>Authenticate</a></td><td class=docright> +Authenticate with the webservice. +</td></tr> +<tr><td class=docleft width=1%><a href=#Container>Container</a></td><td class=docright> +Use an existing container. +</td></tr> +<tr><td class=docleft width=1%><a href=#Containers>Containers</a></td><td class=docright> +List all the containers. +</td></tr> +<tr><td class=docleft width=1%><a href=#Create>Create</a></td><td class=docright> +Creates a TRackspaceCloudFiles object. +</td></tr> +<tr><td class=docleft width=1%><a href=#CreateContainer>CreateContainer</a></td><td class=docright> +Create a new container. +</td></tr> +<tr><td class=docleft width=1%><a href=#TotalBytesUsed>TotalBytesUsed</a></td><td class=docright> +Returns the total amount of bytes used in your Cloud Files account. +</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFiles_functions></a>Functions Summary</th></tr> +<tr><td class=docleft width=1%><a href=#CreateQueryString>CreateQueryString</a></td><td class=docright> +Create a query string from the given values. +</td></tr> +<tr><td class=docleft width=1%><a href=#HeaderCallback>HeaderCallback</a></td><td class=docright> +Callback for cURL to catch headers. +</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=CAInfo> +<tr><td class=doctop colspan=2>Global CAInfo:String</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. +This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate()</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Authenticate> +<tr><td class=doctop colspan=2>Method Authenticate()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Authenticate with the webservice.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Container> +<tr><td class=doctop colspan=2>Method Container:TRackspaceCloudFilesContainer(name:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Use an existing container.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Containers> +<tr><td class=doctop colspan=2>Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>List all the containers.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix if you want to filter out the containers not beginning with the prefix.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Create> +<tr><td class=doctop colspan=2>Method Create:TRackspaceCloudFiles(user:String, key:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Creates a TRackspaceCloudFiles object.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>This method calls Authenticate()</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=CreateContainer> +<tr><td class=doctop colspan=2>Method CreateContainer:TRackspaceCloudFilesContainer(name:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Create a new container.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=TotalBytesUsed> +<tr><td class=doctop colspan=2>Method TotalBytesUsed:Long()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total amount of bytes used in your Cloud Files account.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=CreateQueryString> +<tr><td class=doctop colspan=2>Function CreateQueryString:String(params:String[])</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Create a query string from the given values.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Expects an array with strings. Each entry should be something like var=value.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=HeaderCallback> +<tr><td class=doctop colspan=2>Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Callback for cURL to catch headers.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainer> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainer</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>This type represents a container in Cloud Files.</td></tr> +</table> +<table class=doc width=90% align=center><tr ><th class=doctop colspan=2 align=left><a name=TRackspaceCloudFilesContainer_methods></a>Methods Summary</th></tr> +<tr><td class=docleft width=1%><a href=#BytesUsed>BytesUsed</a></td><td class=docright> +Returns the total number of bytes used by objects in the container. +</td></tr> +<tr><td class=docleft width=1%><a href=#FileObject>FileObject</a></td><td class=docright> +This returns an object. +</td></tr> +<tr><td class=docleft width=1%><a href=#Name>Name</a></td><td class=docright> +Returns the name of the container. +</td></tr> +<tr><td class=docleft width=1%><a href=#ObjectCount>ObjectCount</a></td><td class=docright> +Returns the total number of objects in the container. +</td></tr> +<tr><td class=docleft width=1%><a href=#Objects>Objects</a></td><td class=docright> +Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix. +</td></tr> +<tr><td class=docleft width=1%><a href=#Remove>Remove</a></td><td class=docright> +Deletes the container, which should be empty. +</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=BytesUsed> +<tr><td class=doctop colspan=2>Method BytesUsed:Long()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of bytes used by objects in the container.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=FileObject> +<tr><td class=doctop colspan=2>Method FileObject:TRackspaceCloudFileObject(name:String)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>This returns an object.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Name> +<tr><td class=doctop colspan=2>Method Name:String()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the name of the container.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=ObjectCount> +<tr><td class=doctop colspan=2>Method ObjectCount:Int()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns the total number of objects in the container.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Objects> +<tr><td class=doctop colspan=2>Method Objects:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null)</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Returns a list of objects in the container. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. You can also pass in a prefix.</td></tr> +<tr><td class=docleft width=1%>Information</td><td class=docright>Set prefix to retrieve only the objects beginning with that name.</td></tr> +</table> +<table class=doc width=100% cellspacing=3 id=Remove> +<tr><td class=doctop colspan=2>Method Remove()</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Deletes the container, which should be empty.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesContainerException> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFilesContainer.</td></tr> +</table> +<br> +<table class=doc width=100% cellspacing=3 id=TRackspaceCloudFilesException> +<tr><td class=doctop colspan=2>Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException</td></tr> +<tr><td class=docleft width=1%>Description</td><td class=docright>Exception for TRackspaceCloudFiles.</td></tr> +</table> +<br> +<h2 id=modinfo>Module Information</h2> +<table width=100%> +<tr><th width=1%>Name</th><td>htbaapub.rackspacecloudfiles</td></tr> +<tr><th width=1%>Version</th><td>1.00</td></tr> +<tr><th width=1%>Author</th><td>Christiaan Kras</td></tr> +<tr><th width=1%>Git repository</th><td><a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a></td></tr> +<tr><th width=1%>Rackspace Cloud Files</th><td><a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a></td></tr> +</body></html> diff --git a/doc/intro.bbdoc b/doc/intro.bbdoc new file mode 100644 index 0000000..e4ae92e --- /dev/null +++ b/doc/intro.bbdoc @@ -0,0 +1,9 @@ +<h1>Rackspace CloudFiles</h1> +<p>This module allows you to interact with your account for Rackspace Cloud Files. Cloud Files is a webservice that allows you to store content online in the cloud.</p> + + +<h2>Examples</h2> +<p>Please take a look at one of the examples below.</p> +<ul> + <li><a href="../examples/example1.bmx">example1.bmx</a></li> +</ul> \ No newline at end of file diff --git a/examples/credentials.default.txt b/examples/credentials.default.txt new file mode 100644 index 0000000..95b78bf --- /dev/null +++ b/examples/credentials.default.txt @@ -0,0 +1,2 @@ +authName +authKey \ No newline at end of file diff --git a/examples/example1.bmx b/examples/example1.bmx new file mode 100644 index 0000000..2479cde --- /dev/null +++ b/examples/example1.bmx @@ -0,0 +1,53 @@ +SuperStrict +Import htbaapub.rackspacecloudfiles + +'Make sure a file called credentials.txt is available +'On the first line the username is expected. On the second line the API key is expected. +Local credentials:String[] = LoadText("credentials.txt").Split("~n") +If Not credentials.Length = 2 + RuntimeError("Invalid configuration file!") +End If + +'Create our TRackspaceCloudFiles object +Local mcf:TRackspaceCloudFiles = New TRackspaceCloudFiles.Create(credentials[0].Trim(), credentials[1].Trim()) + +Print "Total bytes used: " + mcf.TotalBytesUsed() + +'list all containers +Local containers:TList = mcf.Containers() +For Local container:TRackspaceCloudFilesContainer = EachIn containers + Print "Container: " + container.Name() + " --- Object count: " + container.ObjectCount() +Next + +'create a new container. If the container already exists it'll be returned as well +Local container:TRackspaceCloudFilesContainer = mcf.CreateContainer("testing") + +'use an existing container +Local existingContainer:TRackspaceCloudFilesContainer = mcf.Container("testing2") + +Print "Object count: " + container.ObjectCount() +Print container.BytesUsed() + " bytes" + +Local objects:TList = container.Objects() +For Local obj:TRackspaceCloudFileObject = EachIn objects + Print "have object " + obj.Name() +Next + +'You can also request a objects list that is prefixed +'Local objects2:TList = container.Objects("dir/") + +'To create a new object with the contents of a local file +Local obj1:TRackspaceCloudFileObject = container.FileObject("Test1.txt") +obj1.PutFile("credentials.default.txt") + +Print obj1.ETag() +Print obj1.LastModified() + +'To download an Object To a Local file +obj1.GetFile("test.DOWNLOADED") + +'Delete the object from the container +obj1.Remove() + +'Remove the container +container.Remove() diff --git a/exceptions.bmx b/exceptions.bmx new file mode 100644 index 0000000..2ce4a12 --- /dev/null +++ b/exceptions.bmx @@ -0,0 +1,39 @@ +Rem + bbdoc: Exception for TRackspaceCloudFiles +End Rem +Type TRackspaceCloudBaseException Abstract + Field message:String + + Rem + bbdoc: Sets message + End Rem + Method SetMessage:TRackspaceCloudBaseException(message:String) + Self.message = message + Return Self + End Method + + Rem + bbdoc: Return message + End Rem + Method ToString:String() + Return Self.message + End Method +End Type + +Rem + bbdoc: Exception for TRackspaceCloudFiles +End Rem +Type TRackspaceCloudFilesException Extends TRackspaceCloudBaseException +End Type + +Rem + bbdoc: Exception for TRackspaceCloudFilesContainer +End Rem +Type TRackspaceCloudFilesContainerException Extends TRackspaceCloudBaseException +End Type + +Rem + bbdoc: Exception for TRackspaceCloudFileObject +End Rem +Type TRackspaceCloudFileObjectException Extends TRackspaceCloudBaseException +End Type diff --git a/object.bmx b/object.bmx new file mode 100644 index 0000000..996a1c3 --- /dev/null +++ b/object.bmx @@ -0,0 +1,189 @@ +Rem + bbdoc: This type represents an object in Cloud Files + info: +End Rem +Type TRackspaceCloudFileObject + Field _name:String + Field _contentType:String + Field _etag:String + Field _size:Long + Field _lastModified:String + + Field _rackspace:TRackspaceCloudFiles + Field _container:TRackspaceCloudFilesContainer + Field _url:String + +' Rem +' bbdoc: +' about: +' End Rem + Method Create:TRackspaceCloudFileObject(container:TRackspaceCloudFilesContainer, name:String) + Self._name = name + Self._rackspace = container._rackspace + Self._container = container + Self._url = container._rackspace._storageUrl + "/" + container.Name() + "/" + name + Return Self + End Method + + Rem + bbdoc: Returns the name of the object + about: + End Rem + Method Name:String() + Return Self._name + End Method + + Rem + bbdoc: Fetches the metadata of the object + about: + End Rem + Method Head() + Select Self._rackspace._Transport(Self._url, Null, "HEAD") + Case 404 + Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") + Case 204 + Self._SetAttributesFromResponse() + Default + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End Select + End Method + + Rem + bbdoc: Fetches the metadata and content of an object + about: Returns data content + End Rem + Method Get:String() + Select Self._rackspace._Transport(Self._url, Null) + Case 404 + Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") + Case 200 + Self._SetAttributesFromResponse() + If Self._etag <> MD5(Self._rackspace._content).ToLower() + Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") + End If + Return Self._rackspace._content + Default + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End Select + End Method + + Rem + bbdoc: Downloads the content of an object to a local file, checks the integrity of the file, sets metadata in the object <strike>and sets the last modified time of the file to the same as the object</strike> + about: + End Rem + Method GetFile:String(filename:String) + SaveText(Self.Get(), filename) + Return filename + End Method + + Rem + bbdoc: Deletes an object + about: + End Rem + Method Remove() + Select Self._rackspace._Transport(Self._url, Null, "DELETE") + Case 404 + Throw New TRackspaceCloudFileObjectException.SetMessage("Object " + Self._name + " not found") + Case 204 + 'OK + Default + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End Select + End Method + + Rem + bbdoc: Creates a new object with the contents of a local file + about: Remember that the max. filesize supported by Cloud Files is 5Gb + End Rem + Method PutFile(filename:String) + Local stream:TStream = ReadStream(filename) + Local md5Hex:String = MD5(LoadText(filename)) + Local headers:String[] = ["ETag: " + md5Hex.ToLower(), "Content-Type: " + TRackspaceCloudFileObject.ContentTypeOf(filename) ] + + Select Self._rackspace._Transport(Self._url, headers, "PUT", stream) + Case 201 + 'Object created + Self._SetAttributesFromResponse() + Case 412 + Throw New TRackspaceCloudFileObjectException.SetMessage("Missing Content-Length or Content-Type header") + Case 422 + Throw New TRackspaceCloudFileObjectException.SetMessage("Data corruption error") + Default + Throw New TRackspaceCloudFileObjectException.SetMessage("Unable to handle response") + End Select + End Method + + Rem + bbdoc: Return content-type of a file + about: Decision is based on the file extension. Which is not a safe method and the list + of content types and extensions is far from complete. If no matching content type is being + found it'll return application/octet-stream.<br> + <br> + The list content-type > file extension mapping can be found in <a href="../content-types.txt">content-types.txt</a>. + This file is IncBinned during compilation of the module. + End Rem + Function ContentTypeOf:String(filename:String) + Global mapping:TMap = New TMap + + If mapping.IsEmpty() + Local strMapping:String[] = LoadText("incbin::content-types.txt").Split("~n") + + For Local line:String = EachIn strMapping + Local parts:String[] = line.Split(":") + Local contentType:String = parts[0] + Local exts:String[] = parts[1].Split(",") + For Local ext:String = EachIn exts + mapping.Insert(ext, contentType.ToLower()) + Next + Next + End If + + Local contentType:String = String(mapping.ValueForKey(ExtractExt(filename).ToLower())) + If Not contentType + contentType = "application/octet-stream" + End If + Return contentType + End Function + + Rem + bbdoc: Returns the entity tag of the object, which is its MD5 + about: + End Rem + Method ETag:String() + Return Self._etag + End Method + + Rem + bbdoc: Return the size of an object in bytes + about: + End Rem + Method Size:Long() + Return Self._size + End Method + + Rem + bbdoc: Return the content type of an object + about: + End Rem + Method ContentType:String() + Return Self._contentType + End Method + + Rem + bbdoc: Return the last modified time of an object + about: + End Rem + Method LastModified:String() + Return Self._lastModified + End Method + +' Rem +' bbdoc: Private method +' End Rem + Method _SetAttributesFromResponse() + Self._etag = String(Self._rackspace._headers.ValueForKey("Etag")) + Self._size = String(Self._rackspace._headers.ValueForKey("Content-Length")).ToLong() + Self._contentType = String(Self._rackspace._headers.ValueForKey("Content-Type")) + Self._lastModified = String(Self._rackspace._headers.ValueForKey("Last-Modified")) + End Method +End Type diff --git a/rackspacecloudfiles.bmx b/rackspacecloudfiles.bmx new file mode 100644 index 0000000..840b1b4 --- /dev/null +++ b/rackspacecloudfiles.bmx @@ -0,0 +1,271 @@ +SuperStrict + +Rem + bbdoc: htbaapub.rackspacecloudfiles +EndRem +Module htbaapub.rackspacecloudfiles +ModuleInfo "Name: htbaapub.rackspacecloudfiles" +ModuleInfo "Version: 1.00" +ModuleInfo "Author: Christiaan Kras" +ModuleInfo "Git repository: <a href='http://github.com/Htbaa/htbaapub.mod/'>http://github.com/Htbaa/htbaapub.mod/</a>" +ModuleInfo "Rackspace Cloud Files: <a href='http://www.rackspacecloud.com'>http://www.rackspacecloud.com</a>" + +Import bah.crypto +Import bah.libcurlssl +Import brl.linkedlist +Import brl.map +Import brl.standardio +Import brl.stream +Import brl.system + +Include "exceptions.bmx" +Include "container.bmx" +Include "object.bmx" + +Incbin "content-types.txt" + +Rem + bbdoc: Interface to Rackspace CloudFiles service + about: Please note that TRackspaceCloudFiles is not thread safe (yet) +End Rem +Type TRackspaceCloudFiles + Field _authUser:String + Field _authKey:String + + Field _storageToken:String + Field _storageUrl:String + Field _cdnManagementUrl:String + Field _authToken:String +' Field _authTokenExpires:Int + + Field _headers:TMap + Field _content:String + + Rem + bbdoc: Optionally set the path to a certification bundle to validate the SSL certificate of Rackspace + about: If you want to validate the SSL certificate of the Rackspace server you can set the path to your certificate bundle here. + This needs to be set BEFORE creating a TRackspaceCloudFiles object, as TRackspaceCloudFiles.Create() automatically calls Authenticate() + End Rem + Global CAInfo:String + + Method New() + ?Threaded + DebugLog "Warning: TRackspaceCloudFiles is not thread-safe. It's not safe to do multiple requests at the same time on the same object." + ? + End Method + + Rem + bbdoc: Creates a TRackspaceCloudFiles object + about: This method calls Authenticate() + End Rem + Method Create:TRackspaceCloudFiles(user:String, key:String) + Self._headers = New TMap + Self._authUser = user + Self._authKey = key + Self.Authenticate() + Return Self + End Method + + Rem + bbdoc: Authenticate with the webservice + End Rem + Method Authenticate() + Local headers:String[2] + headers[0] = "X-Auth-User: " + Self._authUser + headers[1] = "X-Auth-Key: " + Self._authKey + Select Self._Transport("https://api.mosso.com/auth", headers) + Case 204 + Self._storageToken = String(Self._headers.ValueForKey("X-Storage-Token")) + Self._storageUrl = String(Self._headers.ValueForKey("X-Storage-Url")) + Self._cdnManagementUrl = String(Self._headers.ValueForKey("X-CDN-Management-Url")) + Self._authToken = String(Self._headers.ValueForKey("X-Auth-Token")) + Case 401 + Throw New TRackspaceCloudFilesException.SetMessage("Invalid account or access key!") + Default + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") + End Select + End Method + + Rem + bbdoc: List all the containers + about: Set prefix if you want to filter out the containers not beginning with the prefix + End Rem + Method Containers:TList(prefix:String = Null, limit:Int = 10000, marker:String = Null) + Local qs:String = TRackspaceCloudFiles.CreateQueryString(["limit=" + limit, "prefix=" + prefix, "marker=" + marker]) + Select Self._Transport(Self._storageUrl + qs) + Case 200 + Local containerList:TList = New TList + Local containerNames:String[] = Self._content.Split("~n") + For Local containerName:String = EachIn containerNames + If containerName.Length = 0 Then Continue + containerList.AddLast(New TRackspaceCloudFilesContainer.Create(Self, containerName)) + Next + + 'Check if there are more containers + If containerList.Count() = limit + Local lastContainer:TRackspaceCloudFilesContainer = TRackspaceCloudFilesContainer(containerList.Last()) + Local more:TList = Self.Containers(prefix, limit, lastContainer._name) + 'If the list has items then add them to the mainlist + If more.Count() > 0 + For Local c:TRackspaceCloudFilesContainer = EachIn more + containerList.AddLast(c) + Next + End If + End If + + Return containerList + Case 204 + Return New TList + Default + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") + End Select + Return Null + End Method + + Rem + bbdoc: Create a new container + about: + End Rem + Method CreateContainer:TRackspaceCloudFilesContainer(name:String) + Select Self._Transport(Self._storageUrl + "/" + name, Null, "PUT") + Case 201 'Created + Return Self.Container(name) + Case 202 'Already exists + Return Self.Container(name) + Default + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") + End Select + End Method + + Rem + bbdoc: Use an existing container + about: + End Rem + Method Container:TRackspaceCloudFilesContainer(name:String) + Return New TRackspaceCloudFilesContainer.Create(Self, name) + End Method + + Rem + bbdoc: Returns the total amount of bytes used in your Cloud Files account + about: + End Rem + Method TotalBytesUsed:Long() + Select Self._Transport(Self._storageUrl, Null, "HEAD") + Case 204 + Return String(Self._headers.ValueForKey("X-Account-Bytes-Used")).ToLong() + Default + Throw New TRackspaceCloudFilesException.SetMessage("Unable to handle response!") + End Select + Return 0 + End Method + +' Rem +' bbdoc: Private method +' about: Used to send requests. Sets header data and content data. Returns HTTP status code +' End Rem + Method _Transport:Int(url:String, headers:String[] = Null, requestMethod:String = "GET", userData:Object = Null) + Self._headers.Clear() + + Local curl:TCurlEasy = TCurlEasy.Create() + curl.setWriteString() + curl.setOptInt(CURLOPT_VERBOSE, 0) + curl.setOptInt(CURLOPT_FOLLOWLOCATION, 1) + curl.setOptString(CURLOPT_CUSTOMREQUEST, requestMethod) + curl.setOptString(CURLOPT_URL, url) + + 'Use certificate bundle if set + If TRackspaceCloudFiles.CAInfo + curl.setOptString(CURLOPT_CAINFO, TRackspaceCloudFiles.CAInfo) + 'Otherwise don't check if SSL certificate is valid + Else + curl.setOptInt(CURLOPT_SSL_VERIFYPEER, False) + End If + + 'Pass content + If userData + Select requestMethod + Case "POST" + curl.setOptString(CURLOPT_POSTFIELDS, String(userData)) + curl.setOptLong(CURLOPT_POSTFIELDSIZE, String(userData).Length) + Case "PUT" + curl.setOptInt(CURLOPT_UPLOAD, True) + Local stream:TStream = TStream(userData) + curl.setOptLong(CURLOPT_INFILESIZE_LARGE, stream.Size()) + curl.setReadStream(stream) + End Select + End If + + Local headerList:TList = New TList + If headers <> Null + For Local str:String = EachIn headers + headerList.AddLast(str) + Next + End If + + 'Pass auth-token if available + If Self._authToken + headerList.AddLast("X-Auth-Token:" + Self._authToken) + End If + + Local headerArray:String[] = New String[headerList.Count()] + For Local i:Int = 0 To headerArray.Length - 1 + headerArray[i] = String(headerList.ValueAtIndex(i)) + Next + + curl.httpHeader(headerArray) + + curl.setHeaderCallback(Self.HeaderCallback, Self) + + Local res:Int = curl.perform() + + If TStream(userData) + TStream(userData).Close() + End If + + Local errorMessage:String + If res Then + errorMessage = CurlError(res) + End If + + Local info:TCurlInfo = curl.getInfo() + Local responseCode:Int = info.responseCode() + + curl.freeLists() + curl.cleanup() + + Self._content = curl.toString() + + 'Throw exception if an error with cURL occured + If errorMessage <> Null + Throw New TRackspaceCloudFilesException.SetMessage(errorMessage) + End If + + Return responseCode + End Method + + Rem + bbdoc: Callback for cURL to catch headers + End Rem + Function HeaderCallback:Int(buffer:Byte Ptr, size:Int, data:Object) + Local str:String = String.FromCString(buffer) + + Local parts:String[] = str.Split(":") + If parts.Length >= 2 + TRackspaceCloudFiles(data)._headers.Insert(parts[0], str[parts[0].Length + 2..].Trim()) + End If + + Return size + End Function + + Rem + bbdoc: Create a query string from the given values + about: Expects an array with strings. Each entry should be something like var=value + End Rem + Function CreateQueryString:String(params:String[]) + Local qs:String = "&".Join(params) + If qs.Length > 0 + Return "?" + qs + End If + Return Null + End Function +End Type
scronide/scuttle
9ce0bb50d2e8288c22e9cb801a2168b2c76a070c
- Updated default filetypes used for system tags - Added support for RSS media enclosures - Restricted registration fields to match DB limits - Updated debug mode activation - Updated form style - Minor code style updates
diff --git a/AUTHORS b/AUTHORS index 998ffe8..232a9cf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,17 +1,20 @@ Scuttle contains code from the following open-source projects: +Drupal +http://www.drupal.org/ + jQuery http://www.jquery.com/ phpBB2 (database abstraction layer) http://www.phpbb.com/ php-gettext Danilo Segan <danilo@kvota.net> http://savannah.nongnu.org/projects/php-gettext/ PHP UTF-8 https://sourceforge.net/projects/phputf8/ XSPF Web Music Player (Flash) http://musicplayer.sourceforge.net/ \ No newline at end of file diff --git a/config.inc.php.example b/config.inc.php.example index a8c32c9..9d52a2f 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -1,137 +1,138 @@ <?php ###################################################################### # SCUTTLE: Online social bookmarks manager ###################################################################### # Copyright (c) 2005 - 2010 Marcus Campbell # http://scuttle.org/ # # This module is to configure the main options for your site # # This program 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. ###################################################################### ###################################################################### # Database Configuration # # dbtype: Database driver - mysql, mysqli, mysql4, oracle, postgres, # sqlite, db2, firebird, mssql, mssq-odbc # dbhost: Database hostname # dbport: Database port # dbuser: Database username # dbpass: Database password # dbname: Database name ###################################################################### $dbtype = 'mysql'; $dbhost = '127.0.0.1'; $dbport = '3306'; $dbuser = 'username'; $dbpass = 'password'; $dbname = 'scuttle'; ###################################################################### # Basic Configuration ###################################################################### # sitename: The name of this site # locale: The locale used - de_DE, dk_DK, en_GB, es_ES, fr_FR, hi_IN, # it_IT, ja_JP, lt_LT, nl_NL, pt_BR, sk_SK, zh_CN, zh_TW # adminemail: Contact address for the site administrator. Used as the from: # address in password retrieval e-mails. ###################################################################### $sitename = 'Scuttle'; $locale = 'en_GB'; $adminemail = 'admin@example.org'; ###################################################################### # You have finished configuring the database! # ONLY EDIT THE INFORMATION BELOW IF YOU KNOW WHAT YOU ARE DOING. ###################################################################### # System Configuration # # top_include: The header file. # bottom_include: The footer file. # shortdate: The format of short dates. # longdate: The format of long dates. # nofollow: true - Include rel="nofollow" attribute on # bookmark links. # false - Don't include rel="nofollow". # defaultPerPage: The default number of bookmarks per page. # -1 means no limit! # defaultRecentDays: The number of days that bookmarks or tags should # be considered recent. # defaultOrderBy: The default order in which bookmarks will appear. # Possible values are: # date_desc - By date of entry descending. # Latest entry first. (Default) # date_asc - By date of entry ascending. # Earliest entry first. # title_desc - By title, descending alphabetically. # title_asc - By title, ascending alphabetically. # url_desc - By URL, descending alphabetically. # url_asc - By URL, ascending alphabetically. # TEMPLATES_DIR: The directory where the template files should be # loaded from (the *.tpl.php files) # root : Set to NULL to autodetect the root url of the website # cookieprefix : The prefix to use for the cookies on the site # tableprefix : The table prefix used for this installation # cleanurls : true - Use mod_rewrite to hide PHP extensions # : false - Don't hide extensions [Default] # # usecache : true - Cache pages when possible # false - Don't cache at all [Default] # dir_cache : The directory where cache files will be stored # # useredir : true - Improve privacy by redirecting all bookmarks # through the address specified in url_redir # false - Don't redirect bookmarks # url_redir : URL prefix for bookmarks to redirect through # # filetypes : An array of bookmark extensions that Scuttle should # add system tags for. # reservedusers : An array of usernames that cannot be registered # email_whitelist : Array of regex patterns. Used to whitelist addresses that # may otherwise match the blacklist. # email_blacklist : Array of regex patterns. Registration is blocked if a # match is found. ###################################################################### $top_include = 'top.inc.php'; $bottom_include = 'bottom.inc.php'; $shortdate = 'd-m-Y'; $longdate = 'j F Y'; $nofollow = TRUE; $defaultPerPage = 10; $defaultRecentDays = 14; $defaultOrderBy = 'date_desc'; $TEMPLATES_DIR = dirname(__FILE__) .'/templates/'; $root = NULL; $cookieprefix = 'SCUTTLE'; $tableprefix = 'sc_'; $adminemail = 'admin@example.org'; $cleanurls = FALSE; $usecache = FALSE; $dir_cache = dirname(__FILE__) .'/cache/'; $useredir = FALSE; $url_redir = 'http://www.google.com/url?sa=D&q='; $filetypes = array( - 'audio' => array('mp3', 'ogg', 'wav'), - 'document' => array('doc', 'odt', 'pdf'), - 'image' => array('gif', 'jpeg', 'jpg', 'png'), - 'video' => array('avi', 'mov', 'mp4', 'mpeg', 'mpg', 'wmv') + 'audio' => array('aac', 'mp3', 'm4a', 'oga', 'ogg', 'wav'), + 'document' => array('doc', 'docx', 'odt', 'pages', 'pdf', 'txt'), + 'image' => array('gif', 'jpe', 'jpeg', 'jpg', 'png', 'svg'), + 'bittorrent' => array('torrent'), + 'video' => array('avi', 'flv', 'mov', 'mp4', 'mpeg', 'mpg', 'm4v', 'ogv', 'wmv') ); $reservedusers = array('all', 'watchlist'); $email_whitelist = NULL; $email_blacklist = array( - '/(.*-){2,}/', - '/mailinator\.com/i' + '/(.*-){2,}/', + '/mailinator\.com/i' ); include_once 'debug.inc.php'; diff --git a/debug.inc.php b/debug.inc.php index 346140a..2c5a977 100644 --- a/debug.inc.php +++ b/debug.inc.php @@ -1,15 +1,16 @@ <?php // Turn debugging on -define('SCUTTLE_DEBUG', TRUE); +define('SCUTTLE_DEBUG', FALSE); // generic debugging function // Sample: // pc_debug(__FILE__, __LINE__, "This is a debug message."); function pc_debug($file, $line, $message) { - if (defined('SCUTTLE_DEBUG') && SCUTTLE_DEBUG) { - error_log("---DEBUG-". $sitename .": [$file][$line]: $message"); - } else { - error_log("SCUTTLE_DEBUG disabled"); - } + if (defined('SCUTTLE_DEBUG') && SCUTTLE_DEBUG) { + error_log("---DEBUG-". $sitename .": [$file][$line]: $message"); + } + else { + error_log("SCUTTLE_DEBUG disabled"); + } } diff --git a/edit.php b/edit.php index bae38e4..fbbc083 100644 --- a/edit.php +++ b/edit.php @@ -1,92 +1,92 @@ <?php /*************************************************************************** -Copyright (c) 2004 - 2006 Marcus Campbell +Copyright (c) 2004 - 2010 Marcus Campbell http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once 'header.inc.php'; -$bookmarkservice = & ServiceFactory::getServiceInstance('BookmarkService'); -$templateservice = & ServiceFactory::getServiceInstance('TemplateService'); -$userservice = & ServiceFactory::getServiceInstance('UserService'); +$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); +$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); // Header variables $tplVars['subtitle'] = T_('Edit Bookmark'); -$tplVars['loadjs'] = true; +$tplVars['loadjs'] = TRUE; list ($url, $bookmark) = explode('/', $_SERVER['PATH_INFO']); + if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) { - $tplVars['error'] = sprintf(T_('Bookmark with id %s not was not found'), $bookmark); + $tplVars['error'] = sprintf(T_('Bookmark with id %s was not found'), $bookmark); $templateservice->loadTemplate('error.404.tpl', $tplVars); exit(); } else { if (!$bookmarkservice->editAllowed($row)) { $tplVars['error'] = T_('You are not allowed to edit this bookmark'); $templateservice->loadTemplate('error.500.tpl', $tplVars); exit(); } else if ($_POST['submitted']) { if (!$_POST['title'] || !$_POST['address']) { $tplVars['error'] = T_('Your bookmark must have a title and an address'); } else { // Update bookmark $bId = intval($bookmark); $address = trim($_POST['address']); $title = trim($_POST['title']); $description = trim($_POST['description']); $status = intval($_POST['status']); $tags = trim($_POST['tags']); $logged_on_user = $userservice->getCurrentUser(); if (!$bookmarkservice->updateBookmark($bId, $address, $title, $description, $status, $tags)) { $tplvars['error'] = T_('Error while saving your bookmark'); } else { if (isset($_POST['popup'])) { $tplVars['msg'] = (isset($_POST['popup'])) ? '<script type="text/javascript">window.close();</script>' : T_('Bookmark saved'); } elseif (isset($_POST['referrer'])) { header('Location: '. $_POST['referrer']); } else { header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); } } } } else { if ($_POST['delete']) { // Delete bookmark if ($bookmarkservice->deleteBookmark($bookmark)) { $logged_on_user = $userservice->getCurrentUser(); if (isset($_POST['referrer'])) { header('Location: '. $_POST['referrer']); } else { header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); } exit(); } else { $tplVars['error'] = T_('Failed to delete the bookmark'); $templateservice->loadTemplate('error.500.tpl', $tplVars); exit(); } } } $tplVars['popup'] = (isset($_GET['popup'])) ? $_GET['popup'] : null; $tplVars['row'] =& $row; $tplVars['formaction'] = createURL('edit', $bookmark); $tplVars['btnsubmit'] = T_('Save Changes'); $tplVars['showdelete'] = true; $tplVars['referrer'] = $_SERVER['HTTP_REFERER']; $templateservice->loadTemplate('editbookmark.tpl', $tplVars); } -?> diff --git a/functions.inc.php b/functions.inc.php index c9ef2f6..c32fa68 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1,159 +1,546 @@ <?php // UTF-8 functions require_once dirname(__FILE__) .'/includes/utf8/utf8.php'; // Translation require_once dirname(__FILE__) .'/includes/php-gettext/gettext.inc'; $domain = 'messages'; T_setlocale(LC_ALL, $locale); T_bindtextdomain($domain, dirname(__FILE__) .'/locales'); T_bind_textdomain_codeset($domain, 'UTF-8'); T_textdomain($domain); // Converts tags: // - direction = out: convert spaces to underscores; // - direction = in: convert underscores to spaces. function convertTag($tag, $direction = 'out') { - if ($direction == 'out') { - $tag = str_replace(' ', '_', $tag); - } else { - $tag = str_replace('_', ' ', $tag); - } - return $tag; + if ($direction == 'out') { + return str_replace(' ', '_', $tag); + } + else { + return str_replace('_', ' ', $tag); + } } function filter($data, $type = NULL) { if (is_string($data)) { $data = trim($data); $data = stripslashes($data); switch ($type) { case 'url': $data = rawurlencode($data); break; default: $data = htmlspecialchars($data); break; } } else if (is_array($data)) { foreach(array_keys($data) as $key) { $row =& $data[$key]; $row = filter($row, $type); } } return $data; } function getPerPageCount() { - global $defaultPerPage; - return $defaultPerPage; + global $defaultPerPage; + return $defaultPerPage; } function getSortOrder($override = NULL) { global $defaultOrderBy; if (isset($_GET['sort'])) { return $_GET['sort']; } else if (isset($override)) { return $override; } else { return $defaultOrderBy; } } function multi_array_search($needle, $haystack) { if (is_array($haystack)) { foreach(array_keys($haystack) as $key) { $value =& $haystack[$key]; $result = multi_array_search($needle, $value); if (is_array($result)) { $return = $result; array_unshift($return, $key); return $return; - } elseif ($result == true) { + } elseif ($result == TRUE) { $return[] = $key; return $return; } } - return false; + return FALSE; } else { if ($needle === $haystack) { - return true; + return TRUE; } else { - return false; + return FALSE; } } } function createURL($page = '', $ending = '') { global $cleanurls, $root; if (!$cleanurls && $page != '') { $page .= '.php'; } return $root . $page .'/'. $ending; } +/** + * Return the size of the given file in bytes + */ +function file_get_filesize($filename) { + if (function_exists('curl_init')) { + $ch = curl_init($filename); + curl_setopt($ch, CURLOPT_NOBODY, TRUE); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($ch, CURLOPT_HEADER, TRUE); + $data = curl_exec($ch); + curl_close($ch); + + if (FALSE !== $data && preg_match('/Content-Length: (\d+)/', $data, $matches)) { + return (float)$matches[1]; + } + } + return FALSE; +} + +/** + * Determine MIME type from a filename + */ +function file_get_mimetype($filename, $mapping = NULL) { + if (!is_array($mapping)) { + $mapping = array( + 'ez' => 'application/andrew-inset', + 'atom' => 'application/atom', + 'atomcat' => 'application/atomcat+xml', + 'atomsrv' => 'application/atomserv+xml', + 'cap|pcap' => 'application/cap', + 'cu' => 'application/cu-seeme', + 'tsp' => 'application/dsptype', + 'spl' => 'application/x-futuresplash', + 'hta' => 'application/hta', + 'jar' => 'application/java-archive', + 'ser' => 'application/java-serialized-object', + 'class' => 'application/java-vm', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'image/x-corelphotopaint', + 'nb' => 'application/mathematica', + 'mdb' => 'application/msaccess', + 'doc|dot' => 'application/msword', + 'bin' => 'application/octet-stream', + 'oda' => 'application/oda', + 'ogg|ogx' => 'application/ogg', + 'pdf' => 'application/pdf', + 'key' => 'application/pgp-keys', + 'pgp' => 'application/pgp-signature', + 'prf' => 'application/pics-rules', + 'ps|ai|eps' => 'application/postscript', + 'rar' => 'application/rar', + 'rdf' => 'application/rdf+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'smi|smil' => 'application/smil', + 'wpd' => 'application/wordperfect', + 'wp5' => 'application/wordperfect5.1', + 'xhtml|xht' => 'application/xhtml+xml', + 'xml|xsl' => 'application/xml', + 'zip' => 'application/zip', + 'cdy' => 'application/vnd.cinderella', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xls|xlb|xlt' => 'application/vnd.ms-excel', + 'cat' => 'application/vnd.ms-pki.seccat', + 'stl' => 'application/vnd.ms-pki.stl', + 'ppt|pps' => 'application/vnd.ms-powerpoint', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'cod' => 'application/vnd.rim.cod', + 'mmf' => 'application/vnd.smaf', + 'sdc' => 'application/vnd.stardivision.calc', + 'sds' => 'application/vnd.stardivision.chart', + 'sda' => 'application/vnd.stardivision.draw', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdf' => 'application/vnd.stardivision.math', + 'sdw' => 'application/vnd.stardivision.writer', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sxc' => 'application/vnd.sun.xml.calc', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'sxd' => 'application/vnd.sun.xml.draw', + 'std' => 'application/vnd.sun.xml.draw.template', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'sis' => 'application/vnd.symbian.install', + 'vsd' => 'application/vnd.visio', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wk' => 'application/x-123', + '7z' => 'application/x-7z-compressed', + 'abw' => 'application/x-abiword', + 'dmg' => 'application/x-apple-diskimage', + 'bcpio' => 'application/x-bcpio', + 'torrent' => 'application/x-bittorrent', + 'cab' => 'application/x-cab', + 'cbr' => 'application/x-cbr', + 'cbz' => 'application/x-cbz', + 'cdf' => 'application/x-cdf', + 'vcd' => 'application/x-cdlink', + 'pgn' => 'application/x-chess-pgn', + 'cpio' => 'application/x-cpio', + 'csh' => 'text/x-csh', + 'deb|udeb' => 'application/x-debian-package', + 'dcr|dir|dxr' => 'application/x-director', + 'dms' => 'application/x-dms', + 'wad' => 'application/x-doom', + 'dvi' => 'application/x-dvi', + 'rhtml' => 'application/x-httpd-eruby', + 'pages' => 'application/x-iwork-pages-sffpages', + 'flac' => 'application/x-flac', + 'pfa|pfb|gsf|pcf|pcf.Z' => 'application/x-font', + 'mm' => 'application/x-freemind', + 'gnumeric' => 'application/x-gnumeric', + 'sgf' => 'application/x-go-sgf', + 'gcf' => 'application/x-graphing-calculator', + 'gtar|tgz|taz' => 'application/x-gtar', + 'hdf' => 'application/x-hdf', + 'phtml|pht|php' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'php3' => 'application/x-httpd-php3', + 'php3p' => 'application/x-httpd-php3-preprocessed', + 'php4' => 'application/x-httpd-php4', + 'ica' => 'application/x-ica', + 'ins|isp' => 'application/x-internet-signup', + 'iii' => 'application/x-iphone', + 'iso' => 'application/x-iso9660-image', + 'jnlp' => 'application/x-java-jnlp-file', + 'js' => 'application/x-javascript', + 'jmz' => 'application/x-jmol', + 'chrt' => 'application/x-kchart', + 'kil' => 'application/x-killustrator', + 'skp|skd|skt|skm' => 'application/x-koan', + 'kpr|kpt' => 'application/x-kpresenter', + 'ksp' => 'application/x-kspread', + 'kwd|kwt' => 'application/x-kword', + 'latex' => 'application/x-latex', + 'lha' => 'application/x-lha', + 'lyx' => 'application/x-lyx', + 'lzh' => 'application/x-lzh', + 'lzx' => 'application/x-lzx', + 'frm|maker|frame|fm|fb|book|fbdoc' => 'application/x-maker', + 'mif' => 'application/x-mif', + 'wmd' => 'application/x-ms-wmd', + 'wmz' => 'application/x-ms-wmz', + 'com|exe|bat|dll' => 'application/x-msdos-program', + 'msi' => 'application/x-msi', + 'nc' => 'application/x-netcdf', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'nwc' => 'application/x-nwc', + 'o' => 'application/x-object', + 'oza' => 'application/x-oz-application', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'crl' => 'application/x-pkcs7-crl', + 'pyc|pyo' => 'application/x-python-code', + 'qtl' => 'application/x-quicktimeplayer', + 'rpm' => 'application/x-redhat-package-manager', + 'sh' => 'text/x-sh', + 'shar' => 'application/x-shar', + 'swf|swfl' => 'application/x-shockwave-flash', + 'sit|sitx' => 'application/x-stuffit', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'tar' => 'application/x-tar', + 'tcl' => 'application/x-tcl', + 'gf' => 'application/x-tex-gf', + 'pk' => 'application/x-tex-pk', + 'texinfo|texi' => 'application/x-texinfo', + '~|%|bak|old|sik' => 'application/x-trash', + 't|tr|roff' => 'application/x-troff', + 'man' => 'application/x-troff-man', + 'me' => 'application/x-troff-me', + 'ms' => 'application/x-troff-ms', + 'ustar' => 'application/x-ustar', + 'src' => 'application/x-wais-source', + 'wz' => 'application/x-wingz', + 'crt' => 'application/x-x509-ca-cert', + 'xcf' => 'application/x-xcf', + 'fig' => 'application/x-xfig', + 'xpi' => 'application/x-xpinstall', + 'aac' => 'audio/aac', + 'au|snd' => 'audio/basic', + 'mid|midi|kar' => 'audio/midi', + 'mpga|mpega|mp2|mp3|m4a' => 'audio/mpeg', + 'f4a|f4b' => 'audio/mp4', + 'm3u' => 'audio/x-mpegurl', + 'oga|spx' => 'audio/ogg', + 'sid' => 'audio/prs.sid', + 'aif|aiff|aifc' => 'audio/x-aiff', + 'gsm' => 'audio/x-gsm', + 'wma' => 'audio/x-ms-wma', + 'wax' => 'audio/x-ms-wax', + 'ra|rm|ram' => 'audio/x-pn-realaudio', + 'ra' => 'audio/x-realaudio', + 'pls' => 'audio/x-scpls', + 'sd2' => 'audio/x-sd2', + 'wav' => 'audio/x-wav', + 'alc' => 'chemical/x-alchemy', + 'cac|cache' => 'chemical/x-cache', + 'csf' => 'chemical/x-cache-csf', + 'cbin|cascii|ctab' => 'chemical/x-cactvs-binary', + 'cdx' => 'chemical/x-cdx', + 'cer' => 'chemical/x-cerius', + 'c3d' => 'chemical/x-chem3d', + 'chm' => 'chemical/x-chemdraw', + 'cif' => 'chemical/x-cif', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cpa' => 'chemical/x-compass', + 'bsd' => 'chemical/x-crossfire', + 'csml|csm' => 'chemical/x-csml', + 'ctx' => 'chemical/x-ctx', + 'cxf|cef' => 'chemical/x-cxf', + 'emb|embl' => 'chemical/x-embl-dl-nucleotide', + 'spc' => 'chemical/x-galactic-spc', + 'inp|gam|gamin' => 'chemical/x-gamess-input', + 'fch|fchk' => 'chemical/x-gaussian-checkpoint', + 'cub' => 'chemical/x-gaussian-cube', + 'gau|gjc|gjf' => 'chemical/x-gaussian-input', + 'gal' => 'chemical/x-gaussian-log', + 'gcg' => 'chemical/x-gcg8-sequence', + 'gen' => 'chemical/x-genbank', + 'hin' => 'chemical/x-hin', + 'istr|ist' => 'chemical/x-isostar', + 'jdx|dx' => 'chemical/x-jcamp-dx', + 'kin' => 'chemical/x-kinemage', + 'mcm' => 'chemical/x-macmolecule', + 'mmd|mmod' => 'chemical/x-macromodel-input', + 'mol' => 'chemical/x-mdl-molfile', + 'rd' => 'chemical/x-mdl-rdfile', + 'rxn' => 'chemical/x-mdl-rxnfile', + 'sd|sdf' => 'chemical/x-mdl-sdfile', + 'tgf' => 'chemical/x-mdl-tgf', + 'mcif' => 'chemical/x-mmcif', + 'mol2' => 'chemical/x-mol2', + 'b' => 'chemical/x-molconn-Z', + 'gpt' => 'chemical/x-mopac-graph', + 'mop|mopcrt|mpc|dat|zmt' => 'chemical/x-mopac-input', + 'moo' => 'chemical/x-mopac-out', + 'mvb' => 'chemical/x-mopac-vib', + 'asn' => 'chemical/x-ncbi-asn1-spec', + 'prt|ent' => 'chemical/x-ncbi-asn1-ascii', + 'val|aso' => 'chemical/x-ncbi-asn1-binary', + 'pdb|ent' => 'chemical/x-pdb', + 'ros' => 'chemical/x-rosdal', + 'sw' => 'chemical/x-swissprot', + 'vms' => 'chemical/x-vamas-iso14976', + 'vmd' => 'chemical/x-vmd', + 'xtel' => 'chemical/x-xtel', + 'xyz' => 'chemical/x-xyz', + 'gif' => 'image/gif', + 'ief' => 'image/ief', + 'jpeg|jpg|jpe' => 'image/jpeg', + 'pcx' => 'image/pcx', + 'png' => 'image/png', + 'svg|svgz' => 'image/svg+xml', + 'tiff|tif' => 'image/tiff', + 'djvu|djv' => 'image/vnd.djvu', + 'wbmp' => 'image/vnd.wap.wbmp', + 'ras' => 'image/x-cmu-raster', + 'cdr' => 'image/x-coreldraw', + 'pat' => 'image/x-coreldrawpattern', + 'cdt' => 'image/x-coreldrawtemplate', + 'ico' => 'image/x-icon', + 'art' => 'image/x-jg', + 'jng' => 'image/x-jng', + 'bmp' => 'image/x-ms-bmp', + 'psd' => 'image/x-photoshop', + 'pnm' => 'image/x-portable-anymap', + 'pbm' => 'image/x-portable-bitmap', + 'pgm' => 'image/x-portable-graymap', + 'ppm' => 'image/x-portable-pixmap', + 'rgb' => 'image/x-rgb', + 'xbm' => 'image/x-xbitmap', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'eml' => 'message/rfc822', + 'igs|iges' => 'model/iges', + 'msh|mesh|silo' => 'model/mesh', + 'wrl|vrml' => 'model/vrml', + 'ics|icz' => 'text/calendar', + 'css' => 'text/css', + 'csv' => 'text/csv', + '323' => 'text/h323', + 'html|htm|shtml' => 'text/html', + 'uls' => 'text/iuls', + 'mml' => 'text/mathml', + 'asc|txt|text|pot' => 'text/plain', + 'rtx' => 'text/richtext', + 'sct|wsc' => 'text/scriptlet', + 'tm|ts' => 'text/texmacs', + 'tsv' => 'text/tab-separated-values', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'wml' => 'text/vnd.wap.wml', + 'wmls' => 'text/vnd.wap.wmlscript', + 'bib' => 'text/x-bibtex', + 'boo' => 'text/x-boo', + 'h++|hpp|hxx|hh' => 'text/x-c++hdr', + 'c++|cpp|cxx|cc' => 'text/x-c++src', + 'h' => 'text/x-chdr', + 'htc' => 'text/x-component', + 'c' => 'text/x-csrc', + 'd' => 'text/x-dsrc', + 'diff|patch' => 'text/x-diff', + 'hs' => 'text/x-haskell', + 'java' => 'text/x-java', + 'lhs' => 'text/x-literate-haskell', + 'moc' => 'text/x-moc', + 'p|pas' => 'text/x-pascal', + 'gcd' => 'text/x-pcs-gcd', + 'pl|pm' => 'text/x-perl', + 'py' => 'text/x-python', + 'etx' => 'text/x-setext', + 'tcl|tk' => 'text/x-tcl', + 'tex|ltx|sty|cls' => 'text/x-tex', + 'vcs' => 'text/x-vcalendar', + 'vcf' => 'text/x-vcard', + '3gp' => 'video/3gpp', + 'dl' => 'video/dl', + 'dif|dv' => 'video/dv', + 'fli' => 'video/fli', + 'gl' => 'video/gl', + 'mpeg|mpg|mpe' => 'video/mpeg', + 'mp4|f4v|f4p' => 'video/mp4', + 'flv' => 'video/x-flv', + 'ogv' => 'video/ogg', + 'qt|mov' => 'video/quicktime', + 'mxu' => 'video/vnd.mpegurl', + 'lsf|lsx' => 'video/x-la-asf', + 'mng' => 'video/x-mng', + 'asf|asx' => 'video/x-ms-asf', + 'wm' => 'video/x-ms-wm', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wvx' => 'video/x-ms-wvx', + 'avi' => 'video/x-msvideo', + 'm4v' => 'video/x-m4v', + 'movie' => 'video/x-sgi-movie', + 'ice' => 'x-conference/x-cooltalk', + 'sisx' => 'x-epoc/x-sisx-app', + 'vrm|vrml|wrl' => 'x-world/x-vrml', + 'xps' => 'application/vnd.ms-xpsdocument', + ); + } + foreach ($mapping as $ext_preg => $mime_match) { + if (preg_match('!\.(' . $ext_preg . ')$!i', $filename)) { + return $mime_match; + } + } + + return 'application/octet-stream'; +} + function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) { if(defined('HAS_DIED')) die(T_('message_die() was called multiple times.')); define('HAS_DIED', 1); - - $sql_store = $sql; - - // Get SQL error if we are debugging. Do this as soon as possible to prevent - // subsequent queries from overwriting the status of sql_error() - if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { - $sql_error = is_null($db) ? '' : $db->sql_error(); - $debug_text = ''; - - if ($sql_error['message'] != '') - $debug_text .= '<br /><br />'. T_('SQL Error') .' : '. $sql_error['code'] .' '. $sql_error['message']; - - if ($sql_store != '') - $debug_text .= '<br /><br />'. $sql_store; - - if ($err_line != '' && $err_file != '') - $debug_text .= '</br /><br />'. T_('Line') .' : '. $err_line .'<br />'. T_('File') .' :'. $err_file; - } - - switch($msg_code) { - case GENERAL_MESSAGE: - if ($msg_title == '') - $msg_title = T_('Information'); - break; - - case CRITICAL_MESSAGE: - if ($msg_title == '') - $msg_title = T_('Critical Information'); - break; - - case GENERAL_ERROR: - if ($msg_text == '') - $msg_text = T_('An error occured'); - - if ($msg_title == '') - $msg_title = T_('General Error'); - break; - - case CRITICAL_ERROR: - // Critical errors mean we cannot rely on _ANY_ DB information being - // available so we're going to dump out a simple echo'd statement - - if ($msg_text == '') - $msg_text = T_('An critical error occured'); - - if ($msg_title == '') - $msg_title = T_('Critical Error'); - break; - } - - // Add on DEBUG info if we've enabled debug mode and this is an error. This - // prevents debug info being output for general messages should DEBUG be - // set TRUE by accident (preventing confusion for the end user!) - if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { - if ($debug_text != '') - $msg_text = $msg_text . '<br /><br /><strong>'. T_('DEBUG MODE') .'</strong>'. $debug_text; - } - - echo "<html>\n<body>\n". $msg_title ."\n<br /><br />\n". $msg_text ."</body>\n</html>"; - exit; + + $sql_store = $sql; + + // Get SQL error if we are debugging. Do this as soon as possible to prevent + // subsequent queries from overwriting the status of sql_error() + if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { + $sql_error = is_null($db) ? '' : $db->sql_error(); + $debug_text = ''; + + if ($sql_error['message'] != '') + $debug_text .= '<br /><br />'. T_('SQL Error') .' : '. $sql_error['code'] .' '. $sql_error['message']; + + if ($sql_store != '') + $debug_text .= '<br /><br />'. $sql_store; + + if ($err_line != '' && $err_file != '') + $debug_text .= '</br /><br />'. T_('Line') .' : '. $err_line .'<br />'. T_('File') .' :'. $err_file; + } + + switch($msg_code) { + case GENERAL_MESSAGE: + if ($msg_title == '') + $msg_title = T_('Information'); + break; + + case CRITICAL_MESSAGE: + if ($msg_title == '') + $msg_title = T_('Critical Information'); + break; + + case GENERAL_ERROR: + if ($msg_text == '') + $msg_text = T_('An error occured'); + + if ($msg_title == '') + $msg_title = T_('General Error'); + break; + + case CRITICAL_ERROR: + // Critical errors mean we cannot rely on _ANY_ DB information being + // available so we're going to dump out a simple echo'd statement + + if ($msg_text == '') + $msg_text = T_('An critical error occured'); + + if ($msg_title == '') + $msg_title = T_('Critical Error'); + break; + } + + // Add on DEBUG info if we've enabled debug mode and this is an error. This + // prevents debug info being output for general messages should DEBUG be + // set TRUE by accident (preventing confusion for the end user!) + if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { + if ($debug_text != '') + $msg_text = $msg_text . '<br /><br /><strong>'. T_('DEBUG MODE') .'</strong>'. $debug_text; + } + + echo "<html>\n<body>\n". $msg_title ."\n<br /><br />\n". $msg_text ."</body>\n</html>"; + exit; } diff --git a/header.inc.php b/header.inc.php index 1002aab..d3c6ed8 100644 --- a/header.inc.php +++ b/header.inc.php @@ -1,34 +1,40 @@ <?php -ini_set('display_errors', '1'); -ini_set('mysql.trace_mode', '0'); - -error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE); session_start(); require_once dirname(__FILE__) .'/services/servicefactory.php'; require_once dirname(__FILE__) .'/config.inc.php'; require_once dirname(__FILE__) .'/functions.inc.php'; // Determine the base URL if (!isset($root)) { - $pieces = explode('/', $_SERVER['SCRIPT_NAME']); - $root = '/'; - foreach ($pieces as $piece) { - if ($piece != '' && !strstr($piece, '.php')) { - $root .= $piece .'/'; - } - } - if (($root != '/') && (substr($root, -1, 1) != '/')) { - $root .= '/'; + $pieces = explode('/', $_SERVER['SCRIPT_NAME']); + $root = '/'; + foreach ($pieces as $piece) { + if ($piece != '' && !strstr($piece, '.php')) { + $root .= $piece .'/'; } - $path = $root; + } + if (($root != '/') && (substr($root, -1, 1) != '/')) { + $root .= '/'; + } + $path = $root; - $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; - $root = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root; + $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; + $root = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root; } define('GENERAL_MESSAGE', 200); define('GENERAL_ERROR', 202); define('CRITICAL_MESSAGE', 203); define('CRITICAL_ERROR', 204); -define('DEBUG', TRUE); + +if (defined('SCUTTLE_DEBUG') && SCUTTLE_DEBUG) { + ini_set('display_errors', '1'); + ini_set('mysql.trace_mode', '1'); + error_reporting(E_ALL); +} +else { + ini_set('display_errors', '0'); + ini_set('mysql.trace_mode', '0'); + error_reporting(E_ALL); +} \ No newline at end of file diff --git a/jsScuttle.php b/jsScuttle.php index e9fec46..93fa85b 100644 --- a/jsScuttle.php +++ b/jsScuttle.php @@ -1,64 +1,64 @@ <?php header('Content-Type: text/javascript'); require_once 'header.inc.php'; require_once 'functions.inc.php'; $player_root = $root .'includes/player/'; ?> var deleted = false; function deleteBookmark(ele, input) { $(ele).hide(); $(ele).parent().append("<span><?php echo T_('Are you sure?') ?> <a href=\"#\" onclick=\"deleteConfirmed(this, " + input + "); return false;\"><?php echo T_('Yes'); ?></a> - <a href=\"#\" onclick=\"deleteCancelled(this); return false;\"><?php echo T_('No'); ?></a></span>"); return false; } function deleteCancelled(ele) { $(ele).parent().prev().show(); $(ele).parent().remove(); return false; } function deleteConfirmed(ele, input) { $.get("<?php echo $root; ?>ajaxDelete.php?id=" + input, function(data) { if (1 === parseInt(data)) { $(ele).parents(".xfolkentry").slideUp(); } }); return false; } function useAddress(ele) { var address = ele.value; if (address != '') { if (address.indexOf(':') < 0) { address = 'http:\/\/' + address; } getTitle(address, null); ele.value = address; } } function getTitle(input) { var title = $("#titleField").val(); if (title.length < 1) { $("#titleField").css("background-image", "url(<?php echo $root; ?>loading.gif)"); if (input.indexOf("http") > -1) { $.get("<?php echo $root; ?>ajaxGetTitle.php?url=" + input, function(data) { $("#titleField").css("background-image", "none") .val(data); }); } } } /* Page load */ $(function() { - /* Insert Flash player for MP3 links */ + // Insert Flash player for MP3 links if ($("#bookmarks").length > 0) { $("a[href$=.mp3].taggedlink").each(function() { var url = this.href; var code = '<object type="application/x-shockwave-flash" data="<?php echo $player_root ?>musicplayer_f6.swf?song_url=' + url +'&amp;b_bgcolor=ffffff&amp;b_fgcolor=000000&amp;b_colors=0000ff,0000ff,ff0000,ff0000&buttons=<?php echo $player_root ?>load.swf,<?php echo $player_root ?>play.swf,<?php echo $player_root ?>stop.swf,<?php echo $player_root ?>error.swf" width="14" height="14">'; code = code + '<param name="movie" value="<?php echo $player_root ?>musicplayer.swf?song_url=' + url +'&amp;b_bgcolor=ffffff&amp;b_fgcolor=000000&amp;b_colors=0000ff,0000ff,ff0000,ff0000&amp;buttons=<?php echo $player_root ?>load.swf,<?php echo $player_root ?>play.swf,<?php echo $player_root ?>stop.swf,<?php echo $player_root ?>error.swf" />'; code = code + '</object> '; $(this).prepend(code); }); } }) diff --git a/readme.txt b/readme.txt index fba23fa..58a703b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,15 +1,15 @@ -Scuttle 0.8.0 +Scuttle 0.9.0 http://scuttle.org/ Copyright (C) 2004 - 2010 Marcus Campbell Available under the GNU General Public License ============ INSTALLATION ============ * Use the SQL contained in tables.sql to create the necessary database tables. This file was written specifically for MySQL, so may need rewritten if you intend to use a different database system. * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. * Set the CHMOD permissions on the /cache/ subdirectory to 777 \ No newline at end of file diff --git a/rss.php b/rss.php index cf10478..533bf4c 100644 --- a/rss.php +++ b/rss.php @@ -1,114 +1,125 @@ <?php /*************************************************************************** -Copyright (C) 2004 - 2006 Marcus Campbell +Copyright (C) 2004 - 2010 Marcus Campbell http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once 'header.inc.php'; + $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); -$cacheservice =& ServiceFactory::getServiceInstance('CacheService'); +$cacheservice =& ServiceFactory::getServiceInstance('CacheService'); $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); -$userservice =& ServiceFactory::getServiceInstance('UserService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); $tplVars = array(); header('Content-Type: application/xml'); list($url, $user, $cat) = explode('/', $_SERVER['PATH_INFO']); if ($usecache) { - // Generate hash for caching on - $hashtext = $_SERVER['REQUEST_URI']; - if ($userservice->isLoggedOn()) { - $hashtext .= $userservice->getCurrentUserID(); - $currentUser = $userservice->getCurrentUser(); - $currentUsername = $currentUser[$userservice->getFieldName('username')]; - if ($currentUsername == $user) { - $hashtext .= $user; - } + // Generate hash for caching on + $hashtext = $_SERVER['REQUEST_URI']; + if ($userservice->isLoggedOn()) { + $hashtext .= $userservice->getCurrentUserID(); + $currentUser = $userservice->getCurrentUser(); + $currentUsername = $currentUser[$userservice->getFieldName('username')]; + if ($currentUsername == $user) { + $hashtext .= $user; } - $hash = md5($hashtext); + } + $hash = md5($hashtext); - // Cache for an hour - $cacheservice->Start($hash, 3600); + // Cache for an hour + $cacheservice->Start($hash, 3600); } -$watchlist = null; +$watchlist = NULL; if ($user && $user != 'all') { - if ($user == 'watchlist') { - $user = $cat; - $cat = null; - $watchlist = true; - } - if (is_int($user)) { - $userid = intval($user); + if ($user == 'watchlist') { + $user = $cat; + $cat = NULL; + $watchlist = TRUE; + } + if (is_int($user)) { + $userid = intval($user); + } else { + if ($userinfo = $userservice->getUserByUsername($user)) { + $userid =& $userinfo[$userservice->getFieldName('primary')]; } else { - if ($userinfo = $userservice->getUserByUsername($user)) { - $userid =& $userinfo[$userservice->getFieldName('primary')]; - } else { - $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); - $templateservice->loadTemplate('error.404.tpl', $tplVars); - //throw a 404 error - exit(); - } + $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); + $templateservice->loadTemplate('error.404.tpl', $tplVars); + //throw a 404 error + exit(); } - $pagetitle .= ": ". $user; + } + $pagetitle .= ": ". $user; } else { - $userid = NULL; + $userid = NULL; } if ($cat) { - $pagetitle .= ": ". str_replace('+', ' + ', $cat); + $pagetitle .= ": ". str_replace('+', ' + ', $cat); } $tplVars['feedtitle'] = filter($GLOBALS['sitename'] . (isset($pagetitle) ? $pagetitle : '')); $tplVars['feedlink'] = $GLOBALS['root']; $tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']); -$bookmarks =& $bookmarkservice->getBookmarks(0, 15, $userid, $cat, NULL, getSortOrder(), $watchlist); +$bookmarks =& $bookmarkservice->getBookmarks(0, 15, $userid, $cat, NULL, getSortOrder(), $watchlist); $bookmarks_tmp =& filter($bookmarks['bookmarks']); $bookmarks_tpl = array(); foreach(array_keys($bookmarks_tmp) as $key) { - $row =& $bookmarks_tmp[$key]; - - $_link = $row['bAddress']; - // Redirection option - if ($GLOBALS['useredir']) { - $_link = $GLOBALS['url_redir'] . $_link; - } - $_pubdate = date("r", strtotime($row['bDatetime'])); - // array_walk($row['tags'], 'filter'); - - $bookmarks_tpl[] = array( - 'title' => $row['bTitle'], - 'link' => $_link, - 'description' => $row['bDescription'], - 'creator' => $row['username'], - 'pubdate' => $_pubdate, - 'tags' => $row['tags'] - ); + $row =& $bookmarks_tmp[$key]; + + $_link = $row['bAddress']; + // Redirection option + if ($GLOBALS['useredir']) { + $_link = $GLOBALS['url_redir'] . $_link; + } + $_pubdate = date("r", strtotime($row['bDatetime'])); + + $uriparts = explode('.', $_link); + $extension = end($uriparts); + unset($uriparts); + + $enclosure = array(); + if ($keys = multi_array_search($extension, $GLOBALS['filetypes'])) { + $enclosure['mime'] = file_get_mimetype($_link); + $enclosure['length'] = file_get_filesize($_link); + } + + $bookmarks_tpl[] = array( + 'title' => $row['bTitle'], + 'link' => $_link, + 'description' => $row['bDescription'], + 'creator' => $row['username'], + 'pubdate' => $_pubdate, + 'tags' => $row['tags'], + 'enclosure_mime' => $enclosure['mime'], + 'enclosure_length' => $enclosure['length'] + ); } unset($bookmarks_tmp); unset($bookmarks); $tplVars['bookmarks'] =& $bookmarks_tpl; $templateservice->loadTemplate('rss.tpl', $tplVars); if ($usecache) { - // Cache output if existing copy has expired - $cacheservice->End($hash); + // Cache output if existing copy has expired + $cacheservice->End($hash); } -?> diff --git a/scuttle.css b/scuttle.css index c94341c..fba6933 100644 --- a/scuttle.css +++ b/scuttle.css @@ -1,441 +1,448 @@ /* BASE */ * { font-family: helvetica, arial, sans-serif; } a { color: #47A; text-decoration: none; } a:hover { color: #258; text-decoration: underline; } a img { border: 0; } body { background-color: #FFF; margin: 0; padding: 0; } -input[type=text], -input[type=password], -select, -textarea { - border: 1px solid #AAA; - padding: .1em; +input[type=submit] { + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFF), to(#DDD)); + border: 1px solid #CCC; + border-radius: 5px; + font-size: 13px; + padding: 4px 12px; + text-shadow: #FFF 1px 1px 0px; + -moz-border-radius: 5px; +} +input[type=submit]:active { + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#DDD), to(#FFF)); +} +input[type=submit]:hover { + border-color: #666; } input[type=text], input[type=password], +select, textarea { - padding: .2em; -} -input[type=text]:focus, -input[type=password]:focus, -select:focus, -textarea:focus { - border-color: #666; + border: 1px solid #CCC; + border-radius: 3px; + font-size: 13px; + padding: 4px 5px; + -moz-border-radius: 3px; } p.error, p.success { border: 1px solid; font-size: small; margin: .5em; padding: .5em; width: 70%; } p.error { background: #FCC; border-color: #966; color: #633; } p.success { background: #CFC; border-color: #696; color: #363; } td#availability { color: #285; font-weight: bold; } td#availability.not-available { color: #F00; } textarea { font-size: small; padding: .2em; } th { padding-right: 1em; text-align: right; } /* HEADER */ div#header { background: #FFF url('bg_header.png') bottom repeat-x; border-bottom: 3px solid #9CD; clear: both; } div#header:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } * html div#header { height: 1%; } h1 { float: left; font-size: x-large; font-weight: bold; margin: 0; padding: 1em; text-transform: lowercase; } html > body h1 { background: url('logo.png') no-repeat 10px; padding-left: 75px; } html > body div#header.popup h1 { background: url('logo_24.png') no-repeat 10px; padding: .5em .5em .5em 50px; } h1 a { color: #000; text-shadow: 2px 2px 2px #9CD; } h1 a:hover { color: #000; } h2 { background: #666 url('bg_bar.png') center center repeat-x; border-bottom: 3px solid #DDD; clear: both; color: #DDD; font-size: medium; letter-spacing: .1em; margin: 0 0 1em 0; padding: .5em 1em; text-shadow: 1px 1px 1px #333; text-transform: lowercase; } /* NAVIGATION */ ul#navigation { list-style-type: none; margin: 0; padding: 1.9em 1em; text-transform: lowercase; width: auto; } ul#navigation a { font-size: medium; font-weight: bold; padding: .2em .5em; } ul#navigation a:hover { background: #7AD; color: #FFF; } ul#navigation li { float: left; } ul#navigation li.access { float: right; } /* BOOKMARKS */ ol#bookmarks { list-style-type: none; margin: 0; padding: 0 1em; width: 70%; } html > body ol#bookmarks { margin: 0 1em; padding: 0; } div.link a { color: blue; font-size: medium; } div.link a:visited { color: purple; } div.meta { color: #285; } div.meta span { color: #F00; } li.xfolkentry { border-bottom: 1px solid #DDD; margin-bottom: 0; padding: 1em .5em; } html > body li.xfolkentry { border-bottom: 1px dotted #AAA; } li.xfolkentry div { padding: .1em; } li.xfolkentry.deleted { opacity: .5; } li.xfolkentry.private { border-left: 3px solid #F00; } li.xfolkentry.shared { border-left: 3px solid #FA0; } /* SIDEBAR */ div#sidebar { font-size: small; position: absolute; right: 1em; top: 10em; width: 25%; } div#sidebar a { color: #995; } div#sidebar a:hover { color: #773; } div#sidebar div { background: #FFF url('bg_sidebar.png') bottom repeat-x; border: 1px solid #CC8; color: #555; margin-bottom: 1em; } div#sidebar h2 { background: transparent; border: 0; color: #995; letter-spacing: 0; margin: 0; padding: .5em 0; text-shadow: none; } div#sidebar hr { display: none; } div#sidebar p { margin: 1em; } div#sidebar p.tags a { margin: 0; } div#sidebar table { margin: .5em .5em 0 .5em; } div#sidebar table td { padding-bottom: .25em; padding-right: .5em; } div#sidebar ul { list-style-type: none; margin: 0; padding: .5em; } div#sidebar ul li { margin: .5em 0; } /* TAGS */ p.tags { line-height: 2.25em; margin: 2em 10%; text-align: justify; vertical-align: middle; } p.tags a, p.tags span { color: #47A; margin-right: .5em; } p.tags span:hover { cursor: pointer; text-decoration: underline; } p.tags span.selected { background: #CEC; } /* PROFILE */ table.profile th { width: 10em; } /* OTHER GUFF */ dd { background: #CEC; border-right: 4px solid #ACA; color: #464; padding: 6px; } dd a { color: #464; } dd a:hover { color: #000 !important; text-decoration: underline !important; } dl { font-size: small; margin: 1em; width: 70%; } dl#profile dd { background: #CDE; border-color: #ABC; color: #247; } dl#profile dt { background: #BCE; border-color: #9AC; color: #245; display: block; font-weight: bold; padding: 6px; } dl#profile a { color: #446; } dl#profile a:hover { color: #000 !important; text-decoration: underline !important; } dl#meta dd { line-height: 1.5em; } dl#meta dt { background: #BDB; color: #353; display: block; font-weight: bold; padding: 6px; } dt { border-right: 4px solid #9B9; } dt a { background: #BDB; color: #353; display: block; font-weight: bold; padding: 6px; } dt a:hover { background: #ACA; border: 0; } form { margin: 0; } form#search { background: #FFF; color: #555; font-size: small; margin-bottom: 1em; } form label, form td, form th { font-size: small; } form table { margin: 0 1em; } h3 { background: #DDD; color: #555; font-size: small; letter-spacing: .2em; margin: 2em 1em 1em 1em; padding: .5em .75em; text-shadow: 1px 1px 1px #FFF; } li { font-size: small; margin-bottom: .5em; } p { font-size: small; margin: 1em; } p#sort { color: #CCC; font-size: small; float: right; margin: 0; position: absolute; right: 0; top: 6.9em; } html > body p#sort { margin-right: .75em; } p#sort a { background: #AAA; color: #555; font-weight: normal; margin-right: .5em; padding: 0 1em; border-radius: .25em;. } html > body p#sort a { margin-right: 0; } p#sort a:hover { background: #CCC; text-decoration: none !important; } p#sort span { display: none; } p.paging { font-size: small; margin-left: 1em; } p.paging a, p.paging span.disable { background: #888; color: #FFF; display: inline; margin-right: .5em; padding: .25em 1em; } p.paging a:hover { background: #666; } p.paging span { display: none; } p.paging span.disable { background: #DDD; color: #AAA; } div.collapsible p.tags { line-height: 2.25em; margin: 1em 2em; } th label { padding-right: 1em; } ul { margin-right: 1em; width: 75%; } diff --git a/templates/register.tpl.php b/templates/register.tpl.php index 4348116..f7a62ac 100644 --- a/templates/register.tpl.php +++ b/templates/register.tpl.php @@ -1,56 +1,56 @@ <?php $this->includeTemplate($GLOBALS['top_include']); ?> <p><?php echo sprintf(T_('Sign up here to create a free %s account. All the information requested below is required'), $GLOBALS['sitename']); ?>.</p> <form action="<?php echo $formaction; ?>" method="post"> <table> <tr> <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> - <td><input type="text" id="username" name="username" size="20" class="required" /></td> + <td><input type="text" id="username" name="username" size="20" maxlength="25" class="required" /></td> <td id="availability"></td> </tr> <tr> <th align="left"><label for="password"><?php echo T_('Password'); ?></label></th> <td><input type="password" id="password" name="password" size="20" class="required" /></td> <td></td> </tr> <tr> <th align="left"><label for="passconf"><?php echo T_('Confirm Password'); ?></label></th> <td><input type="password" id="passconf" name="passconf" size="20" class="required" /></td> <td></td> </tr> <tr> <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> - <td><input type="text" id="email" name="email" size="40" class="required" /></td> + <td><input type="text" id="email" name="email" size="40" maxlength="50" class="required" /></td> <td></td> </tr> <tr> <td><input type="hidden" name="token" value="<?php echo $token; ?>" /></td> <td><input type="submit" name="submitted" value="<?php echo T_('Register'); ?>" /></td> <td></td> </tr> </table> </form> <script type="text/javascript"> $(function() { $("#username").focus() .keydown(function() { clearTimeout(self.searching); self.searching = setTimeout(function() { $.get("<?php echo $GLOBALS['root']; ?>ajaxIsAvailable.php?username=" + $("#username").val(), function(data) { if (data) { $("#availability").removeClass() .html("<?php echo T_('Available'); ?>"); } else { $("#availability").removeClass() .addClass("not-available") .html("<?php echo T_('Not Available'); ?>"); } } ); }, 300); }); }); </script> <?php $this->includeTemplate($GLOBALS['bottom_include']); ?> \ No newline at end of file diff --git a/templates/rss.tpl.php b/templates/rss.tpl.php index 0f03c06..5ef4877 100644 --- a/templates/rss.tpl.php +++ b/templates/rss.tpl.php @@ -1,28 +1,24 @@ -<?php -echo '<?xml version="1.0" encoding="UTF-8" ?'.">\n"; -?> - +<?php echo '<?xml version="1.0" encoding="UTF-8" ?'.">\n"; ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> - <title><?php echo $feedtitle; ?></title> - <link><?php echo $feedlink; ?></link> - <description><?php echo $feeddescription; ?></description> - <ttl>60</ttl> - -<?php foreach($bookmarks as $bookmark): ?> + <title><?php echo $feedtitle; ?></title> + <link><?php echo $feedlink; ?></link> + <description><?php echo $feeddescription; ?></description> + <ttl>60</ttl> + <?php foreach($bookmarks as $bookmark): ?> <item> - <title><?php echo $bookmark['title']; ?></title> - <link><?php echo $bookmark['link']; ?></link> - <description><?php echo $bookmark['description']; ?></description> - <dc:creator><?php echo $bookmark['creator']; ?></dc:creator> - <pubDate><?php echo $bookmark['pubdate']; ?></pubDate> - - <?php foreach($bookmark['tags'] as $tag): ?> + <title><?php echo $bookmark['title']; ?></title> + <link><?php echo $bookmark['link']; ?></link> + <description><?php echo $bookmark['description']; ?></description> + <dc:creator><?php echo $bookmark['creator']; ?></dc:creator> + <pubDate><?php echo $bookmark['pubdate']; ?></pubDate> + <?php foreach($bookmark['tags'] as $tag): ?> <category><?php echo $tag; ?></category> - <?php endforeach; ?> - + <?php endforeach; ?> + <?php if ($bookmark['enclosure_mime']): ?> + <enclosure url="<?php echo $bookmark['link']; ?>" length="<?php echo $bookmark['enclosure_length']; ?>" type="<?php echo $bookmark['enclosure_mime']; ?>" /> + <?php endif; ?> </item> -<?php endforeach; ?> - + <?php endforeach; ?> </channel> </rss> \ No newline at end of file diff --git a/templates/top.inc.php b/templates/top.inc.php index 87f9f26..85c965d 100644 --- a/templates/top.inc.php +++ b/templates/top.inc.php @@ -1,48 +1,48 @@ <?php header('Content-Type: text/html; charset=utf-8'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title><?php echo filter($GLOBALS['sitename'] . (isset($pagetitle) ? ': ' . $pagetitle : '')); ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="icon" type="image/png" href="<?php echo $GLOBALS['root']; ?>icon.png" /> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['root']; ?>scuttle.css" /> <?php $size = count($rsschannels); for ($i = 0; $i < $size; $i++) { echo '<link rel="alternate" type="application/rss+xml" title="'. $rsschannels[$i][0] .'" href="'. $rsschannels[$i][1] .'" />'; } ?> <?php if ($loadjs): ?> <script type="text/javascript" src="<?php echo $GLOBALS['root']; ?>includes/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="<?php echo $GLOBALS['root']; ?>jsScuttle.php"></script> <?php endif; ?> </head> <body> <?php $headerstyle = ''; -if(isset($_GET['popup'])) { +if (isset($_GET['popup'])) { $headerstyle = ' class="popup"'; } ?> <div id="header"<?php echo $headerstyle; ?>> <h1><a href="<?php echo $GLOBALS['root']; ?>"><?php echo $GLOBALS['sitename']; ?></a></h1> <?php - if(!isset($_GET['popup'])) { + if (!isset($_GET['popup'])) { $this->includeTemplate('toolbar.inc'); } ?> </div> <?php if (isset($subtitle)) { echo '<h2>'. $subtitle ."</h2>\n"; } if (isset($error)) { echo '<p class="error">'. $error ."</p>\n"; } if (isset($msg)) { echo '<p class="success">'. $msg ."</p>\n"; } ?>
scronide/scuttle
616df7459a1262dc55320ee60cc74dae9d878ab3
- Override privacy status on bookmark file import, if specified (i.e. Delicious) - Set tags on bookmark file import, if specified (i.e. Delicious)
diff --git a/import.php b/import.php index 2af25d0..9f29728 100644 --- a/import.php +++ b/import.php @@ -1,108 +1,112 @@ <?php /*************************************************************************** Copyright (c) 2004 - 2006 Marcus Campbell http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once 'header.inc.php'; -$userservice =& ServiceFactory::getServiceInstance('UserService'); + +$userservice =& ServiceFactory::getServiceInstance('UserService'); $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); + $tplVars = array(); if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) { $userinfo = $userservice->getCurrentUser(); if (isset($_POST['status']) && is_numeric($_POST['status'])) { - $status = intval($_POST['status']); - } else { - $status = 2; + $status = intval($_POST['status']); + } + else { + $status = 2; } $depth = array(); $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); if (!($fp = fopen($_FILES['userfile']['tmp_name'], "r"))) die(T_("Could not open XML input")); while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf(T_("XML error: %s at line %d"), xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); header('Location: '. createURL('bookmarks', $userinfo[$userservice->getFieldName('username')])); -} else { - $templatename = 'importDelicious.tpl'; - $tplVars['subtitle'] = T_('Import Bookmarks from del.icio.us'); - $tplVars['formaction'] = createURL('import'); - $templateservice->loadTemplate($templatename, $tplVars); +} +else { + $templatename = 'importDelicious.tpl'; + $tplVars['subtitle'] = T_('Import Bookmarks from del.icio.us'); + $tplVars['formaction'] = createURL('import'); + $templateservice->loadTemplate($templatename, $tplVars); } function startElement($parser, $name, $attrs) { global $depth, $status, $tplVars, $userservice; $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); $userservice =& ServiceFactory::getServiceInstance('UserService'); if ($name == 'POST') { while(list($attrTitle, $attrVal) = each($attrs)) { switch ($attrTitle) { case 'HREF': $bAddress = $attrVal; break; case 'DESCRIPTION': $bTitle = $attrVal; break; case 'EXTENDED': $bDescription = $attrVal; break; case 'TIME': $bDatetime = $attrVal; break; case 'TAG': $tags = strtolower($attrVal); break; } } if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) { $tplVars['error'] = T_('You have already submitted this bookmark.'); } else { // Strangely, PHP can't work out full ISO 8601 dates, so we have to chop off the Z. $bDatetime = substr($bDatetime, 0, -1); // If bookmark claims to be from the future, set it to be now instead if (strtotime($bDatetime) > time()) { $bDatetime = gmdate('Y-m-d H:i:s'); } if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $status, $tags, $bDatetime, true, true)) $tplVars['msg'] = T_('Bookmark imported.'); else $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.'); } } $depth[$parser]++; } function endElement($parser, $name) { global $depth; $depth[$parser]--; } ?> diff --git a/importNetscape.php b/importNetscape.php index 97c0a4f..f953ffc 100644 --- a/importNetscape.php +++ b/importNetscape.php @@ -1,84 +1,97 @@ <?php /*************************************************************************** -Copyright (c) 2004 - 2006 Marcus Campbell +Copyright (c) 2004 - 2010 Marcus Campbell http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once 'header.inc.php'; + $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); -$userservice =& ServiceFactory::getServiceInstance('UserService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); + $tplVars = array(); if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) { $userinfo = $userservice->getCurrentUser(); if (isset($_POST['status']) && is_numeric($_POST['status'])) { - $status = intval($_POST['status']); - } else { - $status = 2; + $status = intval($_POST['status']); + } + else { + $status = 2; } // File handle $html = file_get_contents($_FILES['userfile']['tmp_name']); // Create link array preg_match_all('/<a\s+(.*?)\s*\/*>([^<]*)/si', $html, $matches); - $links = $matches[1]; + $links = $matches[1]; $titles = $matches[2]; $size = count($links); for ($i = 0; $i < $size; $i++) { - $attributes = preg_split('/\s+/s', $links[$i]); - foreach ($attributes as $attribute) { - $att = preg_split('/\s*=\s*/s', $attribute, 2); - $attrTitle = $att[0]; - $attrVal = eregi_replace('"', '&quot;', preg_replace('/([\'"]?)(.*)\1/', '$2', $att[1])); - switch ($attrTitle) { - case "HREF": - $bAddress = $attrVal; - break; - case "ADD_DATE": - $bDatetime = gmdate('Y-m-d H:i:s', $attrVal); - break; - } - } - $bTitle = eregi_replace('"', '&quot;', trim($titles[$i])); + $bTags = ''; + $bStatus = $status; - if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) { - $tplVars['error'] = T_('You have already submitted this bookmark.'); - } else { - // If bookmark claims to be from the future, set it to be now instead - if (strtotime($bDatetime) > time()) { - $bDatetime = gmdate('Y-m-d H:i:s'); - } + $attributes = preg_split('/\s+/s', $links[$i]); + foreach ($attributes as $attribute) { + $att = preg_split('/\s*=\s*/s', $attribute, 2); + $attrTitle = $att[0]; + $attrVal = str_replace('"', '&quot;', preg_replace('/([\'"]?)(.*)\1/', '$2', $att[1])); + switch ($attrTitle) { + case 'HREF': + $bAddress = $attrVal; + break; + case 'ADD_DATE': + $bDatetime = gmdate('Y-m-d H:i:s', $attrVal); + break; + case 'PRIVATE': + $bStatus = (intval($attrVal) == 1) ? 2 : $status; + break; + case 'TAGS': + $bTags = strtolower($attrVal); + break; + } + } + $bTitle = str_replace('"', '&quot;', trim($titles[$i])); - if ($bookmarkservice->addBookmark($bAddress, $bTitle, NULL, $status, NULL, $bDatetime, false, true)) { - $tplVars['msg'] = T_('Bookmark imported.'); - } else { - $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.'); - } + if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) { + $tplVars['error'] = T_('You have already submitted this bookmark.'); + } else { + // If bookmark claims to be from the future, set it to be now instead + if (strtotime($bDatetime) > time()) { + $bDatetime = gmdate('Y-m-d H:i:s'); } + + if ($bookmarkservice->addBookmark($bAddress, $bTitle, NULL, $bStatus, $bTags, $bDatetime, false, true)) { + $tplVars['msg'] = T_('Bookmark imported.'); + } + else { + $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.'); + } + } } header('Location: '. createURL('bookmarks', $userinfo[$userservice->getFieldName('username')])); -} else { - $templatename = 'importNetscape.tpl'; - $tplVars['subtitle'] = T_('Import Bookmarks from Browser File'); - $tplVars['formaction'] = createURL('importNetscape'); - $templateservice->loadTemplate($templatename, $tplVars); } -?> +else { + $templatename = 'importNetscape.tpl'; + $tplVars['subtitle'] = T_('Import Bookmarks from Browser File'); + $tplVars['formaction'] = createURL('importNetscape'); + $templateservice->loadTemplate($templatename, $tplVars); +} diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php index ab35787..c79655e 100644 --- a/templates/bookmarks.tpl.php +++ b/templates/bookmarks.tpl.php @@ -1,161 +1,157 @@ <?php $userservice =& ServiceFactory::getServiceInstance('UserService'); $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); $logged_on_userid = $userservice->getCurrentUserId(); $this->includeTemplate($GLOBALS['top_include']); include 'search.inc.php'; if (count($bookmarks) > 0) { ?> <p id="sort"> - <?php echo T_("Sort by:"); ?> - <a href="?sort=date_desc"><?php echo T_("Date"); ?></a><span> / </span> - <a href="?sort=title_asc"><?php echo T_("Title"); ?></a><span> / </span> - <?php - if (!isset($hash)) { - ?> + <?php echo T_("Sort by:"); ?> + <a href="?sort=date_desc"><?php echo T_("Date"); ?></a><span> / </span> + <a href="?sort=title_asc"><?php echo T_("Title"); ?></a><span> / </span> + <?php if (!isset($hash)): ?> <a href="?sort=url_asc"><?php echo T_("URL"); ?></a> - <?php - } - ?> + <?php endif; ?> </p> <ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> <?php foreach(array_keys($bookmarks) as $key) { $row =& $bookmarks[$key]; switch ($row['bStatus']) { case 0: $access = ''; break; case 1: $access = ' shared'; break; case 2: $access = ' private'; break; } $cats = ''; $tags = $row['tags']; foreach(array_keys($tags) as $key) { $tag =& $tags[$key]; $cats .= '<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, '; } $cats = substr($cats, 0, -2); if ($cats != '') { $cats = ' to '. $cats; } // Edit and delete links $edit = ''; if ($bookmarkservice->editAllowed($row['bId'])) { $edit = ' - <a href="'. createURL('edit', $row['bId']) .'">'. T_('Edit') .'</a><script type="text/javascript">document.write(" - <a href=\"#\" onclick=\"deleteBookmark(this, '. $row['bId'] .'); return false;\">'. T_('Delete') .'<\/a>");</script>'; } // User attribution $copy = ''; if (!isset($user) || isset($watched)) { $copy = ' '. T_('by') .' <a href="'. createURL('bookmarks', $row['username']) .'">'. $row['username'] .'</a>'; } // Udders! if (!isset($hash)) { $others = $bookmarkservice->countOthers($row['bAddress']); $ostart = '<a href="'. createURL('history', $row['bHash']) .'">'; $oend = '</a>'; switch ($others) { case 0: break; case 1: $copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend); break; default: $copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend); } } // Copy link if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId'])) { // Get the username of the current user $currentUser = $userservice->getCurrentUser(); $currentUsername = $currentUser[$userservice->getFieldName('username')]; $copy .= ' - <a href="'. createURL('bookmarks', $currentUsername .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])) .'">'. T_('Copy') .'</a>'; } // Nofollow option $rel = ''; if ($GLOBALS['nofollow']) { $rel = ' rel="nofollow"'; } $address = filter($row['bAddress']); // Redirection option if ($GLOBALS['useredir']) { $address = $GLOBALS['url_redir'] . $address; } // Output echo '<li class="xfolkentry'. $access .'">'."\n"; echo '<div class="link"><a href="'. $address .'"'. $rel .' class="taggedlink">'. filter($row['bTitle']) ."</a></div>\n"; if ($row['bDescription'] != '') { echo '<div class="description">'. filter($row['bDescription']) ."</div>\n"; } echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n"; echo "</li>\n"; } ?> </ol> <?php // PAGINATION // Ordering $sortOrder = ''; if (isset($_GET['sort'])) { $sortOrder = 'sort='. $_GET['sort']; } $sortAmp = (($sortOrder) ? '&amp;'. $sortOrder : ''); $sortQue = (($sortOrder) ? '?'. $sortOrder : ''); // Previous $perpage = getPerPageCount(); if (!$page || $page < 2) { $page = 1; $start = 0; $bfirst = '<span class="disable">'. T_('First') .'</span>'; $bprev = '<span class="disable">'. T_('Previous') .'</span>'; } else { $prev = $page - 1; $prev = 'page='. $prev; $start = ($page - 1) * $perpage; $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>'; $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>'; } // Next $next = $page + 1; $totalpages = ceil($total / $perpage); if (count($bookmarks) < $perpage || $perpage * $page == $total) { $bnext = '<span class="disable">'. T_('Next') .'</span>'; $blast = '<span class="disable">'. T_('Last') .'</span>'; } else { $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>'; $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') .'</a>'; } echo '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) .'</p>'; } else { ?> <p class="error"><?php echo T_('No bookmarks available'); ?>.</p> <?php } $this->includeTemplate('sidebar.tpl'); $this->includeTemplate($GLOBALS['bottom_include']); ?> diff --git a/templates/importNetscape.tpl.php b/templates/importNetscape.tpl.php index 627a5af..6145979 100644 --- a/templates/importNetscape.tpl.php +++ b/templates/importNetscape.tpl.php @@ -1,50 +1,46 @@ -<?php -$this->includeTemplate($GLOBALS['top_include']); -?> +<?php $this->includeTemplate($GLOBALS['top_include']); ?> <div id="bookmarks"> <form id="import" enctype="multipart/form-data" action="<?php echo $formaction; ?>" method="post"> <table> <tr valign="top"> <th align="left"><?php echo T_('File'); ?></th> <td> <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> <input type="file" name="userfile" size="50" /> </td> </tr> <tr valign="top"> <th align="left"><?php echo T_('Privacy'); ?></th> <td> <select name="status"> <option value="0"><?php echo T_('Public'); ?></option> <option value="1"><?php echo T_('Shared with Watchlist'); ?></option> <option value="2"><?php echo T_('Private'); ?></option> </select> </td> </tr> <tr> <td /> <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> </tr> </table> </form> <h3><?php echo T_('Instructions'); ?></h3> <ol> <li> <p><?php echo T_('Export your bookmarks from your browser to a file'); ?>:</p> <ul> - <li><?php echo T_('Internet Explorer: <kbd>File &gt; Import and Export... &gt; Export Favorites'); ?></kbd></li> - <li><?php echo T_('Mozilla Firefox: <kbd>Bookmarks &gt; Manage Bookmarks... &gt; File &gt; Export...'); ?></kbd></li> - <li><?php echo T_('Netscape: <kbd>Bookmarks &gt; Manage Bookmarks... &gt; Tools &gt; Export...'); ?></kbd></li> + <li><?php echo T_('Internet Explorer: <kbd>File &rarr; Import and Export&hellip; &rarr; Export Favorites</kbd>'); ?></li> + <li><?php echo T_('Mozilla Firefox: <kbd>Bookmarks &rarr; Manage Bookmarks&hellip; &rarr; File &rarr; Export&hellip;</kbd>'); ?></li> + <li><?php echo T_('Google Chrome: <kbd>Bookmark Manager &rarr; Organize &rarr; Export Bookmarks&hellip;</kbd>'); ?></li> </ul> </li> - <li><?php echo T_('Click <kbd>Browse...</kbd> to find the saved bookmark file on your computer. The maximum size the file can be is 1MB'); ?>.</li> - <li><?php echo T_('Select the default privacy setting for your imported bookmarks'); ?>.</li> - <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute'); ?>.</li> + <li><?php echo T_('Click <kbd>Browse&hellip;</kbd> to find the saved bookmark file on your computer. The maximum size the file can be is 1MB.'); ?></li> + <li><?php echo T_('Select the default privacy setting for your imported bookmarks.'); ?></li> + <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute.'); ?></li> </ol> </div> -<?php -$this->includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file +<?php $this->includeTemplate($GLOBALS['bottom_include']); ?> \ No newline at end of file
scronide/scuttle
d297e7b43dff2c97f05ca2802f150d51c31bfcb3
Bumped version numver
diff --git a/readme.txt b/readme.txt index 01efe57..fdbd954 100644 --- a/readme.txt +++ b/readme.txt @@ -1,16 +1,15 @@ -Scuttle 0.7.5 -http://sourceforge.net/projects/scuttle/ +Scuttle 0.8.0 http://scuttle.org/ Copyright (C) 2004 - 2010 Scuttle project Available under the GNU General Public License ============ INSTALLATION ============ * Use the SQL contained in tables.sql to create the necessary database tables. This file was written specifically for MySQL, so may need rewritten if you intend to use a different database system. * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. * Set the CHMOD permissions on the /cache/ subdirectory to 777 \ No newline at end of file
scronide/scuttle
6ff691979dd906ff4b4c70b3e5e1bbd4d906b87b
- .htaccess yoinked from Drupal - Minor CSS tweaks
diff --git a/.htaccess b/.htaccess index de83899..cba1f4d 100644 --- a/.htaccess +++ b/.htaccess @@ -1,12 +1,95 @@ -# Rewrite clean URLs onto real files +# +# Apache/PHP settings for Scuttle +# + +# Don't show directory listings for URLs which map to a directory. +Options -Indexes + +# Follow symbolic links in this directory. +Options +FollowSymLinks + +# Force simple error message for requests for non-existent favicon.ico. +<Files favicon.ico> + # There is no end quote below, for compatibility with Apache 1.3. + ErrorDocument 404 "The requested file favicon.ico was not found. +</Files> + +# Set the default handler. +DirectoryIndex index.php + +# Override PHP settings. + +# PHP 4, Apache 1. +<IfModule mod_php4.c> + php_value magic_quotes_gpc 0 + php_value register_globals 0 + php_value session.auto_start 0 + php_value mbstring.http_input pass + php_value mbstring.http_output pass + php_value mbstring.encoding_translation 0 +</IfModule> + +# PHP 4, Apache 2. +<IfModule sapi_apache2.c> + php_value magic_quotes_gpc 0 + php_value register_globals 0 + php_value session.auto_start 0 + php_value mbstring.http_input pass + php_value mbstring.http_output pass + php_value mbstring.encoding_translation 0 +</IfModule> + + +# Requires mod_expires to be enabled. +<IfModule mod_expires.c> + # Enable expirations. + ExpiresActive On + + # Cache all files for 2 weeks after access (A). + ExpiresDefault A1209600 + + <FilesMatch \.php$> + # Do not allow PHP scripts to be cached unless they explicitly send cache + # headers themselves. Otherwise all scripts would have to overwrite the + # headers set by mod_expires if they want another caching behavior. + ExpiresActive Off + </FilesMatch> +</IfModule> + +# Various rewrite rules. <IfModule mod_rewrite.c> - <IfDefine APACHE2> - AcceptPathInfo On - </IfDefine> - RewriteEngine On - RewriteBase / + RewriteEngine on + + # If your site can be accessed both with and without the 'www.' prefix, you + # can use one of the following settings to redirect users to your preferred + # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: + # + # To redirect all users to access the site WITH the 'www.' prefix, + # (http://example.com/... will be redirected to http://www.example.com/...) + # adapt and uncomment the following: + # RewriteCond %{HTTP_HOST} ^example\.com$ [NC] + # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] + # + # To redirect all users to access the site WITHOUT the 'www.' prefix, + # (http://www.example.com/... will be redirected to http://example.com/...) + # uncomment and adapt the following: + # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] + # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] + + # Modify the RewriteBase if you are using Scuttle in a subdirectory or in a + # VirtualDocumentRoot and the rewrite rules are not working properly. + # For example if your site is at http://example.com/scuttle uncomment and + # modify the following line: + # RewriteBase /scuttle + # + # If your site is running in a VirtualDocumentRoot at http://example.com/, + # uncomment the following line: + # RewriteBase / + + # Rewrite clean URLs onto real files. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteCond %{REQUEST_FILENAME}.php -f - RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L] -</IfModule> + RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L,QSA] +</IfModule> \ No newline at end of file diff --git a/scuttle.css b/scuttle.css index b23fad8..c94341c 100644 --- a/scuttle.css +++ b/scuttle.css @@ -1,440 +1,441 @@ /* BASE */ * { - font-family: "trebuchet ms", tahoma, sans-serif; + font-family: helvetica, arial, sans-serif; } a { - color: #47A; - text-decoration: none; + color: #47A; + text-decoration: none; } a:hover { - color: #258; - text-decoration: underline; + color: #258; + text-decoration: underline; } a img { - border: 0; + border: 0; } body { - background-color: #FFF; - margin: 0; - padding: 0; + background-color: #FFF; + margin: 0; + padding: 0; } input[type=text], input[type=password], select, textarea { - border: 1px solid #AAA; - padding: 0.1em; + border: 1px solid #AAA; + padding: .1em; } input[type=text], input[type=password], textarea { - padding: 0.2em; + padding: .2em; } input[type=text]:focus, input[type=password]:focus, select:focus, textarea:focus { - border-color: #666; + border-color: #666; } p.error, p.success { - border: 1px solid; - font-size: small; - margin: 0.5em; - padding: 0.5em; - width: 70%; + border: 1px solid; + font-size: small; + margin: .5em; + padding: .5em; + width: 70%; } p.error { - background: #FCC; - border-color: #966; - color: #633; + background: #FCC; + border-color: #966; + color: #633; } p.success { - background: #CFC; - border-color: #696; - color: #363; + background: #CFC; + border-color: #696; + color: #363; } td#availability { - color: #285; - font-weight: bold; + color: #285; + font-weight: bold; } td#availability.not-available { - color: #F00; + color: #F00; } textarea { - font-size: small; - padding: 0.2em; + font-size: small; + padding: .2em; } th { - padding-right: 1em; - text-align: right; + padding-right: 1em; + text-align: right; } /* HEADER */ div#header { - background: #FFF url('bg_header.png') bottom repeat-x; - border-bottom: 3px solid #9CD; - clear: both; + background: #FFF url('bg_header.png') bottom repeat-x; + border-bottom: 3px solid #9CD; + clear: both; } div#header:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; } * html div#header { - height: 1%; + height: 1%; } h1 { - float: left; - font-size: x-large; - font-weight: bold; - letter-spacing: 0.25em; - margin: 0; - padding: 1em; - text-transform: lowercase; + float: left; + font-size: x-large; + font-weight: bold; + margin: 0; + padding: 1em; + text-transform: lowercase; } html > body h1 { - background: url('logo.png') no-repeat 10px; - padding-left: 75px; + background: url('logo.png') no-repeat 10px; + padding-left: 75px; } html > body div#header.popup h1 { - background: url('logo_24.png') no-repeat 10px; - padding: 0.5em 0.5em 0.5em 50px; + background: url('logo_24.png') no-repeat 10px; + padding: .5em .5em .5em 50px; } h1 a { - color: #000; + color: #000; + text-shadow: 2px 2px 2px #9CD; } h1 a:hover { - color: #000; + color: #000; } h2 { - background: #666 url('bg_bar.png') center center repeat-x; - border-bottom: 3px solid #DDD; - clear: both; - color: #DDD; - font-size: medium; - letter-spacing: 0.1em; - margin: 0 0 1em 0; - padding: 0.5em 1em; - text-transform: lowercase; + background: #666 url('bg_bar.png') center center repeat-x; + border-bottom: 3px solid #DDD; + clear: both; + color: #DDD; + font-size: medium; + letter-spacing: .1em; + margin: 0 0 1em 0; + padding: .5em 1em; + text-shadow: 1px 1px 1px #333; + text-transform: lowercase; } /* NAVIGATION */ ul#navigation { - list-style-type: none; - margin: 0; - padding: 1.75em 1em; - text-transform: lowercase; - width: auto; + list-style-type: none; + margin: 0; + padding: 1.9em 1em; + text-transform: lowercase; + width: auto; } ul#navigation a { - font-size: medium; - font-weight: bold; - padding: 0.2em 0.5em; + font-size: medium; + font-weight: bold; + padding: .2em .5em; } ul#navigation a:hover { - background: #7AD; - color: #FFF; + background: #7AD; + color: #FFF; } ul#navigation li { - float: left; + float: left; } ul#navigation li.access { - float: right; + float: right; } /* BOOKMARKS */ ol#bookmarks { - list-style-type: none; - margin: 0; - padding: 0 1em; - width: 70%; + list-style-type: none; + margin: 0; + padding: 0 1em; + width: 70%; } html > body ol#bookmarks { - margin: 0 1em; - padding: 0; + margin: 0 1em; + padding: 0; } div.link a { - color: blue; - font-size: medium; + color: blue; + font-size: medium; } div.link a:visited { - color: purple; + color: purple; } div.meta { - color: #285; + color: #285; } div.meta span { - color: #F00; + color: #F00; } li.xfolkentry { - border-bottom: 1px solid #DDD; - margin-bottom: 0; - padding: 1em 0.5em; + border-bottom: 1px solid #DDD; + margin-bottom: 0; + padding: 1em .5em; } html > body li.xfolkentry { - border-bottom: 1px dotted #AAA; + border-bottom: 1px dotted #AAA; } li.xfolkentry div { - padding: 0.1em; + padding: .1em; } li.xfolkentry.deleted { - opacity: 0.5; + opacity: .5; } li.xfolkentry.private { - border-left: 3px solid #F00; + border-left: 3px solid #F00; } li.xfolkentry.shared { - border-left: 3px solid #FA0; + border-left: 3px solid #FA0; } /* SIDEBAR */ div#sidebar { - font-size: small; - position: absolute; - right: 1em; - top: 10em; - width: 25%; + font-size: small; + position: absolute; + right: 1em; + top: 10em; + width: 25%; } div#sidebar a { - color: #995; + color: #995; } div#sidebar a:hover { - color: #773; + color: #773; } div#sidebar div { - background: #FFF url('bg_sidebar.png') bottom repeat-x; - border: 1px solid #CC8; - color: #555; - margin-bottom: 1em; + background: #FFF url('bg_sidebar.png') bottom repeat-x; + border: 1px solid #CC8; + color: #555; + margin-bottom: 1em; } div#sidebar h2 { - background: transparent; - border: 0; - color: #995; - letter-spacing: 0; - margin: 0; - padding: 0.5em 0; + background: transparent; + border: 0; + color: #995; + letter-spacing: 0; + margin: 0; + padding: .5em 0; + text-shadow: none; } div#sidebar hr { - display: none; + display: none; } div#sidebar p { - margin: 1em; + margin: 1em; } div#sidebar p.tags a { - margin: 0; + margin: 0; } div#sidebar table { - margin: 0.5em 0.5em 0 0.5em; + margin: .5em .5em 0 .5em; } div#sidebar table td { - padding-bottom: 0.25em; - padding-right: 0.5em; + padding-bottom: .25em; + padding-right: .5em; } div#sidebar ul { - list-style-type: none; - margin: 0; - padding: 0.5em; + list-style-type: none; + margin: 0; + padding: .5em; } div#sidebar ul li { - margin: 0.5em 0; + margin: .5em 0; } /* TAGS */ p.tags { - line-height: 2.25em; - margin: 2em 10%; - text-align: justify; - vertical-align: middle; + line-height: 2.25em; + margin: 2em 10%; + text-align: justify; + vertical-align: middle; } p.tags a, p.tags span { - color: #47A; - margin-right: 0.5em; + color: #47A; + margin-right: .5em; } p.tags span:hover { - cursor: pointer; - text-decoration: underline; + cursor: pointer; + text-decoration: underline; } p.tags span.selected { - background: #CEC; + background: #CEC; } /* PROFILE */ table.profile th { - width: 10em; + width: 10em; } /* OTHER GUFF */ dd { - background: #CEC; - border-right: 4px solid #ACA; - color: #464; - padding: 6px; + background: #CEC; + border-right: 4px solid #ACA; + color: #464; + padding: 6px; } dd a { - color: #464; + color: #464; } dd a:hover { - color: #000 !important; - text-decoration: underline !important; + color: #000 !important; + text-decoration: underline !important; } dl { - font-size: small; - margin: 1em; - width: 70%; + font-size: small; + margin: 1em; + width: 70%; } dl#profile dd { - background: #CDE; - border-color: #ABC; - color: #247; + background: #CDE; + border-color: #ABC; + color: #247; } dl#profile dt { - background: #BCE; - border-color: #9AC; - color: #245; - display: block; - font-weight: bold; - padding: 6px; + background: #BCE; + border-color: #9AC; + color: #245; + display: block; + font-weight: bold; + padding: 6px; } dl#profile a { - color: #446; + color: #446; } dl#profile a:hover { - color: #000 !important; - text-decoration: underline !important; + color: #000 !important; + text-decoration: underline !important; } dl#meta dd { - line-height: 1.5em; + line-height: 1.5em; } dl#meta dt { - background: #BDB; - color: #353; - display: block; - font-weight: bold; - padding: 6px; + background: #BDB; + color: #353; + display: block; + font-weight: bold; + padding: 6px; } dt { - border-right: 4px solid #9B9; + border-right: 4px solid #9B9; } dt a { - background: #BDB; - color: #353; - display: block; - font-weight: bold; - padding: 6px; + background: #BDB; + color: #353; + display: block; + font-weight: bold; + padding: 6px; } dt a:hover { - background: #ACA; - border: 0; + background: #ACA; + border: 0; } form { - margin: 0; + margin: 0; } form#search { - background: #FFF; - color: #555; - font-size: small; - margin-bottom: 1em; + background: #FFF; + color: #555; + font-size: small; + margin-bottom: 1em; } form label, form td, form th { - font-size: small; + font-size: small; } form table { - margin: 0 1em; + margin: 0 1em; } h3 { - background: #DDD; - color: #555; - font-size: small; - letter-spacing: 0.2em; - margin: 2em 1em 1em 1em; - padding: 0.25em 0.75em; + background: #DDD; + color: #555; + font-size: small; + letter-spacing: .2em; + margin: 2em 1em 1em 1em; + padding: .5em .75em; + text-shadow: 1px 1px 1px #FFF; } li { - font-size: small; - margin-bottom: 0.5em; + font-size: small; + margin-bottom: .5em; } p { - font-size: small; - margin: 1em; + font-size: small; + margin: 1em; } p#sort { color: #CCC; font-size: small; float: right; margin: 0; position: absolute; right: 0; - top: 7em; + top: 6.9em; } html > body p#sort { - margin-right: 0.75em; + margin-right: .75em; } p#sort a { background: #AAA; color: #555; font-weight: normal; - margin-right: 0.5em; + margin-right: .5em; padding: 0 1em; - border-radius: 0.25em; - -moz-border-radius: 0.25em; - -webkit-border-radius: 0.25em; + border-radius: .25em;. } html > body p#sort a { - margin-right: 0; + margin-right: 0; } p#sort a:hover { - background: #CCC; - text-decoration: none !important; + background: #CCC; + text-decoration: none !important; } p#sort span { - display: none; + display: none; } p.paging { - font-size: small; - margin-left: 1em; + font-size: small; + margin-left: 1em; } p.paging a, p.paging span.disable { - background: #888; - color: #FFF; - display: inline; - margin-right: 0.5em; - padding: 0.25em 1em; + background: #888; + color: #FFF; + display: inline; + margin-right: .5em; + padding: .25em 1em; } p.paging a:hover { - background: #666; + background: #666; } p.paging span { - display: none; + display: none; } p.paging span.disable { - background: #DDD; - color: #AAA; + background: #DDD; + color: #AAA; } div.collapsible p.tags { - line-height: 2.25em; - margin: 1em 2em; + line-height: 2.25em; + margin: 1em 2em; } th label { - padding-right: 1em; + padding-right: 1em; } ul { - margin-right: 1em; - width: 75%; + margin-right: 1em; + width: 75%; }
scronide/scuttle
a52e94e7d37efbd5356bb8a5b65f577e8500aed5
- Allow blacklisting and whitelisting of e-mail addresses used for new user accounts - Added hash to the registration form to prevent CRSF - Added password confirmation to registration form - Update jQuery to 1.4.4
diff --git a/config.inc.php.example b/config.inc.php.example index 1db84c2..a355bfa 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -1,119 +1,139 @@ <?php ###################################################################### # SCUTTLE: Online social bookmarks manager ###################################################################### # Copyright (c) 2005 - 2010 Scuttle project -# http://sourceforge.net/projects/scuttle/ # http://scuttle.org/ # # This module is to configure the main options for your site # # This program 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. ###################################################################### ###################################################################### # Database Configuration # # dbtype: Database driver - mysql, mysqli, mysql4, oracle, postgres, # sqlite, db2, firebird, mssql, mssq-odbc # dbhost: Database hostname # dbport: Database port # dbuser: Database username # dbpass: Database password # dbname: Database name ###################################################################### $dbtype = 'mysql'; $dbhost = '127.0.0.1'; $dbport = '3306'; $dbuser = 'username'; $dbpass = 'password'; $dbname = 'scuttle'; +###################################################################### +# Basic Configuration +###################################################################### +# sitename: The name of this site +# locale: The locale used - de_DE, dk_DK, en_GB, es_ES, fr_FR, hi_IN, +# it_IT, ja_JP, lt_LT, nl_NL, pt_BR, sk_SK, zh_CN, zh_TW +# adminemail: Contact address for the site administrator. Used as the from: +# address in password retrieval e-mails. +###################################################################### + +$sitename = 'Scuttle'; +$locale = 'en_GB'; +$adminemail = 'admin@example.org'; + ###################################################################### # You have finished configuring the database! # ONLY EDIT THE INFORMATION BELOW IF YOU KNOW WHAT YOU ARE DOING. ###################################################################### # System Configuration # -# sitename: The name of this site. -# locale: The locale used. # top_include: The header file. # bottom_include: The footer file. # shortdate: The format of short dates. # longdate: The format of long dates. # nofollow: true - Include rel="nofollow" attribute on # bookmark links. # false - Don't include rel="nofollow". # defaultPerPage: The default number of bookmarks per page. # -1 means no limit! # defaultRecentDays: The number of days that bookmarks or tags should # be considered recent. # defaultOrderBy: The default order in which bookmarks will appear. # Possible values are: # date_desc - By date of entry descending. # Latest entry first. (Default) # date_asc - By date of entry ascending. # Earliest entry first. # title_desc - By title, descending alphabetically. # title_asc - By title, ascending alphabetically. # url_desc - By URL, descending alphabetically. # url_asc - By URL, ascending alphabetically. # TEMPLATES_DIR: The directory where the template files should be # loaded from (the *.tpl.php files) # root : Set to NULL to autodetect the root url of the website # cookieprefix : The prefix to use for the cookies on the site # tableprefix : The table prefix used for this installation -# adminemail : Contact address for the site administrator. Used -# as the FROM address in password retrieval e-mails. # cleanurls : true - Use mod_rewrite to hide PHP extensions # : false - Don't hide extensions [Default] # # usecache : true - Cache pages when possible # false - Don't cache at all [Default] # dir_cache : The directory where cache files will be stored # # useredir : true - Improve privacy by redirecting all bookmarks # through the address specified in url_redir # false - Don't redirect bookmarks # url_redir : URL prefix for bookmarks to redirect through # # filetypes : An array of bookmark extensions that Scuttle should # add system tags for. # reservedusers : An array of usernames that cannot be registered +# url_blacklist : Array of regex patterns. User is banned and existing +# bookmarks are hidden if a match is found. +# email_whitelist : Array of regex patterns. Used to whitelist addresses that +# may otherwise match the blacklist. +# email_blacklist : Array of regex patterns. Registration is blocked if a +# match is found. ###################################################################### -$sitename = 'Scuttle'; -$locale = 'en_GB'; -$top_include = 'top.inc.php'; -$bottom_include = 'bottom.inc.php'; -$shortdate = 'd-m-Y'; -$longdate = 'j F Y'; -$nofollow = true; -$defaultPerPage = 10; -$defaultRecentDays = 14; -$defaultOrderBy = 'date_desc'; -$TEMPLATES_DIR = dirname(__FILE__) .'/templates/'; -$root = NULL; -$cookieprefix = 'SCUTTLE'; -$tableprefix = 'sc_'; -$adminemail = 'admin@example.org'; -$cleanurls = false; +$top_include = 'top.inc.php'; +$bottom_include = 'bottom.inc.php'; +$shortdate = 'd-m-Y'; +$longdate = 'j F Y'; +$nofollow = true; +$defaultPerPage = 10; +$defaultRecentDays = 14; +$defaultOrderBy = 'date_desc'; +$TEMPLATES_DIR = dirname(__FILE__) .'/templates/'; +$root = NULL; +$cookieprefix = 'SCUTTLE'; +$tableprefix = 'sc_'; +$adminemail = 'admin@example.org'; +$cleanurls = false; + +$usecache = false; +$dir_cache = dirname(__FILE__) .'/cache/'; + +$useredir = false; +$url_redir = 'http://www.google.com/url?sa=D&q='; -$usecache = false; -$dir_cache = dirname(__FILE__) .'/cache/'; +$filetypes = array( + 'audio' => array('mp3', 'ogg', 'wav'), + 'document' => array('doc', 'odt', 'pdf'), + 'image' => array('gif', 'jpeg', 'jpg', 'png'), + 'video' => array('avi', 'mov', 'mp4', 'mpeg', 'mpg', 'wmv') + ); -$useredir = false; -$url_redir = 'http://www.google.com/url?sa=D&q='; +$reservedusers = array('all', 'watchlist'); -$filetypes = array( - 'audio' => array('mp3', 'ogg', 'wav'), - 'document' => array('doc', 'odt', 'pdf'), - 'image' => array('gif', 'jpeg', 'jpg', 'png'), - 'video' => array('avi', 'mov', 'mp4', 'mpeg', 'mpg', 'wmv') - ); -$reservedusers = array('all', 'watchlist'); +$email_whitelist = NULL; +$email_blacklist = array( + '/(.*-){2,}/', + '/mailinator\.com/i' + ); include_once 'debug.inc.php'; diff --git a/includes/jquery-1.4.2.min.js b/includes/jquery-1.4.2.min.js deleted file mode 100644 index 7c24308..0000000 --- a/includes/jquery-1.4.2.min.js +++ /dev/null @@ -1,154 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.2 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Sat Feb 13 22:33:48 2010 -0500 - */ -(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? -e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= -j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, -"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= -true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| -c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", -L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, -"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ -a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], -d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== -a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& -!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= -true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", -i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", -" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= -this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= -e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= -null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), -fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| -d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, -"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= -a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, -isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= -{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; -if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& -!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, -toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, -u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), -function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; -if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; -for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- -1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, -CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, -relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= -l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; -h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= -m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| -!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= -h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, -gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; -c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? -a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& -this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| -u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== -1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); -this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], -"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, -animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= -j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); -this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| -c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? -function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= -this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; -k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& -f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/includes/jquery-1.4.4.min.js b/includes/jquery-1.4.4.min.js new file mode 100644 index 0000000..8f3ca2e --- /dev/null +++ b/includes/jquery-1.4.4.min.js @@ -0,0 +1,167 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| +h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; +if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], +z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, +s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= +s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| +[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, +false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, +a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= +c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, +a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", +colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== +1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), +l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, +"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= +a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= +w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, +Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= +c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; +var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== +"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, +xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, +a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= +1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== +"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); +c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, +[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); +return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== +B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, +POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== +i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= +i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, +"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== +"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; +for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), +i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; +c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, +not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, +"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= +c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, +b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): +this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", +d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, +d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== +"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| +1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== +b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& +h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; +for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= +parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", +height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= +f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, +"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/register.php b/register.php index 62128db..8f95ed6 100644 --- a/register.php +++ b/register.php @@ -1,63 +1,101 @@ <?php /*************************************************************************** Copyright (c) 2004 - 2010 Marcus Campbell -http://sourceforge.net/projects/scuttle/ http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once 'header.inc.php'; -$userservice =& ServiceFactory::getServiceInstance('UserService'); -$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); +$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); -$tplVars = array(); +$tplVars = array(); +$completed = FALSE; if ($_POST['submitted']) { + if (!$completed) { $posteduser = trim(utf8_strtolower($_POST['username'])); + $postedpass = trim($_POST['password']); + $postedconf = trim($_POST['passconf']); + + // Check token + if (!isset($_SESSION['token']) || $_POST['token'] != $_SESSION['token']) { + $tplVars['error'] = T_('Form could not be authenticated. Please try again.'); + } // Check if form is incomplete - if (!($posteduser) || !($_POST['password']) || !($_POST['email'])) { - $tplVars['error'] = T_('You <em>must</em> enter a username, password and e-mail address.'); + elseif (!$posteduser || !$postedpass || !($_POST['email'])) { + $tplVars['error'] = T_('You <em>must</em> enter a username, password and e-mail address.'); + } // Check if username is reserved - } elseif ($userservice->isReserved($posteduser)) { - $tplVars['error'] = T_('This username has been reserved, please make another choice.'); + elseif ($userservice->isReserved($posteduser)) { + $tplVars['error'] = T_('This username has been reserved, please make another choice.'); + } // Check if username already exists - } elseif ($userservice->getUserByUsername($posteduser)) { - $tplVars['error'] = T_('This username already exists, please make another choice.'); + elseif ($userservice->getUserByUsername($posteduser)) { + $tplVars['error'] = T_('This username already exists, please make another choice.'); + } + // Check that password is long enough + elseif ($postedpass != '' && strlen($postedpass) < 6) { + $tplVars['error'] = T_('Password must be at least 6 characters long.'); + } + + // Check if password matches confirmation + elseif ($postedpass != $postedconf) { + $tplVars['error'] = T_('Password and confirmation do not match.'); + } + + // Check if e-mail address is blocked + elseif ($userservice->isBlockedEmail($_POST['email'])) { + $tplVars['error'] = T_('This e-mail address is not permitted.'); + } + // Check if e-mail address is valid - } elseif (!$userservice->isValidEmail($_POST['email'])) { - $tplVars['error'] = T_('E-mail address is not valid. Please try again.'); + elseif (!$userservice->isValidEmail($_POST['email'])) { + $tplVars['error'] = T_('E-mail address is not valid. Please try again.'); + } // Register details - } elseif ($userservice->addUser($posteduser, $_POST['password'], $_POST['email'])) { - // Log in with new username - $login = $userservice->login($posteduser, $_POST['password']); - if ($login) { - header('Location: '. createURL('bookmarks', $posteduser)); - } - $tplVars['msg'] = T_('You have successfully registered. Enjoy!'); - } else { - $tplVars['error'] = T_('Registration failed. Please try again.'); + elseif ($userservice->addUser($posteduser, $_POST['password'], $_POST['email'])) { + // Log in with new username + $login = $userservice->login($posteduser, $_POST['password']); + if ($login) { + header('Location: '. createURL('bookmarks', $posteduser)); + } + $tplVars['msg'] = T_('You have successfully registered. Enjoy!'); + } + else { + $tplVars['error'] = T_('Registration failed. Please try again.'); } + } + else { + $tplVars['msg'] = T_('Woah there, go easy on the Register button! Your registration was successful. Check your e-mail for instructions on how to verify your account.'); + } } -$tplVars['loadjs'] = true; -$tplVars['subtitle'] = T_('Register'); -$tplVars['formaction'] = createURL('register'); +// Generate anti-CSRF token +$token = md5(uniqid(rand(), TRUE)); +$_SESSION['token'] = $token; +$_SESSION['token_time'] = time(); + +$tplVars['loadjs'] = TRUE; +$tplVars['subtitle'] = T_('Register'); +$tplVars['formaction'] = createURL('register'); +$tplVars['token'] = $token; $templateservice->loadTemplate('register.tpl', $tplVars); diff --git a/services/userservice.php b/services/userservice.php index a2709fb..44374a0 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -1,360 +1,392 @@ <?php class UserService { var $db; function &getInstance(&$db) { static $instance; if (!isset($instance)) { $instance = new UserService($db); } return $instance; } var $fields = array( 'primary' => 'uId', 'username' => 'username', 'password' => 'password' ); var $profileurl; var $tablename; var $sessionkey; var $cookiekey; var $cookietime = 1209600; // 2 weeks function UserService(&$db) { $this->db =& $db; $this->tablename = $GLOBALS['tableprefix'] .'users'; $this->sessionkey = $GLOBALS['cookieprefix'] .'-currentuserid'; $this->cookiekey = $GLOBALS['cookieprefix'] .'-login'; $this->profileurl = createURL('profile', '%2$s'); } function _checkdns($host) { if (function_exists('checkdnsrr')) { return checkdnsrr($host); } else { return $this->_checkdnsrr($host); } } function _checkdnsrr($host, $type = "MX") { if(!empty($host)) { @exec("nslookup -type=$type $host", $output); while(list($k, $line) = each($output)) { if(eregi("^$host", $line)) { return true; } } return false; } } function _getuser($fieldname, $value) { $query = 'SELECT * FROM '. $this->getTableName() .' WHERE '. $fieldname .' = "'. $this->db->sql_escape($value) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) return $row; else return false; } + function _in_regex_array($value, $array) { + foreach ($array as $key => $pattern) { + if (preg_match($pattern, $value)) { + return TRUE; + } + } + return FALSE; + } + function _randompassword() { $password = mt_rand(1, 99999999); $password = substr(md5($password), mt_rand(0, 19), mt_rand(6, 12)); return $password; } function _updateuser($uId, $fieldname, $value) { $updates = array ($fieldname => $value); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function getProfileUrl($id, $username) { return sprintf($this->profileurl, urlencode($id), urlencode($username)); } function getUserByUsername($username) { return $this->_getuser($this->getFieldName('username'), $username); } function getUser($id) { return $this->_getuser($this->getFieldName('primary'), $id); } function isLoggedOn() { return ($this->getCurrentUserId() !== false); } function &getCurrentUser($refresh = FALSE, $newval = NULL) { static $currentuser; if (!is_null($newval)) //internal use only: reset currentuser $currentuser = $newval; else if ($refresh || !isset($currentuser)) { if ($id = $this->getCurrentUserId()) $currentuser = $this->getUser($id); else return; } return $currentuser; } function isAdmin($userid) { return false; //not implemented yet } function getCurrentUserId() { if (isset($_SESSION[$this->getSessionKey()])) { return $_SESSION[$this->getSessionKey()]; } else if (isset($_COOKIE[$this->getCookieKey()])) { $cook = split(':', $_COOKIE[$this->getCookieKey()]); //cookie looks like this: 'id:md5(username+password)' $query = 'SELECT * FROM '. $this->getTableName() . ' WHERE MD5(CONCAT('.$this->getFieldName('username') . ', '.$this->getFieldName('password') . ')) = \''.$this->db->sql_escape($cook[1]).'\' AND '. $this->getFieldName('primary'). ' = '. $this->db->sql_escape($cook[0]); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row = $this->db->sql_fetchrow($dbresult)) { $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; return $_SESSION[$this->getSessionKey()]; } } return false; } function login($username, $password, $remember = FALSE, $path = '/') { $password = $this->sanitisePassword($password); $query = 'SELECT '. $this->getFieldName('primary') .' FROM '. $this->getTableName() .' WHERE '. $this->getFieldName('username') .' = "'. $this->db->sql_escape($username) .'" AND '. $this->getFieldName('password') .' = "'. $this->db->sql_escape($password) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) { $id = $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; if ($remember) { $cookie = $id .':'. md5($username.$password); setcookie($this->cookiekey, $cookie, time() + $this->cookietime, $path); } return true; } else { return false; } } function logout($path = '/') { @setcookie($this->cookiekey, NULL, time() - 1, $path); unset($_COOKIE[$this->cookiekey]); session_unset(); $this->getCurrentUser(TRUE, false); } function getWatchlist($uId) { // Gets the list of user IDs being watched by the given user. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($uId); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return $arrWatch; while ($row =& $this->db->sql_fetchrow($dbresult)) $arrWatch[] = $row['watched']; return $arrWatch; } function getWatchNames($uId, $watchedby = false) { // Gets the list of user names being watched by the given user. // - If $watchedby is false get the list of users that $uId watches // - If $watchedby is true get the list of users that watch $uId if ($watchedby) { $table1 = 'b'; $table2 = 'a'; } else { $table1 = 'a'; $table2 = 'b'; } $query = 'SELECT '. $table1 .'.'. $this->getFieldName('username') .' FROM '. $GLOBALS['tableprefix'] .'watched AS W, '. $this->getTableName() .' AS a, '. $this->getTableName() .' AS b WHERE W.watched = a.'. $this->getFieldName('primary') .' AND W.uId = b.'. $this->getFieldName('primary') .' AND '. $table2 .'.'. $this->getFieldName('primary') .' = '. intval($uId) .' ORDER BY '. $table1 .'.'. $this->getFieldName('username'); if (!($dbresult =& $this->db->sql_query($query))) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) { return $arrWatch; } while ($row =& $this->db->sql_fetchrow($dbresult)) { $arrWatch[] = $row[$this->getFieldName('username')]; } return $arrWatch; } function getWatchStatus($watcheduser, $currentuser) { // Returns true if the current user is watching the given user, and false otherwise. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched AS W INNER JOIN '. $this->getTableName() .' AS U ON U.'. $this->getFieldName('primary') .' = W.watched WHERE U.'. $this->getFieldName('primary') .' = '. intval($watcheduser) .' AND W.uId = '. intval($currentuser); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchstatus', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return false; else return true; } function setWatchStatus($subjectUserID) { if (!is_numeric($subjectUserID)) return false; $currentUserID = $this->getCurrentUserId(); $watched = $this->getWatchStatus($subjectUserID, $currentUserID); if ($watched) { $sql = 'DELETE FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($currentUserID) .' AND watched = '. intval($subjectUserID); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } else { $values = array( 'uId' => intval($currentUserID), 'watched' => intval($subjectUserID) ); $sql = 'INSERT INTO '. $GLOBALS['tableprefix'] .'watched '. $this->db->sql_build_array('INSERT', $values); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } $this->db->sql_transaction('commit'); return true; } function addUser($username, $password, $email) { // Set up the SQL UPDATE statement. $datetime = gmdate('Y-m-d H:i:s', time()); $password = $this->sanitisePassword($password); $values = array('username' => $username, 'password' => $password, 'email' => $email, 'uDatetime' => $datetime, 'uModified' => $datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function updateUser($uId, $password, $name, $email, $homepage, $uContent) { if (!is_numeric($uId)) return false; // Set up the SQL UPDATE statement. $moddatetime = gmdate('Y-m-d H:i:s', time()); if ($password == '') $updates = array ('uModified' => $moddatetime, 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); else $updates = array ('uModified' => $moddatetime, 'password' => $this->sanitisePassword($password), 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function sanitisePassword($password) { return sha1(trim($password)); } function generatePassword($uId) { if (!is_numeric($uId)) return false; $password = $this->_randompassword(); if ($this->_updateuser($uId, $this->getFieldName('password'), $this->sanitisePassword($password))) return $password; else return false; } + function isBlockedEmail($email) { + // Check whitelist + $whitelist = $GLOBALS['email_whitelist']; + if (!is_null($whitelist) && is_array($whitelist)) { + if (!$this->_in_regex_array($email, $whitelist)) { + // Not in whitelist -> blocked + return TRUE; + } + } + + // Check blacklist + $blacklist = $GLOBALS['email_blacklist']; + if (!is_null($blacklist) && is_array($blacklist)) { + if ($this->_in_regex_array($email, $blacklist)) { + // In blacklist -> blocked + return TRUE; + } + } + + // Not blocked + return FALSE; + } + function isReserved($username) { if (in_array($username, $GLOBALS['reservedusers'])) { return true; } else { return false; } } function isValidEmail($email) { if (preg_match("/^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$/i", $email) > 0) { list($emailUser, $emailDomain) = explode("@", $email); // Check if the email domain has a DNS record if ($this->_checkdns($emailDomain)) { return true; } } return false; } // Properties function getTableName() { return $this->tablename; } function setTableName($value) { $this->tablename = $value; } function getFieldName($field) { return $this->fields[$field]; } function setFieldName($field, $value) { $this->fields[$field] = $value; } function getSessionKey() { return $this->sessionkey; } function setSessionKey($value) { $this->sessionkey = $value; } function getCookieKey() { return $this->cookiekey; } function setCookieKey($value) { $this->cookiekey = $value; } } diff --git a/templates/register.tpl.php b/templates/register.tpl.php index 8629ec2..4348116 100644 --- a/templates/register.tpl.php +++ b/templates/register.tpl.php @@ -1,51 +1,56 @@ <?php $this->includeTemplate($GLOBALS['top_include']); ?> <p><?php echo sprintf(T_('Sign up here to create a free %s account. All the information requested below is required'), $GLOBALS['sitename']); ?>.</p> <form action="<?php echo $formaction; ?>" method="post"> <table> <tr> - <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> - <td><input type="text" id="username" name="username" size="20" class="required" /></td> - <td id="availability"></td> + <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> + <td><input type="text" id="username" name="username" size="20" class="required" /></td> + <td id="availability"></td> </tr> <tr> - <th align="left"><label for="password"><?php echo T_('Password'); ?></label></th> - <td><input type="password" id="password" name="password" size="20" class="required" /></td> - <td></td> + <th align="left"><label for="password"><?php echo T_('Password'); ?></label></th> + <td><input type="password" id="password" name="password" size="20" class="required" /></td> + <td></td> </tr> <tr> - <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> - <td><input type="text" id="email" name="email" size="40" class="required" /></td> - <td></td> + <th align="left"><label for="passconf"><?php echo T_('Confirm Password'); ?></label></th> + <td><input type="password" id="passconf" name="passconf" size="20" class="required" /></td> + <td></td> </tr> <tr> - <td></td> - <td><input type="submit" name="submitted" value="<?php echo T_('Register'); ?>" /></td> - <td></td> + <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> + <td><input type="text" id="email" name="email" size="40" class="required" /></td> + <td></td> +</tr> +<tr> + <td><input type="hidden" name="token" value="<?php echo $token; ?>" /></td> + <td><input type="submit" name="submitted" value="<?php echo T_('Register'); ?>" /></td> + <td></td> </tr> </table> </form> <script type="text/javascript"> $(function() { $("#username").focus() .keydown(function() { clearTimeout(self.searching); self.searching = setTimeout(function() { $.get("<?php echo $GLOBALS['root']; ?>ajaxIsAvailable.php?username=" + $("#username").val(), function(data) { if (data) { $("#availability").removeClass() .html("<?php echo T_('Available'); ?>"); } else { $("#availability").removeClass() .addClass("not-available") .html("<?php echo T_('Not Available'); ?>"); } } ); }, 300); }); }); </script> <?php $this->includeTemplate($GLOBALS['bottom_include']); ?> \ No newline at end of file diff --git a/templates/top.inc.php b/templates/top.inc.php index 44b31df..87f9f26 100644 --- a/templates/top.inc.php +++ b/templates/top.inc.php @@ -1,48 +1,48 @@ <?php header('Content-Type: text/html; charset=utf-8'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title><?php echo filter($GLOBALS['sitename'] . (isset($pagetitle) ? ': ' . $pagetitle : '')); ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="icon" type="image/png" href="<?php echo $GLOBALS['root']; ?>icon.png" /> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['root']; ?>scuttle.css" /> <?php $size = count($rsschannels); for ($i = 0; $i < $size; $i++) { echo '<link rel="alternate" type="application/rss+xml" title="'. $rsschannels[$i][0] .'" href="'. $rsschannels[$i][1] .'" />'; } ?> <?php if ($loadjs): ?> - <script type="text/javascript" src="<?php echo $GLOBALS['root']; ?>includes/jquery-1.4.2.min.js"></script> + <script type="text/javascript" src="<?php echo $GLOBALS['root']; ?>includes/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="<?php echo $GLOBALS['root']; ?>jsScuttle.php"></script> <?php endif; ?> </head> <body> <?php $headerstyle = ''; if(isset($_GET['popup'])) { $headerstyle = ' class="popup"'; } ?> <div id="header"<?php echo $headerstyle; ?>> <h1><a href="<?php echo $GLOBALS['root']; ?>"><?php echo $GLOBALS['sitename']; ?></a></h1> <?php if(!isset($_GET['popup'])) { $this->includeTemplate('toolbar.inc'); } ?> </div> <?php if (isset($subtitle)) { echo '<h2>'. $subtitle ."</h2>\n"; } if (isset($error)) { echo '<p class="error">'. $error ."</p>\n"; } if (isset($msg)) { echo '<p class="success">'. $msg ."</p>\n"; } ?>
scronide/scuttle
bce919af7b49bbd06223f79b8c37a53a3d263ff0
* Fixed REG_BADRPT error in isValidEmail() that prevented registration * Merged cookie fix from trunk * Set body background to white * Removed poor seed from _randompassword() * Minor fix to updateBookmark()
diff --git a/.htaccess b/.htaccess index af3cae9..89f6dfd 100644 --- a/.htaccess +++ b/.htaccess @@ -1,10 +1,13 @@ +# Rewrite clean URLs onto real files +<IfModule mod_rewrite.c> Options +FollowSymlinks <IfDefine APACHE2> AcceptPathInfo On </IfDefine> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L] +</IfModule> diff --git a/header.inc.php b/header.inc.php index 751e4e8..de56c84 100644 --- a/header.inc.php +++ b/header.inc.php @@ -1,34 +1,35 @@ <?php ini_set('display_errors', '1'); ini_set('mysql.trace_mode', '0'); error_reporting(E_ALL ^ E_NOTICE); define('DEBUG', true); session_start(); require_once(dirname(__FILE__) .'/services/servicefactory.php'); require_once(dirname(__FILE__) .'/config.inc.php'); require_once(dirname(__FILE__) .'/functions.inc.php'); // Determine the base URL if (!isset($root)) { $pieces = explode('/', $_SERVER['SCRIPT_NAME']); $root = '/'; foreach($pieces as $piece) { if ($piece != '' && !strstr($piece, '.php')) { $root .= $piece .'/'; } } if (($root != '/') && (substr($root, -1, 1) != '/')) { $root .= '/'; } + $path = $root; $root = 'http://'. $_SERVER['HTTP_HOST'] . $root; } // Error codes define('GENERAL_MESSAGE', 200); define('GENERAL_ERROR', 202); define('CRITICAL_MESSAGE', 203); define('CRITICAL_ERROR', 204); ?> \ No newline at end of file diff --git a/index.php b/index.php index b760bd7..ad6f1cc 100644 --- a/index.php +++ b/index.php @@ -1,87 +1,87 @@ <?php /*************************************************************************** Copyright (C) 2004 - 2006 Scuttle project http://sourceforge.net/projects/scuttle/ http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once('header.inc.php'); $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $userservice =& ServiceFactory::getServiceInstance('UserService'); $cacheservice =& ServiceFactory::getServiceInstance('CacheService'); $tplvars = array(); if (isset($_GET['action'])){ if ($_GET['action'] == "logout") { - $userservice->logout(); + $userservice->logout($path); $tplvars['msg'] = T_('You have now logged out'); } } // Header variables $tplVars['loadjs'] = true; $tplVars['rsschannels'] = array( array(sprintf(T_('%s: Recent bookmarks'), $sitename), createURL('rss')) ); if ($usecache) { // Generate hash for caching on $hashtext = $_SERVER['REQUEST_URI']; if ($userservice->isLoggedOn()) { $hashtext .= $userservice->getCurrentUserID(); } $hash = md5($hashtext); // Cache for 15 minutes $cacheservice->Start($hash, 900); } // Pagination $perpage = getPerPageCount(); if (isset($_GET['page']) && intval($_GET['page']) > 1) { $page = $_GET['page']; $start = ($page - 1) * $perpage; } else { $page = 0; $start = 0; } $dtend = date('Y-m-d H:i:s', strtotime('tomorrow')); $dtstart = date('Y-m-d H:i:s', strtotime($dtend .' -'. $defaultRecentDays .' days')); $tplVars['page'] = $page; $tplVars['start'] = $start; $tplVars['popCount'] = 30; $tplVars['sidebar_blocks'] = array('recent'); $tplVars['range'] = 'all'; $tplVars['pagetitle'] = T_('Store, share and tag your favourite links'); $tplVars['subtitle'] = T_('Recent Bookmarks'); $tplVars['bookmarkCount'] = $start + 1; $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, $dtstart, $dtend); $tplVars['total'] = $bookmarks['total']; $tplVars['bookmarks'] =& $bookmarks['bookmarks']; $tplVars['cat_url'] = createURL('tags', '%2$s'); $tplVars['nav_url'] = createURL('index', '%3$s'); $templateservice->loadTemplate('bookmarks.tpl', $tplVars); if ($usecache) { // Cache output if existing copy has expired $cacheservice->End($hash); } ?> \ No newline at end of file diff --git a/login.php b/login.php index 4d212a9..41913f0 100644 --- a/login.php +++ b/login.php @@ -1,53 +1,53 @@ <?php /*************************************************************************** Copyright (C) 2004 - 2006 Scuttle project http://sourceforge.net/projects/scuttle/ http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once('header.inc.php'); $userservice =& ServiceFactory::getServiceInstance('UserService'); $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $tplVars = array(); $login = false; if (isset($_POST['submitted']) && isset($_POST['username']) && isset($_POST['password'])) { $posteduser = trim(utf8_strtolower($_POST['username'])); - $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == "yes")); + $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == 'yes'), $path); if ($login) { if ($_POST['query']) header('Location: '. createURL('bookmarks', $posteduser .'?'. $_POST['query'])); else header('Location: '. createURL('bookmarks', $posteduser)); } else { $tplVars['error'] = T_('The details you have entered are incorrect. Please try again.'); } } if (!$login) { if ($userservice->isLoggedOn()) { $cUser = $userservice->getCurrentUser(); $cUsername = strtolower($cUser[$userservice->getFieldName('username')]); header('Location: '. createURL('bookmarks', $cUsername)); } $tplVars['subtitle'] = T_('Log In'); $tplVars['formaction'] = createURL('login'); $tplVars['querystring'] = filter($_SERVER['QUERY_STRING']); $templateservice->loadTemplate('login.tpl', $tplVars); } ?> diff --git a/readme.txt b/readme.txt index 64b186b..44abd6b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,23 +1,16 @@ -Scuttle 0.7.3 +Scuttle 0.7.4 http://sourceforge.net/projects/scuttle/ http://scuttle.org/ Copyright (C) 2004 - 2008 Scuttle project Available under the GNU General Public License ============ INSTALLATION ============ * Use the SQL contained in tables.sql to create the necessary database tables. This file was written specifically for MySQL, so may need rewritten if you intend to use a different database system. * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. -* Set the CHMOD permissions on the /cache/ subdirectory to 777 - -============= -PROJECT LINKS -============= - -Scuttle Project: -http://sourceforge.net/projects/scuttle/ \ No newline at end of file +* Set the CHMOD permissions on the /cache/ subdirectory to 777 \ No newline at end of file diff --git a/register.php b/register.php index 8549d05..bca4de2 100644 --- a/register.php +++ b/register.php @@ -1,64 +1,64 @@ <?php /*************************************************************************** Copyright (C) 2004 - 2006 Marcus Campbell http://sourceforge.net/projects/scuttle/ http://scuttle.org/ This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ require_once('header.inc.php'); -$userservice =& ServiceFactory::getServiceInstance('UserService'); -$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); +$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $tplVars = array(); if ($_POST['submitted']) { $posteduser = trim(utf8_strtolower($_POST['username'])); // Check if form is incomplete if (!($posteduser) || !($_POST['password']) || !($_POST['email'])) { $tplVars['error'] = T_('You <em>must</em> enter a username, password and e-mail address.'); // Check if username is reserved } elseif ($userservice->isReserved($posteduser)) { $tplVars['error'] = T_('This username has been reserved, please make another choice.'); // Check if username already exists } elseif ($userservice->getUserByUsername($posteduser)) { $tplVars['error'] = T_('This username already exists, please make another choice.'); // Check if e-mail address is valid } elseif (!$userservice->isValidEmail($_POST['email'])) { $tplVars['error'] = T_('E-mail address is not valid. Please try again.'); // Register details } elseif ($userservice->addUser($posteduser, $_POST['password'], $_POST['email'])) { // Log in with new username $login = $userservice->login($posteduser, $_POST['password']); if ($login) { header('Location: '. createURL('bookmarks', $posteduser)); } $tplVars['msg'] = T_('You have successfully registered. Enjoy!'); } else { $tplVars['error'] = T_('Registration failed. Please try again.'); } } $tplVars['loadjs'] = true; $tplVars['subtitle'] = T_('Register'); $tplVars['formaction'] = createURL('register'); $templateservice->loadTemplate('register.tpl', $tplVars); ?> diff --git a/scuttle.css b/scuttle.css index 0d7ab2b..ecd2ab7 100644 --- a/scuttle.css +++ b/scuttle.css @@ -1,436 +1,437 @@ /* BASE */ * { font-family: "trebuchet ms", tahoma, sans-serif; } a { color: #47A; text-decoration: none; } a:hover { color: #258; text-decoration: underline; } a img { border: 0; } body { + background-color: #FFF; margin: 0; padding: 0; } input[type=text], input[type=password], select, textarea { border: 1px solid #AAA; padding: 0.1em; } input[type=text], input[type=password], textarea { padding: 0.2em; } input[type=text]:focus, input[type=password]:focus, select:focus, textarea:focus { border-color: #666; } p.error, p.success { border: 1px solid; font-size: small; margin: 0.5em; padding: 0.5em; width: 70%; } p.error { background: #FCC; border-color: #966; color: #633; } p.success { background: #CFC; border-color: #696; color: #363; } td#availability { color: #285; font-weight: bold; } td#availability.not-available { color: #F00; } textarea { font-size: small; padding: 0.2em; } th { padding-right: 1em; text-align: right; } /* HEADER */ div#header { background: #FFF url('bg_header.png') bottom repeat-x; border-bottom: 3px solid #9CD; clear: both; } div#header:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } * html div#header { height: 1%; } h1 { float: left; font-size: x-large; font-weight: bold; letter-spacing: 0.25em; margin: 0; padding: 1em; text-transform: lowercase; } html > body h1 { background: url('logo.png') no-repeat 10px; padding-left: 75px; } html > body div#header.popup h1 { background: url('logo_24.png') no-repeat 10px; padding: 0.5em 0.5em 0.5em 50px; } h1 a { color: #000; } h1 a:hover { color: #000; } h2 { background: #666 url('bg_bar.png') center center repeat-x; border-bottom: 3px solid #DDD; clear: both; color: #DDD; font-size: medium; letter-spacing: 0.1em; margin: 0 0 1em 0; padding: 0.5em 1em; text-transform: lowercase; } /* NAVIGATION */ ul#navigation { list-style-type: none; margin: 0; padding: 1.75em 1em; text-transform: lowercase; width: auto; } ul#navigation a { font-size: medium; font-weight: bold; padding: 0.2em 0.5em; } ul#navigation a:hover { background: #7AD; color: #FFF; } ul#navigation li { float: left; } ul#navigation li.access { float: right; } /* BOOKMARKS */ ol#bookmarks { list-style-type: none; margin: 0; padding: 0 1em; width: 70%; } html > body ol#bookmarks { margin: 0 1em; padding: 0; } div.link a { color: blue; font-size: medium; } div.link a:visited { color: purple; } div.meta { color: #285; } div.meta span { color: #F00; } li.xfolkentry { border-bottom: 1px solid #DDD; margin-bottom: 0; padding: 1em 0.5em; } html > body li.xfolkentry { border-bottom: 1px dotted #AAA; } li.xfolkentry div { padding: 0.1em; } li.xfolkentry.deleted { opacity: 0.5; } li.xfolkentry.private { border-left: 3px solid #F00; } li.xfolkentry.shared { border-left: 3px solid #FA0; } /* SIDEBAR */ div#sidebar { font-size: small; position: absolute; right: 1em; top: 10em; width: 25%; } div#sidebar a { color: #995; } div#sidebar a:hover { color: #773; } div#sidebar div { background: #FFF url('bg_sidebar.png') bottom repeat-x; border: 1px solid #CC8; color: #555; margin-bottom: 1em; } div#sidebar h2 { background: transparent; border: 0; color: #995; letter-spacing: 0; margin: 0; padding: 0.5em 0; } div#sidebar hr { display: none; } div#sidebar p { margin: 1em; } div#sidebar p.tags a { margin: 0; } div#sidebar table { margin: 0.5em 0.5em 0 0.5em; } div#sidebar table td { padding-bottom: 0.25em; padding-right: 0.5em; } div#sidebar ul { list-style-type: none; margin: 0; padding: 0.5em; } div#sidebar ul li { margin: 0.5em 0; } /* TAGS */ p.tags { line-height: 2.25em; margin: 2em 10%; text-align: justify; vertical-align: middle; } p.tags a, p.tags span { color: #47A; margin-right: 0.5em; } p.tags span:hover { cursor: pointer; text-decoration: underline; } p.tags span.selected { background: #CEC; } /* PROFILE */ table.profile th { width: 10em; } /* OTHER GUFF */ dd { background: #CEC; border-right: 4px solid #ACA; color: #464; padding: 6px; } dd a { color: #464; } dd a:hover { color: #000 !important; text-decoration: underline !important; } dl { font-size: small; margin: 1em; width: 70%; } dl#profile dd { background: #CDE; border-color: #ABC; color: #247; } dl#profile dt { background: #BCE; border-color: #9AC; color: #245; display: block; font-weight: bold; padding: 6px; } dl#profile a { color: #446; } dl#profile a:hover { color: #000 !important; text-decoration: underline !important; } dl#meta dd { line-height: 1.5em; } dl#meta dt { background: #BDB; color: #353; display: block; font-weight: bold; padding: 6px; } dt { border-right: 4px solid #9B9; } dt a { background: #BDB; color: #353; display: block; font-weight: bold; padding: 6px; } dt a:hover { background: #ACA; border: 0; } form { margin: 0; } form#search { background: #FFF; color: #555; font-size: small; margin-bottom: 1em; } form label, form td, form th { font-size: small; } form table { margin: 0 1em; } h3 { background: #DDD; color: #555; font-size: small; letter-spacing: 0.2em; margin: 2em 1em 1em 1em; padding: 0.25em 0.75em; } li { font-size: small; margin-bottom: 0.5em; } p { font-size: small; margin: 1em; } p#sort { color: #CCC; font-size: small; float: right; margin: 0; position: absolute; right: 0; top: 7em; } html > body p#sort { margin-right: 0.75em; } p#sort a { background: #AAA; color: #555; font-weight: normal; margin-right: 0.5em; padding: 0 1em; } html > body p#sort a { margin-right: 0; } p#sort a:hover { background: #CCC; text-decoration: none !important; } p#sort span { display: none; } p.paging { font-size: small; margin-left: 1em; } p.paging a, p.paging span.disable { background: #888; color: #FFF; display: inline; margin-right: 0.5em; padding: 0.25em 1em; } p.paging a:hover { background: #666; } p.paging span { display: none; } p.paging span.disable { background: #DDD; color: #AAA; } div.collapsible p.tags { line-height: 2.25em; margin: 1em 2em; } th label { padding-right: 1em; } ul { margin-right: 1em; width: 75%; } diff --git a/services/bookmarkservice.php b/services/bookmarkservice.php index afc7179..9159f97 100644 --- a/services/bookmarkservice.php +++ b/services/bookmarkservice.php @@ -1,416 +1,415 @@ <?php class BookmarkService { var $db; function & getInstance(& $db) { static $instance; if (!isset ($instance)) $instance = & new BookmarkService($db); return $instance; } function BookmarkService(& $db) { $this->db = & $db; } function _getbookmark($fieldname, $value, $all = false) { if (!$all) { $userservice = & ServiceFactory :: getServiceInstance('UserService'); $sId = $userservice->getCurrentUserId(); $range = ' AND uId = '. $sId; } $query = 'SELECT * FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE '. $fieldname .' = "'. $this->db->sql_escape($value) .'"'. $range; if (!($dbresult = & $this->db->sql_query_limit($query, 1, 0))) { message_die(GENERAL_ERROR, 'Could not get bookmark', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) { return $row; } else { return false; } } function & getBookmark($bid, $include_tags = false) { if (!is_numeric($bid)) return; $sql = 'SELECT * FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE bId = '. $this->db->sql_escape($bid); if (!($dbresult = & $this->db->sql_query($sql))) message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db); if ($row = & $this->db->sql_fetchrow($dbresult)) { if ($include_tags) { $tagservice = & ServiceFactory :: getServiceInstance('TagService'); $row['tags'] = $tagservice->getTagsForBookmark($bid); } return $row; } else { return false; } } function getBookmarkByAddress($address) { $hash = md5($address); return $this->getBookmarkByHash($hash); } function getBookmarkByHash($hash) { return $this->_getbookmark('bHash', $hash, true); } function editAllowed($bookmark) { if (!is_numeric($bookmark) && (!is_array($bookmark) || !is_numeric($bookmark['bId']))) return false; if (!is_array($bookmark)) if (!($bookmark = $this->getBookmark($bookmark))) return false; $userservice = & ServiceFactory :: getServiceInstance('UserService'); $userid = $userservice->getCurrentUserId(); if ($userservice->isAdmin($userid)) return true; else return ($bookmark['uId'] == $userid); } function bookmarkExists($address = false, $uid = NULL) { if (!$address) { return; } // If address doesn't contain ":", add "http://" as the default protocol if (strpos($address, ':') === false) { $address = 'http://'. $address; } $crit = array ('bHash' => md5($address)); if (isset ($uid)) { $crit['uId'] = $uid; } $sql = 'SELECT COUNT(*) FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE '. $this->db->sql_build_array('SELECT', $crit); if (!($dbresult = & $this->db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db); } return ($this->db->sql_fetchfield(0, 0) > 0); } // Adds a bookmark to the database. // Note that date is expected to be a string that's interpretable by strtotime(). function addBookmark($address, $title, $description, $status, $categories, $date = NULL, $fromApi = false, $fromImport = false) { $userservice = & ServiceFactory :: getServiceInstance('UserService'); $sId = $userservice->getCurrentUserId(); // If bookmark address doesn't contain ":", add "http://" to the start as a default protocol if (strpos($address, ':') === false) { $address = 'http://'. $address; } // Get the client's IP address and the date; note that the date is in GMT. if (getenv('HTTP_CLIENT_IP')) $ip = getenv('HTTP_CLIENT_IP'); else if (getenv('REMOTE_ADDR')) $ip = getenv('REMOTE_ADDR'); else $ip = getenv('HTTP_X_FORWARDED_FOR'); // Note that if date is NULL, then it's added with a date and time of now, and if it's present, // it's expected to be a string that's interpretable by strtotime(). if (is_null($date)) $time = time(); else $time = strtotime($date); $datetime = gmdate('Y-m-d H:i:s', $time); // Set up the SQL insert statement and execute it. $values = array('uId' => intval($sId), 'bIp' => $ip, 'bDatetime' => $datetime, 'bModified' => $datetime, 'bTitle' => $title, 'bAddress' => $address, 'bDescription' => $description, 'bStatus' => intval($status), 'bHash' => md5($address)); $sql = 'INSERT INTO '. $GLOBALS['tableprefix'] .'bookmarks '. $this->db->sql_build_array('INSERT', $values); $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert bookmark', '', __LINE__, __FILE__, $sql, $this->db); return false; } // Get the resultant row ID for the bookmark. $bId = $this->db->sql_nextid($dbresult); if (!isset($bId) || !is_int($bId)) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert bookmark', '', __LINE__, __FILE__, $sql, $this->db); return false; } $uriparts = explode('.', $address); $extension = end($uriparts); unset($uriparts); $tagservice = & ServiceFactory :: getServiceInstance('TagService'); if (!$tagservice->attachTags($bId, $categories, $fromApi, $extension, false, $fromImport)) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert bookmark', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return the new bookmark's bId. return $bId; } function updateBookmark($bId, $address, $title, $description, $status, $categories, $date = NULL, $fromApi = false) { if (!is_numeric($bId)) return false; // Get the client's IP address and the date; note that the date is in GMT. if (getenv('HTTP_CLIENT_IP')) $ip = getenv('HTTP_CLIENT_IP'); else if (getenv('REMOTE_ADDR')) $ip = getenv('REMOTE_ADDR'); else $ip = getenv('HTTP_X_FORWARDED_FOR'); $moddatetime = gmdate('Y-m-d H:i:s', time()); // Set up the SQL update statement and execute it. $updates = array('bModified' => $moddatetime, 'bTitle' => $title, 'bAddress' => $address, 'bDescription' => $description, 'bStatus' => $status, 'bHash' => md5($address)); if (!is_null($date)) { - $datetime = gmdate('Y-m-d H:i:s', strtotime($date)); - $updates[] = array('bDateTime' => $datetime); + $updates['bDateTime'] = gmdate('Y-m-d H:i:s', strtotime($date)); } $sql = 'UPDATE '. $GLOBALS['tableprefix'] .'bookmarks SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE bId = '. intval($bId); $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update bookmark', '', __LINE__, __FILE__, $sql, $this->db); return false; } $uriparts = explode('.', $address); $extension = end($uriparts); unset($uriparts); $tagservice = & ServiceFactory :: getServiceInstance('TagService'); if (!$tagservice->attachTags($bId, $categories, $fromApi, $extension)) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update bookmark', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function & getBookmarks($start = 0, $perpage = NULL, $user = NULL, $tags = NULL, $terms = NULL, $sortOrder = NULL, $watched = NULL, $startdate = NULL, $enddate = NULL, $hash = NULL) { // Only get the bookmarks that are visible to the current user. Our rules: // - if the $user is NULL, that means get bookmarks from ALL users, so we need to make // sure to check the logged-in user's watchlist and get the contacts-only bookmarks from // those users. If the user isn't logged-in, just get the public bookmarks. // - if the $user is set and isn't the logged-in user, then get that user's bookmarks, and // if that user is on the logged-in user's watchlist, get the public AND contacts-only // bookmarks; otherwise, just get the public bookmarks. // - if the $user is set and IS the logged-in user, then get all bookmarks. $userservice =& ServiceFactory::getServiceInstance('UserService'); $tagservice =& ServiceFactory::getServiceInstance('TagService'); $sId = $userservice->getCurrentUserId(); if ($userservice->isLoggedOn()) { // All public bookmarks, user's own bookmarks and any shared with user $privacy = ' AND ((B.bStatus = 0) OR (B.uId = '. $sId .')'; $watchnames = $userservice->getWatchNames($sId, true); foreach($watchnames as $watchuser) { $privacy .= ' OR (U.username = "'. $watchuser .'" AND B.bStatus = 1)'; } $privacy .= ')'; } else { // Just public bookmarks $privacy = ' AND B.bStatus = 0'; } // Set up the tags, if need be. if (!is_array($tags) && !is_null($tags)) { $tags = explode('+', trim($tags)); } $tagcount = count($tags); for ($i = 0; $i < $tagcount; $i ++) { $tags[$i] = trim($tags[$i]); } // Set up the SQL query. $query_1 = 'SELECT DISTINCT '; if (SQL_LAYER == 'mysql4') { $query_1 .= 'SQL_CALC_FOUND_ROWS '; } $query_1 .= 'B.*, U.'. $userservice->getFieldName('username'); $query_2 = ' FROM '. $userservice->getTableName() .' AS U, '. $GLOBALS['tableprefix'] .'bookmarks AS B'; $query_3 = ' WHERE B.uId = U.'. $userservice->getFieldName('primary') . $privacy; if (is_null($watched)) { if (!is_null($user)) { $query_3 .= ' AND B.uId = '. $user; } } else { $arrWatch = $userservice->getWatchlist($user); if (count($arrWatch) > 0) { foreach($arrWatch as $row) { $query_3_1 .= 'B.uId = '. intval($row) .' OR '; } $query_3_1 = substr($query_3_1, 0, -3); } else { $query_3_1 = 'B.uId = -1'; } $query_3 .= ' AND ('. $query_3_1 .') AND B.bStatus IN (0, 1)'; } switch($sortOrder) { case 'date_asc': $query_5 = ' ORDER BY B.bDatetime ASC '; break; case 'title_desc': $query_5 = ' ORDER BY B.bTitle DESC '; break; case 'title_asc': $query_5 = ' ORDER BY B.bTitle ASC '; break; case 'url_desc': $query_5 = ' ORDER BY B.bAddress DESC '; break; case 'url_asc': $query_5 = ' ORDER BY B.bAddress ASC '; break; default: $query_5 = ' ORDER BY B.bDatetime DESC '; } // Handle the parts of the query that depend on any tags that are present. $query_4 = ''; for ($i = 0; $i < $tagcount; $i ++) { $query_2 .= ', '. $GLOBALS['tableprefix'] .'tags AS T'. $i; $query_4 .= ' AND T'. $i .'.tag = "'. $this->db->sql_escape($tags[$i]) .'" AND T'. $i .'.bId = B.bId'; } // Search terms if ($terms) { // Multiple search terms okay $aTerms = explode(' ', $terms); $aTerms = array_map('trim', $aTerms); // Search terms in tags as well when none given if (!count($tags)) { $query_2 .= ' LEFT JOIN '. $GLOBALS['tableprefix'] .'tags AS T ON B.bId = T.bId'; $dotags = true; } else { $dotags = false; } $query_4 = ''; for ($i = 0; $i < count($aTerms); $i++) { $query_4 .= ' AND (B.bTitle LIKE "%'. $this->db->sql_escape($aTerms[$i]) .'%"'; $query_4 .= ' OR B.bDescription LIKE "%'. $this->db->sql_escape($aTerms[$i]) .'%"'; if ($dotags) { $query_4 .= ' OR T.tag = "'. $this->db->sql_escape($aTerms[$i]) .'"'; } $query_4 .= ')'; } } // Start and end dates if ($startdate) { $query_4 .= ' AND B.bDatetime > "'. $startdate .'"'; } if ($enddate) { $query_4 .= ' AND B.bDatetime < "'. $enddate .'"'; } // Hash if ($hash) { $query_4 .= ' AND B.bHash = "'. $hash .'"'; } $query = $query_1 . $query_2 . $query_3 . $query_4 . $query_5; if (!($dbresult = & $this->db->sql_query_limit($query, intval($perpage), intval($start)))) { message_die(GENERAL_ERROR, 'Could not get bookmarks', '', __LINE__, __FILE__, $query, $this->db); return false; } if (SQL_LAYER == 'mysql4') { $totalquery = 'SELECT FOUND_ROWS() AS total'; } else { $totalquery = 'SELECT COUNT(*) AS total'. $query_2 . $query_3 . $query_4; } if (!($totalresult = & $this->db->sql_query($totalquery)) || (!($row = & $this->db->sql_fetchrow($totalresult)))) { message_die(GENERAL_ERROR, 'Could not get total bookmarks', '', __LINE__, __FILE__, $totalquery, $this->db); return false; } $total = $row['total']; $bookmarks = array(); while ($row = & $this->db->sql_fetchrow($dbresult)) { $row['tags'] = $tagservice->getTagsForBookmark(intval($row['bId'])); $bookmarks[] = $row; } return array ('bookmarks' => $bookmarks, 'total' => $total); } function deleteBookmark($bookmarkid) { $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE bId = '. intval($bookmarkid); $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($query))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db); return false; } $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'tags WHERE bId = '. intval($bookmarkid); $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($query))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db); return false; } $this->db->sql_transaction('commit'); return true; } function countOthers($address) { if (!$address) { return false; } $userservice = & ServiceFactory :: getServiceInstance('UserService'); $sId = $userservice->getCurrentUserId(); if ($userservice->isLoggedOn()) { // All public bookmarks, user's own bookmarks and any shared with user $privacy = ' AND ((B.bStatus = 0) OR (B.uId = '. $sId .')'; $watchnames = $userservice->getWatchNames($sId, true); foreach($watchnames as $watchuser) { $privacy .= ' OR (U.username = "'. $watchuser .'" AND B.bStatus = 1)'; } $privacy .= ')'; } else { // Just public bookmarks $privacy = ' AND B.bStatus = 0'; } $sql = 'SELECT COUNT(*) FROM '. $userservice->getTableName() .' AS U, '. $GLOBALS['tableprefix'] .'bookmarks AS B WHERE U.'. $userservice->getFieldName('primary') .' = B.uId AND B.bHash = "'. md5($address) .'"'. $privacy; if (!($dbresult = & $this->db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db); } return $this->db->sql_fetchfield(0, 0) - 1; } } ?> diff --git a/services/userservice.php b/services/userservice.php index 82abaf0..e0b7ba9 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -1,362 +1,360 @@ <?php class UserService { var $db; function &getInstance(&$db) { static $instance; if (!isset($instance)) $instance =& new UserService($db); return $instance; } var $fields = array( 'primary' => 'uId', 'username' => 'username', 'password' => 'password' ); var $profileurl; var $tablename; var $sessionkey; var $cookiekey; var $cookietime = 1209600; // 2 weeks function UserService(&$db) { $this->db =& $db; $this->tablename = $GLOBALS['tableprefix'] .'users'; $this->sessionkey = $GLOBALS['cookieprefix'] .'-currentuserid'; $this->cookiekey = $GLOBALS['cookieprefix'] .'-login'; $this->profileurl = createURL('profile', '%2$s'); } function _checkdns($host) { if (function_exists('checkdnsrr')) { return checkdnsrr($host); } else { return $this->_checkdnsrr($host); } } function _checkdnsrr($host, $type = "MX") { if(!empty($host)) { @exec("nslookup -type=$type $host", $output); while(list($k, $line) = each($output)) { if(eregi("^$host", $line)) { return true; } } return false; } } function _getuser($fieldname, $value) { $query = 'SELECT * FROM '. $this->getTableName() .' WHERE '. $fieldname .' = "'. $this->db->sql_escape($value) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) return $row; else return false; } function _randompassword() { - $seed = (integer) md5(microtime()); - mt_srand($seed); $password = mt_rand(1, 99999999); $password = substr(md5($password), mt_rand(0, 19), mt_rand(6, 12)); return $password; } function _updateuser($uId, $fieldname, $value) { $updates = array ($fieldname => $value); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function getProfileUrl($id, $username) { return sprintf($this->profileurl, urlencode($id), urlencode($username)); } function getUserByUsername($username) { return $this->_getuser($this->getFieldName('username'), $username); } function getUser($id) { return $this->_getuser($this->getFieldName('primary'), $id); } function isLoggedOn() { return ($this->getCurrentUserId() !== false); } function &getCurrentUser($refresh = FALSE, $newval = NULL) { static $currentuser; if (!is_null($newval)) //internal use only: reset currentuser $currentuser = $newval; else if ($refresh || !isset($currentuser)) { if ($id = $this->getCurrentUserId()) $currentuser = $this->getUser($id); else return; } return $currentuser; } function isAdmin($userid) { return false; //not implemented yet } function getCurrentUserId() { if (isset($_SESSION[$this->getSessionKey()])) { return $_SESSION[$this->getSessionKey()]; } else if (isset($_COOKIE[$this->getCookieKey()])) { $cook = split(':', $_COOKIE[$this->getCookieKey()]); //cookie looks like this: 'id:md5(username+password)' $query = 'SELECT * FROM '. $this->getTableName() . ' WHERE MD5(CONCAT('.$this->getFieldName('username') . ', '.$this->getFieldName('password') . ')) = \''.$this->db->sql_escape($cook[1]).'\' AND '. $this->getFieldName('primary'). ' = '. $this->db->sql_escape($cook[0]); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row = $this->db->sql_fetchrow($dbresult)) { $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; return $_SESSION[$this->getSessionKey()]; } } return false; } - function login($username, $password, $remember = FALSE) { + function login($username, $password, $remember = FALSE, $path = '/') { $password = $this->sanitisePassword($password); $query = 'SELECT '. $this->getFieldName('primary') .' FROM '. $this->getTableName() .' WHERE '. $this->getFieldName('username') .' = "'. $this->db->sql_escape($username) .'" AND '. $this->getFieldName('password') .' = "'. $this->db->sql_escape($password) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) { $id = $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; if ($remember) { $cookie = $id .':'. md5($username.$password); - setcookie($this->cookiekey, $cookie, time() + $this->cookietime); + setcookie($this->cookiekey, $cookie, time() + $this->cookietime, $path); } return true; } else { return false; } } - function logout() { - @setcookie($this->cookiekey, NULL, time() - 1); + function logout($path = '/') { + @setcookie($this->cookiekey, NULL, time() - 1, $path); unset($_COOKIE[$this->cookiekey]); session_unset(); $this->getCurrentUser(TRUE, false); } function getWatchlist($uId) { // Gets the list of user IDs being watched by the given user. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($uId); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return $arrWatch; while ($row =& $this->db->sql_fetchrow($dbresult)) $arrWatch[] = $row['watched']; return $arrWatch; } function getWatchNames($uId, $watchedby = false) { // Gets the list of user names being watched by the given user. // - If $watchedby is false get the list of users that $uId watches // - If $watchedby is true get the list of users that watch $uId if ($watchedby) { $table1 = 'b'; $table2 = 'a'; } else { $table1 = 'a'; $table2 = 'b'; } $query = 'SELECT '. $table1 .'.'. $this->getFieldName('username') .' FROM '. $GLOBALS['tableprefix'] .'watched AS W, '. $this->getTableName() .' AS a, '. $this->getTableName() .' AS b WHERE W.watched = a.'. $this->getFieldName('primary') .' AND W.uId = b.'. $this->getFieldName('primary') .' AND '. $table2 .'.'. $this->getFieldName('primary') .' = '. intval($uId) .' ORDER BY '. $table1 .'.'. $this->getFieldName('username'); if (!($dbresult =& $this->db->sql_query($query))) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) { return $arrWatch; } while ($row =& $this->db->sql_fetchrow($dbresult)) { $arrWatch[] = $row[$this->getFieldName('username')]; } return $arrWatch; } function getWatchStatus($watcheduser, $currentuser) { // Returns true if the current user is watching the given user, and false otherwise. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched AS W INNER JOIN '. $this->getTableName() .' AS U ON U.'. $this->getFieldName('primary') .' = W.watched WHERE U.'. $this->getFieldName('primary') .' = '. intval($watcheduser) .' AND W.uId = '. intval($currentuser); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchstatus', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return false; else return true; } function setWatchStatus($subjectUserID) { if (!is_numeric($subjectUserID)) return false; $currentUserID = $this->getCurrentUserId(); $watched = $this->getWatchStatus($subjectUserID, $currentUserID); if ($watched) { $sql = 'DELETE FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($currentUserID) .' AND watched = '. intval($subjectUserID); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } else { $values = array( 'uId' => intval($currentUserID), 'watched' => intval($subjectUserID) ); $sql = 'INSERT INTO '. $GLOBALS['tableprefix'] .'watched '. $this->db->sql_build_array('INSERT', $values); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } $this->db->sql_transaction('commit'); return true; } function addUser($username, $password, $email) { // Set up the SQL UPDATE statement. $datetime = gmdate('Y-m-d H:i:s', time()); $password = $this->sanitisePassword($password); $values = array('username' => $username, 'password' => $password, 'email' => $email, 'uDatetime' => $datetime, 'uModified' => $datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function updateUser($uId, $password, $name, $email, $homepage, $uContent) { if (!is_numeric($uId)) return false; // Set up the SQL UPDATE statement. $moddatetime = gmdate('Y-m-d H:i:s', time()); if ($password == '') $updates = array ('uModified' => $moddatetime, 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); else $updates = array ('uModified' => $moddatetime, 'password' => $this->sanitisePassword($password), 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function sanitisePassword($password) { return sha1(trim($password)); } function generatePassword($uId) { if (!is_numeric($uId)) return false; $password = $this->_randompassword(); if ($this->_updateuser($uId, $this->getFieldName('password'), $this->sanitisePassword($password))) return $password; else return false; } function isReserved($username) { if (in_array($username, $GLOBALS['reservedusers'])) { return true; } else { return false; } } function isValidEmail($email) { - if (eregi("^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$", $email)) { + if (preg_match("/^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$/i", $email) > 0) { list($emailUser, $emailDomain) = split("@", $email); // Check if the email domain has a DNS record if ($this->_checkdns($emailDomain)) { return true; } } return false; } // Properties function getTableName() { return $this->tablename; } function setTableName($value) { $this->tablename = $value; } function getFieldName($field) { return $this->fields[$field]; } function setFieldName($field, $value) { $this->fields[$field] = $value; } function getSessionKey() { return $this->sessionkey; } function setSessionKey($value) { $this->sessionkey = $value; } function getCookieKey() { return $this->cookiekey; } function setCookieKey($value) { $this->cookiekey = $value; } } ?>
scronide/scuttle
cd5cb72f09ebcc2379d7f92fc00f6e62f221b658
branches/version-0.7: * Updated readme * Set mysql as default DB type
diff --git a/config.inc.php.example b/config.inc.php.example index c78f361..71e6406 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -1,120 +1,120 @@ <?php ###################################################################### # SCUTTLE: Online social bookmarks manager ###################################################################### # Copyright (C) 2005 - 2006 Scuttle project # http://sourceforge.net/projects/scuttle/ # http://scuttle.org/ # # This module is to configure the main options for your site # # This program 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. ###################################################################### ###################################################################### # Database Configuration # # dbtype: Database driver - mysql, mysqli, mysql4, oracle, postgres, # sqlite, db2, firebird, mssql, mssq-odbc # dbhost: Database hostname # dbport: Database port # dbuser: Database username # dbpass: Database password # dbname: Database name ###################################################################### -$dbtype = 'mysql4'; +$dbtype = 'mysql'; $dbhost = '127.0.0.1'; $dbport = '3306'; $dbuser = 'username'; $dbpass = 'password'; $dbname = 'scuttle'; ###################################################################### # You have finished configuring the database! # ONLY EDIT THE INFORMATION BELOW IF YOU KNOW WHAT YOU ARE DOING. ###################################################################### # System Configuration # # sitename: The name of this site. # locale: The locale used. # top_include: The header file. # bottom_include: The footer file. # shortdate: The format of short dates. # longdate: The format of long dates. # nofollow: true - Include rel="nofollow" attribute on # bookmark links. # false - Don't include rel="nofollow". # defaultPerPage: The default number of bookmarks per page. # -1 means no limit! # defaultRecentDays: The number of days that bookmarks or tags should # be considered recent. # defaultOrderBy: The default order in which bookmarks will appear. # Possible values are: # date_desc - By date of entry descending. # Latest entry first. (Default) # date_asc - By date of entry ascending. # Earliest entry first. # title_desc - By title, descending alphabetically. # title_asc - By title, ascending alphabetically. # url_desc - By URL, descending alphabetically. # url_asc - By URL, ascending alphabetically. # TEMPLATES_DIR: The directory where the template files should be # loaded from (the *.tpl.php files) # root : Set to NULL to autodetect the root url of the website # cookieprefix : The prefix to use for the cookies on the site # tableprefix : The table prefix used for this installation # adminemail : Contact address for the site administrator. Used # as the FROM address in password retrieval e-mails. # cleanurls : true - Use mod_rewrite to hide PHP extensions # : false - Don't hide extensions [Default] # # usecache : true - Cache pages when possible # false - Don't cache at all [Default] # dir_cache : The directory where cache files will be stored # # useredir : true - Improve privacy by redirecting all bookmarks # through the address specified in url_redir # false - Don't redirect bookmarks # url_redir : URL prefix for bookmarks to redirect through # # filetypes : An array of bookmark extensions that Scuttle should # add system tags for. # reservedusers : An array of usernames that cannot be registered ###################################################################### $sitename = 'Scuttle'; $locale = 'en_GB'; $top_include = 'top.inc.php'; $bottom_include = 'bottom.inc.php'; $shortdate = 'd-m-Y'; $longdate = 'j F Y'; $nofollow = true; $defaultPerPage = 10; $defaultRecentDays = 14; $defaultOrderBy = 'date_desc'; $TEMPLATES_DIR = dirname(__FILE__) .'/templates/'; $root = NULL; $cookieprefix = 'SCUTTLE'; $tableprefix = 'sc_'; $adminemail = 'admin@example.org'; $cleanurls = false; $usecache = false; $dir_cache = dirname(__FILE__) .'/cache/'; $useredir = false; $url_redir = 'http://www.google.com/url?sa=D&q='; $filetypes = array( 'audio' => array('mp3', 'ogg', 'wav'), 'document' => array('doc', 'odt', 'pdf'), 'image' => array('gif', 'jpeg', 'jpg', 'png'), 'video' => array('avi', 'mov', 'mp4', 'mpeg', 'mpg', 'wmv') ); $reservedusers = array('all', 'watchlist'); include_once('debug.inc.php'); ?> diff --git a/readme.txt b/readme.txt index 636893f..64b186b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,86 +1,23 @@ -Scuttle 0.7.2 +Scuttle 0.7.3 http://sourceforge.net/projects/scuttle/ http://scuttle.org/ -Copyright (C) 2004 - 2006 Scuttle project +Copyright (C) 2004 - 2008 Scuttle project Available under the GNU General Public License ============ INSTALLATION ============ * Use the SQL contained in tables.sql to create the necessary database tables. This file was written specifically for MySQL, so may need rewritten if you intend to use a different database system. * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. * Set the CHMOD permissions on the /cache/ subdirectory to 777 -[ See also: http://scuttle.org/wiki/doku.php?id=installation ] - -========= -UPGRADING -========= - -Instructions on how to upgrade from the last stable release of Scuttle are detailed on our Wiki: - -http://scuttle.org/wiki/doku.php?id=upgrading - -=== -API -=== - -Scuttle supports most of the del.icio.us API [ http://del.icio.us/doc/api ]. Almost all of the neat tools made for that system can be modified to work with your installation instead. If you find a tool that won't let you change the API address, ask the creator to add this setting. You never know, they might just do it. - -[ See also: http://scuttle.org/wiki/doku.php?id=scuttle_api ] - -============ -TRANSLATIONS -============ - -Scuttle is available in many languages. If you know gettext and can provide additional translations, your help would be greatly appreciated. - -------------------- -Available languages -------------------- -English en-GB 100% (Default) -Chinese zh-CN 86% -Danish dk-DK 100% -Dutch nl-NL 68% -French fr-FR 100% -German de-DE 100% -Hindi hi-IN 100% -Italian it-IT 89% -Japanese ja-JP 100% -Lithuanian lt-LT 100% -Portuguese pt-BR 100% -Spanish es-ES 94% - -[ See also: http://scuttle.org/wiki/doku.php?id=translations ] - ============= PROJECT LINKS ============= Scuttle Project: -http://sourceforge.net/projects/scuttle/ - -Scuttle.org: -http://scuttle.org/ - -Scuttle Wiki: -http://scuttle.org/wiki/ - -Help forum: -https://sourceforge.net/forum/forum.php?forum_id=455068 - -Bug reports: -https://sourceforge.net/tracker/?atid=729860&group_id=134378&func=browse - -Feature requests: -https://sourceforge.net/tracker/?atid=729863&group_id=134378&func=browse - -User-submitted patches: -https://sourceforge.net/tracker/?atid=729862&group_id=134378&func=browse - -Discussion forum: -https://sourceforge.net/forum/forum.php?forum_id=455067 +http://sourceforge.net/projects/scuttle/ \ No newline at end of file
scronide/scuttle
7138fee281c6e11cfef6c669c4b3daab329f8850
trunk, branches/version-0.7: * Changed LC_MESSAGES to LC_ALL trunk: * Changed regex from eregi to preg_match in isValidEmail * Updated tables.sql * Added jQuery * Added prelim Atom feed template * Updated DB abstraction layer to latest phpBB code - Note: Breaks lots of code! * Updated config.inc.php.example
diff --git a/functions.inc.php b/functions.inc.php index 63b789a..b22747e 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1,160 +1,160 @@ <?php // UTF-8 functions require_once(dirname(__FILE__) .'/includes/utf8.php'); // Translation require_once(dirname(__FILE__) .'/includes/php-gettext/gettext.inc'); $domain = 'messages'; -T_setlocale(LC_MESSAGES, $locale); +T_setlocale(LC_ALL, $locale); T_bindtextdomain($domain, dirname(__FILE__) .'/locales'); T_bind_textdomain_codeset($domain, 'UTF-8'); T_textdomain($domain); // Converts tags: // - direction = out: convert spaces to underscores; // - direction = in: convert underscores to spaces. function convertTag($tag, $direction = 'out') { if ($direction == 'out') { $tag = str_replace(' ', '_', $tag); } else { $tag = str_replace('_', ' ', $tag); } return $tag; } function filter($data, $type = NULL) { if (is_string($data)) { $data = trim($data); $data = stripslashes($data); switch ($type) { case 'url': $data = rawurlencode($data); break; default: $data = htmlspecialchars($data); break; } } else if (is_array($data)) { foreach(array_keys($data) as $key) { $row =& $data[$key]; $row = filter($row, $type); } } return $data; } function getPerPageCount() { global $defaultPerPage; return $defaultPerPage; } function getSortOrder($override = NULL) { global $defaultOrderBy; if (isset($_GET['sort'])) { return $_GET['sort']; } else if (isset($override)) { return $override; } else { return $defaultOrderBy; } } function multi_array_search($needle, $haystack) { if (is_array($haystack)) { foreach(array_keys($haystack) as $key) { $value =& $haystack[$key]; $result = multi_array_search($needle, $value); if (is_array($result)) { $return = $result; array_unshift($return, $key); return $return; } elseif ($result == true) { $return[] = $key; return $return; } } return false; } else { if ($needle === $haystack) { return true; } else { return false; } } } function createURL($page = '', $ending = '') { global $cleanurls, $root; if (!$cleanurls && $page != '') { $page .= '.php'; } return $root . $page .'/'. $ending; } function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) { if(defined('HAS_DIED')) die(T_('message_die() was called multiple times.')); define('HAS_DIED', 1); $sql_store = $sql; // Get SQL error if we are debugging. Do this as soon as possible to prevent // subsequent queries from overwriting the status of sql_error() if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { $sql_error = is_null($db) ? '' : $db->sql_error(); $debug_text = ''; if ($sql_error['message'] != '') $debug_text .= '<br /><br />'. T_('SQL Error') .' : '. $sql_error['code'] .' '. $sql_error['message']; if ($sql_store != '') $debug_text .= '<br /><br />'. $sql_store; if ($err_line != '' && $err_file != '') $debug_text .= '</br /><br />'. T_('Line') .' : '. $err_line .'<br />'. T_('File') .' :'. $err_file; } switch($msg_code) { case GENERAL_MESSAGE: if ($msg_title == '') $msg_title = T_('Information'); break; case CRITICAL_MESSAGE: if ($msg_title == '') $msg_title = T_('Critical Information'); break; case GENERAL_ERROR: if ($msg_text == '') $msg_text = T_('An error occured'); if ($msg_title == '') $msg_title = T_('General Error'); break; case CRITICAL_ERROR: // Critical errors mean we cannot rely on _ANY_ DB information being // available so we're going to dump out a simple echo'd statement if ($msg_text == '') $msg_text = T_('An critical error occured'); if ($msg_title == '') $msg_title = T_('Critical Error'); break; } // Add on DEBUG info if we've enabled debug mode and this is an error. This // prevents debug info being output for general messages should DEBUG be // set TRUE by accident (preventing confusion for the end user!) if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) { if ($debug_text != '') $msg_text = $msg_text . '<br /><br /><strong>'. T_('DEBUG MODE') .'</strong>'. $debug_text; } echo "<html>\n<body>\n". $msg_title ."\n<br /><br />\n". $msg_text ."</body>\n</html>"; exit; } ?>
scronide/scuttle
270046795d391a18ef69609b317febe8aec6facb
* Updated isValidEmail regex to match plussed addresses
diff --git a/services/userservice.php b/services/userservice.php index 1e7ed46..82abaf0 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -1,362 +1,362 @@ <?php class UserService { var $db; function &getInstance(&$db) { static $instance; if (!isset($instance)) $instance =& new UserService($db); return $instance; } var $fields = array( 'primary' => 'uId', 'username' => 'username', 'password' => 'password' ); var $profileurl; var $tablename; var $sessionkey; var $cookiekey; var $cookietime = 1209600; // 2 weeks function UserService(&$db) { $this->db =& $db; $this->tablename = $GLOBALS['tableprefix'] .'users'; $this->sessionkey = $GLOBALS['cookieprefix'] .'-currentuserid'; $this->cookiekey = $GLOBALS['cookieprefix'] .'-login'; $this->profileurl = createURL('profile', '%2$s'); } function _checkdns($host) { if (function_exists('checkdnsrr')) { return checkdnsrr($host); } else { return $this->_checkdnsrr($host); } } function _checkdnsrr($host, $type = "MX") { if(!empty($host)) { @exec("nslookup -type=$type $host", $output); while(list($k, $line) = each($output)) { if(eregi("^$host", $line)) { return true; } } return false; } } function _getuser($fieldname, $value) { $query = 'SELECT * FROM '. $this->getTableName() .' WHERE '. $fieldname .' = "'. $this->db->sql_escape($value) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) return $row; else return false; } function _randompassword() { $seed = (integer) md5(microtime()); mt_srand($seed); $password = mt_rand(1, 99999999); $password = substr(md5($password), mt_rand(0, 19), mt_rand(6, 12)); return $password; } function _updateuser($uId, $fieldname, $value) { $updates = array ($fieldname => $value); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function getProfileUrl($id, $username) { return sprintf($this->profileurl, urlencode($id), urlencode($username)); } function getUserByUsername($username) { return $this->_getuser($this->getFieldName('username'), $username); } function getUser($id) { return $this->_getuser($this->getFieldName('primary'), $id); } function isLoggedOn() { return ($this->getCurrentUserId() !== false); } function &getCurrentUser($refresh = FALSE, $newval = NULL) { static $currentuser; if (!is_null($newval)) //internal use only: reset currentuser $currentuser = $newval; else if ($refresh || !isset($currentuser)) { if ($id = $this->getCurrentUserId()) $currentuser = $this->getUser($id); else return; } return $currentuser; } function isAdmin($userid) { return false; //not implemented yet } function getCurrentUserId() { if (isset($_SESSION[$this->getSessionKey()])) { return $_SESSION[$this->getSessionKey()]; } else if (isset($_COOKIE[$this->getCookieKey()])) { $cook = split(':', $_COOKIE[$this->getCookieKey()]); //cookie looks like this: 'id:md5(username+password)' $query = 'SELECT * FROM '. $this->getTableName() . ' WHERE MD5(CONCAT('.$this->getFieldName('username') . ', '.$this->getFieldName('password') . ')) = \''.$this->db->sql_escape($cook[1]).'\' AND '. $this->getFieldName('primary'). ' = '. $this->db->sql_escape($cook[0]); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row = $this->db->sql_fetchrow($dbresult)) { $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; return $_SESSION[$this->getSessionKey()]; } } return false; } function login($username, $password, $remember = FALSE) { $password = $this->sanitisePassword($password); $query = 'SELECT '. $this->getFieldName('primary') .' FROM '. $this->getTableName() .' WHERE '. $this->getFieldName('username') .' = "'. $this->db->sql_escape($username) .'" AND '. $this->getFieldName('password') .' = "'. $this->db->sql_escape($password) .'"'; if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); return false; } if ($row =& $this->db->sql_fetchrow($dbresult)) { $id = $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')]; if ($remember) { $cookie = $id .':'. md5($username.$password); setcookie($this->cookiekey, $cookie, time() + $this->cookietime); } return true; } else { return false; } } function logout() { @setcookie($this->cookiekey, NULL, time() - 1); unset($_COOKIE[$this->cookiekey]); session_unset(); $this->getCurrentUser(TRUE, false); } function getWatchlist($uId) { // Gets the list of user IDs being watched by the given user. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($uId); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return $arrWatch; while ($row =& $this->db->sql_fetchrow($dbresult)) $arrWatch[] = $row['watched']; return $arrWatch; } function getWatchNames($uId, $watchedby = false) { // Gets the list of user names being watched by the given user. // - If $watchedby is false get the list of users that $uId watches // - If $watchedby is true get the list of users that watch $uId if ($watchedby) { $table1 = 'b'; $table2 = 'a'; } else { $table1 = 'a'; $table2 = 'b'; } $query = 'SELECT '. $table1 .'.'. $this->getFieldName('username') .' FROM '. $GLOBALS['tableprefix'] .'watched AS W, '. $this->getTableName() .' AS a, '. $this->getTableName() .' AS b WHERE W.watched = a.'. $this->getFieldName('primary') .' AND W.uId = b.'. $this->getFieldName('primary') .' AND '. $table2 .'.'. $this->getFieldName('primary') .' = '. intval($uId) .' ORDER BY '. $table1 .'.'. $this->getFieldName('username'); if (!($dbresult =& $this->db->sql_query($query))) { message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) { return $arrWatch; } while ($row =& $this->db->sql_fetchrow($dbresult)) { $arrWatch[] = $row[$this->getFieldName('username')]; } return $arrWatch; } function getWatchStatus($watcheduser, $currentuser) { // Returns true if the current user is watching the given user, and false otherwise. $query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched AS W INNER JOIN '. $this->getTableName() .' AS U ON U.'. $this->getFieldName('primary') .' = W.watched WHERE U.'. $this->getFieldName('primary') .' = '. intval($watcheduser) .' AND W.uId = '. intval($currentuser); if (! ($dbresult =& $this->db->sql_query($query)) ) { message_die(GENERAL_ERROR, 'Could not get watchstatus', '', __LINE__, __FILE__, $query, $this->db); return false; } $arrWatch = array(); if ($this->db->sql_numrows($dbresult) == 0) return false; else return true; } function setWatchStatus($subjectUserID) { if (!is_numeric($subjectUserID)) return false; $currentUserID = $this->getCurrentUserId(); $watched = $this->getWatchStatus($subjectUserID, $currentUserID); if ($watched) { $sql = 'DELETE FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($currentUserID) .' AND watched = '. intval($subjectUserID); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } else { $values = array( 'uId' => intval($currentUserID), 'watched' => intval($subjectUserID) ); $sql = 'INSERT INTO '. $GLOBALS['tableprefix'] .'watched '. $this->db->sql_build_array('INSERT', $values); if (!($dbresult =& $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db); return false; } } $this->db->sql_transaction('commit'); return true; } function addUser($username, $password, $email) { // Set up the SQL UPDATE statement. $datetime = gmdate('Y-m-d H:i:s', time()); $password = $this->sanitisePassword($password); $values = array('username' => $username, 'password' => $password, 'email' => $email, 'uDatetime' => $datetime, 'uModified' => $datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function updateUser($uId, $password, $name, $email, $homepage, $uContent) { if (!is_numeric($uId)) return false; // Set up the SQL UPDATE statement. $moddatetime = gmdate('Y-m-d H:i:s', time()); if ($password == '') $updates = array ('uModified' => $moddatetime, 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); else $updates = array ('uModified' => $moddatetime, 'password' => $this->sanitisePassword($password), 'name' => $name, 'email' => $email, 'homepage' => $homepage, 'uContent' => $uContent); $sql = 'UPDATE '. $this->getTableName() .' SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE '. $this->getFieldName('primary') .'='. intval($uId); // Execute the statement. $this->db->sql_transaction('begin'); if (!($dbresult = & $this->db->sql_query($sql))) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update user', '', __LINE__, __FILE__, $sql, $this->db); return false; } $this->db->sql_transaction('commit'); // Everything worked out, so return true. return true; } function sanitisePassword($password) { return sha1(trim($password)); } function generatePassword($uId) { if (!is_numeric($uId)) return false; $password = $this->_randompassword(); if ($this->_updateuser($uId, $this->getFieldName('password'), $this->sanitisePassword($password))) return $password; else return false; } function isReserved($username) { if (in_array($username, $GLOBALS['reservedusers'])) { return true; } else { return false; } } function isValidEmail($email) { - if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $email)) { + if (eregi("^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$", $email)) { list($emailUser, $emailDomain) = split("@", $email); // Check if the email domain has a DNS record if ($this->_checkdns($emailDomain)) { return true; } } return false; } // Properties function getTableName() { return $this->tablename; } function setTableName($value) { $this->tablename = $value; } function getFieldName($field) { return $this->fields[$field]; } function setFieldName($field, $value) { $this->fields[$field] = $value; } function getSessionKey() { return $this->sessionkey; } function setSessionKey($value) { $this->sessionkey = $value; } function getCookieKey() { return $this->cookiekey; } function setCookieKey($value) { $this->cookiekey = $value; } } ?>
scronide/scuttle
5bcd594660941b2d4560da70788be17b52ef68eb
Trunk, 0.7: Add patch [ 1597978 ] Missing tag rename for 0.7.2
diff --git a/tagrename.php b/tagrename.php new file mode 100644 index 0000000..0fd2f1a --- /dev/null +++ b/tagrename.php @@ -0,0 +1,67 @@ +<?php +/*************************************************************************** +Copyright (C) 2006 Scuttle project +http://sourceforge.net/projects/scuttle/ +http://scuttle.org/ + +This program 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 +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +***************************************************************************/ + +require_once('header.inc.php'); +$tagservice = & ServiceFactory :: getServiceInstance('TagService'); +$templateservice = & ServiceFactory :: getServiceInstance('TemplateService'); +$userservice = & ServiceFactory :: getServiceInstance('UserService'); + +list ($url, $tag) = explode('/', $_SERVER['PATH_INFO']); + +if ($_POST['confirm']) { + if (isset($_POST['old']) && (trim($_POST['old']) != '')) + $old = trim($_REQUEST['old']); + else + $old = NULL; + + if (isset($_POST['new']) && (trim($_POST['new']) != '')) + $new = trim($_POST['new']); + else + $new = NULL; + + if (is_null($old) || is_null($new)) { + $tplVars['error'] = T_('Failed to rename the tag'); + $templateservice->loadTemplate('error.500.tpl', $tplVars); + exit(); + } else { + // Rename the tag. + if($tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, true)) { + $tplVars['msg'] = T_('Tag renamed'); + $logged_on_user = $userservice->getCurrentUser(); + header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); + } else { + $tplVars['error'] = T_('Failed to rename the tag'); + $templateservice->loadTemplate('error.500.tpl', $tplVars); + exit(); + } + } +} elseif ($_POST['cancel']) { + $logged_on_user = $userservice->getCurrentUser(); + header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); +} + +$tplVars['subtitle'] = T_('Rename Tag') .': '. $tag; +$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag; +$tplVars['referrer'] = $_SERVER['HTTP_REFERER']; +$tplVars['old'] = $tag; +$templateservice->loadTemplate('tagrename.tpl', $tplVars); +?> + diff --git a/templates/tagrename.tpl.php b/templates/tagrename.tpl.php new file mode 100644 index 0000000..2e93fad --- /dev/null +++ b/templates/tagrename.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("new").focus(); +} +</script> +<form action="<?= $formaction ?>" method="post"> +<table> +<tr> + <th align="left"><?php echo T_('Old'); ?></th> + <td><input type="text" name="old" id="old" value="<?= $old ?>" /></td> + <td>&larr; <?php echo T_('Required'); ?></td> +</tr> +<tr> + <th align="left"><?php echo T_('New'); ?></th> + <td><input type="text" name="new" id="new" value="" /></td> + <td>&larr; <?php echo T_('Required'); ?></td> +</tr> +<tr> + <td></td> + <td> + <input type="submit" name="confirm" value="<?php echo T_('Rename'); ?>" /> + <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> +</tr> + +</table> +</p> + +<?php if (isset($referrer)): ?> +<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> +<?php endif; ?> + +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> +
johnsonch/northwind
48e30586a277f50321aacd80aabf69edce47d9d6
added support for territories and regions
diff --git a/app/models/employee_territories.rb b/app/models/employee_territories.rb new file mode 100644 index 0000000..5696f49 --- /dev/null +++ b/app/models/employee_territories.rb @@ -0,0 +1,5 @@ +class EmployeeTerritories < ActiveRecord::Base + set_table_name "EmployeeTerritories" + belongs_to :employee, :class_name => "Employee", :foreign_key => "EmployeeID" + belongs_to :territory, :class_name => "Territory", :foreign_key => "TerritoryID" +end diff --git a/app/models/region.rb b/app/models/region.rb new file mode 100644 index 0000000..6d2100c --- /dev/null +++ b/app/models/region.rb @@ -0,0 +1,5 @@ +class Region < ActiveRecord::Base + set_table_name "Region" + set_primary_key "RegionID" + has_many :territories, :foreign_key => "RegionID" +end diff --git a/test/fixtures/employee_territories.yml b/test/fixtures/employee_territories.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/employee_territories.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/fixtures/regions.yml b/test/fixtures/regions.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/regions.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/unit/region_test.rb b/test/unit/region_test.rb new file mode 100644 index 0000000..0184f1f --- /dev/null +++ b/test/unit/region_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class RegionTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end
johnsonch/northwind
6acb6c3f6afeefee99d6ad770c1256a4332c60e6
trying to add files correctly
diff --git a/app/views/customers/edit.html.erb b/app/views/customers/edit.html.erb index 57ad97a..5d3d46f 100644 --- a/app/views/customers/edit.html.erb +++ b/app/views/customers/edit.html.erb @@ -1,12 +1,12 @@ <h1>Editing customer</h1> <% form_for(@customer) do |f| %> <%= f.error_messages %> - <%= render :partial => 'form' %> + <%= render :partial => 'form', :locals => {:f => f} %> <p> <%= f.submit "Update" %> </p> <% end %> <%= link_to 'Show', @customer %> | <%= link_to 'Back', customers_path %> diff --git a/app/views/customers/new.html.erb b/app/views/customers/new.html.erb index 984ecd4..04d75e4 100644 --- a/app/views/customers/new.html.erb +++ b/app/views/customers/new.html.erb @@ -1,11 +1,11 @@ <h1>New customer</h1> <% form_for(@customer) do |f| %> <%= f.error_messages %> - <%= render :partial => 'form' %> + <%= render :partial => 'form', :locals => {:f => f} %> <p> <%= f.submit "Create" %> </p> <% end %> <%= link_to 'Back', customers_path %> diff --git a/app/views/employees/edit.html.erb b/app/views/employees/edit.html.erb index 80809c6..510b219 100644 --- a/app/views/employees/edit.html.erb +++ b/app/views/employees/edit.html.erb @@ -1,60 +1,15 @@ <h1>Editing employee</h1> <% form_for(@employee) do |f| %> <%= f.error_messages %> - <table> - <tr> - <td width="100px;">Name:</td> - <td><%= f.text_field :FirstName %> <%= f.text_field :LastName %></td> - </tr> - <tr> - <td>Birthday:</td> - <td><%= f.text_field :BirthDate %></td> - </tr> - <tr> - <td>Hire Date:</td> - <td><%= f.text_field :HireDate %></td> - </tr> - <tr> - <td>Address:</td> - <td><%= f.text_field :Address %> </td> - </tr> - <tr> - <td>City:</td> - <td><%= f.text_field :City %></td> - </tr> - <tr> - <td>Region:</td> - <td><%= f.text_field :Region %></td> - </tr> - <tr> - <td>Postal Code:</td> - <td><%= f.text_field :PostalCode %></td> - </tr> - <tr> - <td>Country :</td> - <td><%= f.text_field :Country %></td> - </tr> - <tr> - <td>Home Phone:</td> - <td><%= f.text_field :HomePhone %> (XXX) XXX-XXXX</td> - </tr> - <tr> - <td>Extension:</td> - <td><%= f.text_field :Extension %></td> - </tr> - <tr> - <td>Notes:</td> - <td><%= f.text_area :Notes %></td> - </tr> - </table> + <%= render :partial => 'form', :locals => {:f => f} %> <p> <%= f.submit "Update" %> </p> <% end %> <%= link_to 'Show', @employee %> | <%= link_to 'Back', employees_path %> diff --git a/app/views/employees/new.html.erb b/app/views/employees/new.html.erb index 03256cb..fc70703 100644 --- a/app/views/employees/new.html.erb +++ b/app/views/employees/new.html.erb @@ -1,11 +1,13 @@ <h1>New employee</h1> <% form_for(@employee) do |f| %> <%= f.error_messages %> + <%= render :partial => 'form', :locals => {:f => f} %> + <p> <%= f.submit "Create" %> </p> <% end %> <%= link_to 'Back', employees_path %>
johnsonch/northwind
d3c3b8dc87bf1dbc46510af336b6969a751278d3
added support to set manager for an employee
diff --git a/app/views/employees/_form.html.erb b/app/views/employees/_form.html.erb new file mode 100644 index 0000000..f32fd9b --- /dev/null +++ b/app/views/employees/_form.html.erb @@ -0,0 +1,50 @@ + <table> + <tr> + <td width="100px;">Name:</td> + <td><%= f.text_field :FirstName %> <%= f.text_field :LastName %></td> + </tr> + <tr> + <td>Birthday:</td> + <td><%= f.date_select :BirthDate, :start_year => 1950 %></td> + </tr> + <tr> + <td>Hire Date:</td> + <td><%= f.text_field :HireDate %></td> + </tr> + <tr> + <td>Address:</td> + <td><%= f.text_field :Address %> </td> + </tr> + <tr> + <td>City:</td> + <td><%= f.text_field :City %></td> + </tr> + <tr> + <td>Region:</td> + <td><%= f.text_field :Region %></td> + </tr> + <tr> + <td>Postal Code:</td> + <td><%= f.text_field :PostalCode %></td> + </tr> + <tr> + <td>Country :</td> + <td><%= f.text_field :Country %></td> + </tr> + <tr> + <td>Home Phone:</td> + <td><%= f.text_field :HomePhone %> (XXX) XXX-XXXX</td> + </tr> + <tr> + <td>Extension:</td> + <td><%= f.text_field :Extension %></td> + </tr> + <tr> + <td>Reports To:</td> + <td><%= f.select :ReportsTo, Manager.find(:all, :conditions => ("EmployeeID != #{@employee.id}")).collect{|m| ["#{m.FirstName} #{m.LastName}", m.id]}, :prompt => "Choose One" %></td> + </tr> + <tr> + <td>Notes:</td> + <td><%= f.text_area :Notes %></td> + </tr> + </table> \ No newline at end of file
johnsonch/northwind
0f4211bfe3bcb3c694d6b14849c8225cb8eddbad
adding files
diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb new file mode 100644 index 0000000..eba6175 --- /dev/null +++ b/app/controllers/orders_controller.rb @@ -0,0 +1,85 @@ +class OrdersController < ApplicationController + # GET /orders + # GET /orders.xml + def index + @orders = Order.find(:all) + + respond_to do |format| + format.html # index.html.erb + format.xml { render :xml => @orders } + end + end + + # GET /orders/1 + # GET /orders/1.xml + def show + @order = Order.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.xml { render :xml => @order } + end + end + + # GET /orders/new + # GET /orders/new.xml + def new + @order = Order.new + + respond_to do |format| + format.html # new.html.erb + format.xml { render :xml => @order } + end + end + + # GET /orders/1/edit + def edit + @order = Order.find(params[:id]) + end + + # POST /orders + # POST /orders.xml + def create + @order = Order.new(params[:order]) + + respond_to do |format| + if @order.save + flash[:notice] = 'Order was successfully created.' + format.html { redirect_to(@order) } + format.xml { render :xml => @order, :status => :created, :location => @order } + else + format.html { render :action => "new" } + format.xml { render :xml => @order.errors, :status => :unprocessable_entity } + end + end + end + + # PUT /orders/1 + # PUT /orders/1.xml + def update + @order = Order.find(params[:id]) + + respond_to do |format| + if @order.update_attributes(params[:order]) + flash[:notice] = 'Order was successfully updated.' + format.html { redirect_to(@order) } + format.xml { head :ok } + else + format.html { render :action => "edit" } + format.xml { render :xml => @order.errors, :status => :unprocessable_entity } + end + end + end + + # DELETE /orders/1 + # DELETE /orders/1.xml + def destroy + @order = Order.find(params[:id]) + @order.destroy + + respond_to do |format| + format.html { redirect_to(orders_url) } + format.xml { head :ok } + end + end +end diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb new file mode 100644 index 0000000..443227f --- /dev/null +++ b/app/helpers/orders_helper.rb @@ -0,0 +1,2 @@ +module OrdersHelper +end diff --git a/app/models/manager.rb b/app/models/manager.rb new file mode 100644 index 0000000..0947e1e --- /dev/null +++ b/app/models/manager.rb @@ -0,0 +1,6 @@ +class Manager < ActiveRecord::Base + set_table_name "Employees" + set_primary_key "EmployeeID" + + has_many :employees, :class_name => "employee", :foreign_key => "EmployeeID" +end diff --git a/app/models/order_detail.rb b/app/models/order_detail.rb new file mode 100644 index 0000000..f30bad0 --- /dev/null +++ b/app/models/order_detail.rb @@ -0,0 +1,6 @@ +class OrderDetail < ActiveRecord::Base + set_table_name "Order Details" + set_primary_key "OrderID" + + belongs_to :order, :class_name => "Order", :foreign_key => "OrderID" +end diff --git a/app/models/product.rb b/app/models/product.rb new file mode 100644 index 0000000..077a819 --- /dev/null +++ b/app/models/product.rb @@ -0,0 +1,2 @@ +class Product < ActiveRecord::Base +end diff --git a/app/views/customers/_form.html.erb b/app/views/customers/_form.html.erb new file mode 100644 index 0000000..371ad7c --- /dev/null +++ b/app/views/customers/_form.html.erb @@ -0,0 +1,9 @@ + <p>Company Name: <%= f.text_field :CompanyName %></p> + <p>Contact Name: <%= f.text_field :ContactName %></p> + <p>Contact Title: <%= f.text_field :ContactTitle %></p> + <p>Address: <%= f.text_field :Address %></p> + <p>City: <%= f.text_field :City %></p> + <p>Region: <%= f.text_field :Region %></p> + <p>Postal Code: <%= f.text_field :PostalCode %></p> + <p>Phone: <%= f.text_field :Phone %></p> + <p>Fax: <%= f.text_field :Fax %></p> \ No newline at end of file diff --git a/app/views/layouts/orders.html.erb b/app/views/layouts/orders.html.erb new file mode 100644 index 0000000..ee970df --- /dev/null +++ b/app/views/layouts/orders.html.erb @@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> + <title>Orders: <%= controller.action_name %></title> + <%= stylesheet_link_tag 'scaffold' %> +</head> +<body> + +<p style="color: green"><%= flash[:notice] %></p> + +<%= yield %> + +</body> +</html> diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb new file mode 100644 index 0000000..1dcce67 --- /dev/null +++ b/app/views/orders/edit.html.erb @@ -0,0 +1,12 @@ +<h1>Editing order</h1> + +<% form_for(@order) do |f| %> + <%= f.error_messages %> + + <p> + <%= f.submit "Update" %> + </p> +<% end %> + +<%= link_to 'Show', @order %> | +<%= link_to 'Back', orders_path %> diff --git a/app/views/orders/index.html.erb b/app/views/orders/index.html.erb new file mode 100644 index 0000000..cd23363 --- /dev/null +++ b/app/views/orders/index.html.erb @@ -0,0 +1,18 @@ +<h1>Listing orders</h1> + +<table> + <tr> + </tr> + +<% for order in @orders %> + <tr> + <td><%= link_to 'Show', order %></td> + <td><%= link_to 'Edit', edit_order_path(order) %></td> + <td><%= link_to 'Destroy', order, :confirm => 'Are you sure?', :method => :delete %></td> + </tr> +<% end %> +</table> + +<br /> + +<%= link_to 'New order', new_order_path %> diff --git a/app/views/orders/new.html.erb b/app/views/orders/new.html.erb new file mode 100644 index 0000000..7b405ec --- /dev/null +++ b/app/views/orders/new.html.erb @@ -0,0 +1,11 @@ +<h1>New order</h1> + +<% form_for(@order) do |f| %> + <%= f.error_messages %> + + <p> + <%= f.submit "Create" %> + </p> +<% end %> + +<%= link_to 'Back', orders_path %> diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb new file mode 100644 index 0000000..c03de2e --- /dev/null +++ b/app/views/orders/show.html.erb @@ -0,0 +1,4 @@ + + + +<%= link_to 'Back', orders_path %> diff --git a/db/migrate/20090316232514_create_managers.rb b/db/migrate/20090316232514_create_managers.rb new file mode 100644 index 0000000..786d5bd --- /dev/null +++ b/db/migrate/20090316232514_create_managers.rb @@ -0,0 +1,12 @@ +class CreateManagers < ActiveRecord::Migration + def self.up + create_table :managers do |t| + + t.timestamps + end + end + + def self.down + drop_table :managers + end +end diff --git a/db/migrate/20090316235003_create_orders.rb b/db/migrate/20090316235003_create_orders.rb new file mode 100644 index 0000000..76c214f --- /dev/null +++ b/db/migrate/20090316235003_create_orders.rb @@ -0,0 +1,12 @@ +class CreateOrders < ActiveRecord::Migration + def self.up + create_table :orders do |t| + + t.timestamps + end + end + + def self.down + drop_table :orders + end +end diff --git a/db/migrate/20090316235057_create_products.rb b/db/migrate/20090316235057_create_products.rb new file mode 100644 index 0000000..483e46e --- /dev/null +++ b/db/migrate/20090316235057_create_products.rb @@ -0,0 +1,12 @@ +class CreateProducts < ActiveRecord::Migration + def self.up + create_table :products do |t| + + t.timestamps + end + end + + def self.down + drop_table :products + end +end diff --git a/test/fixtures/managers.yml b/test/fixtures/managers.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/managers.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/fixtures/order_details.yml b/test/fixtures/order_details.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/order_details.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/products.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/functional/orders_controller_test.rb b/test/functional/orders_controller_test.rb new file mode 100644 index 0000000..ec6232f --- /dev/null +++ b/test/functional/orders_controller_test.rb @@ -0,0 +1,45 @@ +require 'test_helper' + +class OrdersControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:orders) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create order" do + assert_difference('Order.count') do + post :create, :order => { } + end + + assert_redirected_to order_path(assigns(:order)) + end + + test "should show order" do + get :show, :id => orders(:one).id + assert_response :success + end + + test "should get edit" do + get :edit, :id => orders(:one).id + assert_response :success + end + + test "should update order" do + put :update, :id => orders(:one).id, :order => { } + assert_redirected_to order_path(assigns(:order)) + end + + test "should destroy order" do + assert_difference('Order.count', -1) do + delete :destroy, :id => orders(:one).id + end + + assert_redirected_to orders_path + end +end diff --git a/test/unit/manager_test.rb b/test/unit/manager_test.rb new file mode 100644 index 0000000..c55bb17 --- /dev/null +++ b/test/unit/manager_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class ManagerTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/unit/order_detail_test.rb b/test/unit/order_detail_test.rb new file mode 100644 index 0000000..0ad76f6 --- /dev/null +++ b/test/unit/order_detail_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class OrderDetailTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/unit/product_test.rb b/test/unit/product_test.rb new file mode 100644 index 0000000..bb39ca7 --- /dev/null +++ b/test/unit/product_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class ProductTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end
devyn/ensei
879bba92f7368e723762381922b6e2137a5fcb6d
+x to scripts
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index c233207..f865c5c 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,20 +1,20 @@ -<% themes = ["main", "red"] %> +<% themes = ["main", "red", "yellow"] %> <html> <head> <title>Ensei Webtop</title> <%= stylesheet_link_tag (params['theme'] or themes.first), :id => "theme" %> <%= javascript_include_tag :all %> </head> <body> <div id="loginPart"><div style="" id="loginWindow"> <%= image_tag 'ensei.png' %><br/> <table><tr><td><strong>Username:</strong></td><td><input id="username"/></td></tr><tr><td><strong>Password:</strong></td><td><input id="password" type="password"/></td></tr><tr><td><button class="enseiButton" id="loginButton" onClick="processLogin();">Login</button></td><td><button class="enseiButton" id="signupButton" onClick="processSignup();">Sign up</button></td></tr></table> </div></div> <div id="desktopPart" style="display:none"> <div id="desktop"></div> <div id="footbar" onmouseover='getElementById("footbar").style.opacity = 1.0' onmouseout='getElementById("footbar").style.opacity = 0.6'><span> <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> <a href='#' onclick='logout()'><%= image_tag 'logout.gif' %></a> Theme: <% themes.each do |i| %><a href="#" onclick="$('theme').href = '<%= path_to_stylesheet i %>';"><%= i %></a> <% end %> </span></div> </div> </body> -</html> \ No newline at end of file +</html> diff --git a/script/about b/script/about old mode 100644 new mode 100755 diff --git a/script/console b/script/console old mode 100644 new mode 100755 diff --git a/script/destroy b/script/destroy old mode 100644 new mode 100755 diff --git a/script/generate b/script/generate old mode 100644 new mode 100755 diff --git a/script/plugin b/script/plugin old mode 100644 new mode 100755 diff --git a/script/runner b/script/runner old mode 100644 new mode 100755 diff --git a/script/server b/script/server old mode 100644 new mode 100755
devyn/ensei
bcfe9909e6bbcdf5cb32b0915a8bd0408486af4e
yellow theme
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efaec30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +log/* +db/*.sqlite3 + diff --git a/public/images/background_yellow.gif b/public/images/background_yellow.gif new file mode 100644 index 0000000..42ec57b Binary files /dev/null and b/public/images/background_yellow.gif differ diff --git a/public/stylesheets/yellow.css b/public/stylesheets/yellow.css new file mode 100644 index 0000000..5d0fcc1 --- /dev/null +++ b/public/stylesheets/yellow.css @@ -0,0 +1,121 @@ +body { + background-image: url(/images/background_yellow.gif); + background-color: #403b04; + color: #0e79eb; + font-family: Verdana, sans-serif; +} + +a, a:visited { + color: #540eeb; +} + +a:hover { + color: #874fff; +} + +#footbar { + position: fixed; + border-top: 2px solid black; + border-bottom: 10px solid red; + background-color: #948809; + width: 100%; + left: 0px; + bottom: 0px; + text-align: left; + color: #0b19b8; + font-size: 10px; + z-index: 10000; + opacity: 0.6; + height: 20px; + padding-left: 10px; +} + +#footbar a img { + border: none; + vertical-align: bottom; +} + +#footbar input { + width: 300px; +} + +#footbar a { + color: #0bb853; +} + +.window { + position: absolute; +} + +.window .titlebar { + background-color: #b80b70; + color: black; + font-size: 14pt; + padding-right: 10px; + padding-left: 10px; + border-left: 2px solid black; + border-top: 2px solid black; + border-bottom: 2px solid black; +} + +.window .refreshButton { + background-color: green; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; + border-bottom: 2px solid black; +} + +.window .closeButton { + background-color: red; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; + border-right: 2px solid black; + border-bottom: 2px solid black; +} + +.window .renameButton { + background-color: blue; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; + border-bottom: 2px solid black; +} + +.window .content { + background-color: white; + color: black; + padding-left: 10px; + padding-right: 10px; + max-width: 400px; + border: 2px solid black; +} + +button.enseiButton, input.enseiButton { + background-color: #6df2a5; +} + +#loginPart { + display: inline; + position: absolute; + width: 100%; + height: 100%; + left: 0px; + top: 0px; + background-color: black; + opacity: 0.7; + text-align: center; +} + +#loginWindow { + position: absolute; + left: 33%; + top: 33%; + width: 33%; + height: 33%; + background-color: #f2e018; +}
devyn/ensei
54824d5e6f9ac7f57fa131a4c8b2615474a0e1be
css fix
diff --git a/public/stylesheets/red.css b/public/stylesheets/red.css index 1876449..eafae06 100644 --- a/public/stylesheets/red.css +++ b/public/stylesheets/red.css @@ -1,118 +1,121 @@ body { background-image: url(/images/background_red.gif); background-color: darkred; color: white; font-family: Verdana, sans-serif; } a, a:visited { color: red; } a:hover { color: orange; } -/* thanks to wiki.script.aculo.us/stylesheets/script.aculo.us.css for this */ #footbar { position: fixed; border-top: 2px solid black; border-bottom: 10px solid red; background-color: red; width: 100%; left: 0px; bottom: 0px; text-align:left; color: #aaa; font-size: 10px; z-index: 10000; opacity: 0.6; height: 20px; padding-left: 10px; } #footbar a img { border: none; vertical-align: bottom; } #footbar input { width: 300px; +} + +#footbar a { + color: yellow; } .window { position: absolute; } .window .titlebar { background-color: yellow; color: black; font-size: 14pt; padding-right: 10px; padding-left: 10px; border-left: 2px solid black; border-top: 2px solid black; border-bottom: 2px solid black; } .window .refreshButton { background-color: green; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .closeButton { background-color: red; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-right: 2px solid black; border-bottom: 2px solid black; } .window .renameButton { background-color: blue; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .content { background-color: white; color: black; padding-left: 10px; padding-right: 10px; max-width: 400px; border: 2px solid black; } button.enseiButton, input.enseiButton { background-color: #FFAAAA; } #loginPart { display: inline; position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; background-color: black; opacity: 0.7; text-align: center; } #loginWindow { position: absolute; left: 33%; top: 33%; width: 33%; height: 33%; background-color: red; }
devyn/ensei
00c44739d4eb1d89eaf3ea92abfc8fafa7fec5f0
add copyright to README
diff --git a/README b/README index ebffbb4..2531384 100644 --- a/README +++ b/README @@ -1,19 +1,20 @@ =============== Ensei =============== == a webtop entirely in ruby/rails == +Copyright (C) 2008 Devyn Cairns. 1. What's a webtop? It's basically a desktop on the internet. That's Ensei's goal. For more, go to http://en.wikipedia.org/wiki/Web_desktop 2. Why should I care if it's in ruby/rails? Well, if you're a developer: Ruby is a very easy to learn programming language. Rails is a very powerful web framework. But, if you're a user, there's no real reason why. 3. Is this open source? Well, you can see it above you right now, can't you? Yes, it is, although at this time there is no specific license. Just please give me credit! 4. Try it! Just run script/server (on windows: ruby script/server) then go to http://localhost:3000/
devyn/ensei
d80c670be8acfa56d7734d38ab83ef68145faba1
Ensei: started working on file storage.
diff --git a/app/controllers/dfs_controller.rb b/app/controllers/dfs_controller.rb index a85a28d..6836e52 100644 --- a/app/controllers/dfs_controller.rb +++ b/app/controllers/dfs_controller.rb @@ -1,115 +1,116 @@ require 'digest/sha2' class DfsController < ApplicationController def client if params[:format] == 'json' require 'json' case params[:part] when 'login' token = rand(255*255*255*255).to_s(16) while UserTokens.keys.include? token token = rand(255*255*255*255).to_s(16) end if u = User.find(:all).select{|u|(u.name =~ /^#{params[:username]}$/i) and (u.pass == Base64.encode64(Digest::SHA256.digest(params[:password])))}.first UserTokens[token] = u.name render :text => token else render :text => "", :status => 403 end when 'logout' UserTokens.delete(params[:token]) rescue nil render :text => "" when 'signup' if User.find(:all).select{|u|u.name =~ /^#{params[:username]}$/i} == [] u = User.new u.name = params[:username] u.pass = Base64.encode64(Digest::SHA256.digest(params[:password])) u.data = {} + Userspace.new(:user_id => u.id).save u.save render :text => "" else render :text => "", :status => 500 end when 'appList' render(:text => "", :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => JSON.dump(u.data.keys) when 'getSector' render(:text => "", :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => JSON.dump(u.data[params[:app]][params[:name]]) rescue render :text => "", :status => 404 when 'dataList' render(:text => "", :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => JSON.dump(u.data[params[:app]].keys) rescue render :text => "", :status => 500 when 'sendSector' render(:text => "", :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) x = u.data.dup x[params[:app]] = {} unless x[params[:app]] if params[:value] == 'null' x[params[:app]].delete(params[:name]) else x[params[:app]][params[:name]] = JSON.load(params[:value]) end u.data = x u.save render :text => "" else render(:text => "", :status => 404) end elsif params[:format] == "rbo" case params[:part] when 'login' token = rand(255*255*255*255).to_s(16) while UserTokens.keys.include? token token = rand(255*255*255*255).to_s(16) end if u = User.find(:all).select{|u|(u.name =~ /^#{params[:username]}$/i) and (u.pass == Digest::SHA256.digest(params[:password]))}.first UserTokens[token] = u.name render :text => Marshal.dump(token) else render :text => Marshal.dump(nil), :status => 403 end when 'logout' UserTokens.delete(params[:token]) rescue nil render :text => Marshal.dump(true) when 'signup' if User.find(:all).select{|u|u.name =~ /^#{params[:username]}$/i} == [] u = User.new u.name = params[:username] u.pass = Digest::SHA256.digest(params[:password]) u.data = {} u.save render :text => Marshal.dump(true) else render :text => Marshal.dump(nil), :status => 500 end when 'appList' render(:text => Marshal.dump(nil), :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => Marshal.dump(u.data.keys) when 'getSector' render(:text => Marshal.dump(nil), :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => Marshal.dump(u.data[params[:app]][params[:name]]) rescue render :text => Marshal.dump(nil), :status => 404 when 'sendSector' render(:text => Marshal.dump(nil), :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) x = u.data.dup x[params[:app]] = {} unless x[params[:app]] x[params[:app]][params[:name]] = Marshal.load(params[:value]) x[params[:app]].reject!{|k,i| not i} u.data = x u.save render :text => Marshal.dump(true) when 'dataList' render(:text => Marshal.dump(nil), :status => 403) unless UserTokens[params[:token]] u = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) render :text => Marshal.dump(u.data[params[:app]].keys) rescue render :text => Marshal.dump(nil), :status => 500 else render :text => Marshal.dump(nil), :status => 404 end end end def manager;end end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 4970192..8ef23c4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -1,2 +1,23 @@ class FilesController < ApplicationController + def index + @path = params[:path] or '/' + render :status => 403, :text => '' unless UserTokens[params[:token]] + @user = User.find(:first, :conditions => {:name => UserTokens[params[:token]]}) + @z3 = @user.userspace.contents + @things = @z3.things_in(@path) + case params[:format] + when /^html?$/i + when '' + when /^json$/i + require 'json' + render :text => JSON.dump(@things) + when /^ya?ml$/i + require 'yaml' + render :text => YAML.dump(@things) + when /^rbo$/i + render :text => Marshal.dump(@things) + else + raise ArgumentError, "invalid format" + end + end end diff --git a/app/models/user.rb b/app/models/user.rb index 577b920..ce2e2f3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,9 @@ class User < ActiveRecord::Base + has_one :userspace def data Marshal.load(Base64.decode64(self['data'])) end def data=(p) self['data'] = Base64.encode64(Marshal.dump(p)) end end diff --git a/app/models/userspace.rb b/app/models/userspace.rb new file mode 100644 index 0000000..9572440 --- /dev/null +++ b/app/models/userspace.rb @@ -0,0 +1,10 @@ +class Userspace < ActiveRecord::Base + belongs_to :user + def contents + require 'z3' + Z3.new(Base64.decode64(self['contents'])) + end + def contents=(z3) + self['contents'] = Base64.encode64(z3.save) + end +end diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb new file mode 100644 index 0000000..1484e61 --- /dev/null +++ b/app/views/files/index.html.erb @@ -0,0 +1,17 @@ +<html> +<head> +<title><%=@user.name%>'s listing of <%=@path%></title> +</head> +<body> +<h1><%=@path%></h1> +<% unless dir =~ %r"^/ *$" %> +<%= link_to 'Parent Directory', :path => File.dirname(@path) %><br/> +<% end %> +<% @things.each do |thing| %> +<% if thing =~ %r"/$" %> +<%= link_to thing, :path => File.join(@path, thing) %><br/> +<% else %> +<%= link_to thing, :action => 'show' %>&nbsp;&nbsp;<small><%= @z3.metadata(File.join(@path, thing))[:type]+", " rescue nil %><%= @z3.about(File.join(@path, thing)).sub("#{thing}: ", "") %><br/> +<% end %> +</body> +</html> diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 64b298b..a996e24 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ diff --git a/db/migrate/20080614173254_create_userspaces.rb b/db/migrate/20080614173254_create_userspaces.rb new file mode 100644 index 0000000..d94c441 --- /dev/null +++ b/db/migrate/20080614173254_create_userspaces.rb @@ -0,0 +1,16 @@ +require 'z3' +class CreateUserspaces < ActiveRecord::Migration + def self.up + create_table :userspaces do |t| + t.integer :id, :null => false + t.integer :user_id, :null => false + t.text :contents, :default => Base64.encode64(Z3.new.save) + + t.timestamps + end + end + + def self.down + drop_table :userspaces + end +end diff --git a/db/schema.rb b/db/schema.rb index 82ccbdc..0209d5c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,22 +1,29 @@ -# This file is auto-generated from the current state of the database. Instead of editing this file, -# please use the migrations feature of ActiveRecord to incrementally modify your database, and -# then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your database schema. If you need -# to create the application database on another system, you should be using db:schema:load, not running -# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 1) do - - create_table "users", :force => true do |t| - t.string "name" - t.string "pass" - t.text "data" - t.datetime "created_at" - t.datetime "updated_at" - end - -end +# This file is auto-generated from the current state of the database. Instead of editing this file, +# please use the migrations feature of Active Record to incrementally modify your database, and +# then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your database schema. If you need +# to create the application database on another system, you should be using db:schema:load, not running +# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20080614173254) do + + create_table "users", :force => true do |t| + t.string "name" + t.string "pass" + t.text "data" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "userspaces", :force => true do |t| + t.integer "user_id", :null => false + t.text "contents", :default => "Z3{}\250\253" + t.datetime "created_at" + t.datetime "updated_at" + end + +end diff --git a/log/development.log b/log/development.log index 8b13789..a4f0835 100644 --- a/log/development.log +++ b/log/development.log @@ -1 +1,824 @@ +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing MainController#index (for 127.0.0.1 at 2008-06-14 11:59:46) [GET] + Session ID: 30a6238aef8939b431f573638da170e3 + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01113 (89 reqs/sec) | Rendering: 0.00737 (66%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-06-14 11:59:49) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/recognition_optimisation.rb:67:in `recognize_path' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:384:in `recognize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:148:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (not_found) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + SQL (0.001209)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.000394) select sqlite_version(*) + SQL (0.004258) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  + SQL (0.004144) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") + SQL (0.000635)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.000452) SELECT version FROM "schema_info" + SQL (0.000252) SELECT version FROM "schema_migrations" + SQL (0.002236) INSERT INTO "schema_migrations" (version) VALUES ('1') + SQL (0.002033) DROP TABLE "schema_info" + SQL (0.000458) SELECT version FROM schema_migrations +Migrating to CreateUsers (1) + SQL (0.000447) SELECT version FROM schema_migrations +Migrating to CreateUserspaces (20080614173254) + SQL (0.000446) SELECT version FROM schema_migrations + SQL (0.003846) CREATE TABLE "userspaces" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "contents" text DEFAULT 'Z3{}¨«' NULL, "created_at" datetime DEFAULT NULL NULL, "updated_at" datetime DEFAULT NULL NULL)  + SQL (0.003438) INSERT INTO schema_migrations (version) VALUES ('20080614173254') + SQL (0.000533) SELECT version FROM schema_migrations + SQL (0.000638)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.000165) PRAGMA index_list("users") + SQL (0.000169) PRAGMA index_list("userspaces") +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + User Load (0.000658) SELECT * FROM "users" WHERE ("users"."id" = 1)  + Userspace Create (0.009768) INSERT INTO "userspaces" ("updated_at", "user_id", "contents", "created_at") VALUES('2008-06-14 12:01:07', 1, 'Z3{}¨«', '2008-06-14 12:01:07') +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing ApplicationController#login (for 127.0.0.1 at 2008-06-14 12:01:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"format"=>"json", "username"=>"test", "action"=>"login", "controller"=>"dfs", "password"=>"test"} + + +SyntaxError (/home/devyn/Repo/Ensei/app/controllers/dfs_controller.rb:27: syntax error, unexpected '=', expecting ')' + Userspace.new(:user_id = u.id).save + ^ +/home/devyn/Repo/Ensei/app/controllers/dfs_controller.rb:27: syntax error, unexpected ')', expecting kEND + Userspace.new(:user_id = u.id).save + ^): + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:215:in `load_without_new_constant_marking' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:215:in `load_file' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:214:in `load_file' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:95:in `require_or_load' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:260:in `load_missing_constant' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in `const_missing' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:479:in `const_missing' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/inflector.rb:283:in `constantize' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/string/inflections.rb:143:in `constantize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:386:in `recognize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:148:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing DfsController#login (for 127.0.0.1 at 2008-06-14 12:02:25) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"format"=>"json", "username"=>"test", "action"=>"login", "controller"=>"dfs", "password"=>"test"} + + +ActionController::UnknownAction (No action responded to login): + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (not_found) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:03:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"do"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} +Completed in 0.04913 (20 reqs/sec) | Rendering: 0.00044 (0%) | DB: 0.00000 (0%) | 404 Not Found [http://localhost/dfs/client.json?do=login&username=test&password=test] + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:03:39) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} +Completed in 0.00875 (114 reqs/sec) | Rendering: 0.00039 (4%) | DB: 0.00000 (0%) | 404 Not Found [http://localhost/dfs/client.json?action=login&username=test&password=test] +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:04:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.001306) SELECT * FROM "users"  +Completed in 0.06781 (14 reqs/sec) | Rendering: 0.00042 (0%) | DB: 0.00131 (1%) | 200 OK [http://localhost/dfs/client.json?part=login&username=test&password=test] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-06-14 12:04:25) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"e446e56c", "action"=>"index", "controller"=>"files"} + + +SyntaxError (/home/devyn/Repo/Ensei/app/controllers/files_controller.rb:9: syntax error, unexpected kOR, expecting kTHEN or ':' or '\n' or ';' + when /^html?$/i or '' + ^ +/home/devyn/Repo/Ensei/app/controllers/files_controller.rb:10: syntax error, unexpected kWHEN, expecting kEND + when /^json$/i + ^ +/home/devyn/Repo/Ensei/app/controllers/files_controller.rb:13: syntax error, unexpected kWHEN, expecting kEND + when /^ya?ml$/i + ^ +/home/devyn/Repo/Ensei/app/controllers/files_controller.rb:16: syntax error, unexpected kWHEN, expecting kEND + when /^rbo$/i + ^ +/home/devyn/Repo/Ensei/app/controllers/files_controller.rb:22: syntax error, unexpected kEND, expecting $end): + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:215:in `load_without_new_constant_marking' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:215:in `load_file' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:214:in `load_file' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:95:in `require_or_load' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:260:in `load_missing_constant' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in `const_missing' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:479:in `const_missing' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/inflector.rb:283:in `constantize' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/string/inflections.rb:143:in `constantize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:386:in `recognize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:148:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:05:48) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"e446e56c", "action"=>"index", "controller"=>"files"} + User Load (0.000991) SELECT * FROM "users" WHERE ("users"."name" IS NULL) LIMIT 1 + + +NameError (undefined local variable or method `u' for #<FilesController:0xb78e42e0>): + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:07:26) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"e446e56c", "action"=>"index", "controller"=>"files"} + User Load (0.001020) SELECT * FROM "users" WHERE ("users"."name" IS NULL) LIMIT 1 + + +NoMethodError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.userspace): + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:07:45) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.000985) SELECT * FROM "users"  +Completed in 0.07156 (13 reqs/sec) | Rendering: 0.00041 (0%) | DB: 0.00099 (1%) | 200 OK [http://localhost/dfs/client.json?part=login&username=test&password=test] + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:07:56) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"11c37639", "action"=>"index", "controller"=>"files"} + User Load (0.000966) SELECT * FROM "users" WHERE ("users"."name" = 'test') LIMIT 1 + Userspace Load (0.000639) SELECT * FROM "userspaces" WHERE ("userspaces".user_id = 1) LIMIT 1 + + +NoMethodError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.unpack): + /usr/lib/ruby/1.8/base64.rb:59:in `decode64' + /app/models/userspace.rb:5:in `content' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `send' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `method_missing' + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + Userspace Load (0.000636) SELECT * FROM "userspaces" WHERE ("userspaces"."id" = 1)  + Userspace Load (0.000590) SELECT * FROM "userspaces" WHERE ("userspaces"."id" = 1)  +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:09:46) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"11c37639", "action"=>"index", "controller"=>"files"} + User Load (0.000993) SELECT * FROM "users" WHERE ("users"."name" IS NULL) LIMIT 1 + + +NoMethodError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.userspace): + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:10:07) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.001022) SELECT * FROM "users"  +Completed in 0.07879 (12 reqs/sec) | Rendering: 0.00038 (0%) | DB: 0.00102 (1%) | 200 OK [http://localhost/dfs/client.json?part=login&username=test&password=test] + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:10:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"2c3c5c61", "action"=>"index", "controller"=>"files"} + User Load (0.000990) SELECT * FROM "users" WHERE ("users"."name" = 'test') LIMIT 1 + Userspace Load (0.000636) SELECT * FROM "userspaces" WHERE ("userspaces".user_id = 1) LIMIT 1 + + +NoMethodError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.unpack): + /usr/lib/ruby/1.8/base64.rb:59:in `decode64' + /app/models/userspace.rb:5:in `content' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `send' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `method_missing' + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:12:06) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"2c3c5c61", "action"=>"index", "controller"=>"files"} + User Load (0.000985) SELECT * FROM "users" WHERE ("users"."name" IS NULL) LIMIT 1 + + +NoMethodError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.userspace): + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:12:13) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.002034) SELECT * FROM "users"  +Completed in 0.07590 (13 reqs/sec) | Rendering: 0.00038 (0%) | DB: 0.00203 (2%) | 200 OK [http://localhost/dfs/client.json?part=login&username=test&password=test] + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:12:21) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"8646be90", "action"=>"index", "controller"=>"files"} + User Load (0.000969) SELECT * FROM "users" WHERE ("users"."name" = 'test') LIMIT 1 + Userspace Load (0.000635) SELECT * FROM "userspaces" WHERE ("userspaces".user_id = 1) LIMIT 1 + + +NoMethodError (undefined method `content' for #<Userspace:0xb5912c3c>): + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:256:in `method_missing' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `send' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `method_missing' + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) + + +Processing DfsController#client (for 127.0.0.1 at 2008-06-14 12:13:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.001266) SELECT * FROM "users"  +Completed in 0.07185 (13 reqs/sec) | Rendering: 0.00043 (0%) | DB: 0.00127 (1%) | 200 OK [http://localhost/dfs/client.json?part=login&username=test&password=test] + + +Processing FilesController#index (for 127.0.0.1 at 2008-06-14 12:13:11) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo +SGFzaHsABjoKQHVzZWR7AA==--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"token"=>"b0b79c8d", "action"=>"index", "controller"=>"files"} + User Load (0.001055) SELECT * FROM "users" WHERE ("users"."name" = 'test') LIMIT 1 + Userspace Load (0.000654) SELECT * FROM "userspaces" WHERE ("userspaces".user_id = 1) LIMIT 1 + + +ArgumentError (Not Z3 File): + /lib/z3.rb:144:in `unpack' + /lib/z3.rb:27:in `initialize' + /app/models/userspace.rb:5:in `new' + /app/models/userspace.rb:5:in `contents' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `send' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations/association_proxy.rb:177:in `method_missing' + /app/controllers/files_controller.rb:6:in `index' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' + /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' + /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' + /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' + /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' + /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error) diff --git a/test/fixtures/userspaces.yml b/test/fixtures/userspaces.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/userspaces.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/unit/userspace_test.rb b/test/unit/userspace_test.rb new file mode 100644 index 0000000..662c408 --- /dev/null +++ b/test/unit/userspace_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class UserspaceTest < ActiveSupport::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end
devyn/ensei
0fea6df67afab4d389a590630274ab28adf893e3
Ensei: css font cleanup
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 1b990cf..bb94a6f 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -1,118 +1,118 @@ body { background-image: url(/images/background_blue.gif); background-color: darkblue; color: white; - font-family: Verdana; + font-family: Verdana, sans-serif; } a, a:visited { color: red; } a:hover { color: orange; } /* thanks to wiki.script.aculo.us/stylesheets/script.aculo.us.css for this */ #footbar { position: fixed; border-top: 2px solid black; border-bottom: 10px solid lime; background-color: lime; width: 100%; left: 0px; bottom: 0px; text-align:left; color: #aaa; font-size: 10px; z-index: 10000; opacity: 0.6; height: 20px; padding-left: 10px; } #footbar a img { border: none; vertical-align: bottom; } #footbar input { width: 300px; } .window { position: absolute; } .window .titlebar { background-color: yellow; color: black; font-size: 14pt; padding-right: 10px; padding-left: 10px; border-left: 2px solid black; border-top: 2px solid black; border-bottom: 2px solid black; } .window .refreshButton { background-color: green; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .closeButton { background-color: red; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-right: 2px solid black; border-bottom: 2px solid black; } .window .renameButton { background-color: blue; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .content { background-color: white; color: black; padding-left: 10px; padding-right: 10px; max-width: 400px; border: 2px solid black; } button.enseiButton, input.enseiButton { background-color: cyan; } #loginPart { display:inline; position:absolute; width:100%; height:100%; left:0px; top:0px; background-color:black; opacity:0.7; text-align:center; } #loginWindow { position:absolute; left:33%; top:33%; width:33%; height:33%; background-color:green; -} \ No newline at end of file +} diff --git a/public/stylesheets/red.css b/public/stylesheets/red.css index 302ae47..1876449 100644 --- a/public/stylesheets/red.css +++ b/public/stylesheets/red.css @@ -1,118 +1,118 @@ body { background-image: url(/images/background_red.gif); background-color: darkred; color: white; - font-family: Verdana; + font-family: Verdana, sans-serif; } a, a:visited { color: red; } a:hover { color: orange; } /* thanks to wiki.script.aculo.us/stylesheets/script.aculo.us.css for this */ #footbar { position: fixed; border-top: 2px solid black; border-bottom: 10px solid red; background-color: red; width: 100%; left: 0px; bottom: 0px; text-align:left; color: #aaa; font-size: 10px; z-index: 10000; opacity: 0.6; height: 20px; padding-left: 10px; } #footbar a img { border: none; vertical-align: bottom; } #footbar input { width: 300px; } .window { position: absolute; } .window .titlebar { background-color: yellow; color: black; font-size: 14pt; padding-right: 10px; padding-left: 10px; border-left: 2px solid black; border-top: 2px solid black; border-bottom: 2px solid black; } .window .refreshButton { background-color: green; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .closeButton { background-color: red; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-right: 2px solid black; border-bottom: 2px solid black; } .window .renameButton { background-color: blue; padding-left: 5px; padding-right: 5px; font-size: 14pt; border-top: 2px solid black; border-bottom: 2px solid black; } .window .content { background-color: white; color: black; padding-left: 10px; padding-right: 10px; max-width: 400px; border: 2px solid black; } button.enseiButton, input.enseiButton { background-color: #FFAAAA; } #loginPart { display: inline; position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; background-color: black; opacity: 0.7; text-align: center; } #loginWindow { position: absolute; left: 33%; top: 33%; width: 33%; height: 33%; background-color: red; -} \ No newline at end of file +}
devyn/ensei
0feb6c9eb3d8cc2f78dbdcdbff097785f25b1b6f
Ensei: Code clean for deprecated features.
diff --git a/public/javascripts/ensei.js b/public/javascripts/ensei.js index 42ef951..8b71aba 100644 --- a/public/javascripts/ensei.js +++ b/public/javascripts/ensei.js @@ -1,132 +1,125 @@ // Ensei window framework document.windows = new Hash({}); function openService(uri, title) { var wid; var successFunc = function(t) { wid = newWindow(title, uri); setContent(wid, t.responseText); }; new Ajax.Request(uri, {method:'get', onSuccess:successFunc, asynchronous:false}); return wid; } function newWindow(title, refreshURI) { var wid = Math.round((Math.random() * 1000000000)); new Insertion.Bottom('desktop', "<div onmouseover='focusWindow("+wid+");' onmouseout='unFocusWindow("+wid+");' class='window' id='window" + wid + "'><span ondblclick='Effect.toggle(\"content"+wid+"\", \"blind\");' class='titlebar' id='title" + wid + "'>" + title + "</span><span class='refreshButton' onclick='refreshWindow("+wid+", \""+refreshURI+"\")'>R</span><span class='renameButton' onclick='setTitle("+wid+", prompt(\"rename to?\"))'>T</span><span class='closeButton' onclick='closeWindow(" + wid + ")'>X</span><div class='content' id='content" + wid + "'></div></div>"); new Draggable('window' + wid, {handle:'title'+wid}); document.windows.set(''+wid+'', [refreshURI, title]); return wid; } function refreshWindow(wid, refreshURI) { var successFunc = function(t) { setContent(wid, t.responseText); }; new Ajax.Request(refreshURI, {method:'get', onSuccess:successFunc}); } function setContent(wid, content) { Element.update("content"+ wid, content); } function getContent(wid) { - return document.getElementById(""+wid+"").innerHTML; + return $(""+wid+"").innerHTML; } function closeWindow(wid) { Element.remove('window' + wid); document.windows.unset(''+wid+''); } function setTitle(wid, title) { Element.update("title"+ wid, title); var x = document.windows.get(''+wid+''); x[1] = title; document.windows.set(''+wid+'', x); } -function getIFrameDocument(id) { - var oIFrame = document.getElementById(id); - var oDoc = oIFrame.contentWindow || oIFrame.contentDocument; - if(oDoc.document) { oDoc = oDoc.document }; - return oDoc; -} - function moveWindow(id, x, y) { - var oWindow = document.getElementById("window" + id); + var oWindow = $("window" + id); oWindow.style.left = x; oWindow.style.top = y; return id; } function fetchWins() { var windows = new Array(); document.windows.keys().each(function(k){ var v = document.windows.get(k); var isShaded = ($('content' + k).style.display == 'none'); - windows = windows.concat([v.concat(document.getElementById('window' + k).style.left, document.getElementById('window' + k).style.top, isShaded)]); + windows = windows.concat([v.concat($('window' + k).style.left, $('window' + k).style.top, isShaded)]); }); return windows; } function setShade(id, val) { if(val) { $("content" + id).style.display = 'none'; } else { $("content" + id).style.display = 'block'; } } function persistentWindowsSave() { DFS.app("ensei").sendSector("persistent", fetchWins()); } function persistentWindowsLoad() { var x = DFS.app("ensei").getSector("persistent"); if(x) { x.each(function(i) { if(i) setShade(moveWindow(openService(i[0], i[1]), i[2], i[3]), i[4]); }); } } function processLogin() { $('loginButton').innerHTML = "Logging in..."; if (DFS.login("/DFS/client.json", $('username').value, $('password').value) == true) { $('loginPart').remove(); $('desktopPart').style.display = 'inline'; persistentWindowsLoad(); } else { $('loginButton').innerHTML = "Try again"; $('password').value = ""; } } function processSignup() { $('signupButton').innerHTML = "Signing up..."; if (DFS.signup("/DFS/client.json", $('username').value, $('password').value) == true) { processLogin(); } else { $('signupButton').innerHTML = "Try a different username"; } } function logout() { persistentWindowsSave(); DFS.logout(); window.location.reload(true); } function focusWindow(wid) { $('window' + wid).style.zIndex = 1; } function unFocusWindow(wid) { $('window' + wid).style.zIndex = 0; } function reshTransport(server, script) { var retItem; var request = new Ajax.Request(server, {asynchronous:false, method:'get',parameters:{script:script,token:DFS.token}, onSuccess:function(t) { retItem = t.headerJSON; }}); return retItem; -} \ No newline at end of file +} diff --git a/term.rb b/term.rb deleted file mode 100644 index 7951fad..0000000 --- a/term.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Ensei terminal language parser - -def termEval(str) - str. - gsub(/\n/, ";\n"). - gsub(/open ?\[[^\[\]]\]/) {|s| s.sub(/^open ?\[/, "openService(").sub(/\]$/, ")") }. - gsub(/new ?\[[^\[\]]\]/) {|s| s.sub(/^new ?\[/, "newWindow(").sub(/\]$/, ")") }. - gsub(/refresh ?\[[^\[\]]\]/) {|s| s.sub(/^refresh ?\[/, "refreshWindow(").sub(/\]$/, ")") }. - gsub(/move ?\[[^\[\]]\]/) {|s| s.sub(/^move ?\[/, "moveWindow(").sub(/\]$/, ")") }. - gsub(/set ?\[[^\[\]]\]/) {|s| s.sub(/^set ?\[/, "setContent(").sub(/\]$/, ")") }. - gsub(/get ?\[[^\[\]]\]/) {|s| s.sub(/^get ?\[/, "getContent(").sub(/\]$/, ")") }. - gsub(/set ?\[[^\[\]]\]/) {|s| s.sub(/^set ?\[/, "setContent(").sub(/\]$/, ")") }. - gsub(/title ?\[[^\[\]]\]/) {|s| s.sub(/^title ?\[/, "setTitle(").sub(/\]$/, ")") }. - gsub(/close ?\[[^\[\]]\]/) {|s| s.sub(/^close ?\[/, "closeWindow(").sub(/\]$/, ")") } -end \ No newline at end of file
devyn/ensei
8df3ca2cc485742b4f91630c9dca3feb8ce1725e
Ensei: Preparing for file storage support. Added Z3 library.
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb new file mode 100644 index 0000000..4970192 --- /dev/null +++ b/app/controllers/files_controller.rb @@ -0,0 +1,2 @@ +class FilesController < ApplicationController +end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb new file mode 100644 index 0000000..e9da4f6 --- /dev/null +++ b/app/helpers/files_helper.rb @@ -0,0 +1,2 @@ +module FilesHelper +end diff --git a/lib/z3.rb b/lib/z3.rb new file mode 100644 index 0000000..a27e78f --- /dev/null +++ b/lib/z3.rb @@ -0,0 +1,179 @@ +#!ruby +# added on-demand gzip to lessen mem usage +# added json metadata +# added archive metadata +%w(zlib base64 stringio set fileutils json).each{|r|require r} + +class Object + def full_clone + Marshal.load(Marshal.dump(self)) + end +end + +class Z3 + TABLE = { + :magic => 'Z3', + :begin => "\250", + :filestart => "\251", + :filenext => "\252", + :end => "\253", + :jsonstart => "\254" + } + RANKS = ["bytes", "kilobytes", "megabytes", "gigabytes", "terrabytes"] + def initialize(file=nil) + @files = {} + @mdata = {} + @adata = {} + unpack file if file + end + def self.from_file(filename) + Z3.new(File.read(filename)) + end + def self.zip(pathname, filename) + from_physical(pathname).to_file(filename) + true + end + def self.unzip(filename, pathname) + from_file(filename).extract(pathname) + true + end + def to_physical(pathname) + # initialize directories + dirs.each do |dir| + FileUtils.mkdir_p File.join(File.expand_path(pathname), dir) + end + # save files + files.each do |file| + File.open File.join(File.expand_path(pathname), file), "w" do |f| + f.write @files[file] + end + end + true + end + alias extract to_physical + def self.from_physical(pathname) + files = get_local_recursive(File.expand_path(pathname)) + z3 = Z3.new + files.each do |file| + z3.open(File.join("/", file.sub(File.expand_path(pathname), ""))) do |zf| + zf.write File.read(file) + end + end + return z3 + end + def metadata(filename) + if filename == :archive + return @adata + else + return @mdata[filename] + end + end + def to_file name + File.open(name,'w'){|f|f.write save} + end + def files + @files.keys + end + def things_in dir + a = [] + dir = dir.gsub(%r" $|/$", "") unless dir =~ %r"^/ *$" + a << (dirs.select{|dname|File.dirname(dname) == dir}-[dir]).collect{|d|d+"/"} + a << @files.select{|fname,cont|File.dirname(fname) == dir}.collect{|ia|ia[0]} + return a + end + def dirs + d = Set.new + @files.each{|fname,cont|d << File.dirname(fname)} + return d.to_a + end + def open(filename) + (@files[filename] = "") and (@mdata[filename] = {}) unless @files[filename] + @files[filename] = Zlib::Inflate.inflate(Base64.decode64(@files[filename])) unless @files[filename].empty? + ret = yield StringIO.new(@files[filename]) + @files[filename] = Base64.encode64(Zlib::Deflate.deflate(@files[filename])) + return ret + end + def read(filename) + return false unless @files[filename] + open(filename){|f|f.read} + end + def delete(filename) + return false unless @files[filename] + @files.delete filename + @mdata.delete filename + true + end + def move(src, dest) + copy(src, dest) and delete(src) + + end + def copy(src, dest) + return false unless @files[src] + @files[dest] = @files[src] + @mdata[dest] = @mdata[src] + true + end + def size(filename) + return false unless @files[filename] + Zlib::Inflate.inflate(Base64.decode64(@files[filename])).size + end + def csize(filename) + return false unless @files[filename] + @files[filename].size + end + def about(filename) + return "File not found." unless @files[filename] + compressed = @files[filename].size + uncompressed = size(filename) + crank = 0 + until compressed < 1000 + compressed /= 1000 + crank += 1 + end + urank = 0 + until uncompressed < 1000 + uncompressed /= 1000 + urank += 1 + end + return "#{filename}: #{uncompressed} #{RANKS[urank]} (#{compressed} #{RANKS[crank]} compressed)" + end + def save + TABLE[:magic]+JSON.dump(@adata)+TABLE[:begin]+@files.to_a.collect{|f|f[0]+TABLE[:jsonstart]+JSON.dump(@mdata[f[0]])+TABLE[:filestart]+Base64.encode64(Zlib::Deflate.deflate(f[1])).gsub("\n", "")}.join(TABLE[:filenext])+TABLE[:end] + end + def unpack(file) + raise ArgumentError, "Not Z3 File" unless file =~ /^#{TABLE[:magic]}/ + @adata = JSON.load(file[(TABLE[:magic].size)..(file.index(TABLE[:begin]))].sub(/#{TABLE[:begin]}$/, "")) + encfiles = file[(file.index(TABLE[:begin]))..(file.index(TABLE[:end]))].gsub(/^#{TABLE[:begin]}|#{TABLE[:end]}$/, "").split(TABLE[:filenext]) + encfiles.each do |f| + fj = f.split(TABLE[:jsonstart]) + fs = fj[1].split(TABLE[:filestart]) + @files[fj[0]] = fs[1] + @mdata[fj[0]] = JSON.load(fs[0]) + end + end + def inspect + directories="" + if dirs.size == 1 + directories= "1 directory" + else + directories= "#{dirs.size} directories" + end + if @files.size == 1 + return "(Z3: 1 file in #{directories})" + else + return "(Z3: #{@files.size} files in #{directories})" + end + end + private + def self.get_local_recursive(pathname) + a = [] + (Dir.entries(pathname) - %w(. ..)).each do |e| + if File.directory? File.join(pathname, e) + a += get_local_recursive(File.join(pathname, e)) + else + a << File.join(pathname, e) + end + end + return a + end +end diff --git a/log/development.log b/log/development.log index b5c0735..4de0d1f 100644 --- a/log/development.log +++ b/log/development.log @@ -4099,512 +4099,514 @@ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/vie C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end Function body: def _run_erb_47app47views47main47reshHelp46html46erb(local_assigns) _erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" when 'openservice' ; _erbout.concat "\n" _erbout.concat "<strong>SYNOPSIS</strong><br/>\n" _erbout.concat "<em>openService</em> &lt;uri&gt; &lt;title&gt;<br/>\n" _erbout.concat "Opens an Ensei HTML snippet.<br/>\n" else ; _erbout.concat "\n" _erbout.concat "<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/>\n" _erbout.concat "Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/>\n" _erbout.concat "<strong>Syntax</strong><br/>\n" _erbout.concat "The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/>\n" _erbout.concat "<code>newWindow hello \"\" | moveWindow 290 290</code><br/>\n" _erbout.concat "This generates the JavaScript code:<br/>\n" _erbout.concat "<code>moveWindow(newWindow(\"hello\", \"\"), \"290\", \"290\");</code><br/>\n" _erbout.concat "See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/>\n" _erbout.concat "<strong>Command List</strong> (applies to JavaScript interface too)<br/>\n" %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| ; _erbout.concat "\n" if ind.even? ; _erbout.concat "\n" _erbout.concat "<a href=\"#\" onclick=\"openService('"; _erbout.concat(( url_for :action => :reshHelp, :lookup => i ).to_s); _erbout.concat "', 'Resh Help: "; _erbout.concat(( i ).to_s); _erbout.concat "');\" style=\"color:blue;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" else ; _erbout.concat "\n" _erbout.concat "<a href=\"#\" style=\"color:red;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" end ; _erbout.concat "\n" end ; _erbout.concat "\n" end ; _erbout end Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 ActionView::TemplateError (compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN _erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND when 'openservice' ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end) on line #1 of main/reshHelp.html.erb: 1: <% case params[:lookup].downcase %> 2: <% when 'openservice' %> 3: <strong>SYNOPSIS</strong><br/> 4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> app/views/main/reshHelp.html.erb:24:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:40:23) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp ERROR: compiling _run_erb_47app47views47main47reshHelp46html46erb RAISED compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN _erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND when 'openservice' ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end Function body: def _run_erb_47app47views47main47reshHelp46html46erb(local_assigns) _erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" when 'openservice' ; _erbout.concat "\n" _erbout.concat "<strong>SYNOPSIS</strong><br/>\n" _erbout.concat "<em>openService</em> &lt;uri&gt; &lt;title&gt;<br/>\n" _erbout.concat "Opens an Ensei HTML snippet.<br/>\n" else ; _erbout.concat "\n" _erbout.concat "<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/>\n" _erbout.concat "Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/>\n" _erbout.concat "<strong>Syntax</strong><br/>\n" _erbout.concat "The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/>\n" _erbout.concat "<code>newWindow hello \"\" | moveWindow 290 290</code><br/>\n" _erbout.concat "This generates the JavaScript code:<br/>\n" _erbout.concat "<code>moveWindow(newWindow(\"hello\", \"\"), \"290\", \"290\");</code><br/>\n" _erbout.concat "See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/>\n" _erbout.concat "<strong>Command List</strong> (applies to JavaScript interface too)<br/>\n" %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| ; _erbout.concat "\n" if ind.even? ; _erbout.concat "\n" _erbout.concat "<a href=\"#\" onclick=\"openService('"; _erbout.concat(( url_for :action => :reshHelp, :lookup => i ).to_s); _erbout.concat "', 'Resh Help: "; _erbout.concat(( i ).to_s); _erbout.concat "');\" style=\"color:blue;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" else ; _erbout.concat "\n" _erbout.concat "<a href=\"#\" style=\"color:red;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" end ; _erbout.concat "\n" end ; _erbout.concat "\n" end ; _erbout end Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 ActionView::TemplateError (compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN _erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND when 'openservice' ; _erbout.concat "\n" ^ C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end) on line #1 of main/reshHelp.html.erb: 1: <% case params[:lookup].downcase %> 2: <% when 'openservice' %> 3: <strong>SYNOPSIS</strong><br/> 4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> app/views/main/reshHelp.html.erb:24:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:02) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp ActionView::TemplateError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.downcase) on line #1 of main/reshHelp.html.erb: 1: <% case params[:lookup].downcase 2: when 'openservice' %> 3: <strong>SYNOPSIS</strong><br/> 4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> app/views/main/reshHelp.html.erb:1:in `_run_erb_47app47views47main47reshHelp46html46erb' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:45) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.07800 (12 reqs/sec) | Rendering: 0.04700 (60%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:51) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:45:30) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:42) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"reshTerminal", "controller"=>"main"} Rendering main/reshTerminal Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:46) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"help", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help&token=648d1c] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:47:46) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=] Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:56) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"help openService", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help%20openService&token=648d1c] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:47:56) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 20:05:43) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"reshTerminal", "controller"=>"main"} Rendering main/reshTerminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 20:05:47) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"help", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} Completed in 0.11000 (9 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help&token=648d1c] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:05:47) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:05:52) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:07:11) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:07:29) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} Rendering main/reshHelp Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 20:36:26) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"648d1c", "action"=>"client", "value"=>"[[\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/menu\", \"Menu\", \"827px\", \"67px\", false]]", "controller"=>"dfs"} User Load (0.063000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsHWwoiEC9tYWluL2Nsb2NrIgpD bG9jayIKODI3cHgiCTE1cHhGWwoiDy9tYWluL21lbnUiCU1lbnUiCjgyN3B4 Igk2N3B4Rg== ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 20:36:28' WHERE "id" = 1 Completed in 0.78100 (1 reqs/sec) | Rendering: 0.01600 (2%) | DB: 0.06300 (8%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=648d1c&name=persistent&value=%5B%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20false%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 20:36:28) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"648d1c", "action"=>"client", "controller"=>"dfs"} Completed in 0.04700 (21 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=648d1c] Processing MainController#index (for 127.0.0.1 at 2008-05-11 20:36:29) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.34400 (2 reqs/sec) | Rendering: 0.31200 (90%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) +DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455) diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb new file mode 100644 index 0000000..da25300 --- /dev/null +++ b/test/functional/files_controller_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class FilesControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end diff --git a/vendor/plugins/haml/init.rb b/vendor/plugins/haml/init.rb deleted file mode 100644 index 142726c..0000000 --- a/vendor/plugins/haml/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'haml' -Haml.init_rails(binding)
devyn/ensei
3f01de71677ed5abde9ebf2449efe7608c042fcc
Ensei: Updated to Rails 2.1
diff --git a/config/environment.rb b/config/environment.rb index 1ee07ce..bc603cf 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,60 +1,59 @@ # Be sure to restart your server when you modify this file -UserTokens = {} # 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 = '2.0.2' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # See Rails::Configuration for more options. # Skip frameworks you're not going to use (only works if using vendor/rails). # To use Rails without a database, you must remove the Active Record framework # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] # Only load the plugins named here, in the order given. By default, all plugins # in vendor/plugins are loaded in alphabetical order. # :all can be used as a placeholder for all plugins not explicitly named # config.plugins = [ :exception_notification, :ssl_requirement, :all ] # Add additional load paths for your own custom dirs # config.load_paths += %W( #{RAILS_ROOT}/extras ) # Force all environments to use the same logger level # (by default production uses :info, the others :debug) # config.log_level = :debug # 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. config.action_controller.session = { :session_key => '_Ensei_session', :secret => 'e9fc6fc9f9c5c5cbbb9be86b20a26d10253d4c4ea1a8b2c699f370f9b3ac60b5bd63ec573e839fe50eaadff675c5b0e41e0ad0fe46492aca4087259e62d5af8c' } # 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 'rake db:sessions:create') # config.action_controller.session_store = :active_record_store # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql # Activate observers that should always be running # config.active_record.observers = :cacher, :garbage_collector # Make Active Record use UTC-base instead of local time # config.active_record.default_timezone = :utc -end \ No newline at end of file +end
devyn/ensei
88866abd4825f9cabe0f2e0a9b92bcdde6db813b
Ensei: added easy theming
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index ee95795..c233207 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,19 +1,20 @@ +<% themes = ["main", "red"] %> <html> <head> <title>Ensei Webtop</title> - <%= stylesheet_link_tag (params['theme'] or "main") %> + <%= stylesheet_link_tag (params['theme'] or themes.first), :id => "theme" %> <%= javascript_include_tag :all %> </head> <body> <div id="loginPart"><div style="" id="loginWindow"> <%= image_tag 'ensei.png' %><br/> <table><tr><td><strong>Username:</strong></td><td><input id="username"/></td></tr><tr><td><strong>Password:</strong></td><td><input id="password" type="password"/></td></tr><tr><td><button class="enseiButton" id="loginButton" onClick="processLogin();">Login</button></td><td><button class="enseiButton" id="signupButton" onClick="processSignup();">Sign up</button></td></tr></table> </div></div> <div id="desktopPart" style="display:none"> <div id="desktop"></div> <div id="footbar" onmouseover='getElementById("footbar").style.opacity = 1.0' onmouseout='getElementById("footbar").style.opacity = 0.6'><span> - <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> <a href='#' onclick='logout()'><%= image_tag 'logout.gif' %></a> + <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> <a href='#' onclick='logout()'><%= image_tag 'logout.gif' %></a> Theme: <% themes.each do |i| %><a href="#" onclick="$('theme').href = '<%= path_to_stylesheet i %>';"><%= i %></a> <% end %> </span></div> </div> </body> </html> \ No newline at end of file
devyn/ensei
c1bb57b3ee0a01ed55495ca8e37c8f4c904480f6
Ensei: Resh related updates and documentation.
diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index d784b80..61a4633 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,32 +1,36 @@ class MainController < ApplicationController after_filter :choose_content_type def index;end # sample Ensei windows def rssLoader require 'rss/2.0' @feed = RSS::Parser.parse(Net::HTTP.get(URI.parse(params['uri']))) end def clock; end def help; end + def reshHelp; end def menu; end - def terminal + def reshTerminal if params[:format] == "js" - # right now pretty pointless. require 'resh' exe = Resh::Executor.new %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each do |i| exe.des.define(i) {|pipedata,arguments| - i << "(" << process_args(arguments).collect{|i|'"' << i.gsub('"', '\"') << '"'}.join(", ") << ");" + i << "(" << (pipedata.collect{|i| i.sub(/;$/, "")} + process_args(arguments).collect{|i|'"' << i.gsub('"', '\"') << '"'}).join(", ") << ");" } end + exe.des.define :help do |pipedata, arguments| + "openService('/main/reshHelp?lookup=#{CGI.escape(arguments)}', 'Resh Help');" + end obj = exe.execute(params[:script]) headers['X-JSON'] = obj.to_json render :text => obj.join("\n") end end + def console; end private def choose_content_type headers['Content-Type'] = Mime::JS if params[:format] == "js" end end diff --git a/app/views/main/console.html.erb b/app/views/main/console.html.erb new file mode 100644 index 0000000..c591bb4 --- /dev/null +++ b/app/views/main/console.html.erb @@ -0,0 +1,3 @@ +<textarea style="width:400px;height:200px;background-color:black;font-family:monospace;color:white;" id="jsConsole"></textarea><br/><br/> +<input style="width:300px" id="jsConsoleInput"/>&nbsp;&nbsp;&nbsp; +<button class='enseiButton' onclick='document.getElementById("jsConsole").value += ">> " + document.getElementById("jsConsoleInput").value + "\n=> " + Object.inspect(eval(document.getElementById("jsConsoleInput").value)) + "\n"; document.getElementById("jsConsoleInput").value = "";'>Evaluate</button><br/><br/> \ No newline at end of file diff --git a/app/views/main/menu.html.erb b/app/views/main/menu.html.erb index 8cb7894..356cf55 100644 --- a/app/views/main/menu.html.erb +++ b/app/views/main/menu.html.erb @@ -1,7 +1,8 @@ <!-- the menu starts here --> <a href='#' onclick='openService("<%= url_for :action => :clock %>", "Clock")'>Clock</a><br/> <a href='#' onclick='openService("<%= url_for :action => :help %>", "Help")'>Help</a><br/> -<a href='#' onclick='openService("<%= url_for :action => :terminal %>", "Terminal")'>Terminal</a><br/> +<a href='#' onclick='openService("<%= url_for :action => :reshTerminal %>", "Terminal")'>Terminal</a><br/> +<a href='#' onclick='openService("<%= url_for :action => :console %>", "JS Console")'>JS Console</a><br/> <a href='#' onclick='openService("<%= url_for :action => :manager, :controller => :DFS %>", "DFS Manager")'>DFS Manager</a><br/> <a href='#' onclick='openService("<%= url_for :action => :rssLoader %>?uri=" + escape(prompt("Feed to read?")), "RSS Reader")'>RSS Reader</a><br/> <!-- end menu --><br/> \ No newline at end of file diff --git a/app/views/main/reshHelp.html.erb b/app/views/main/reshHelp.html.erb new file mode 100644 index 0000000..dcf1232 --- /dev/null +++ b/app/views/main/reshHelp.html.erb @@ -0,0 +1,63 @@ +<!-- warning: documentation not complete! --> +<% case (params[:lookup] or '').downcase + when 'openservice' %> +<strong>SYNOPSIS</strong><br/> +<em>openService</em> &lt;uri&gt; &lt;title&gt; <em>=&gt; Window ID</em><br/> +<strong>DESCRIPTION</strong><br/> +Opens an Ensei HTML snippet.<br/> +<strong>PARAMETERS</strong><br/> +<em>uri:</em> The URI that the snippet is located at.<br/> +<em>title:</em> The text in the titlebar of the new window.<br/> +<% when 'newwindow' %> +<strong>SYNOPSIS</strong><br/> +<em>newWindow</em> &lt;title&gt; &lt;refreshURI&gt; <em>=&gt; Window ID</em><br/> +<strong>DESCRIPTION</strong><br/> +Creates a new window. +<strong>PARAMETERS</strong><br/> +<em>title:</em> The text in the titlebar of the new window.<br/> +<em>refreshURI:</em> The URI that the snippet is located at. (optional)<br/> +<% when 'refreshwindow' %> +<strong>SYNOPSIS</strong><br/> +<em>refreshWindow</em> &lt;wid&gt; &lt;refreshURI&gt;<br/> +<strong>PARAMETERS</strong><br/> +<em>wid:</em> The ID of the window you wish to refresh.<br/> +<em>refreshURI:</em> The URI that the snippet is located at.<br/> +<% when 'setcontent' %> +<% when 'getcontent' %> +<% when 'closewindow' %> +<% when 'settitle' %> +<% when 'getiframedocument' %> +Used internally. +<% when 'movewindow' %> +<% when 'fetchwins' %> +<% when 'setshade' %> +<% when 'persistentwindowssave' %> +<% when 'persistentwindowsload' %> +<% when 'processlogin' %> +Used internally. +<% when 'processsignup' %> +Used internally. +<% when 'logout' %> +<% when 'focuswindow' %> +Used internally. +<% when 'unfocuswindow' %> +Used internally. +<% when 'reshtransport' %> +<% else %> +<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/> +Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/> +<strong>Syntax</strong><br/> +The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/> +<code>newWindow hello "" | moveWindow 290 290</code><br/> +This generates the JavaScript code:<br/> +<code>moveWindow(newWindow("hello", ""), "290", "290");</code><br/> +See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/> +<strong>Command List</strong> (applies to JavaScript interface too)<br/> +<% %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| %> +<% if ind.even? %> +<a href="#" onclick="openService('<%= url_for :action => :reshHelp, :lookup => i %>', 'Resh Help: <%= i %>');" style="color:blue;text-decoration:underline"><%= i %></span> +<% else %> +<a href="#" style="color:red;text-decoration:underline"><%= i %></span> +<% end %> +<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/main/reshTerminal.html.erb b/app/views/main/reshTerminal.html.erb new file mode 100644 index 0000000..7b9470b --- /dev/null +++ b/app/views/main/reshTerminal.html.erb @@ -0,0 +1,3 @@ +<textarea style="width:400px;height:200px;background-color:black;font-family:monospace;color:white;" id="reshConsole" disabled="true"></textarea><br/><br/> +<input style="width:300px" id="reshConsoleInput"/>&nbsp;&nbsp;&nbsp; +<button class="enseiButton" onclick="var t = reshTransport('<%= url_for :action => "reshTerminal", :format => "js" %>', $('reshConsoleInput').value);$('reshConsole').value += '>> ' + $('reshConsoleInput').value + '\n=> ' + Object.inspect(t) + '\n';$('reshConsoleInput').value = '';">Evaluate</button><br/><br/> \ No newline at end of file diff --git a/app/views/main/terminal.html.erb b/app/views/main/terminal.html.erb deleted file mode 100644 index 8fa2e6b..0000000 --- a/app/views/main/terminal.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<textarea style="width:400px;height:200px;background-color:black;font-family:monospace;color:white;" id="jsConsole" disabled="true"></textarea><br/><br/> -<input style="width:300px" id="jsConsoleInput"/>&nbsp;&nbsp;&nbsp; -<button class="enseiButton" onclick="var t = reshTransport('<%= url_for :action => "terminal", :format => "js" %>', $('jsConsoleInput').value);$('jsConsole').innerHTML += '>> ' + $('jsConsoleInput').value + '\n=> ' + Object.inspect(t) + '\n';$('jsConsoleInput').value = '';">Evaluate</button><br/><br/> \ No newline at end of file diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 88a6be3..64b298b 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ diff --git a/lib/resh.rb b/lib/resh.rb index 937d319..e8043b0 100644 --- a/lib/resh.rb +++ b/lib/resh.rb @@ -1,147 +1,148 @@ # Resh2: A Pipe-based shell language based on Ruby module Resh VERSION = 2.0 PRODUCT = "Resh" class ReshExit < Exception; end class CommandDescriptor def metaclass; class << self; self; end; end # note: commands have full access to instance variables def define(name, code=nil, &blk) if code and not blk then blk = proc{instance_eval(code)} end metaclass.__send__(:define_method, name, &blk) @commands << name.to_s unless @commands.include?(name.to_s) end def call(name, *args, &blk) if @commands.include? name.to_s send name, *args, &blk else raise NoMethodError, "command #{name} not found." end end def initialize @commands = %w(quit exit) end def exit(pipedata, arguments) raise ReshExit, "internal exit" end alias quit exit def process_args(argumentString) return [] unless argumentString a = argumentString.split(" ") _start = 0 _end = 0 a.each_with_index do |i,ind| if i =~ /^"/ _start = ind elsif i =~ /"$/ _end = ind a[_start.._end] = a[_start.._end].join(" ").gsub(/^"|"$/, "") elsif i =~ /^""$/ a[ind] = "" end end _start = 0 _end = 0 a.each_with_index do |i,ind| if i =~ /^'/ _start = ind elsif i =~ /'$/ _end = ind a[_start.._end] = a[_start.._end].join(" ").gsub(/^'|'$/, "") elsif i =~ /^''$/ a[ind] = "" end end return a end end class InputTokens < Array def initialize(code) a = code.split(/[ \n]*;[ \n]*/) a.each_with_index {|i, ind| a[ind] = i.split(/[ \n]*\|[ \n]*/) a[ind].each_with_index {|ii, iind| a[ind][iind] = ii.split(/[ \n]*\&[ \n]*/) } } concat a end def to_s a = dup s = "" a.each_with_index {|i, ind| a[ind].each_with_index {|ii, iind| a[ind][iind].each_with_index {|iii, iiind| s << iii s << "&" unless (iiind == (a[ind][iind].size - 1)) } s << "|" unless iind == (a[ind].size - 1) } s << ";" unless ind == (a.size - 1) } return s end # not the best for performance, but still valid. def to_pretty a = dup s = "" a.each_with_index {|i, ind| a[ind].each_with_index {|ii, iind| a[ind][iind].each_with_index {|iii, iiind| s << iii s << " &\n" unless (iiind == (a[ind][iind].size - 1)) } s << "\n| " unless iind == (a[ind].size - 1) } s << " ;\n\n" unless ind == (a.size - 1) } return s end end class Executor attr :des def initialize(descriptor=nil) descriptor = Resh::CommandDescriptor.new unless descriptor @des = descriptor end def execute(tokens) + tokens = Resh::InputTokens.new(tokens) if tokens.class >= String last_pipe_data = [] for segment in tokens for pipe_part in segment pipe_data = [] for command in pipe_part begin pipe_data << @des.call(command.split(" ")[0], last_pipe_data, command.split(" ")[1..-1].join(" ")) rescue ReshExit raise $! rescue Exception pipe_data << $! end end last_pipe_data = pipe_data end end last_pipe_data end def interactive(simple_prompt=true, input_stream=STDIN, output_stream=STDOUT) output_stream.write(simple_prompt ? ">> " : "#{Resh::PRODUCT}#{Resh::VERSION}> ") x = execute(InputTokens.new(input_stream.readline.chomp)) xes = "" x.each_with_index do |i,ind| xes << i.inspect xes << " & " unless ind == (x.size - 1) end puts "=> #{xes}\n" return x end def interactive_loop(simple_prompt=true, input_stream=STDIN, output_stream=STDOUT) begin loop do interactive simple_prompt, input_stream, output_stream end rescue ReshExit return end end end end diff --git a/log/development.log b/log/development.log index ea8d6be..b5c0735 100644 --- a/log/development.log +++ b/log/development.log @@ -2796,512 +2796,1815 @@ Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:20:46) [GET] bnUiCjgyN3B4Igk2N3B4RlsKIhAvbWFpbi9jbG9jayIKQ2xvY2siCjgyN3B4 IgkxNXB4RlsKIhMvbWFpbi90ZXJtaW5hbCINVGVybWluYWwiCjIzOXB4Igox NDNweEY= ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 11:20:46' WHERE "id" = 1 Completed in 0.20300 (4 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01500 (7%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=7bf2ed8&name=persistent&value=%5B%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fterminal%22%2C%20%22Terminal%22%2C%20%22239px%22%2C%20%22143px%22%2C%20false%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:20:47) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"7bf2ed8", "action"=>"client", "controller"=>"dfs"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=7bf2ed8] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:20:47) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:21:30) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:21:39) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} User Load (0.000000) SELECT * FROM users  Completed in 0.28200 (3 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:21:39) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"9b8f047", "action"=>"client", "controller"=>"dfs"} User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 Completed in 0.07800 (12 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=9b8f047&name=persistent&app=ensei] Processing MainController#menu (for 127.0.0.1 at 2008-05-11 11:21:39) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-05-11 11:21:39) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:21:40) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing ApplicationController#index (for 127.0.0.1 at 2008-05-11 11:22:01) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>nil} ActionController::RoutingError (No route matches "/newWindow%20hi%20null" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:22:21) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"newWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=newWindow%20hi%20null] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:22:55) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"9b8f047", "action"=>"client", "value"=>"[[\"/main/menu\", \"Menu\", \"827px\", \"67px\", false], [\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/terminal\", \"Terminal\", \"129px\", \"54px\", false]]", "controller"=>"dfs"} User Load (0.016000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsIWwoiDy9tYWluL21lbnUiCU1l bnUiCjgyN3B4Igk2N3B4RlsKIhAvbWFpbi9jbG9jayIKQ2xvY2siCjgyN3B4 IgkxNXB4RlsKIhMvbWFpbi90ZXJtaW5hbCINVGVybWluYWwiCjEyOXB4Igk1 NHB4Rg== ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 11:22:55' WHERE "id" = 1 Completed in 0.10900 (9 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01600 (14%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=9b8f047&name=persistent&value=%5B%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fterminal%22%2C%20%22Terminal%22%2C%20%22129px%22%2C%20%2254px%22%2C%20false%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:22:55) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"9b8f047", "action"=>"client", "controller"=>"dfs"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=9b8f047] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:22:56) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:26:41) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:26:44) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} User Load (0.000000) SELECT * FROM users  Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:26:45) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"ef8567fe", "action"=>"client", "controller"=>"dfs"} User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 Completed in 0.03200 (31 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=ef8567fe&name=persistent&app=ensei] Processing MainController#menu (for 127.0.0.1 at 2008-05-11 11:26:45) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-05-11 11:26:45) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:26:45) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:26:52) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"showWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.06300 (15 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=showWindow%20hi%20null] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:27:26) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"showWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=showWindow%20hi%20null] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:29:35) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"showWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=showWindow%20hi%20null] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:30:41) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"newWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=newWindow%20hi%20null] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:31:19) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"ef8567fe", "action"=>"client", "value"=>"[[\"/main/menu\", \"Menu\", \"827px\", \"67px\", false], [\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/terminal\", \"Terminal\", \"129px\", \"54px\", false]]", "controller"=>"dfs"} User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsIWwoiDy9tYWluL21lbnUiCU1l bnUiCjgyN3B4Igk2N3B4RlsKIhAvbWFpbi9jbG9jayIKQ2xvY2siCjgyN3B4 IgkxNXB4RlsKIhMvbWFpbi90ZXJtaW5hbCINVGVybWluYWwiCjEyOXB4Igk1 NHB4Rg== ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 11:31:19' WHERE "id" = 1 Completed in 0.14000 (7 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=ef8567fe&name=persistent&value=%5B%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fterminal%22%2C%20%22Terminal%22%2C%20%22129px%22%2C%20%2254px%22%2C%20false%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:31:19) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"ef8567fe", "action"=>"client", "controller"=>"dfs"} Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=ef8567fe] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:31:19) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:31:49) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:31:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} User Load (0.000000) SELECT * FROM users  Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:31:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"4f2b1acf", "action"=>"client", "controller"=>"dfs"} User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=4f2b1acf&name=persistent&app=ensei] Processing MainController#menu (for 127.0.0.1 at 2008-05-11 11:31:54) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-05-11 11:31:54) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:31:54) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:32:01) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"newWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=newWindow%20hi%20null] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 11:37:46) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"script"=>"newWindow hi null", "format"=>"js", "action"=>"terminal", "controller"=>"main"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal.js?script=newWindow%20hi%20null] Processing MainController#rssLoader (for 127.0.0.1 at 2008-05-11 11:41:18) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"uri"=>"null", "action"=>"rssLoader", "controller"=>"main"} Errno::ECONNREFUSED (No connection could be made because the target machine actively refused it. - connect(2)): c:/ruby/lib/ruby/1.8/net/http.rb:564:in `initialize' c:/ruby/lib/ruby/1.8/net/http.rb:564:in `open' c:/ruby/lib/ruby/1.8/net/http.rb:564:in `connect' c:/ruby/lib/ruby/1.8/timeout.rb:48:in `timeout' c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout' c:/ruby/lib/ruby/1.8/net/http.rb:564:in `connect' c:/ruby/lib/ruby/1.8/net/http.rb:557:in `do_start' c:/ruby/lib/ruby/1.8/net/http.rb:546:in `start' c:/ruby/lib/ruby/1.8/net/http.rb:379:in `get_response' c:/ruby/lib/ruby/1.8/net/http.rb:356:in `get' /app/controllers/main_controller.rb:7:in `rssLoader' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:49:02) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"4f2b1acf", "action"=>"client", "value"=>"[[\"/main/menu\", \"Menu\", \"827px\", \"67px\", true], [\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/terminal\", \"Terminal\", \"523px\", \"158px\", true]]", "controller"=>"dfs"} User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsIWwoiDy9tYWluL21lbnUiCU1l bnUiCjgyN3B4Igk2N3B4VFsKIhAvbWFpbi9jbG9jayIKQ2xvY2siCjgyN3B4 IgkxNXB4RlsKIhMvbWFpbi90ZXJtaW5hbCINVGVybWluYWwiCjUyM3B4Igox NThweFQ= ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 11:49:02' WHERE "id" = 1 Completed in 0.10900 (9 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=4f2b1acf&name=persistent&value=%5B%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20true%5D%2C%20%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fterminal%22%2C%20%22Terminal%22%2C%20%22523px%22%2C%20%22158px%22%2C%20true%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 11:49:02) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"4f2b1acf", "action"=>"client", "controller"=>"dfs"} Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=4f2b1acf] Processing MainController#index (for 127.0.0.1 at 2008-05-11 11:49:03) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 12:04:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} User Load (0.000000) SELECT * FROM users  Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 12:04:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"43b63ae9", "action"=>"client", "controller"=>"dfs"} User Load (0.016000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 Completed in 0.03200 (31 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01600 (50%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=43b63ae9&name=persistent&app=ensei] Processing MainController#menu (for 127.0.0.1 at 2008-05-11 12:04:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-05-11 12:04:53) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 12:04:54) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 12:06:13) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"43b63ae9", "action"=>"client", "value"=>"[[\"/main/menu\", \"Menu\", \"827px\", \"67px\", true], [\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/terminal\", \"Terminal\", \"81px\", \"75px\", true]]", "controller"=>"dfs"} User Load (0.016000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsIWwoiDy9tYWluL21lbnUiCU1l bnUiCjgyN3B4Igk2N3B4VFsKIhAvbWFpbi9jbG9jayIKQ2xvY2siCjgyN3B4 IgkxNXB4RlsKIhMvbWFpbi90ZXJtaW5hbCINVGVybWluYWwiCTgxcHgiCTc1 cHhU ', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= ', "updated_at" = '2008-05-11 12:06:13' WHERE "id" = 1 Completed in 0.09300 (10 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01600 (17%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=43b63ae9&name=persistent&value=%5B%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20true%5D%2C%20%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fterminal%22%2C%20%22Terminal%22%2C%20%2281px%22%2C%20%2275px%22%2C%20true%5D%5D&app=ensei] Processing DfsController#client (for 127.0.0.1 at 2008-05-11 12:06:13) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"part"=>"logout", "format"=>"json", "token"=>"43b63ae9", "action"=>"client", "controller"=>"dfs"} Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=43b63ae9] Processing MainController#index (for 127.0.0.1 at 2008-05-11 12:06:14) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 12:24:21) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 12:25:08) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-05-11 12:25:13) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 192.168.0.100 at 2008-05-11 12:27:37) [GET] Session ID: 57437fba5f2b54e194553a7920bf51a3 Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://192.168.0.101/] Processing MainController#index (for 192.168.0.101 at 2008-05-11 12:29:37) [GET] Session ID: 487304ad4676cb4380610e87472fc48d Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.04700 (21 reqs/sec) | Rendering: 0.04700 (100%) | DB: 0.00000 (0%) | 200 OK [http://192.168.0.101/] Processing ApplicationController#index (for 192.168.0.101 at 2008-05-11 12:29:44) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing MainController#index (for 127.0.0.1 at 2008-05-11 12:30:10) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.04700 (21 reqs/sec) | Rendering: 0.04700 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 15:50:21) [GET] + Session ID: 0ce038ee9d9792df72203bffd5ab2e08 + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.06300 (15 reqs/sec) | Rendering: 0.06300 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 15:50:54) [GET] + Session ID: 8b14930db298c1831ce3123e427298ae + Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-05-11 15:50:57) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 15:51:01) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.015000) SELECT * FROM users  +Completed in 0.40600 (2 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01500 (3%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 15:51:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"1132c40d", "action"=>"client", "controller"=>"dfs"} + User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=1132c40d&name=persistent&app=ensei] + + +Processing MainController#menu (for 127.0.0.1 at 2008-05-11 15:51:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.09300 (10 reqs/sec) | Rendering: 0.07800 (83%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-05-11 15:51:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 15:51:03) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"terminal", "controller"=>"main"} + + +ActionController::UnknownAction (No action responded to terminal): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#console (for 127.0.0.1 at 2008-05-11 15:51:08) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"console", "controller"=>"main"} +Rendering main/console +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/console] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-05-11 15:51:08) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-05-11 15:51:15) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#console (for 127.0.0.1 at 2008-05-11 15:51:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"console", "controller"=>"main"} +Rendering main/console +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/console] + + +Processing MainController#console (for 127.0.0.1 at 2008-05-11 15:52:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"console", "controller"=>"main"} +Rendering main/console +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01500 (48%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/console] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 15:52:48) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-05-11 15:52:49) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 15:54:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"newWindow hi null | moveWindow 480 680", "format"=>"js", "token"=>"1132c40d", "action"=>"terminal", "controller"=>"main"} + + +ActionController::UnknownAction (No action responded to terminal): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 15:55:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 15:55:52) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"", "format"=>"js", "token"=>"1132c40d", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=&token=1132c40d] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 15:56:01) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"", "format"=>"js", "token"=>"1132c40d", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=&token=1132c40d] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 15:57:27) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"", "format"=>"js", "token"=>"1132c40d", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=&token=1132c40d] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:13:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"", "format"=>"js", "token"=>"1132c40d", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=&token=1132c40d] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:15:12) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:15:25) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"newWindow hi null | moveWindow 480 60", "format"=>"js", "token"=>"1132c40d", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.14100 (7 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=newWindow%20hi%20null%20%7C%20moveWindow%20480%2060&token=1132c40d] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 16:22:45) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 16:22:54) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.000000) SELECT * FROM users  +Completed in 0.28100 (3 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 16:22:54) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"7bc24b03", "action"=>"client", "controller"=>"dfs"} + User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=7bc24b03&name=persistent&app=ensei] + + +Processing MainController#menu (for 127.0.0.1 at 2008-05-11 16:22:54) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-05-11 16:22:55) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-05-11 16:22:55) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"terminal", "controller"=>"main"} + + +ActionController::UnknownAction (No action responded to terminal): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:23:35) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:24:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"newWindow hi null | moveWindow 200 200", "format"=>"js", "token"=>"7bc24b03", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=newWindow%20hi%20null%20%7C%20moveWindow%20200%20200&token=7bc24b03] + + +Processing MainController#console (for 127.0.0.1 at 2008-05-11 16:24:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"console", "controller"=>"main"} +Rendering main/console +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/console] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:25:31) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"setContent 816239456 \"hello world\"", "format"=>"js", "token"=>"7bc24b03", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=setContent%20816239456%20%22hello%20world%22&token=7bc24b03] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:29:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:29:28) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"moveWindow 816239456 400 200", "format"=>"js", "token"=>"7bc24b03", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=moveWindow%20816239456%20400%20200&token=7bc24b03] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 16:30:33) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"setTitle 816239456 \"i like pie\"", "format"=>"js", "token"=>"7bc24b03", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=setTitle%20816239456%20%22i%20like%20pie%22&token=7bc24b03] + + +Processing MainController#menu (for 127.0.0.1 at 2008-05-11 16:32:30) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 16:49:35) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"7bc24b03", "action"=>"client", "value"=>"[[\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/reshTerminal\", \"Terminal\", \"74px\", \"55px\", true], [\"/main/console\", \"JS Console\", \"74px\", \"80px\", true], [\"/main/menu\", \"Menu\", \"827px\", \"67px\", true]]", "controller"=>"dfs"} + User Load (0.000000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 + User Update (0.015000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsJWwoiEC9tYWluL2Nsb2NrIgpD +bG9jayIKODI3cHgiCTE1cHhGWwoiFy9tYWluL3Jlc2hUZXJtaW5hbCINVGVy +bWluYWwiCTc0cHgiCTU1cHhUWwoiEi9tYWluL2NvbnNvbGUiD0pTIENvbnNv +bGUiCTc0cHgiCTgwcHhUWwoiDy9tYWluL21lbnUiCU1lbnUiCjgyN3B4Igk2 +N3B4VA== +', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= +', "updated_at" = '2008-05-11 16:49:35' WHERE "id" = 1 +Completed in 0.09400 (10 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01500 (15%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=7bc24b03&name=persistent&value=%5B%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2FreshTerminal%22%2C%20%22Terminal%22%2C%20%2274px%22%2C%20%2255px%22%2C%20true%5D%2C%20%5B%22%2Fmain%2Fconsole%22%2C%20%22JS%20Console%22%2C%20%2274px%22%2C%20%2280px%22%2C%20true%5D%2C%20%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20true%5D%5D&app=ensei] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 16:49:35) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"logout", "format"=>"json", "token"=>"7bc24b03", "action"=>"client", "controller"=>"dfs"} +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=7bc24b03] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 16:49:36) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 19:24:17) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.04700 (21 reqs/sec) | Rendering: 0.01600 (34%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 19:24:23) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"login", "format"=>"json", "username"=>"test", "action"=>"client", "controller"=>"dfs", "password"=>"test"} + User Load (0.015000) SELECT * FROM users  +Completed in 0.61000 (1 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01500 (2%) | 200 OK [http://localhost/DFS/client.json?part=login&username=test&password=test] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 19:24:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"getSector", "format"=>"json", "token"=>"648d1c", "action"=>"client", "controller"=>"dfs"} + User Load (0.016000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 +Completed in 0.07800 (12 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.01600 (20%) | 200 OK [http://localhost/DFS/client.json?part=getSector&token=648d1c&name=persistent&app=ensei] + + +Processing MainController#clock (for 127.0.0.1 at 2008-05-11 19:24:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:24:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#console (for 127.0.0.1 at 2008-05-11 19:24:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"console", "controller"=>"main"} +Rendering main/console +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/console] + + +Processing MainController#menu (for 127.0.0.1 at 2008-05-11 19:24:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:24:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"help", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help&token=648d1c] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:24:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:32:00) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:39:54) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +ERROR: compiling _run_erb_47app47views47main47reshHelp46html46erb RAISED compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openService' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end +Function body: def _run_erb_47app47views47main47reshHelp46html46erb(local_assigns) +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + when 'openService' ; _erbout.concat "\n" +_erbout.concat "<strong>SYNOPSIS</strong><br/>\n" +_erbout.concat "<em>openService</em> &lt;uri&gt; &lt;title&gt;<br/>\n" +_erbout.concat "Opens an Ensei HTML snippet.<br/>\n" + else ; _erbout.concat "\n" +_erbout.concat "<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/>\n" +_erbout.concat "Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/>\n" +_erbout.concat "<strong>Syntax</strong><br/>\n" +_erbout.concat "The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/>\n" +_erbout.concat "<code>newWindow hello \"\" | moveWindow 290 290</code><br/>\n" +_erbout.concat "This generates the JavaScript code:<br/>\n" +_erbout.concat "<code>moveWindow(newWindow(\"hello\", \"\"), \"290\", \"290\");</code><br/>\n" +_erbout.concat "See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/>\n" +_erbout.concat "<strong>Command List</strong> (applies to JavaScript interface too)<br/>\n" + %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| ; _erbout.concat "\n" + if ind.even? ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" onclick=\"openService('"; _erbout.concat(( url_for :action => :reshHelp, :lookup => i ).to_s); _erbout.concat "', 'Resh Help: "; _erbout.concat(( i ).to_s); _erbout.concat "');\" style=\"color:blue;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + else ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" style=\"color:red;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + end ; _erbout.concat "\n" + end ; _erbout.concat "\n" + end ; _erbout +end +Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24:in `compile_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' +c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' +c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +script/server:3 + + +ActionView::TemplateError (compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openService' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end) on line #1 of main/reshHelp.html.erb: +1: <% case params[:lookup].downcase %> +2: <% when 'openService' %> +3: <strong>SYNOPSIS</strong><br/> +4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> + + app/views/main/reshHelp.html.erb:24:in `compile_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:40:12) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +ERROR: compiling _run_erb_47app47views47main47reshHelp46html46erb RAISED compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openservice' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end +Function body: def _run_erb_47app47views47main47reshHelp46html46erb(local_assigns) +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + when 'openservice' ; _erbout.concat "\n" +_erbout.concat "<strong>SYNOPSIS</strong><br/>\n" +_erbout.concat "<em>openService</em> &lt;uri&gt; &lt;title&gt;<br/>\n" +_erbout.concat "Opens an Ensei HTML snippet.<br/>\n" + else ; _erbout.concat "\n" +_erbout.concat "<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/>\n" +_erbout.concat "Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/>\n" +_erbout.concat "<strong>Syntax</strong><br/>\n" +_erbout.concat "The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/>\n" +_erbout.concat "<code>newWindow hello \"\" | moveWindow 290 290</code><br/>\n" +_erbout.concat "This generates the JavaScript code:<br/>\n" +_erbout.concat "<code>moveWindow(newWindow(\"hello\", \"\"), \"290\", \"290\");</code><br/>\n" +_erbout.concat "See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/>\n" +_erbout.concat "<strong>Command List</strong> (applies to JavaScript interface too)<br/>\n" + %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| ; _erbout.concat "\n" + if ind.even? ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" onclick=\"openService('"; _erbout.concat(( url_for :action => :reshHelp, :lookup => i ).to_s); _erbout.concat "', 'Resh Help: "; _erbout.concat(( i ).to_s); _erbout.concat "');\" style=\"color:blue;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + else ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" style=\"color:red;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + end ; _erbout.concat "\n" + end ; _erbout.concat "\n" + end ; _erbout +end +Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24:in `compile_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' +c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' +c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +script/server:3 + + +ActionView::TemplateError (compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openservice' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end) on line #1 of main/reshHelp.html.erb: +1: <% case params[:lookup].downcase %> +2: <% when 'openservice' %> +3: <strong>SYNOPSIS</strong><br/> +4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> + + app/views/main/reshHelp.html.erb:24:in `compile_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:40:23) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +ERROR: compiling _run_erb_47app47views47main47reshHelp46html46erb RAISED compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openservice' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end +Function body: def _run_erb_47app47views47main47reshHelp46html46erb(local_assigns) +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + when 'openservice' ; _erbout.concat "\n" +_erbout.concat "<strong>SYNOPSIS</strong><br/>\n" +_erbout.concat "<em>openService</em> &lt;uri&gt; &lt;title&gt;<br/>\n" +_erbout.concat "Opens an Ensei HTML snippet.<br/>\n" + else ; _erbout.concat "\n" +_erbout.concat "<strong>Resh:</strong> the <em>safest</em> way to do Ruby.<br/>\n" +_erbout.concat "Resh is a pipe-based language developed for Ensei to do advanced client-server communications.<br/><br/>\n" +_erbout.concat "<strong>Syntax</strong><br/>\n" +_erbout.concat "The syntax is very simple. For example, to put in a new window and move it to [290,290] use:<br/>\n" +_erbout.concat "<code>newWindow hello \"\" | moveWindow 290 290</code><br/>\n" +_erbout.concat "This generates the JavaScript code:<br/>\n" +_erbout.concat "<code>moveWindow(newWindow(\"hello\", \"\"), \"290\", \"290\");</code><br/>\n" +_erbout.concat "See, things just make sense. You can even use the &amp; operator to join functions.<br/><br/>\n" +_erbout.concat "<strong>Command List</strong> (applies to JavaScript interface too)<br/>\n" + %w[openService newWindow refreshWindow setContent getContent closeWindow setTitle getIFrameDocument moveWindow fetchWins setShade persistentWindowsSave persistentWindowsLoad processLogin processSignup logout focusWindow unFocusWindow reshTransport].each_with_index do |i,ind| ; _erbout.concat "\n" + if ind.even? ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" onclick=\"openService('"; _erbout.concat(( url_for :action => :reshHelp, :lookup => i ).to_s); _erbout.concat "', 'Resh Help: "; _erbout.concat(( i ).to_s); _erbout.concat "');\" style=\"color:blue;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + else ; _erbout.concat "\n" +_erbout.concat "<a href=\"#\" style=\"color:red;text-decoration:underline\">"; _erbout.concat(( i ).to_s); _erbout.concat "</span>\n" + end ; _erbout.concat "\n" + end ; _erbout.concat "\n" + end ; _erbout +end +Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24:in `compile_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' +c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' +c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +script/server:3 + + +ActionView::TemplateError (compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:1: syntax error, unexpected tIDENTIFIER, expecting kWHEN +_erbout = ''; case params[:lookup].downcase ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:2: syntax error, unexpected kWHEN, expecting kEND + when 'openservice' ; _erbout.concat "\n" + ^ +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/reshHelp.html.erb:24: syntax error, unexpected kEND, expecting $end) on line #1 of main/reshHelp.html.erb: +1: <% case params[:lookup].downcase %> +2: <% when 'openservice' %> +3: <strong>SYNOPSIS</strong><br/> +4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> + + app/views/main/reshHelp.html.erb:24:in `compile_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp + + +ActionView::TemplateError (You have a nil object when you didn't expect it! +The error occurred while evaluating nil.downcase) on line #1 of main/reshHelp.html.erb: +1: <% case params[:lookup].downcase +2: when 'openservice' %> +3: <strong>SYNOPSIS</strong><br/> +4: <em>openService</em> &lt;uri&gt; &lt;title&gt;<br/> + + app/views/main/reshHelp.html.erb:1:in `_run_erb_47app47views47main47reshHelp46html46erb' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:45) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.07800 (12 reqs/sec) | Rendering: 0.04700 (60%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:42:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:45:30) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:42) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:46) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"help", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help&token=648d1c] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:47:46) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 19:47:56) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"help openService", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help%20openService&token=648d1c] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 19:47:56) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"openService", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=openService] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 20:05:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"reshTerminal", "controller"=>"main"} +Rendering main/reshTerminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal] + + +Processing MainController#reshTerminal (for 127.0.0.1 at 2008-05-11 20:05:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"script"=>"help", "format"=>"js", "token"=>"648d1c", "action"=>"reshTerminal", "controller"=>"main"} +Completed in 0.11000 (9 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshTerminal.js?script=help&token=648d1c] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:05:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:05:52) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:07:11) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] + + +Processing MainController#reshHelp (for 127.0.0.1 at 2008-05-11 20:07:29) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"lookup"=>"refreshWindow", "action"=>"reshHelp", "controller"=>"main"} +Rendering main/reshHelp +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/reshHelp?lookup=refreshWindow] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 20:36:26) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"name"=>"persistent", "app"=>"ensei", "part"=>"sendSector", "format"=>"json", "token"=>"648d1c", "action"=>"client", "value"=>"[[\"/main/clock\", \"Clock\", \"827px\", \"15px\", false], [\"/main/menu\", \"Menu\", \"827px\", \"67px\", false]]", "controller"=>"dfs"} + User Load (0.063000) SELECT * FROM users WHERE (users."name" = 'test') LIMIT 1 + User Update (0.000000) UPDATE users SET "data" = 'BAh7BiIKZW5zZWl7BiIPcGVyc2lzdGVudFsHWwoiEC9tYWluL2Nsb2NrIgpD +bG9jayIKODI3cHgiCTE1cHhGWwoiDy9tYWluL21lbnUiCU1lbnUiCjgyN3B4 +Igk2N3B4Rg== +', "created_at" = '2008-05-03 20:36:39', "name" = 'test', "pass" = 'n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= +', "updated_at" = '2008-05-11 20:36:28' WHERE "id" = 1 +Completed in 0.78100 (1 reqs/sec) | Rendering: 0.01600 (2%) | DB: 0.06300 (8%) | 200 OK [http://localhost/DFS/client.json?part=sendSector&token=648d1c&name=persistent&value=%5B%5B%22%2Fmain%2Fclock%22%2C%20%22Clock%22%2C%20%22827px%22%2C%20%2215px%22%2C%20false%5D%2C%20%5B%22%2Fmain%2Fmenu%22%2C%20%22Menu%22%2C%20%22827px%22%2C%20%2267px%22%2C%20false%5D%5D&app=ensei] + + +Processing DfsController#client (for 127.0.0.1 at 2008-05-11 20:36:28) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"part"=>"logout", "format"=>"json", "token"=>"648d1c", "action"=>"client", "controller"=>"dfs"} +Completed in 0.04700 (21 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/DFS/client.json?part=logout&token=648d1c] + + +Processing MainController#index (for 127.0.0.1 at 2008-05-11 20:36:29) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.34400 (2 reqs/sec) | Rendering: 0.31200 (90%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?theme=red] diff --git a/public/javascripts/ensei.js b/public/javascripts/ensei.js index f7637ad..42ef951 100644 --- a/public/javascripts/ensei.js +++ b/public/javascripts/ensei.js @@ -1,132 +1,132 @@ // Ensei window framework document.windows = new Hash({}); function openService(uri, title) { var wid; var successFunc = function(t) { wid = newWindow(title, uri); setContent(wid, t.responseText); }; new Ajax.Request(uri, {method:'get', onSuccess:successFunc, asynchronous:false}); return wid; } function newWindow(title, refreshURI) { var wid = Math.round((Math.random() * 1000000000)); new Insertion.Bottom('desktop', "<div onmouseover='focusWindow("+wid+");' onmouseout='unFocusWindow("+wid+");' class='window' id='window" + wid + "'><span ondblclick='Effect.toggle(\"content"+wid+"\", \"blind\");' class='titlebar' id='title" + wid + "'>" + title + "</span><span class='refreshButton' onclick='refreshWindow("+wid+", \""+refreshURI+"\")'>R</span><span class='renameButton' onclick='setTitle("+wid+", prompt(\"rename to?\"))'>T</span><span class='closeButton' onclick='closeWindow(" + wid + ")'>X</span><div class='content' id='content" + wid + "'></div></div>"); new Draggable('window' + wid, {handle:'title'+wid}); document.windows.set(''+wid+'', [refreshURI, title]); return wid; } function refreshWindow(wid, refreshURI) { var successFunc = function(t) { setContent(wid, t.responseText); }; new Ajax.Request(refreshURI, {method:'get', onSuccess:successFunc}); } function setContent(wid, content) { Element.update("content"+ wid, content); } function getContent(wid) { return document.getElementById(""+wid+"").innerHTML; } function closeWindow(wid) { Element.remove('window' + wid); document.windows.unset(''+wid+''); } function setTitle(wid, title) { Element.update("title"+ wid, title); var x = document.windows.get(''+wid+''); x[1] = title; document.windows.set(''+wid+'', x); } function getIFrameDocument(id) { var oIFrame = document.getElementById(id); var oDoc = oIFrame.contentWindow || oIFrame.contentDocument; if(oDoc.document) { oDoc = oDoc.document }; return oDoc; } function moveWindow(id, x, y) { var oWindow = document.getElementById("window" + id); oWindow.style.left = x; oWindow.style.top = y; return id; } function fetchWins() { var windows = new Array(); document.windows.keys().each(function(k){ var v = document.windows.get(k); var isShaded = ($('content' + k).style.display == 'none'); windows = windows.concat([v.concat(document.getElementById('window' + k).style.left, document.getElementById('window' + k).style.top, isShaded)]); }); return windows; } function setShade(id, val) { if(val) { $("content" + id).style.display = 'none'; } else { $("content" + id).style.display = 'block'; } } function persistentWindowsSave() { DFS.app("ensei").sendSector("persistent", fetchWins()); } function persistentWindowsLoad() { var x = DFS.app("ensei").getSector("persistent"); if(x) { x.each(function(i) { if(i) setShade(moveWindow(openService(i[0], i[1]), i[2], i[3]), i[4]); }); } } function processLogin() { $('loginButton').innerHTML = "Logging in..."; if (DFS.login("/DFS/client.json", $('username').value, $('password').value) == true) { $('loginPart').remove(); $('desktopPart').style.display = 'inline'; persistentWindowsLoad(); } else { $('loginButton').innerHTML = "Try again"; $('password').value = ""; } } function processSignup() { $('signupButton').innerHTML = "Signing up..."; if (DFS.signup("/DFS/client.json", $('username').value, $('password').value) == true) { processLogin(); } else { $('signupButton').innerHTML = "Try a different username"; } } function logout() { persistentWindowsSave(); DFS.logout(); window.location.reload(true); } function focusWindow(wid) { $('window' + wid).style.zIndex = 1; } function unFocusWindow(wid) { $('window' + wid).style.zIndex = 0; } function reshTransport(server, script) { var retItem; - var request = new Ajax.Request(server, {asynchronous:false, method:'get',parameters:{script:script}, onSuccess:function(t) { + var request = new Ajax.Request(server, {asynchronous:false, method:'get',parameters:{script:script,token:DFS.token}, onSuccess:function(t) { retItem = t.headerJSON; }}); return retItem; } \ No newline at end of file
devyn/ensei
a8890a89aae0578683c9f2adce48197f657eaa03
Ensei skinning update.
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index ab19c10..242804d 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,17 +1,17 @@ <html> <head> <title>Ensei Webtop</title> - <%= stylesheet_link_tag 'main' %> + <%= stylesheet_link_tag (params['theme'] or "main") %> <%= javascript_include_tag :all %> </head> <body> <div id="desktop"></div> <div id="footbar" onmouseover='getElementById("footbar").style.opacity = 1.0' onmouseout='getElementById("footbar").style.opacity = 0.6'><span> <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> </span></div> <% if params['plink'] script = Base64.decode64(params['plink']) %> <script><%= script %></script> <% end %> </body> </html> \ No newline at end of file diff --git a/log/development.log b/log/development.log index 191dbed..05a6149 100644 --- a/log/development.log +++ b/log/development.log @@ -8948,512 +8948,631 @@ Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0 Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:46:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:55:00) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index ERROR: compiling _run_erb_47app47views47main47index46html46erb RAISED compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^ Function body: def _run_erb_47app47views47main47index46html46erb(local_assigns) _erbout = ''; _erbout.concat "<html>\n" _erbout.concat " <head>\n" _erbout.concat " <title>Ensei Webtop</title>\n" _erbout.concat "\t"; _erbout.concat(( stylesheet_link_tag 'main' ).to_s); _erbout.concat "\n" _erbout.concat "\t"; _erbout.concat(( javascript_include_tag :all ).to_s); _erbout.concat "\n" _erbout.concat " </head>\n" _erbout.concat " <body>\n" _erbout.concat " <div id=\"desktop\"></div>\n" _erbout.concat " <div id=\"footbar\" onmouseover='getElementById(\"footbar\").style.opacity = 1.0' onmouseout='getElementById(\"footbar\").style.opacity = 0.6'><span>\n" _erbout.concat "\t <input id=\"footbar_url\" value=\"http://\" /> <a href='#' onclick='openService(document.getElementById(\"footbar_url\").value, \"window\");document.getElementById(\"footbar_url\").value = \"http://\"'>"; _erbout.concat(( image_tag 'plus.gif' ).to_s); _erbout.concat "</a> <a href='#' onclick='openService(\""; _erbout.concat(( url_for :action => "menu" ).to_s); _erbout.concat "\", \"Menu\")'>"; _erbout.concat(( image_tag 'menu.gif' ).to_s); _erbout.concat "</a>\n" _erbout.concat "\t</span></div>\n" _erbout.concat "\t"; if params['plink'] script = Base64.decode64(params['plink') ; _erbout.concat "\n" _erbout.concat "\t <script>"; _erbout.concat(( script ).to_s); _erbout.concat "</script>\n" _erbout.concat "\t"; end ; _erbout.concat "\n" _erbout.concat " </body>\n" _erbout.concat "</html>"; _erbout end Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 ActionView::TemplateError (compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^) on line #13 of main/index.html.erb: 10: <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> 11: </span></div> 12: <% if params['plink'] 13: script = Base64.decode64(params['plink') %> 14: <script><%= script %></script> 15: <% end %> 16: </body> app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:55) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:06:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:07:04) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:24:43) [GET] Session ID: 230412b6f82ad6c84d985ba826ba1ae7 Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:24:46) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:26:16) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:26:19) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#help (for 127.0.0.1 at 2008-04-13 09:26:32) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#terminal (for 127.0.0.1 at 2008-04-13 09:27:00) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:32:32) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:13) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:15) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:37:59) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:38:02) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-13 11:17:39) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 11:17:42) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.18700 (5 reqs/sec) | Rendering: 0.18700 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 13:49:07) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 13:49:12) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01600 (51%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 13:49:12) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01600 (51%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 13:49:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.11000 (9 reqs/sec) | Rendering: 0.01600 (14%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 13:49:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 13:49:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 13:49:59) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 14:55:11) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 14:55:53) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 15:15:18) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01600 (51%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 15:15:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 15:15:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 15:16:38) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"theme"=>"red", "plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=&theme=red] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 15:16:39) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 15:16:39) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 15:16:45) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-13 15:16:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] diff --git a/public/images/background_red.gif b/public/images/background_red.gif new file mode 100644 index 0000000..2814b92 Binary files /dev/null and b/public/images/background_red.gif differ diff --git a/public/stylesheets/red.css b/public/stylesheets/red.css new file mode 100644 index 0000000..89f7526 --- /dev/null +++ b/public/stylesheets/red.css @@ -0,0 +1,89 @@ +body { + background-image: url(/images/background_red.gif); + background-color: darkred; + color: white; + font-family: Verdana; +} + +a, a:visited { + color: red; +} + +a:hover { + color: orange; +} + +/* thanks to wiki.script.aculo.us/stylesheets/script.aculo.us.css for this */ +#footbar { + position: fixed; + border-top: 2px solid black; + border-bottom: 10px solid red; + background-color: red; + width: 100%; + left: 0px; + bottom: 0px; + text-align:left; + color: pink; + font-size: 10px; + z-index: 10000; + opacity: 0.6; + height: 20px; + padding-left: 10px; +} + +#footbar a img { + border: none; + vertical-align: bottom; +} + +#footbar input { + width: 300px; +} + +.window { + position: absolute; +} + +.window .titlebar { + background-color: yellow; + color: black; + font-size: 14pt; + padding-right: 10px; + padding-left: 10px; + border-left: 2px solid black; + border-top: 2px solid black; +} + +.window .refreshButton { + background-color: green; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; +} + +.window .closeButton { + background-color: red; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; + border-right: 2px solid black; +} + +.window .renameButton { + background-color: blue; + padding-left: 5px; + padding-right: 5px; + font-size: 14pt; + border-top: 2px solid black; +} + +.window .content { + background-color: white; + color: black; + padding-left: 10px; + padding-right: 10px; + max-width: 400px; + border: 2px solid black; +} \ No newline at end of file diff --git a/term.rb b/term.rb new file mode 100644 index 0000000..7951fad --- /dev/null +++ b/term.rb @@ -0,0 +1,15 @@ +# Ensei terminal language parser + +def termEval(str) + str. + gsub(/\n/, ";\n"). + gsub(/open ?\[[^\[\]]\]/) {|s| s.sub(/^open ?\[/, "openService(").sub(/\]$/, ")") }. + gsub(/new ?\[[^\[\]]\]/) {|s| s.sub(/^new ?\[/, "newWindow(").sub(/\]$/, ")") }. + gsub(/refresh ?\[[^\[\]]\]/) {|s| s.sub(/^refresh ?\[/, "refreshWindow(").sub(/\]$/, ")") }. + gsub(/move ?\[[^\[\]]\]/) {|s| s.sub(/^move ?\[/, "moveWindow(").sub(/\]$/, ")") }. + gsub(/set ?\[[^\[\]]\]/) {|s| s.sub(/^set ?\[/, "setContent(").sub(/\]$/, ")") }. + gsub(/get ?\[[^\[\]]\]/) {|s| s.sub(/^get ?\[/, "getContent(").sub(/\]$/, ")") }. + gsub(/set ?\[[^\[\]]\]/) {|s| s.sub(/^set ?\[/, "setContent(").sub(/\]$/, ")") }. + gsub(/title ?\[[^\[\]]\]/) {|s| s.sub(/^title ?\[/, "setTitle(").sub(/\]$/, ")") }. + gsub(/close ?\[[^\[\]]\]/) {|s| s.sub(/^close ?\[/, "closeWindow(").sub(/\]$/, ")") } +end \ No newline at end of file
devyn/ensei
15c8ed2acfc48a981b9a37ee5ae625aa3591de28
scrapped Slang
diff --git a/log/development.log b/log/development.log index 6d96c18..191dbed 100644 --- a/log/development.log +++ b/log/development.log @@ -8849,512 +8849,611 @@ Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0% Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:21:19) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:21:23) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:21:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:22:55) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:26:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:14) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:23) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:35:32) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:35:35) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:40:08) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:44:30) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:46:18) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:46:20) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:46:38) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:46:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:55:00) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index ERROR: compiling _run_erb_47app47views47main47index46html46erb RAISED compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^ Function body: def _run_erb_47app47views47main47index46html46erb(local_assigns) _erbout = ''; _erbout.concat "<html>\n" _erbout.concat " <head>\n" _erbout.concat " <title>Ensei Webtop</title>\n" _erbout.concat "\t"; _erbout.concat(( stylesheet_link_tag 'main' ).to_s); _erbout.concat "\n" _erbout.concat "\t"; _erbout.concat(( javascript_include_tag :all ).to_s); _erbout.concat "\n" _erbout.concat " </head>\n" _erbout.concat " <body>\n" _erbout.concat " <div id=\"desktop\"></div>\n" _erbout.concat " <div id=\"footbar\" onmouseover='getElementById(\"footbar\").style.opacity = 1.0' onmouseout='getElementById(\"footbar\").style.opacity = 0.6'><span>\n" _erbout.concat "\t <input id=\"footbar_url\" value=\"http://\" /> <a href='#' onclick='openService(document.getElementById(\"footbar_url\").value, \"window\");document.getElementById(\"footbar_url\").value = \"http://\"'>"; _erbout.concat(( image_tag 'plus.gif' ).to_s); _erbout.concat "</a> <a href='#' onclick='openService(\""; _erbout.concat(( url_for :action => "menu" ).to_s); _erbout.concat "\", \"Menu\")'>"; _erbout.concat(( image_tag 'menu.gif' ).to_s); _erbout.concat "</a>\n" _erbout.concat "\t</span></div>\n" _erbout.concat "\t"; if params['plink'] script = Base64.decode64(params['plink') ; _erbout.concat "\n" _erbout.concat "\t <script>"; _erbout.concat(( script ).to_s); _erbout.concat "</script>\n" _erbout.concat "\t"; end ; _erbout.concat "\n" _erbout.concat " </body>\n" _erbout.concat "</html>"; _erbout end Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 ActionView::TemplateError (compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^) on line #13 of main/index.html.erb: 10: <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> 11: </span></div> 12: <% if params['plink'] 13: script = Base64.decode64(params['plink') %> 14: <script><%= script %></script> 15: <% end %> 16: </body> app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:55) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:06:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:07:04) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:24:43) [GET] Session ID: 230412b6f82ad6c84d985ba826ba1ae7 Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:24:46) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:26:16) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {} ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:26:19) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#help (for 127.0.0.1 at 2008-04-13 09:26:32) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#terminal (for 127.0.0.1 at 2008-04-13 09:27:00) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:32:32) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:13) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:15) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:37:59) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:38:02) [GET] Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 11:17:39) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 11:17:42) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.18700 (5 reqs/sec) | Rendering: 0.18700 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 11:17:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + /script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found)
devyn/ensei
1dc9d82a67f5828fa20f88da040d2c1338d0d265
ensei log update, slang first revision.
diff --git a/log/development.log b/log/development.log index dfd8d9e..6d96c18 100644 --- a/log/development.log +++ b/log/development.log @@ -8666,512 +8666,695 @@ Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:09) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:30) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:59) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:57:58) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:00:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:03:38) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:04:48) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 19:28:01) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 19:28:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:28:08) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:28:22) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:54:17) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:57:26) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.06300 (15 reqs/sec) | Rendering: 0.01600 (25%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:58:42) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:58:42) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:10:08) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:10:13) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:10:15) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:15:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:15:26) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:16:38) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:50) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:52) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:17:17) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:17:26) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:21:19) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:21:23) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:21:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:22:55) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:26:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:14) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:23) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:35:32) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:35:35) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:40:08) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:44:30) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:46:18) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:46:20) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:46:38) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:46:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"terminal", "controller"=>"main"} Rendering main/terminal Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:55:00) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index ERROR: compiling _run_erb_47app47views47main47index46html46erb RAISED compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^ Function body: def _run_erb_47app47views47main47index46html46erb(local_assigns) _erbout = ''; _erbout.concat "<html>\n" _erbout.concat " <head>\n" _erbout.concat " <title>Ensei Webtop</title>\n" _erbout.concat "\t"; _erbout.concat(( stylesheet_link_tag 'main' ).to_s); _erbout.concat "\n" _erbout.concat "\t"; _erbout.concat(( javascript_include_tag :all ).to_s); _erbout.concat "\n" _erbout.concat " </head>\n" _erbout.concat " <body>\n" _erbout.concat " <div id=\"desktop\"></div>\n" _erbout.concat " <div id=\"footbar\" onmouseover='getElementById(\"footbar\").style.opacity = 1.0' onmouseout='getElementById(\"footbar\").style.opacity = 0.6'><span>\n" _erbout.concat "\t <input id=\"footbar_url\" value=\"http://\" /> <a href='#' onclick='openService(document.getElementById(\"footbar_url\").value, \"window\");document.getElementById(\"footbar_url\").value = \"http://\"'>"; _erbout.concat(( image_tag 'plus.gif' ).to_s); _erbout.concat "</a> <a href='#' onclick='openService(\""; _erbout.concat(( url_for :action => "menu" ).to_s); _erbout.concat "\", \"Menu\")'>"; _erbout.concat(( image_tag 'menu.gif' ).to_s); _erbout.concat "</a>\n" _erbout.concat "\t</span></div>\n" _erbout.concat "\t"; if params['plink'] script = Base64.decode64(params['plink') ; _erbout.concat "\n" _erbout.concat "\t <script>"; _erbout.concat(( script ).to_s); _erbout.concat "</script>\n" _erbout.concat "\t"; end ; _erbout.concat "\n" _erbout.concat " </body>\n" _erbout.concat "</html>"; _erbout end Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 ActionView::TemplateError (compile error C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' script = Base64.decode64(params['plink') ; _erbout.concat "\n" ^) on line #13 of main/index.html.erb: 10: <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> 11: </span></div> 12: <% if params['plink'] 13: script = Base64.decode64(params['plink') %> 14: <script><%= script %></script> 15: <% end %> 16: </body> app/views/main/index.html.erb:18:in `compile_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:55) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:06:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:07:04) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:24:43) [GET] + Session ID: 230412b6f82ad6c84d985ba826ba1ae7 + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:24:46) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-13 09:26:16) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:26:19) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:26:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-13 09:26:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-13 09:27:00) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-13 09:32:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:32:33) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:13) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-13 09:36:15) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:37:59) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-13 09:38:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock]
devyn/ensei
6b1c64802d6366b155eace0bd71eb80942524c1c
Ensei terminal and permanent links (plinks) are working now. To create a plink: Base64.encode64(javascript_code).gsub("\n", ""); then go to /?plink=whatever_the_result_of_that_was
diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index c4c26f6..e21aaa1 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,11 +1,12 @@ class MainController < ApplicationController def index;end # sample Ensei windows def rssLoader require 'rss/2.0' @feed = RSS::Parser.parse(Net::HTTP.get(URI.parse(params['uri']))) end def clock; end def help; end def menu; end + def terminal; end end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 1e31f23..ab19c10 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,13 +1,17 @@ <html> <head> <title>Ensei Webtop</title> <%= stylesheet_link_tag 'main' %> <%= javascript_include_tag :all %> </head> <body> <div id="desktop"></div> <div id="footbar" onmouseover='getElementById("footbar").style.opacity = 1.0' onmouseout='getElementById("footbar").style.opacity = 0.6'><span> <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> </span></div> + <% if params['plink'] + script = Base64.decode64(params['plink']) %> + <script><%= script %></script> + <% end %> </body> </html> \ No newline at end of file diff --git a/app/views/main/menu.html.erb b/app/views/main/menu.html.erb index b234586..4bb11b9 100644 --- a/app/views/main/menu.html.erb +++ b/app/views/main/menu.html.erb @@ -1,4 +1,5 @@ <!-- the menu starts here --> <a href='#' onclick='openService("<%= url_for :action => :clock %>", "Clock")'>Clock</a><br/> <a href='#' onclick='openService("<%= url_for :action => :help %>", "Help")'>Help</a><br/> +<a href='#' onclick='openService("<%= url_for :action => :terminal %>", "Terminal")'>Terminal</a><br/> <!-- end menu --><br/> \ No newline at end of file diff --git a/app/views/main/terminal.html.erb b/app/views/main/terminal.html.erb new file mode 100644 index 0000000..c65bc07 --- /dev/null +++ b/app/views/main/terminal.html.erb @@ -0,0 +1,3 @@ +<textarea style="width:400px;height:200px;background-color:black;font-family:monospace;color:white;" id="jsConsole"></textarea><br/><br/> +<input style="width:300px" id="jsConsoleInput"/>&nbsp;&nbsp;&nbsp; +<a href='#' onclick='document.getElementById("jsConsole").value += ">> " + document.getElementById("jsConsoleInput").value + "\n=> " + Object.inspect(eval(document.getElementById("jsConsoleInput").value)) + "\n"; document.getElementById("jsConsoleInput").value = "";'>evaluate</a><br/><br/> \ No newline at end of file diff --git a/log/development.log b/log/development.log index 6ad130e..dfd8d9e 100644 --- a/log/development.log +++ b/log/development.log @@ -8021,512 +8021,1157 @@ Errno::ECONNREFUSED (No connection could be made because the target machine acti c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) Processing MainController#index (for 127.0.0.1 at 2008-04-12 14:42:22) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 14:42:33) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://linuxdevil.wordpress.com/feed", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 2.06200 (0 reqs/sec) | Rendering: 0.01500 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://linuxdevil.wordpress.com/feed] Processing MainController#index (for 127.0.0.1 at 2008-04-12 14:43:49) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 14:43:52) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://linuxdevil.wordpress.com/feed", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 0.67200 (1 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://linuxdevil.wordpress.com/feed] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 14:45:29) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://linuxdevil.wordpress.com/feed", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 0.96900 (1 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://linuxdevil.wordpress.com/feed] Processing MainController#index (for 127.0.0.1 at 2008-04-12 14:47:58) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-04-12 14:49:44) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 14:50:33) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://linuxdevil.wordpress.com/feed", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 0.84400 (1 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://linuxdevil.wordpress.com/feed] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 14:54:13) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 14:56:36) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://devyn.tumblr.com/rss", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 0.32800 (3 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://devyn.tumblr.com/rss] Processing MainController#index (for 127.0.0.1 at 2008-04-12 14:59:29) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing ApplicationController#index (for 127.0.0.1 at 2008-04-12 14:59:40) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {} ActionController::RoutingError (No route matches "/clock" with {:method=>:get}): c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) Processing MainController#clock (for 127.0.0.1 at 2008-04-12 14:59:51) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:00:48) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01600 (51%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 15:01:03) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01600 (51%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:01:06) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:02:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 15:02:09) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:02:18) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 15:02:21) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 15:34:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.14000 (7 reqs/sec) | Rendering: 0.01500 (10%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:47:22) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.56300 (1 reqs/sec) | Rendering: 0.12500 (22%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:47:37) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:47:49) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:47:54) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:48:16) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:48:29) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:51:14) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:51:28) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 15:52:05) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:52:14) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 15:52:41) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#help (for 127.0.0.1 at 2008-04-12 16:03:57) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 16:05:02) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#rssLoader (for 127.0.0.1 at 2008-04-12 16:06:02) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"uri"=>"http://linuxdevil.wordpress.com/feed", "action"=>"rssLoader", "controller"=>"main"} Rendering main/rssLoader Completed in 1.15600 (0 reqs/sec) | Rendering: 0.01600 (1%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/rssLoader?uri=http://linuxdevil.wordpress.com/feed] Processing MainController#index (for 127.0.0.1 at 2008-04-12 16:33:16) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 16:33:19) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 16:33:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 16:34:19) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 16:34:23) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 16:34:24) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 16:34:29) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 16:36:40) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 16:36:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#help (for 127.0.0.1 at 2008-04-12 16:36:45) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 16:38:10) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 16:41:54) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#index (for 127.0.0.1 at 2008-04-12 17:36:03) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.25000 (4 reqs/sec) | Rendering: 0.14000 (56%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 17:36:09) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 17:36:33) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.03200 (31 reqs/sec) | Rendering: 0.01600 (50%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 17:36:43) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 17:44:20) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.04600 (21 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 17:44:25) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 17:44:39) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 17:45:29) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 17:46:17) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 17:47:32) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#index (for 127.0.0.1 at 2008-04-12 17:48:08) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"index", "controller"=>"main"} Rendering main/index Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] Processing MainController#menu (for 127.0.0.1 at 2008-04-12 17:48:11) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"menu", "controller"=>"main"} Rendering main/menu Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 17:48:15) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] Processing MainController#help (for 127.0.0.1 at 2008-04-12 17:48:35) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"help", "controller"=>"main"} Rendering main/help Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] Processing MainController#clock (for 127.0.0.1 at 2008-04-12 18:02:16) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca Parameters: {"action"=>"clock", "controller"=>"main"} Rendering main/clock Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 18:10:33) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 18:11:29) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.07900 (12 reqs/sec) | Rendering: 0.07900 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 18:31:33) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 18:31:36) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:31:40) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 18:33:54) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 18:33:56) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:33:57) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:34:43) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 18:50:49) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 18:50:52) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:50:55) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:51:07) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:52:48) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:52:58) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:53:26) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:53:34) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:53:44) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:53:49) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:09) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:30) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:54:59) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 18:57:58) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:00:43) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:03:38) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:04:48) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 19:28:01) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 19:28:05) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:28:08) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 19:28:22) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:54:17) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:57:26) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.06300 (15 reqs/sec) | Rendering: 0.01600 (25%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:58:42) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 19:58:42) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:10:08) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:10:13) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:10:15) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:15:24) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:15:26) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:16:38) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:43) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:50) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:16:52) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:17:17) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:17:26) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:21:19) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:21:23) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:21:45) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:22:55) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:26:43) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:14) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:35:23) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:35:32) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:35:35) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:40:08) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 20:44:30) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 20:46:18) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 20:46:20) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:46:38) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#terminal (for 127.0.0.1 at 2008-04-12 20:46:46) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"terminal", "controller"=>"main"} +Rendering main/terminal +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/terminal] + + +Processing MainController#help (for 127.0.0.1 at 2008-04-12 20:55:00) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"help", "controller"=>"main"} +Rendering main/help +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/help] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:24) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +ERROR: compiling _run_erb_47app47views47main47index46html46erb RAISED compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' + script = Base64.decode64(params['plink') ; _erbout.concat "\n" + ^ +Function body: def _run_erb_47app47views47main47index46html46erb(local_assigns) +_erbout = ''; _erbout.concat "<html>\n" +_erbout.concat " <head>\n" +_erbout.concat " <title>Ensei Webtop</title>\n" +_erbout.concat "\t"; _erbout.concat(( stylesheet_link_tag 'main' ).to_s); _erbout.concat "\n" +_erbout.concat "\t"; _erbout.concat(( javascript_include_tag :all ).to_s); _erbout.concat "\n" +_erbout.concat " </head>\n" +_erbout.concat " <body>\n" +_erbout.concat " <div id=\"desktop\"></div>\n" +_erbout.concat " <div id=\"footbar\" onmouseover='getElementById(\"footbar\").style.opacity = 1.0' onmouseout='getElementById(\"footbar\").style.opacity = 0.6'><span>\n" +_erbout.concat "\t <input id=\"footbar_url\" value=\"http://\" /> <a href='#' onclick='openService(document.getElementById(\"footbar_url\").value, \"window\");document.getElementById(\"footbar_url\").value = \"http://\"'>"; _erbout.concat(( image_tag 'plus.gif' ).to_s); _erbout.concat "</a> <a href='#' onclick='openService(\""; _erbout.concat(( url_for :action => "menu" ).to_s); _erbout.concat "\", \"Menu\")'>"; _erbout.concat(( image_tag 'menu.gif' ).to_s); _erbout.concat "</a>\n" +_erbout.concat "\t</span></div>\n" +_erbout.concat "\t"; if params['plink'] + script = Base64.decode64(params['plink') ; _erbout.concat "\n" +_erbout.concat "\t <script>"; _erbout.concat(( script ).to_s); _erbout.concat "</script>\n" +_erbout.concat "\t"; end ; _erbout.concat "\n" +_erbout.concat " </body>\n" +_erbout.concat "</html>"; _erbout +end +Backtrace: C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:18:in `compile_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' +c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' +c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' +c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' +c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' +c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' +c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' +c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' +c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' +c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' +c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' +script/server:3 + + +ActionView::TemplateError (compile error +C:/Documents and Settings/Compaq_Owner/My Documents/DCWareProjects/Ensei/app/views/main/index.html.erb:13: syntax error, unexpected ')', expecting ']' + script = Base64.decode64(params['plink') ; _erbout.concat "\n" + ^) on line #13 of main/index.html.erb: +10: <input id="footbar_url" value="http://" /> <a href='#' onclick='openService(document.getElementById("footbar_url").value, "window");document.getElementById("footbar_url").value = "http://"'><%= image_tag 'plus.gif' %></a> <a href='#' onclick='openService("<%= url_for :action => "menu" %>", "Menu")'><%= image_tag 'menu.gif' %></a> +11: </span></div> +12: <% if params['plink'] +13: script = Base64.decode64(params['plink') %> +14: <script><%= script %></script> +15: <% end %> +16: </body> + + app/views/main/index.html.erb:18:in `compile_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:630:in `compile_and_render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render_template' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render_for_file' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:836:in `render_with_no_layout' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:270:in `render_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1153:in `default_render' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1159:in `perform_action_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `sass_old_process' + c:/ruby/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/sass/plugin/rails.rb:19:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (internal_server_error) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:05:55) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:05:56) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:06:45) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:06:46) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 21:07:04) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"plink"=>"dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=", "action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/?plink=dmFyIHdpZD1uZXdXaW5kb3coJ0Nsb2NrJywgJy9tYWluL2Nsb2NrJyk7cmVmcmVzaFdpbmRvdyh3aWQsICcvbWFpbi9jbG9jaycpO21vdmVXaW5kb3cod2lkLCA4MzAsIDMxKTtkZWxldGUgd2lkO3ZhciB3aWQ9bmV3V2luZG93KCdNZW51JywgJy9tYWluL21lbnUnKTtyZWZyZXNoV2luZG93KHdpZCwgJy9tYWluL21lbnUnKTttb3ZlV2luZG93KHdpZCwgODMwLCA4Myk7ZGVsZXRlIHdpZDs=] + + +Processing MainController#menu (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"menu", "controller"=>"main"} +Rendering main/menu +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/menu] + + +Processing MainController#clock (for 127.0.0.1 at 2008-04-12 21:07:05) [GET] + Session ID: BAh7BzoMY3NyZl9pZCIlYTJhYTdlODQ1NTBiY2VjMjVjNjQxMDY4ODFmZTkx%0AZmYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--8dba508932dd195085807acf0c427e22c1d1b0ca + Parameters: {"action"=>"clock", "controller"=>"main"} +Rendering main/clock +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/main/clock] diff --git a/public/javascripts/windowFramework.js b/public/javascripts/windowFramework.js index 884efa4..6d81f5f 100644 --- a/public/javascripts/windowFramework.js +++ b/public/javascripts/windowFramework.js @@ -1,35 +1,48 @@ // Ensei window framework function openService(uri, title) { var successFunc = function(t) { var wid = newWindow(title, uri); setContent(wid, t.responseText); }; new Ajax.Request(uri, {method:'get', onSuccess:successFunc}) } function newWindow(title, refreshURI) { var wid = Math.round((Math.random() * 1000000000)); new Insertion.Top('desktop', "<div class='window' id='window" + wid + "'><span class='titlebar' id='title" + wid + "'>" + title + "</span><span class='refreshButton' onclick='refreshWindow("+wid+", \""+refreshURI+"\")'>R</span><span class='renameButton' onclick='setTitle("+wid+", prompt(\"rename to?\"))'>T</span><span class='closeButton' onclick='closeWindow(" + wid + ")'>X</span><div class='content' id='content" + wid + "'></div></div>"); new Draggable('window' + wid, {handle:'title'+wid}); return wid; } function refreshWindow(wid, refreshURI) { var successFunc = function(t) { setContent(wid, t.responseText); }; new Ajax.Request(refreshURI, {method:'get', onSuccess:successFunc}); } function setContent(wid, content) { Element.update("content"+ wid, content); } function getContent(wid) { return document.getElementById(""+wid+"").innerHTML; } function closeWindow(wid) { Element.remove('window' + wid); } function setTitle(wid, title) { Element.update("title"+ wid, title); } + +function getIFrameDocument(id) { + var oIFrame = document.getElementById(id); + var oDoc = oIFrame.contentWindow || oIFrame.contentDocument; + if(oDoc.document) { oDoc = oDoc.document }; + return oDoc; +} + +function moveWindow(id, x, y) { + var oWindow = document.getElementById("window" + id); + oWindow.style.left = x; + oWindow.style.top = y; +} \ No newline at end of file
devyn/ensei
852804a217f9dda81d5f0e09d5b78412003e9758
Ensei update: desktop now works properly, windows move.
diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..00bf104 --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,3 @@ +class MainController < ApplicationController + def index;end +end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb new file mode 100644 index 0000000..826effe --- /dev/null +++ b/app/helpers/main_helper.rb @@ -0,0 +1,2 @@ +module MainHelper +end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb new file mode 100644 index 0000000..f7fe6db --- /dev/null +++ b/app/views/main/index.html.erb @@ -0,0 +1,13 @@ +<html> + <head> + <title>Ensei Webtop</title> + <%= stylesheet_link_tag 'main' %> + <%= javascript_include_tag :all %> + </head> + <body> + <div id="desktop"></div> + <div id="footbar" onmouseover='footbar.style.opacity = 1.0' onmouseout='footbar.style.opacity = 0.6'><span> + <input id="footbar_url" value="http://" /> <a href="javascript:openService(footbar_url.value)"><img width='24' height='24' src="/images/plus.gif"/></a> + </span></div> + </body> +</html> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index d94afa1..e7407a5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,35 +1,35 @@ 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 # Sample of named route: # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # map.resources :products # Sample resource route with options: # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } # Sample resource route with sub-resources: # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller # Sample resource route within a namespace: # map.namespace :admin do |admin| # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) # admin.resources :products # end # You can have the root of your site routed with map.root -- just remember to delete public/index.html. - # map.root :controller => "welcome" + map.root :controller => "main" # See how all your routes lay out with "rake routes" # Install the default routes as the lowest priority. map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end diff --git a/db/development.sqlite3 b/db/development.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/ensei/service.rb b/ensei/service.rb index e76af3e..5811887 100644 --- a/ensei/service.rb +++ b/ensei/service.rb @@ -1,68 +1,71 @@ # Ensei Remote Services require 'rexml/document' -require 'open-uri' require 'cgi' require 'json' require 'skin' module Ensei; end unless defined?(Ensei) # declare Ensei class Ensei::EnseiError < Exception; end unless defined?(Ensei::EnseiError) # this is for Ensei service files class Ensei::Service def initialize(service_uri) @uri = URI.parse(service_uri.class == URI ? service_uri.to_s : service_uri).to_s end def get_format - root = REXML::Document.new(open(@uri).read).root rescue return false + root = REXML::Document.new(Net::HTTP.get(@uri)).root rescue return false return false unless root.name =~ /^enseiServiceFormat$/i root.elements.collect{|x|x.name} end def retrieve(params) params.class >= Hash ? nil : raise 'parameters must be hash' uri = URI.parse(@uri) uri.query = make_query(params) - root = REXML::Document.new(open(uri.to_s).read).root rescue return false + root = REXML::Document.new(Net::HTTP.get(uri.to_s)).root rescue return false return false unless root.name =~ /^enseiService$/i if (o = root.attributes.select{|x, v| x =~ /^enseiError$/i}).size > 0 raise EnseiError, root.attributes[o[0]] end h = {} root.attributes.each do |k, v| h[k] = v end root.elements.each do |e| h[e.name] = e.text end h end - def html(params=nil, formRequestURL=nil, winID=nil) + def html(winID, params=nil) if params retrieved_data = retrieve params - return Ensei::Skin.render(open(retrieved_data['skin']).read, retrieved_data) + if retrieved_data['title'] and winID + return "<script>Element.update('title#{cNum}', \"#{CGI.escapeHTML(retrieved_data['title'])}\"</script> " << Ensei::Skin.render(Net::HTTP.get(retrieved_data['skin']), retrieved_data) + else + return Ensei::Skin.render(Net::HTTP.get(retrieved_data['skin']), retrieved_data) + end elsif formRequestURL and winID fields = get_format cNum = winID - script = "function x#{cNum}_update() { Element.update('#{cNum}', new Ajax.Request('#{formRequestURL}', {method:'post', postBody:{" + script = "function x#{cNum}_update() { Element.update('#{cNum}', new Ajax.Request('#{@uri}', {parameters:{" str = "<form>" fields.each_with_index do |fi, ind| script << "#{fi}: document.evaluate('//input[id='#{cNum}_#{fi}']', document, null, XPathResult.ANY_TYPE, null).iterateNext().value#{"," unless ind == (fields.size - 1)} " str << "#{CGI.escapeHTML(fi)}: <input id='#{cNum}_#{fi}'/><br/>" end script << "}}).responseText); }" form << "<a href='javascript:x#{cNum}_update()'>load window</a></form>" return "<script>#{script}</script>#{form}" else raise ArgumentError, "Must provide parameters or formRequestURL." end end private; def make_query(h) str = "" h.each_with_index do |x,i| key, value = x str << CGI.escape(key.to_s) << "=" << CGI.escape(value.to_s) str << "&" unless i == (h.size - 1) end str end end \ No newline at end of file diff --git a/ensei/skin.rb b/ensei/skin.rb index ef62fdf..aaee85f 100644 --- a/ensei/skin.rb +++ b/ensei/skin.rb @@ -1,21 +1,22 @@ # Ensei Service Skin Rendering require 'rexml/document' require 'cgi' module Ensei; end unless defined?(Ensei) # declare Ensei class Ensei::EnseiError < Exception; end unless defined?(Ensei::EnseiError) module Ensei::Skin def self.render(skin, data) skin = REXML::Document.new(skin).root return false unless skin.name =~ /^enseiServiceSkin$/i html = "" skin.elements.each do |e| html << "<span style='" e.attributes.each do |k,v| html << "#{k}:#{v};" end html << "'>#{CGI.escapeHTML(data[e.name] or "")}</span>" end + return html end end \ No newline at end of file diff --git a/log/development.log b/log/development.log index e69de29..606a4a2 100644 --- a/log/development.log +++ b/log/development.log @@ -0,0 +1,2130 @@ + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:16:13) [GET] + Session ID: bdf98378afa4f52c86d375c738bb049b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:16:15) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:16:15) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:16:15) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:17:01) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:17:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:17:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:17:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:17:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:17:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:18:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:18:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:18:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:19:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:19:03) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:19:03) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:19:25) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:19:26) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:19:26) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:20:08) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:09) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:09) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:20:22) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:23) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:23) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:20:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:20:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:21:31) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:21:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:21:32) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:22:40) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:22:41) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:22:41) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:22:57) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:22:58) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:22:58) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:28:56) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:28:57) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:28:57) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:29:18) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:29:19) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:29:19) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:29:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:29:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:29:51) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:30:21) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:30:21) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:30:22) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:30:23) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:30:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:30:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/background_blue.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:38:48) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:38:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:39:12) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:39:13) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:40:49) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:40:50) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:41:17) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:41:18) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:41:46) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.12500 (8 reqs/sec) | Rendering: 0.01600 (12%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:41:47) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:42:03) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:42:04) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:42:09) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:42:10) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:42:19) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01500 (48%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:42:20) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:42:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:42:35) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:42:42) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:42:43) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 19:43:00) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.03100 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing ApplicationController#index (for 127.0.0.1 at 2008-04-11 19:43:01) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {} + + +ActionController::RoutingError (No route matches "/images/plus.gif" with {:method=>:get}): + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' + c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:112:in `handle_dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' + c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' + c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' + c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' + c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' + c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in `dispatch' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/webrick.rb:66 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in' + c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' + c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' + c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' + script/server:3 + +Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found) + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:08:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:09:07) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:10:22) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:10:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:11:02) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:11:45) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:11:55) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:14:24) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:14:59) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:16:14) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.01600 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:17:34) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:17:39) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:17:52) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01500 (66 reqs/sec) | Rendering: 0.01500 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:18:28) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 20:44:07) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.04700 (21 reqs/sec) | Rendering: 0.03100 (65%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 21:16:52) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03200 (31 reqs/sec) | Rendering: 0.03200 (100%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 21:18:28) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-11 21:20:33) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.03100 (32 reqs/sec) | Rendering: 0.01500 (48%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 07:18:58) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.04700 (21 reqs/sec) | Rendering: 0.01600 (34%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] + + +Processing MainController#index (for 127.0.0.1 at 2008-04-12 07:27:58) [GET] + Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--661feace738431f2e9fcc09a270c7c536487a36b + Parameters: {"action"=>"index", "controller"=>"main"} +Rendering main/index +Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.00000 (0%) | 200 OK [http://localhost/] diff --git a/public/images/background_blue.gif b/public/images/background_blue.gif new file mode 100644 index 0000000..8cf7756 Binary files /dev/null and b/public/images/background_blue.gif differ diff --git a/public/images/plus.gif b/public/images/plus.gif new file mode 100644 index 0000000..f6cbebe Binary files /dev/null and b/public/images/plus.gif differ diff --git a/public/javascripts/windowFramework.js b/public/javascripts/windowFramework.js new file mode 100644 index 0000000..afe26a6 --- /dev/null +++ b/public/javascripts/windowFramework.js @@ -0,0 +1,27 @@ + +// Ensei window framework + +function openService(uri) { + wid = newWindow("Loading..."); + setContent(wid, new Ajax.Request(uri).responseText); + return wid; +} + +function newWindow(title) { + wid = Math.round((Math.random() * 1000000000)); + new Insertion.Top('desktop', "<div class='window' id='window" + wid + "'><span class='titlebar' id='title" + wid + "'>" + title + "<span class='closeButton' onclick='closeWindow(" + wid + ")'>X</span></span><div class='content' id='" + wid + "'></div></div>"); + new Draggable('window' + wid, {handle:'title'+wid}); + return wid; +} + +function setContent(wid, content) { + Element.update(""+wid+"", content); +} + +function getContent(wid) { + return document.getElementById(""+wid+"").innerHTML; +} + +function closeWindow(wid) { + Element.remove('window' + wid); +} \ No newline at end of file diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css new file mode 100644 index 0000000..2657898 --- /dev/null +++ b/public/stylesheets/main.css @@ -0,0 +1,54 @@ +body { + background-image: url(/images/background_blue.gif); + background-color: darkblue; + color: white; + font-family: Verdana; +} + +/* thanks to wiki.script.aculo.us/stylesheets/script.aculo.us.css for this */ +#footbar { + position: fixed; + border-top: 2px solid black; + border-bottom: 10px solid lime; + background-color: lime; + width: 100%; + left: 0px; + bottom: 0px; + text-align:left; + color: #aaa; + font-size: 10px; + z-index: 10000; + opacity: 0.6; + height: 20px; + padding-left: 10px; +} + +#footbar a img { + border: none; + vertical-align: bottom; +} + +#footbar input { + width: 300px; +} + +.window { + position: absolute; +} + +.window .titlebar { + background-color: darkgreen; + color: white; + font-size: 14pt; +} + +.window .titlebar .closeButton { + background-color: red; + padding-left: 5px; + padding-right: 5px; +} + +.window .content { + background-color: white; + color: black; +} \ No newline at end of file diff --git a/test/functional/main_controller_test.rb b/test/functional/main_controller_test.rb new file mode 100644 index 0000000..fd5bee7 --- /dev/null +++ b/test/functional/main_controller_test.rb @@ -0,0 +1,8 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class MainControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end
aliceinwire/abr2gbr
291e74cc89eb73385b093de3b54496c5ae7805e2
versione 0.3
diff --git a/abr2gbr-1.0.2/debian/abr2gbr.1 b/abr2gbr-1.0.2/debian/abr2gbr.1 index d029f98..cedca06 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr.1 +++ b/abr2gbr-1.0.2/debian/abr2gbr.1 @@ -1,16 +1,48 @@ -NAME - abr2gbr - -SYNOPSIS - - usage: abr2gbr {file1.abr} ... - -DESCRIPTION - Converts PhotoShop .ABR and Paint Shop Pro .JBR brushes to GIMP .GBR. - ABR files can hold many bushes within a single file and GIMP's GBR format was build only for single brushes. This tool simply extracts each brush and saves it into a separate GBR file. - - Currently abr2gbr can only decode ABR files with format version less or equal to 1, format version 2 is undocumented. - -EXAMPLES - ./abr2gbr brush.abr -SEE ALSO +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH ABR2GBR SECTION "July 25, 2009" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +abr2gbr \- Converts PhotoShop and Paint Shop Pro brushes to GIMP +.SH SYNOPSIS +.B abr2gbr +.RI " files" ... +.br +.B jbr2gbr +.RI " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B abr2gbr +and +.B jbr2gbr +commands. +.PP +.\" TeX users may be more comfortable with the \fB<whatever>\fP and +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBabr2gbr\fP is a program that... +.SH SEE ALSO +.BR abr2gbr (1), +.BR jbr2gbr (1). +.br +The programs are documented fully by +.IR "aliceinwire" , +available via the Info system. +.SH AUTHOR +abr2gbr was written by <Marco Lamberto>. +.PP +This manual page was written by aliceinwire <aliceinwire@gnumerica.org>, +for the Debian project (but may be used by others). diff --git a/abr2gbr-1.0.2/debian/abr2gbr.1.we b/abr2gbr-1.0.2/debian/abr2gbr.1.we new file mode 100644 index 0000000..d029f98 --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr.1.we @@ -0,0 +1,16 @@ +NAME + abr2gbr + +SYNOPSIS + + usage: abr2gbr {file1.abr} ... + +DESCRIPTION + Converts PhotoShop .ABR and Paint Shop Pro .JBR brushes to GIMP .GBR. + ABR files can hold many bushes within a single file and GIMP's GBR format was build only for single brushes. This tool simply extracts each brush and saves it into a separate GBR file. + + Currently abr2gbr can only decode ABR files with format version less or equal to 1, format version 2 is undocumented. + +EXAMPLES + ./abr2gbr brush.abr +SEE ALSO diff --git a/abr2gbr-1.0.2/debian/manpage_1.1.ex~ b/abr2gbr-1.0.2/debian/manpage_1.1.ex~ new file mode 100644 index 0000000..aa5ba07 --- /dev/null +++ b/abr2gbr-1.0.2/debian/manpage_1.1.ex~ @@ -0,0 +1,48 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH ABR2GBR SECTION "July 25, 2009" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +abr2gbr \- program to do something +.SH SYNOPSIS +.B abr2gbr +.RI " files" ... +.br +.B jbr2gbr +.RI " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B abr2gbr +and +.B jbr2gbr +commands. +.PP +.\" TeX users may be more comfortable with the \fB<whatever>\fP and +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBabr2gbr\fP is a program that... +.SH SEE ALSO +.BR abr2gbr (1), +.BR jbr2gbr (1). +.br +The programs are documented fully by +.IR "aliceinwire" , +available via the Info system. +.SH AUTHOR +abr2gbr was written by <Marco Lamberto>. +.PP +This manual page was written by aliceinwire <aliceinwire@gnumerica.org>, +for the Debian project (but may be used by others).
aliceinwire/abr2gbr
737fcfc9da19ef1a0afe067a71caa993971ca62a
versione 0.2
diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control index 2d78d76..517f230 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control @@ -1,11 +1,11 @@ Package: abr2gbr Version: 1.0.2-1 Architecture: i386 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> -Installed-Size: 60 +Installed-Size: 72 Depends: libc6 (>= 2.7-1), libglib1.2ldbl (>= 1.2.10-18) Section: x11 Priority: extra Homepage: http://www.sunnyspot.org/gimp/tools.html Description: Converts PhotoShop brushes to GIMP Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums index df9e91c..cbf9605 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums @@ -1,5 +1,6 @@ +e40ae08e7bcc219501c2bdf1898af326 usr/share/man/man1/abr2gbr.1.gz 055a1c9ab6f2645f030ac20bc75f4a8a usr/share/doc/abr2gbr/TODO baa1bb1a438ca7c0d91de64affbcc27f usr/share/doc/abr2gbr/copyright 28f8de99b1288e665606f5cd367dc895 usr/share/doc/abr2gbr/changelog.Debian.gz 4aa9b0176967f0d3671904a2ed54ce71 usr/bin/abr2gbr 4aa9b0176967f0d3671904a2ed54ce71 usr/sbin/abr2gbr diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/man/man1/abr2gbr.1.gz b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/man/man1/abr2gbr.1.gz new file mode 100644 index 0000000..90c956f Binary files /dev/null and b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/man/man1/abr2gbr.1.gz differ diff --git a/abr2gbr-1.0.2/debian/rules b/abr2gbr-1.0.2/debian/rules index 25c8016..d143bef 100755 --- a/abr2gbr-1.0.2/debian/rules +++ b/abr2gbr-1.0.2/debian/rules @@ -1,94 +1,95 @@ #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) #docbook-to-man debian/abr2gbr.sgml > abr2gbr.1 touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/abr2gbr. $(MAKE) DESTDIR=$(CURDIR)/debian/abr2gbr install cp $(CURDIR)/.obj/abr2gbr $(CURDIR)/debian/abr2gbr/usr/bin/ cp $(CURDIR)/.obj/abr2gbr $(CURDIR)/debian/abr2gbr/usr/sbin/ - + mkdir -p $(CURDIR)/debian/abr2gbr/usr/share/man/man1/ + cp $(CURDIR)/debian/abr2gbr.1 $(CURDIR)/debian/abr2gbr/usr/share/man/man1/ # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/abr2gbr_1.0.2-1.diff.gz b/abr2gbr_1.0.2-1.diff.gz index a29cefb..4ef7800 100644 Binary files a/abr2gbr_1.0.2-1.diff.gz and b/abr2gbr_1.0.2-1.diff.gz differ diff --git a/abr2gbr_1.0.2-1.dsc b/abr2gbr_1.0.2-1.dsc index 8228e43..e99d20d 100644 --- a/abr2gbr_1.0.2-1.dsc +++ b/abr2gbr_1.0.2-1.dsc @@ -1,18 +1,18 @@ Format: 1.0 Source: abr2gbr Binary: abr2gbr Architecture: any Version: 1.0.2-1 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Homepage: http://www.sunnyspot.org/gimp/tools.html Standards-Version: 3.8.0 Build-Depends: debhelper (>= 7), libglib2.0-dev Checksums-Sha1: 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - 019a4d47666d4299221c174a3222ee27d61cfa5e 2160 abr2gbr_1.0.2-1.diff.gz + 1b475af9efb8692b431ddce16ba554a9a6edff7e 2184 abr2gbr_1.0.2-1.diff.gz Checksums-Sha256: cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 0a88599c898b578e2d4e4c4b376d1d09173144fe1f7cd7fab440d6edef710a31 2160 abr2gbr_1.0.2-1.diff.gz + 0fccd8c5b081a978c87815651a28574c6b39c6309c0fdc1e5858a9c74b215869 2184 abr2gbr_1.0.2-1.diff.gz Files: edecc74a3df1ce858ec641de9a098cdf 3525 abr2gbr_1.0.2.orig.tar.gz - 3346c1a99442084a2283ea31ff3244f3 2160 abr2gbr_1.0.2-1.diff.gz + 00fe1363b85f91535a3ad4dc83b95670 2184 abr2gbr_1.0.2-1.diff.gz diff --git a/abr2gbr_1.0.2-1_i386.changes b/abr2gbr_1.0.2-1_i386.changes index 8626a03..5f9e233 100644 --- a/abr2gbr_1.0.2-1_i386.changes +++ b/abr2gbr_1.0.2-1_i386.changes @@ -1,33 +1,33 @@ Format: 1.8 Date: Sat, 25 Jul 2009 19:43:53 +0200 Source: abr2gbr Binary: abr2gbr Architecture: source i386 Version: 1.0.2-1 Distribution: unstable Urgency: low Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> Description: abr2gbr - Converts PhotoShop brushes to GIMP Changes: abr2gbr (1.0.2-1) unstable; urgency=low . * Initial release * my first package * Find nothing in the Makefile to fix $DESTDIR problems. Checksums-Sha1: - 735b919c46e63d752f5d64aec9e00eb86889a0bf 766 abr2gbr_1.0.2-1.dsc + 93945b4a9896c90925ca6dfb8dfc6e234e3d3ccd 766 abr2gbr_1.0.2-1.dsc 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - 019a4d47666d4299221c174a3222ee27d61cfa5e 2160 abr2gbr_1.0.2-1.diff.gz - 40b3b95b8fc150a74708467fe49fb8c3b172e4bb 5664 abr2gbr_1.0.2-1_i386.deb + 1b475af9efb8692b431ddce16ba554a9a6edff7e 2184 abr2gbr_1.0.2-1.diff.gz + de5f8e8377ca186a7edf7d0bb7fa465cd82663aa 6112 abr2gbr_1.0.2-1_i386.deb Checksums-Sha256: - f1b82500bb15532088767e5ce0763a9825d40a6560ccb0e3d79f893a5bd66a4c 766 abr2gbr_1.0.2-1.dsc + 9b485e93328115e552ff3c90d0498abbf07c4105003cd196b622a16c74102efb 766 abr2gbr_1.0.2-1.dsc cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 0a88599c898b578e2d4e4c4b376d1d09173144fe1f7cd7fab440d6edef710a31 2160 abr2gbr_1.0.2-1.diff.gz - 078cf7050d62676ca45ec92e410aad9aa33a3444f964296f8bf05533bf55cb92 5664 abr2gbr_1.0.2-1_i386.deb + 0fccd8c5b081a978c87815651a28574c6b39c6309c0fdc1e5858a9c74b215869 2184 abr2gbr_1.0.2-1.diff.gz + 66a898b59e7c774d98a837e578b2178ec118b3ae5a3b919642cef8bea2f92f90 6112 abr2gbr_1.0.2-1_i386.deb Files: - 7e8a04a9b5736df9e754e09cbeb3a2f7 766 x11 extra abr2gbr_1.0.2-1.dsc + 0f251affe41094dc205acf9a3523eed1 766 x11 extra abr2gbr_1.0.2-1.dsc edecc74a3df1ce858ec641de9a098cdf 3525 x11 extra abr2gbr_1.0.2.orig.tar.gz - 3346c1a99442084a2283ea31ff3244f3 2160 x11 extra abr2gbr_1.0.2-1.diff.gz - cc24f76e6ee81b08fb15206cff86744b 5664 x11 extra abr2gbr_1.0.2-1_i386.deb + 00fe1363b85f91535a3ad4dc83b95670 2184 x11 extra abr2gbr_1.0.2-1.diff.gz + 55fdc799dbb8e4ed3739a750047edfa3 6112 x11 extra abr2gbr_1.0.2-1_i386.deb diff --git a/abr2gbr_1.0.2-1_i386.deb b/abr2gbr_1.0.2-1_i386.deb index 7ac11bb..004cec9 100644 Binary files a/abr2gbr_1.0.2-1_i386.deb and b/abr2gbr_1.0.2-1_i386.deb differ
aliceinwire/abr2gbr
ef38b6bca35f21213fabf6441970856c68ccb2d0
versione 0.1
diff --git a/abr2gbr-1.0.2/debian/abr2gbr.1 b/abr2gbr-1.0.2/debian/abr2gbr.1 new file mode 100644 index 0000000..d029f98 --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr.1 @@ -0,0 +1,16 @@ +NAME + abr2gbr + +SYNOPSIS + + usage: abr2gbr {file1.abr} ... + +DESCRIPTION + Converts PhotoShop .ABR and Paint Shop Pro .JBR brushes to GIMP .GBR. + ABR files can hold many bushes within a single file and GIMP's GBR format was build only for single brushes. This tool simply extracts each brush and saves it into a separate GBR file. + + Currently abr2gbr can only decode ABR files with format version less or equal to 1, format version 2 is undocumented. + +EXAMPLES + ./abr2gbr brush.abr +SEE ALSO diff --git a/abr2gbr-1.0.2/debian/abr2gbr.substvars b/abr2gbr-1.0.2/debian/abr2gbr.substvars new file mode 100644 index 0000000..b7c7f69 --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr.substvars @@ -0,0 +1 @@ +shlibs:Depends=libc6 (>= 2.7-1), libglib1.2ldbl (>= 1.2.10-18) diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control index 746ab75..2d78d76 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control @@ -1,10 +1,11 @@ Package: abr2gbr Version: 1.0.2-1 Architecture: i386 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> -Installed-Size: 44 +Installed-Size: 60 +Depends: libc6 (>= 2.7-1), libglib1.2ldbl (>= 1.2.10-18) Section: x11 Priority: extra Homepage: http://www.sunnyspot.org/gimp/tools.html Description: Converts PhotoShop brushes to GIMP Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums index 2aba23f..df9e91c 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums @@ -1,3 +1,5 @@ 055a1c9ab6f2645f030ac20bc75f4a8a usr/share/doc/abr2gbr/TODO -f0e0794f4f521b8a3af0a5033f71fe55 usr/share/doc/abr2gbr/copyright +baa1bb1a438ca7c0d91de64affbcc27f usr/share/doc/abr2gbr/copyright 28f8de99b1288e665606f5cd367dc895 usr/share/doc/abr2gbr/changelog.Debian.gz +4aa9b0176967f0d3671904a2ed54ce71 usr/bin/abr2gbr +4aa9b0176967f0d3671904a2ed54ce71 usr/sbin/abr2gbr diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/bin/abr2gbr b/abr2gbr-1.0.2/debian/abr2gbr/usr/bin/abr2gbr new file mode 100755 index 0000000..23cb423 Binary files /dev/null and b/abr2gbr-1.0.2/debian/abr2gbr/usr/bin/abr2gbr differ diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/sbin/abr2gbr b/abr2gbr-1.0.2/debian/abr2gbr/usr/sbin/abr2gbr new file mode 100755 index 0000000..23cb423 Binary files /dev/null and b/abr2gbr-1.0.2/debian/abr2gbr/usr/sbin/abr2gbr differ diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright index 280f667..38abdcc 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright +++ b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright @@ -1,34 +1,34 @@ This package was debianized by Alice Ferrazzi <aliceinwire@gnumerica.org> on Sat, 25 Jul 2009 19:43:53 +0200. It was downloaded from <http://www.sunnyspot.org/gimp/tools/abr2gbr-1.0.2.tgz> Upstream Author(s): Marco Lambert0 Copyright: Copyright (C) 2001 Marco Lamberto License: This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,MA 02110-1301, USA. The Debian packaging is (C) 2009, Alice Ferrazzi <aliceinwire@gnumerica.org> and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. # Please also look if there are files or directories which have a # different copyright/license attached and list them here. diff --git a/abr2gbr-1.0.2/debian/copyright b/abr2gbr-1.0.2/debian/copyright index 280f667..38abdcc 100644 --- a/abr2gbr-1.0.2/debian/copyright +++ b/abr2gbr-1.0.2/debian/copyright @@ -1,34 +1,34 @@ This package was debianized by Alice Ferrazzi <aliceinwire@gnumerica.org> on Sat, 25 Jul 2009 19:43:53 +0200. It was downloaded from <http://www.sunnyspot.org/gimp/tools/abr2gbr-1.0.2.tgz> Upstream Author(s): Marco Lambert0 Copyright: Copyright (C) 2001 Marco Lamberto License: This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,MA 02110-1301, USA. The Debian packaging is (C) 2009, Alice Ferrazzi <aliceinwire@gnumerica.org> and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. # Please also look if there are files or directories which have a # different copyright/license attached and list them here. diff --git a/abr2gbr-1.0.2/debian/rules b/abr2gbr-1.0.2/debian/rules index f50a84f..25c8016 100755 --- a/abr2gbr-1.0.2/debian/rules +++ b/abr2gbr-1.0.2/debian/rules @@ -1,91 +1,94 @@ #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a +# As a special exception, when this file is copied by into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) #docbook-to-man debian/abr2gbr.sgml > abr2gbr.1 touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/abr2gbr. $(MAKE) DESTDIR=$(CURDIR)/debian/abr2gbr install + cp $(CURDIR)/.obj/abr2gbr $(CURDIR)/debian/abr2gbr/usr/bin/ + cp $(CURDIR)/.obj/abr2gbr $(CURDIR)/debian/abr2gbr/usr/sbin/ + # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/abr2gbr_1.0.2-1.diff.gz b/abr2gbr_1.0.2-1.diff.gz index 5510626..a29cefb 100644 Binary files a/abr2gbr_1.0.2-1.diff.gz and b/abr2gbr_1.0.2-1.diff.gz differ diff --git a/abr2gbr_1.0.2-1.dsc b/abr2gbr_1.0.2-1.dsc index 7b5f0c6..8228e43 100644 --- a/abr2gbr_1.0.2-1.dsc +++ b/abr2gbr_1.0.2-1.dsc @@ -1,18 +1,18 @@ Format: 1.0 Source: abr2gbr Binary: abr2gbr Architecture: any Version: 1.0.2-1 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Homepage: http://www.sunnyspot.org/gimp/tools.html Standards-Version: 3.8.0 Build-Depends: debhelper (>= 7), libglib2.0-dev Checksums-Sha1: 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - 626adc480064a86004de2a8b6ce1fe5a2a6cb721 1883 abr2gbr_1.0.2-1.diff.gz + 019a4d47666d4299221c174a3222ee27d61cfa5e 2160 abr2gbr_1.0.2-1.diff.gz Checksums-Sha256: cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 4af3d55bd0c88d1156886347e63f17bdcf1f97eaff4433fe2d637d3dd35bb26c 1883 abr2gbr_1.0.2-1.diff.gz + 0a88599c898b578e2d4e4c4b376d1d09173144fe1f7cd7fab440d6edef710a31 2160 abr2gbr_1.0.2-1.diff.gz Files: edecc74a3df1ce858ec641de9a098cdf 3525 abr2gbr_1.0.2.orig.tar.gz - 6314e7103f1de609b94456567de7c6a3 1883 abr2gbr_1.0.2-1.diff.gz + 3346c1a99442084a2283ea31ff3244f3 2160 abr2gbr_1.0.2-1.diff.gz diff --git a/abr2gbr_1.0.2-1_i386.changes b/abr2gbr_1.0.2-1_i386.changes index 33e297b..8626a03 100644 --- a/abr2gbr_1.0.2-1_i386.changes +++ b/abr2gbr_1.0.2-1_i386.changes @@ -1,33 +1,33 @@ Format: 1.8 Date: Sat, 25 Jul 2009 19:43:53 +0200 Source: abr2gbr Binary: abr2gbr Architecture: source i386 Version: 1.0.2-1 Distribution: unstable Urgency: low Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> Description: abr2gbr - Converts PhotoShop brushes to GIMP Changes: abr2gbr (1.0.2-1) unstable; urgency=low . * Initial release * my first package * Find nothing in the Makefile to fix $DESTDIR problems. Checksums-Sha1: - 7df33b16b3ee8a5656af3301566fa000bf35a2d4 766 abr2gbr_1.0.2-1.dsc + 735b919c46e63d752f5d64aec9e00eb86889a0bf 766 abr2gbr_1.0.2-1.dsc 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - 626adc480064a86004de2a8b6ce1fe5a2a6cb721 1883 abr2gbr_1.0.2-1.diff.gz - 2def17c0ecc4754af270dd291d758b241cc7b44b 2072 abr2gbr_1.0.2-1_i386.deb + 019a4d47666d4299221c174a3222ee27d61cfa5e 2160 abr2gbr_1.0.2-1.diff.gz + 40b3b95b8fc150a74708467fe49fb8c3b172e4bb 5664 abr2gbr_1.0.2-1_i386.deb Checksums-Sha256: - 53ef33d0e48b2ffb07f8f61ac07540fd0c99517600956ab693722adc19b417b9 766 abr2gbr_1.0.2-1.dsc + f1b82500bb15532088767e5ce0763a9825d40a6560ccb0e3d79f893a5bd66a4c 766 abr2gbr_1.0.2-1.dsc cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 4af3d55bd0c88d1156886347e63f17bdcf1f97eaff4433fe2d637d3dd35bb26c 1883 abr2gbr_1.0.2-1.diff.gz - b39731a9913cd83b2dfda137f6efa027bcd47a0bad9bd5a9d2629b7b621b7a01 2072 abr2gbr_1.0.2-1_i386.deb + 0a88599c898b578e2d4e4c4b376d1d09173144fe1f7cd7fab440d6edef710a31 2160 abr2gbr_1.0.2-1.diff.gz + 078cf7050d62676ca45ec92e410aad9aa33a3444f964296f8bf05533bf55cb92 5664 abr2gbr_1.0.2-1_i386.deb Files: - b5d3004150546de12609b1bf1ebcb114 766 x11 extra abr2gbr_1.0.2-1.dsc + 7e8a04a9b5736df9e754e09cbeb3a2f7 766 x11 extra abr2gbr_1.0.2-1.dsc edecc74a3df1ce858ec641de9a098cdf 3525 x11 extra abr2gbr_1.0.2.orig.tar.gz - 6314e7103f1de609b94456567de7c6a3 1883 x11 extra abr2gbr_1.0.2-1.diff.gz - b5641cb5b4507b86d01449ff41c2bf4b 2072 x11 extra abr2gbr_1.0.2-1_i386.deb + 3346c1a99442084a2283ea31ff3244f3 2160 x11 extra abr2gbr_1.0.2-1.diff.gz + cc24f76e6ee81b08fb15206cff86744b 5664 x11 extra abr2gbr_1.0.2-1_i386.deb diff --git a/abr2gbr_1.0.2-1_i386.deb b/abr2gbr_1.0.2-1_i386.deb index adc4f6e..7ac11bb 100644 Binary files a/abr2gbr_1.0.2-1_i386.deb and b/abr2gbr_1.0.2-1_i386.deb differ
aliceinwire/abr2gbr
ed8f94765610615c424653def866647f12cc1b8c
versione 0.0a
diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.Debian.gz b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.Debian.gz new file mode 100644 index 0000000..0c8e1f6 Binary files /dev/null and b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.Debian.gz differ
aliceinwire/abr2gbr
187e4d7448a4916c3034da8401f9bd8aa7038e7e
versione 0.0
diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control index c7fa09e..746ab75 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control @@ -1,10 +1,10 @@ Package: abr2gbr -Version: 3.0.8 +Version: 1.0.2-1 Architecture: i386 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Installed-Size: 44 Section: x11 Priority: extra Homepage: http://www.sunnyspot.org/gimp/tools.html Description: Converts PhotoShop brushes to GIMP Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums index fc9b3af..2aba23f 100644 --- a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums @@ -1,3 +1,3 @@ -9ff1a8f6018cae2aafb172e09511779f usr/share/doc/abr2gbr/changelog.gz 055a1c9ab6f2645f030ac20bc75f4a8a usr/share/doc/abr2gbr/TODO f0e0794f4f521b8a3af0a5033f71fe55 usr/share/doc/abr2gbr/copyright +28f8de99b1288e665606f5cd367dc895 usr/share/doc/abr2gbr/changelog.Debian.gz diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz deleted file mode 100644 index f1f1966..0000000 Binary files a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz and /dev/null differ diff --git a/abr2gbr-1.0.2/debian/changelog~ b/abr2gbr-1.0.2/debian/changelog~ deleted file mode 100644 index 8fbc7ce..0000000 --- a/abr2gbr-1.0.2/debian/changelog~ +++ /dev/null @@ -1,8 +0,0 @@ -abr2gbr (3.0.8) unstable; urgency=low - - * Initial release - * my first package - * Find nothing in the Makefile to fix $DESTDIR problems. - - -- Alice Ferrazzi <aliceinwire@gnumerica.org> Sat, 25 Jul 2009 19:43:53 +0200 - diff --git a/abr2gbr-1.0.2/debian/control b/abr2gbr-1.0.2/debian/control index 993c4d4..ad9919f 100644 --- a/abr2gbr-1.0.2/debian/control +++ b/abr2gbr-1.0.2/debian/control @@ -1,13 +1,13 @@ Source: abr2gbr Section: x11 Priority: extra Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Build-Depends: debhelper (>= 7), libglib2.0-dev -Standards-Version: 3.0.8 +Standards-Version: 3.8.0 Homepage: http://www.sunnyspot.org/gimp/tools.html Package: abr2gbr Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Converts PhotoShop brushes to GIMP Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. \ No newline at end of file diff --git a/abr2gbr-1.0.2/debian/files b/abr2gbr-1.0.2/debian/files index 5b99eeb..3fa9498 100644 --- a/abr2gbr-1.0.2/debian/files +++ b/abr2gbr-1.0.2/debian/files @@ -1 +1 @@ -abr2gbr_3.0.8_i386.deb x11 extra +abr2gbr_1.0.2-1_i386.deb x11 extra diff --git a/abr2gbr_1.0.2-1.diff.gz b/abr2gbr_1.0.2-1.diff.gz index 0e3bc92..5510626 100644 Binary files a/abr2gbr_1.0.2-1.diff.gz and b/abr2gbr_1.0.2-1.diff.gz differ diff --git a/abr2gbr_1.0.2-1.dsc b/abr2gbr_1.0.2-1.dsc index e857f90..7b5f0c6 100644 --- a/abr2gbr_1.0.2-1.dsc +++ b/abr2gbr_1.0.2-1.dsc @@ -1,18 +1,18 @@ Format: 1.0 Source: abr2gbr Binary: abr2gbr Architecture: any Version: 1.0.2-1 Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Homepage: http://www.sunnyspot.org/gimp/tools.html -Standards-Version: 3.0.8 +Standards-Version: 3.8.0 Build-Depends: debhelper (>= 7), libglib2.0-dev Checksums-Sha1: 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - ec295a248c0d58036312cfbef532d28c87f13770 1883 abr2gbr_1.0.2-1.diff.gz + 626adc480064a86004de2a8b6ce1fe5a2a6cb721 1883 abr2gbr_1.0.2-1.diff.gz Checksums-Sha256: cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 1654326a7aace90eb2020226f578d4c256d92ac3bb4fbf60b7139c75e7c3f3bf 1883 abr2gbr_1.0.2-1.diff.gz + 4af3d55bd0c88d1156886347e63f17bdcf1f97eaff4433fe2d637d3dd35bb26c 1883 abr2gbr_1.0.2-1.diff.gz Files: edecc74a3df1ce858ec641de9a098cdf 3525 abr2gbr_1.0.2.orig.tar.gz - 39d48e017a62ff2712840449083e9cc5 1883 abr2gbr_1.0.2-1.diff.gz + 6314e7103f1de609b94456567de7c6a3 1883 abr2gbr_1.0.2-1.diff.gz diff --git a/abr2gbr_1.0.2-1_i386.changes b/abr2gbr_1.0.2-1_i386.changes index 331fee4..33e297b 100644 --- a/abr2gbr_1.0.2-1_i386.changes +++ b/abr2gbr_1.0.2-1_i386.changes @@ -1,33 +1,33 @@ Format: 1.8 Date: Sat, 25 Jul 2009 19:43:53 +0200 Source: abr2gbr Binary: abr2gbr Architecture: source i386 Version: 1.0.2-1 Distribution: unstable Urgency: low Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> Description: abr2gbr - Converts PhotoShop brushes to GIMP Changes: abr2gbr (1.0.2-1) unstable; urgency=low . * Initial release * my first package * Find nothing in the Makefile to fix $DESTDIR problems. Checksums-Sha1: - 2bc1d4412c7e188cb2c61223121c7483928abbe3 766 abr2gbr_1.0.2-1.dsc + 7df33b16b3ee8a5656af3301566fa000bf35a2d4 766 abr2gbr_1.0.2-1.dsc 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz - ec295a248c0d58036312cfbef532d28c87f13770 1883 abr2gbr_1.0.2-1.diff.gz - 94cc0b3aeda7c8da66578a460edc812a029d874c 2066 abr2gbr_1.0.2-1_i386.deb + 626adc480064a86004de2a8b6ce1fe5a2a6cb721 1883 abr2gbr_1.0.2-1.diff.gz + 2def17c0ecc4754af270dd291d758b241cc7b44b 2072 abr2gbr_1.0.2-1_i386.deb Checksums-Sha256: - a2593ddc9be41d37c9cad5fde024157e5a9c1f1174b7afa10a2714a40b742251 766 abr2gbr_1.0.2-1.dsc + 53ef33d0e48b2ffb07f8f61ac07540fd0c99517600956ab693722adc19b417b9 766 abr2gbr_1.0.2-1.dsc cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz - 1654326a7aace90eb2020226f578d4c256d92ac3bb4fbf60b7139c75e7c3f3bf 1883 abr2gbr_1.0.2-1.diff.gz - 580c58beadd1e0d1dcec973bcb33dfcf38929b2ca699185858a9f23fb7e9f8c8 2066 abr2gbr_1.0.2-1_i386.deb + 4af3d55bd0c88d1156886347e63f17bdcf1f97eaff4433fe2d637d3dd35bb26c 1883 abr2gbr_1.0.2-1.diff.gz + b39731a9913cd83b2dfda137f6efa027bcd47a0bad9bd5a9d2629b7b621b7a01 2072 abr2gbr_1.0.2-1_i386.deb Files: - cd62fd2d83cae4f14e01bc06c8eb9074 766 x11 extra abr2gbr_1.0.2-1.dsc + b5d3004150546de12609b1bf1ebcb114 766 x11 extra abr2gbr_1.0.2-1.dsc edecc74a3df1ce858ec641de9a098cdf 3525 x11 extra abr2gbr_1.0.2.orig.tar.gz - 39d48e017a62ff2712840449083e9cc5 1883 x11 extra abr2gbr_1.0.2-1.diff.gz - 4a1be9f91bfad738643181a55540bce3 2066 x11 extra abr2gbr_1.0.2-1_i386.deb + 6314e7103f1de609b94456567de7c6a3 1883 x11 extra abr2gbr_1.0.2-1.diff.gz + b5641cb5b4507b86d01449ff41c2bf4b 2072 x11 extra abr2gbr_1.0.2-1_i386.deb diff --git a/abr2gbr_1.0.2-1_i386.deb b/abr2gbr_1.0.2-1_i386.deb index daa800c..adc4f6e 100644 Binary files a/abr2gbr_1.0.2-1_i386.deb and b/abr2gbr_1.0.2-1_i386.deb differ
aliceinwire/abr2gbr
d0192e7d7a19c2007861bd9e7b8aa95ed4945f57
versione 0.00a
diff --git a/abr2gbr-1.0.2.tgz b/abr2gbr-1.0.2.tgz new file mode 100644 index 0000000..6f944f1 Binary files /dev/null and b/abr2gbr-1.0.2.tgz differ diff --git a/abr2gbr-1.0.2/.obj/abr2gbr b/abr2gbr-1.0.2/.obj/abr2gbr new file mode 100755 index 0000000..c57afa4 Binary files /dev/null and b/abr2gbr-1.0.2/.obj/abr2gbr differ diff --git a/abr2gbr-1.0.2/.obj/abr2gbr.o b/abr2gbr-1.0.2/.obj/abr2gbr.o new file mode 100644 index 0000000..220db49 Binary files /dev/null and b/abr2gbr-1.0.2/.obj/abr2gbr.o differ diff --git a/abr2gbr-1.0.2/Makefile b/abr2gbr-1.0.2/Makefile new file mode 100644 index 0000000..fc4aa88 --- /dev/null +++ b/abr2gbr-1.0.2/Makefile @@ -0,0 +1,70 @@ +# GIMP Text Colorer GNUMakefile +# Copyright (C) 2000 Marco Lamberto <lm@sunnyspot.org> +# Web page: http://the.sunnyspot.org/gimp/ +# +# This program 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 +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +CC = gcc +CDEBUG = $(DEBUG) -g #-DDEBUG +CCFLAGS = -Wall -Wstrict-prototypes -Wmissing-declarations -I. $(CDEBUG) +CLIBS = +SOURCES = $(wildcard *.c) + +OBJDIR = .obj +BINDIR = /usr/bin +CFLAGS = $(CCFLAGS) $(shell $(BINDIR)/glib-config --cflags) +LIBS = $(CLIBS) $(shell $(BINDIR)/glib-config --libs) +DESTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o)) +BIN = abr2gbr +DEPEND = $(OBJDIR)/.depend + + +default: all + + +$(OBJDIR): + if [ ! -d $@ ]; then mkdir $@; fi + + +all: $(OBJDIR) $(OBJDIR)/$(BIN) + +$(OBJDIR)/%.o: %.c + $(CC) -o $@ $(CFLAGS) -c $< + +$(OBJDIR)/$(BIN): $(DESTS) + $(CC) -o $@ $(CFLAGS) $(LIBS) $(DESTS) + if [ ! -L $(BIN) ]; then \ + ln -s $(OBJDIR)/$(BIN) .; \ + ln -s $(OBJDIR)/$(BIN) jbr2gbr; \ + fi + +dep depend: + $(CC) $(CFLAGS) -M $(SOURCES) > $(DEPEND) + +install: $(BIN) + strip $(BIN) + + +clean: + -rm -f core $(DESTS) \ + $(OBJDIR)/$(BIN) $(BIN) $(BIN)-ui \ + $(DEPEND) \ + font_selection jbr2gbr + -rmdir $(OBJDIR) + +cleandests: + -rm -f core $(DESTS) + +# vim: set ts=2 sw=2 tw=79 ai nowrap: diff --git a/abr2gbr-1.0.2/TODO b/abr2gbr-1.0.2/TODO new file mode 100644 index 0000000..62e0a2a --- /dev/null +++ b/abr2gbr-1.0.2/TODO @@ -0,0 +1,3 @@ +* check for endianess troubles!! +* support wide brushes +* retrieve abr version 2 informations diff --git a/abr2gbr-1.0.2/abr2gbr b/abr2gbr-1.0.2/abr2gbr new file mode 120000 index 0000000..99c8dd7 --- /dev/null +++ b/abr2gbr-1.0.2/abr2gbr @@ -0,0 +1 @@ +.obj/abr2gbr \ No newline at end of file diff --git a/abr2gbr-1.0.2/abr2gbr.c b/abr2gbr-1.0.2/abr2gbr.c new file mode 100644 index 0000000..79c33c5 --- /dev/null +++ b/abr2gbr-1.0.2/abr2gbr.c @@ -0,0 +1,326 @@ +/* + * Converts PhotoShop .ABR and Paint Shop Pro .JBR brushes to GIMP .GBR + * Copyright (C) 2001 Marco Lamberto <lm@sunnyspot.org> + * Web page: http://the.sunnyspot.org/gimp/ + * + * This program 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id:$ + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <glib.h> + + +#define GBRUSH_MAGIC (('G' << 24) + ('I' << 16) + ('M' << 8) + ('P' << 0)) + + +typedef struct _AbrHeader AbrHeader; +typedef struct _AbrBrushHeader AbrBrushHeader; +typedef struct _AbrSampledBrushHeader AbrSampledBrushHeader; +typedef struct _GbrBrushHeader GbrBrushHeader; +typedef struct _GbrBrush GbrBrush; + +struct _AbrHeader +{ + gshort version; + gshort count; +}; + +struct _AbrBrushHeader +{ + gshort type; + gint32 size; +}; + +struct _AbrSampledBrushHeader +{ + gint32 misc; + gshort spacing; + gchar antialiasing; + gshort bounds[4]; + gint32 bounds_long[4]; + gshort depth; + gboolean wide; +}; + +struct _GbrBrushHeader +{ + guint header_size; + guint version; + guint width; + guint height; + guint depth; + guint magic_number; + guint spacing; +}; + +struct _GbrBrush +{ + GbrBrushHeader header; + gchar *name; + gchar *description; + gchar *data; + gint size; +}; + + +gchar abr_read_char (FILE *abr); +gshort abr_read_short (FILE *abr); +gint32 abr_read_long (FILE *abr); +void abr_load (const gchar *file); +GbrBrush * abr_brush_load (FILE *abr); +void gbr_brush_save (GbrBrush *brush, const gchar *file, const gint id); +void gbr_brush_free (GbrBrush *brush); +gint main (gint argc, gchar *argv[]); + + +gchar +abr_read_char(FILE *abr) +{ + g_return_val_if_fail ( abr != NULL, 0 ); + + return fgetc(abr); +} + +gshort +abr_read_short(FILE *abr) +{ + gshort val; + + g_return_val_if_fail ( abr != NULL, 0 ); + + fread(&val, sizeof(val), 1, abr); + + return GUINT16_SWAP_LE_BE(val); +} + +gint32 +abr_read_long(FILE *abr) +{ + gint32 val; + + g_return_val_if_fail ( abr != NULL, 0 ); + + fread(&val, sizeof(val), 1, abr); + + return GUINT32_SWAP_LE_BE(val); +} + +GbrBrush * +abr_brush_load(FILE *abr) +{ + AbrBrushHeader abr_brush_hdr; + GbrBrush *gbr = NULL; + + g_return_val_if_fail ( abr != NULL, NULL ); + + abr_brush_hdr.type = abr_read_short(abr); + abr_brush_hdr.size = abr_read_long(abr); + g_print(" + BRUSH\n | << type: %d block size: %d bytes\n", + abr_brush_hdr.type, abr_brush_hdr.size); + + switch (abr_brush_hdr.type) { + case 1: /* computed brush */ + /* FIXME: support it! */ + g_print("WARNING: computed brush unsupported, skipping.\n"); + fseek(abr, abr_brush_hdr.size, SEEK_CUR); + break; + case 2: /* sampled brush */ + { + AbrSampledBrushHeader abr_sampled_brush_hdr; + gint width, height; + gint size; + gint i = 0; + + abr_sampled_brush_hdr.misc = abr_read_long(abr); + abr_sampled_brush_hdr.spacing = abr_read_short(abr); + abr_sampled_brush_hdr.antialiasing = abr_read_char(abr); + + for (i = 0; i < 4; i++) + abr_sampled_brush_hdr.bounds[i] = abr_read_short(abr); + for (i = 0; i < 4; i++) { + abr_sampled_brush_hdr.bounds_long[i] = abr_read_long(abr); + } + abr_sampled_brush_hdr.depth = abr_read_short(abr); + + height = abr_sampled_brush_hdr.bounds_long[2] - + abr_sampled_brush_hdr.bounds_long[0]; /* bottom - top */ + width = abr_sampled_brush_hdr.bounds_long[3] - + abr_sampled_brush_hdr.bounds_long[1]; /* right - left */ + size = width * (abr_sampled_brush_hdr.depth >> 3) * height; + + /* FIXME: support wide brushes */ + abr_sampled_brush_hdr.wide = height > 16384; + if (abr_sampled_brush_hdr.wide) + g_print("WARING: wide brushes not supported\n"); + + gbr = g_new0(GbrBrush, 1); + gbr->header.version = g_htonl(2); + gbr->header.width = g_htonl(width); + gbr->header.height = g_htonl(height); + gbr->header.depth = g_htonl(abr_sampled_brush_hdr.depth >> 3); + gbr->header.magic_number = g_htonl(GBRUSH_MAGIC); + gbr->header.spacing = g_htonl(abr_sampled_brush_hdr.spacing); + gbr->data = g_new0(gchar, size); + gbr->size = size; + + /* data decoding */ + { + gshort comp; + + comp = abr_read_char(abr); + g_print(" | << size: %dx%d %d bit (%d bytes) %s\n", + width, height, abr_sampled_brush_hdr.depth, size, + comp ? "compressed" : "raw"); + if (!comp) { + fread(gbr->data, size, 1, abr); + } else { + gint32 n; + gchar ch; + gint i, j, c; + gshort *cscanline_len; + gchar *data = gbr->data; + + /* read compressed size foreach scanline */ + cscanline_len = g_new0(gshort, height); + for (i = 0; i < height; i++) + cscanline_len[i] = abr_read_short(abr); + + /* unpack each scanline data */ + for (i = 0; i < height; i++) { + for (j = 0; j < cscanline_len[i];) { + n = abr_read_char(abr); + j++; + if (n >= 128) /* force sign */ + n -= 256; + if (n < 0) { /* copy the following char -n + 1 times */ + if (n == -128) /* it's a nop */ + continue; + n = -n + 1; + ch = abr_read_char(abr); + j++; + for (c = 0; c < n; c++, data++) + *data = ch; + } else { /* read the following n + 1 chars (no compr) */ + for (c = 0; c < n + 1; c++, j++, data++) + *data = (guchar)abr_read_char(abr); + } + } + } + g_free(cscanline_len); + } + } + } + break; + default: + g_print("WARNING: unknown brush type, skipping.\n"); + fseek(abr, abr_brush_hdr.size, SEEK_CUR); + } + + return gbr; +} + +void +gbr_brush_free(GbrBrush *brush) +{ + g_free(brush->name); + g_free(brush->description); + g_free(brush->data); + g_free(brush); +} + +void +abr_load(const gchar *file) +{ + FILE *abr; + AbrHeader abr_hdr; + GbrBrush *brush; + gint i; + + if (!(abr = fopen(file, "rb"))) { + g_print("ERROR: can't open '%s'\n", file); + return; + } + + abr_hdr.version = abr_read_short(abr); + abr_hdr.count = abr_read_short(abr); + + g_print("FILE %s\n + HEADER\n | << ver: %d brushes: %d\n", + file, abr_hdr.version, abr_hdr.count); + + if (abr_hdr.version > 1) { + g_print("ERROR: unable to decode abr format version %d\n", abr_hdr.version); + } else { + for (i = 0; i < abr_hdr.count; i++) { + brush = abr_brush_load(abr); + if (!brush) { + g_print("ERROR: load error (brush #%d)\n", i); + break; + } + gbr_brush_save(brush, file, i); + gbr_brush_free(brush); + } + } + + fclose(abr); +} + +void +gbr_brush_save(GbrBrush *brush, const gchar *file, const gint id) +{ + FILE *gbr; + gchar *p; + + p = strrchr(file, '.'); + brush->name = g_strndup(file, p - file); + //g_print("%s\n", brush->name); + p = brush->name; + brush->name = g_strdup_printf("%s_%03d.gbr", p, id); + brush->description = g_strdup_printf("%s %03d", p, id); + g_free(p); + //g_print("%s\n", brush->name); + //g_print("%s\n", brush->description); + + brush->header.header_size = g_htonl(sizeof(GbrBrushHeader) + + strlen(brush->description) + 1); + gbr = fopen(brush->name, "wb"); + fwrite(&brush->header, sizeof(GbrBrushHeader), 1, gbr); + fwrite(brush->description, strlen(brush->description) + 1, 1, gbr); + fwrite(brush->data, brush->size, 1, gbr); + g_print(" | >> %s (%d bytes)\n", brush->name, + brush->size + sizeof(GbrBrushHeader) + strlen(brush->description) + 1); + fclose(gbr); +} + + +gint +main(gint argc, gchar *argv[]) +{ + gint i; + + if (argc < 2) { + g_print("usage: %s {file1.abr} ...\n", argv[0]); + return -1; + } + + for (i = 1; i < argc; i++) + abr_load(argv[i]); + g_print("DONE\n"); + + return 0; +} diff --git a/abr2gbr-1.0.2/build-stamp b/abr2gbr-1.0.2/build-stamp new file mode 100644 index 0000000..e69de29 diff --git a/abr2gbr-1.0.2/configure-stamp b/abr2gbr-1.0.2/configure-stamp new file mode 100644 index 0000000..e69de29 diff --git a/abr2gbr-1.0.2/debian/abr2gbr.debhelper.log b/abr2gbr-1.0.2/debian/abr2gbr.debhelper.log new file mode 100644 index 0000000..cbd42b1 --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr.debhelper.log @@ -0,0 +1,14 @@ +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_installexamples +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control new file mode 100644 index 0000000..c7fa09e --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/control @@ -0,0 +1,10 @@ +Package: abr2gbr +Version: 3.0.8 +Architecture: i386 +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Installed-Size: 44 +Section: x11 +Priority: extra +Homepage: http://www.sunnyspot.org/gimp/tools.html +Description: Converts PhotoShop brushes to GIMP + Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. diff --git a/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums new file mode 100644 index 0000000..fc9b3af --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr/DEBIAN/md5sums @@ -0,0 +1,3 @@ +9ff1a8f6018cae2aafb172e09511779f usr/share/doc/abr2gbr/changelog.gz +055a1c9ab6f2645f030ac20bc75f4a8a usr/share/doc/abr2gbr/TODO +f0e0794f4f521b8a3af0a5033f71fe55 usr/share/doc/abr2gbr/copyright diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/TODO b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/TODO new file mode 100644 index 0000000..62e0a2a --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/TODO @@ -0,0 +1,3 @@ +* check for endianess troubles!! +* support wide brushes +* retrieve abr version 2 informations diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz new file mode 100644 index 0000000..f1f1966 Binary files /dev/null and b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/changelog.gz differ diff --git a/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright new file mode 100644 index 0000000..280f667 --- /dev/null +++ b/abr2gbr-1.0.2/debian/abr2gbr/usr/share/doc/abr2gbr/copyright @@ -0,0 +1,34 @@ +This package was debianized by Alice Ferrazzi <aliceinwire@gnumerica.org> on +Sat, 25 Jul 2009 19:43:53 +0200. + +It was downloaded from <http://www.sunnyspot.org/gimp/tools/abr2gbr-1.0.2.tgz> + +Upstream Author(s): + + Marco Lambert0 + + +Copyright: + + Copyright (C) 2001 Marco Lamberto + + +License: + + This program 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 + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +The Debian packaging is (C) 2009, Alice Ferrazzi <aliceinwire@gnumerica.org> and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/abr2gbr-1.0.2/debian/changelog b/abr2gbr-1.0.2/debian/changelog new file mode 100644 index 0000000..18ff9da --- /dev/null +++ b/abr2gbr-1.0.2/debian/changelog @@ -0,0 +1,8 @@ +abr2gbr (1.0.2-1) unstable; urgency=low + + * Initial release + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. + + -- Alice Ferrazzi <aliceinwire@gnumerica.org> Sat, 25 Jul 2009 19:43:53 +0200 + diff --git a/abr2gbr-1.0.2/debian/changelog~ b/abr2gbr-1.0.2/debian/changelog~ new file mode 100644 index 0000000..8fbc7ce --- /dev/null +++ b/abr2gbr-1.0.2/debian/changelog~ @@ -0,0 +1,8 @@ +abr2gbr (3.0.8) unstable; urgency=low + + * Initial release + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. + + -- Alice Ferrazzi <aliceinwire@gnumerica.org> Sat, 25 Jul 2009 19:43:53 +0200 + diff --git a/abr2gbr-1.0.2/debian/compat b/abr2gbr-1.0.2/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/abr2gbr-1.0.2/debian/compat @@ -0,0 +1 @@ +7 diff --git a/abr2gbr-1.0.2/debian/control b/abr2gbr-1.0.2/debian/control new file mode 100644 index 0000000..993c4d4 --- /dev/null +++ b/abr2gbr-1.0.2/debian/control @@ -0,0 +1,13 @@ +Source: abr2gbr +Section: x11 +Priority: extra +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Build-Depends: debhelper (>= 7), libglib2.0-dev +Standards-Version: 3.0.8 +Homepage: http://www.sunnyspot.org/gimp/tools.html + +Package: abr2gbr +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Converts PhotoShop brushes to GIMP + Converts PhotoShop ABR and Paint Shop Pro JBR brushes to GIMP GBR. \ No newline at end of file diff --git a/abr2gbr-1.0.2/debian/copyright b/abr2gbr-1.0.2/debian/copyright new file mode 100644 index 0000000..280f667 --- /dev/null +++ b/abr2gbr-1.0.2/debian/copyright @@ -0,0 +1,34 @@ +This package was debianized by Alice Ferrazzi <aliceinwire@gnumerica.org> on +Sat, 25 Jul 2009 19:43:53 +0200. + +It was downloaded from <http://www.sunnyspot.org/gimp/tools/abr2gbr-1.0.2.tgz> + +Upstream Author(s): + + Marco Lambert0 + + +Copyright: + + Copyright (C) 2001 Marco Lamberto + + +License: + + This program 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 + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +The Debian packaging is (C) 2009, Alice Ferrazzi <aliceinwire@gnumerica.org> and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/abr2gbr-1.0.2/debian/dirs b/abr2gbr-1.0.2/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/abr2gbr-1.0.2/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/abr2gbr-1.0.2/debian/docs b/abr2gbr-1.0.2/debian/docs new file mode 100644 index 0000000..1333ed7 --- /dev/null +++ b/abr2gbr-1.0.2/debian/docs @@ -0,0 +1 @@ +TODO diff --git a/abr2gbr-1.0.2/debian/files b/abr2gbr-1.0.2/debian/files new file mode 100644 index 0000000..5b99eeb --- /dev/null +++ b/abr2gbr-1.0.2/debian/files @@ -0,0 +1 @@ +abr2gbr_3.0.8_i386.deb x11 extra diff --git a/abr2gbr-1.0.2/debian/rules b/abr2gbr-1.0.2/debian/rules new file mode 100755 index 0000000..f50a84f --- /dev/null +++ b/abr2gbr-1.0.2/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/abr2gbr.sgml > abr2gbr.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/abr2gbr. + $(MAKE) DESTDIR=$(CURDIR)/debian/abr2gbr install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/abr2gbr-1.0.2/jbr2gbr b/abr2gbr-1.0.2/jbr2gbr new file mode 120000 index 0000000..99c8dd7 --- /dev/null +++ b/abr2gbr-1.0.2/jbr2gbr @@ -0,0 +1 @@ +.obj/abr2gbr \ No newline at end of file diff --git a/abr2gbr_1.0.2-1.diff.gz b/abr2gbr_1.0.2-1.diff.gz new file mode 100644 index 0000000..0e3bc92 Binary files /dev/null and b/abr2gbr_1.0.2-1.diff.gz differ diff --git a/abr2gbr_1.0.2-1.dsc b/abr2gbr_1.0.2-1.dsc new file mode 100644 index 0000000..e857f90 --- /dev/null +++ b/abr2gbr_1.0.2-1.dsc @@ -0,0 +1,18 @@ +Format: 1.0 +Source: abr2gbr +Binary: abr2gbr +Architecture: any +Version: 1.0.2-1 +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Homepage: http://www.sunnyspot.org/gimp/tools.html +Standards-Version: 3.0.8 +Build-Depends: debhelper (>= 7), libglib2.0-dev +Checksums-Sha1: + 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz + ec295a248c0d58036312cfbef532d28c87f13770 1883 abr2gbr_1.0.2-1.diff.gz +Checksums-Sha256: + cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz + 1654326a7aace90eb2020226f578d4c256d92ac3bb4fbf60b7139c75e7c3f3bf 1883 abr2gbr_1.0.2-1.diff.gz +Files: + edecc74a3df1ce858ec641de9a098cdf 3525 abr2gbr_1.0.2.orig.tar.gz + 39d48e017a62ff2712840449083e9cc5 1883 abr2gbr_1.0.2-1.diff.gz diff --git a/abr2gbr_1.0.2-1_i386.changes b/abr2gbr_1.0.2-1_i386.changes new file mode 100644 index 0000000..331fee4 --- /dev/null +++ b/abr2gbr_1.0.2-1_i386.changes @@ -0,0 +1,33 @@ +Format: 1.8 +Date: Sat, 25 Jul 2009 19:43:53 +0200 +Source: abr2gbr +Binary: abr2gbr +Architecture: source i386 +Version: 1.0.2-1 +Distribution: unstable +Urgency: low +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> +Description: + abr2gbr - Converts PhotoShop brushes to GIMP +Changes: + abr2gbr (1.0.2-1) unstable; urgency=low + . + * Initial release + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. +Checksums-Sha1: + 2bc1d4412c7e188cb2c61223121c7483928abbe3 766 abr2gbr_1.0.2-1.dsc + 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz + ec295a248c0d58036312cfbef532d28c87f13770 1883 abr2gbr_1.0.2-1.diff.gz + 94cc0b3aeda7c8da66578a460edc812a029d874c 2066 abr2gbr_1.0.2-1_i386.deb +Checksums-Sha256: + a2593ddc9be41d37c9cad5fde024157e5a9c1f1174b7afa10a2714a40b742251 766 abr2gbr_1.0.2-1.dsc + cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz + 1654326a7aace90eb2020226f578d4c256d92ac3bb4fbf60b7139c75e7c3f3bf 1883 abr2gbr_1.0.2-1.diff.gz + 580c58beadd1e0d1dcec973bcb33dfcf38929b2ca699185858a9f23fb7e9f8c8 2066 abr2gbr_1.0.2-1_i386.deb +Files: + cd62fd2d83cae4f14e01bc06c8eb9074 766 x11 extra abr2gbr_1.0.2-1.dsc + edecc74a3df1ce858ec641de9a098cdf 3525 x11 extra abr2gbr_1.0.2.orig.tar.gz + 39d48e017a62ff2712840449083e9cc5 1883 x11 extra abr2gbr_1.0.2-1.diff.gz + 4a1be9f91bfad738643181a55540bce3 2066 x11 extra abr2gbr_1.0.2-1_i386.deb diff --git a/abr2gbr_1.0.2-1_i386.deb b/abr2gbr_1.0.2-1_i386.deb new file mode 100644 index 0000000..daa800c Binary files /dev/null and b/abr2gbr_1.0.2-1_i386.deb differ diff --git a/abr2gbr_1.0.2.diff.gz b/abr2gbr_1.0.2.diff.gz new file mode 100644 index 0000000..ea47207 Binary files /dev/null and b/abr2gbr_1.0.2.diff.gz differ diff --git a/abr2gbr_1.0.2.dsc b/abr2gbr_1.0.2.dsc new file mode 100644 index 0000000..c4bfde5 --- /dev/null +++ b/abr2gbr_1.0.2.dsc @@ -0,0 +1,18 @@ +Format: 1.0 +Source: abr2gbr +Binary: abr2gbr +Architecture: any +Version: 1.0.2 +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Homepage: http://www.sunnyspot.org/gimp/tools.html +Standards-Version: 1.0.2 +Build-Depends: debhelper (>= 7), libglib2.0-dev +Checksums-Sha1: + 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz + b96f7c85f1658cd8c7a7062ac9baa371d0ba282e 2018 abr2gbr_1.0.2.diff.gz +Checksums-Sha256: + cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz + 847bfb60517c6e2a032edb497533dee81ade01a160e25a810f174a8bfda2b165 2018 abr2gbr_1.0.2.diff.gz +Files: + edecc74a3df1ce858ec641de9a098cdf 3525 abr2gbr_1.0.2.orig.tar.gz + 2bd43fc3217ff54e306056c48163cd77 2018 abr2gbr_1.0.2.diff.gz diff --git a/abr2gbr_1.0.2.orig.tar.gz b/abr2gbr_1.0.2.orig.tar.gz new file mode 100644 index 0000000..6f944f1 Binary files /dev/null and b/abr2gbr_1.0.2.orig.tar.gz differ diff --git a/abr2gbr_1.0.2_i386.changes b/abr2gbr_1.0.2_i386.changes new file mode 100644 index 0000000..1d53111 --- /dev/null +++ b/abr2gbr_1.0.2_i386.changes @@ -0,0 +1,33 @@ +Format: 1.8 +Date: Sat, 25 Jul 2009 19:43:53 +0200 +Source: abr2gbr +Binary: abr2gbr +Architecture: source i386 +Version: 1.0.2 +Distribution: unstable +Urgency: low +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> +Description: + abr2gbr - Converts PhotoShop brushes to GIMP +Changes: + abr2gbr (1.0.2) unstable; urgency=low + . + * Initial release + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. +Checksums-Sha1: + 2704270938fadaeaaed9a81ad82277374e5083d8 758 abr2gbr_1.0.2.dsc + 6a6a12dd7f156b9a29fec22920d4b6a26f596036 3525 abr2gbr_1.0.2.orig.tar.gz + b96f7c85f1658cd8c7a7062ac9baa371d0ba282e 2018 abr2gbr_1.0.2.diff.gz + 770c9d46a4780225cbb4ad894aef72c07d57f8e4 2210 abr2gbr_1.0.2_i386.deb +Checksums-Sha256: + 11cefb8bc18d6c72f4c3a35864ef42c4e2c06e5e175a15060e2c0e9ef01fed8b 758 abr2gbr_1.0.2.dsc + cbfeb8726b08490146bc982a87aa228de271e8fdfa4a013f3705ce3135dafd68 3525 abr2gbr_1.0.2.orig.tar.gz + 847bfb60517c6e2a032edb497533dee81ade01a160e25a810f174a8bfda2b165 2018 abr2gbr_1.0.2.diff.gz + 3c9a4c0c4b57efa8dfdcef16a6e119e78e3558b8ecdaa668b39b300312cdbd4e 2210 abr2gbr_1.0.2_i386.deb +Files: + 67a7937712e7d0859ea7b27898d48e1d 758 x11 extra abr2gbr_1.0.2.dsc + edecc74a3df1ce858ec641de9a098cdf 3525 x11 extra abr2gbr_1.0.2.orig.tar.gz + 2bd43fc3217ff54e306056c48163cd77 2018 x11 extra abr2gbr_1.0.2.diff.gz + 8360ef424b67e48d48ab39aa735ed6fa 2210 x11 extra abr2gbr_1.0.2_i386.deb diff --git a/abr2gbr_1.0.2_i386.deb b/abr2gbr_1.0.2_i386.deb new file mode 100644 index 0000000..da0276a Binary files /dev/null and b/abr2gbr_1.0.2_i386.deb differ diff --git a/abr2gbr_3.0.8.dsc b/abr2gbr_3.0.8.dsc new file mode 100644 index 0000000..e7b8955 --- /dev/null +++ b/abr2gbr_3.0.8.dsc @@ -0,0 +1,15 @@ +Format: 1.0 +Source: abr2gbr +Binary: abr2gbr +Architecture: any +Version: 3.0.8 +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Homepage: http://www.sunnyspot.org/gimp/tools.html +Standards-Version: 3.0.8 +Build-Depends: debhelper (>= 7), libglib2.0-dev +Checksums-Sha1: + d824f979a27020a8347e4316a354f33090f271c0 5037 abr2gbr_3.0.8.tar.gz +Checksums-Sha256: + 55bb4c15960b99b289b6ac624ea9ee181dfd5b6be093cd87b3a30024a2bf3642 5037 abr2gbr_3.0.8.tar.gz +Files: + 117365852a707ed0c32e8b719d0f5c28 5037 abr2gbr_3.0.8.tar.gz diff --git a/abr2gbr_3.0.8.tar.gz b/abr2gbr_3.0.8.tar.gz new file mode 100644 index 0000000..6e2ba2a Binary files /dev/null and b/abr2gbr_3.0.8.tar.gz differ diff --git a/abr2gbr_3.0.8_i386.changes b/abr2gbr_3.0.8_i386.changes new file mode 100644 index 0000000..5cfc21b --- /dev/null +++ b/abr2gbr_3.0.8_i386.changes @@ -0,0 +1,30 @@ +Format: 1.8 +Date: Sat, 25 Jul 2009 19:43:53 +0200 +Source: abr2gbr +Binary: abr2gbr +Architecture: source i386 +Version: 3.0.8 +Distribution: unstable +Urgency: low +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Changed-By: Alice Ferrazzi <aliceinwire@gnumerica.org> +Description: + abr2gbr - Converts PhotoShop brushes to GIMP +Changes: + abr2gbr (3.0.8) unstable; urgency=low + . + * Initial release + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. +Checksums-Sha1: + 4e352faa18d42853bfad0247bfb627f8a89340bc 520 abr2gbr_3.0.8.dsc + d824f979a27020a8347e4316a354f33090f271c0 5037 abr2gbr_3.0.8.tar.gz + a884fa54036bfc6e7e13d170b4156460000a47dd 2054 abr2gbr_3.0.8_i386.deb +Checksums-Sha256: + 334c1422b909ca3b6ecbc2ec76c55fa47364efaffe629855bdf7c4292202b881 520 abr2gbr_3.0.8.dsc + 55bb4c15960b99b289b6ac624ea9ee181dfd5b6be093cd87b3a30024a2bf3642 5037 abr2gbr_3.0.8.tar.gz + 59f93d5d49c2017787a21be51344c8f87d013d87fc4dae66bfb191cc5f629127 2054 abr2gbr_3.0.8_i386.deb +Files: + e4c163b5230b54446bed20acf45bf753 520 x11 extra abr2gbr_3.0.8.dsc + 117365852a707ed0c32e8b719d0f5c28 5037 x11 extra abr2gbr_3.0.8.tar.gz + 0341d52d52a3d26ca9ab0c71d43c6166 2054 x11 extra abr2gbr_3.0.8_i386.deb diff --git a/abr2gbr_3.0.8_i386.deb b/abr2gbr_3.0.8_i386.deb new file mode 100644 index 0000000..3a41bd4 Binary files /dev/null and b/abr2gbr_3.0.8_i386.deb differ diff --git a/abr2gbr_3.8.0.dsc b/abr2gbr_3.8.0.dsc new file mode 100644 index 0000000..1a1697e --- /dev/null +++ b/abr2gbr_3.8.0.dsc @@ -0,0 +1,15 @@ +Format: 1.0 +Source: abr2gbr +Binary: abr2gbr +Architecture: any +Version: 3.8.0 +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Homepage: http://www.sunnyspot.org/gimp/tools.html +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 7), libglib2.0-dev +Checksums-Sha1: + af404e31f452948d7b1880da2932e758e1b77919 5180 abr2gbr_3.8.0.tar.gz +Checksums-Sha256: + 7deee7c64b9efeecdb03d4ba67abdcff1879b4c34040d01dd43f619733cdc700 5180 abr2gbr_3.8.0.tar.gz +Files: + 433f6800e58259367764ece37f95da9e 5180 abr2gbr_3.8.0.tar.gz diff --git a/abr2gbr_3.8.0.tar.gz b/abr2gbr_3.8.0.tar.gz new file mode 100644 index 0000000..64049c4 Binary files /dev/null and b/abr2gbr_3.8.0.tar.gz differ diff --git a/abr2gbr_3.8.0_i386.changes b/abr2gbr_3.8.0_i386.changes new file mode 100644 index 0000000..f80d3bd --- /dev/null +++ b/abr2gbr_3.8.0_i386.changes @@ -0,0 +1,29 @@ +Format: 1.8 +Date: Sat, 25 Jul 2009 19:43:53 +0200 +Source: abr2gbr +Binary: abr2gbr +Architecture: source i386 +Version: 3.8.0 +Distribution: unstable +Urgency: low +Maintainer: Alice Ferrazzi <aliceinwire@gnumerica.org> +Changed-By: aliceinwire <aliceinwire@gnumerica.org> +Description: + abr2gbr - Converts PhotoShop and Paint Shop Pro brushes to GIMP +Changes: + abr2gbr (3.8.0) unstable; urgency=low + . + * my first package + * Find nothing in the Makefile to fix $DESTDIR problems. +Checksums-Sha1: + 21a7064d4cfe70b3dd8208f0b77e794515bfa98a 520 abr2gbr_3.8.0.dsc + af404e31f452948d7b1880da2932e758e1b77919 5180 abr2gbr_3.8.0.tar.gz + ffdf1b0f30a49da2c02c89d1086626c567b80430 2178 abr2gbr_3.8.0_i386.deb +Checksums-Sha256: + eaa684a523525f2a54ebc5249e8860f7493bd0ed350d2f90185770ed1452694f 520 abr2gbr_3.8.0.dsc + 7deee7c64b9efeecdb03d4ba67abdcff1879b4c34040d01dd43f619733cdc700 5180 abr2gbr_3.8.0.tar.gz + 8bf0c2334bae0536f7003ffb44e1657675fe417b6a43dbc2376bbe82196468d5 2178 abr2gbr_3.8.0_i386.deb +Files: + 7d7e49d02c3a7deabb753c6dc1e74b2c 520 x11 extra abr2gbr_3.8.0.dsc + 433f6800e58259367764ece37f95da9e 5180 x11 extra abr2gbr_3.8.0.tar.gz + 84581a9afa76c748558ba071980fc951 2178 x11 extra abr2gbr_3.8.0_i386.deb diff --git a/abr2gbr_3.8.0_i386.deb b/abr2gbr_3.8.0_i386.deb new file mode 100644 index 0000000..b81901e Binary files /dev/null and b/abr2gbr_3.8.0_i386.deb differ
robertbrook/findyourmp
f63853c65c2ed8ca0fce213435695346b258a45c
removing the overwrite logic from the deploy script
diff --git a/config/deploy.rb b/config/deploy.rb index 6b485d2..9b242cc 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,399 +1,399 @@ require "rvm/capistrano" load File.expand_path(File.dirname(__FILE__) + '/virtualserver/deploy_secrets.rb') default_run_options[:pty] = true set :repository, "git://github.com/robertbrook/findyourmp.git" set :scm, :git ssh_options[:forward_agent] = true set :branch, "master" set :deploy_via, :remote_cache set :git_enable_submodules, 1 role :app, domain role :web, domain role :db, domain, :primary => true set :test_deploy, true set :master_data_file, 'NSPDC_AUG_2008_UK_100M.txt' namespace :rvm do task :trust_rvmrc do run "rvm rvmrc trust #{release_path}" end end namespace :deploy do set :user, deployuser set :password, deploypassword desc "Set sitemap cron job" task :set_sitemap_cron_job, :roles => :app do freq_in_minutes = ENV['freq_in_minutes'] unless freq_in_minutes puts puts 'must supply freq_in_minutes when setting cron job' puts 'USAGE: cap deploy:set_sitemap_cron_job freq_in_minutes=59' puts else cmd = "*/#{freq_in_minutes} * * * * cd #{deploy_to}/current; rake fymp:make_sitemap RAILS_ENV=production" set_cron_job cmd, 'make_sitemap' end end desc "Set delete stored messages cron job" task :set_delete_message_contents_cron_job, :roles => :app do weeks_to_keep = ENV['weeks_to_keep'] unless weeks_to_keep puts puts 'must supply weeks_to_keep when setting cron job' puts 'USAGE: cap deploy:set_delete_message_contents_cron_job weeks_to_keep=6' puts else cmd = "35 4 * * * cd #{deploy_to}/current; rake fymp:delete_stored_message_contents weeks_to_keep=#{weeks_to_keep} RAILS_ENV=production" set_cron_job cmd, 'delete_stored_message_contents' end end desc "Set delete stored messages cron job" task :set_delete_messages_cron_job, :roles => :app do months_to_keep = ENV['months_to_keep'] unless months_to_keep puts puts 'must supply months_to_keep when setting cron job' puts 'USAGE: cap deploy:set_delete_messages_cron_job months_to_keep=6' puts else cmd = "05 4 * * * cd #{deploy_to}/current; rake fymp:delete_stored_messages months_to_keep=#{months_to_keep} RAILS_ENV=production" set_cron_job cmd, 'delete_stored_messages' end end desc "Set ar_sendmail cron job" task :set_ar_sendmail_cron_job, :roles => :app do batch_size = ENV['batch_size'] freq_in_minutes = ENV['freq_in_mins'] unless batch_size && freq_in_minutes puts puts 'must supply batch_size and freq_in_minutes when setting cron job' puts 'USAGE: cap deploy:set_ar_sendmail_cron_job batch_size=100 freq_in_mins=5' puts else cmd = "*/#{freq_in_minutes} * * * * cd #{deploy_to}/current; rake fymp:run_ar_sendmail batch_size=#{batch_size} deploy_dir=#{deploy_to}/current environment=production" set_cron_job cmd, 'ar_sendmail' end end desc "Set db backup cron job" task :set_db_backup_cron_job, :roles => :app do cmd = "02 3 * * * #{deploy_to}/current; rake fymp:backup_db_s3 path=db/backup RAILS_ENV='production'" set_cron_job cmd, 'backup_database_to_S3' end desc "Set db backup cleanup cron job" task :set_db_backup_cleanup_cron_job, :roles => :app do cmd = "42 3 * * * cd #{deploy_to}/current; rake fymp:cleanup_db_backup files_to_keep=42 RAILS_ENV='production'" set_cron_job cmd, 'S3_backup_cleanup' end def set_cron_job cmd, identifier tmpname = "/tmp/appname-crontab.#{Time.now.strftime('%s')}" run "(crontab -l || echo '') | grep -v '#{identifier}' > #{tmpname}" run %Q|echo "#{cmd}" >> #{tmpname}| run "crontab #{tmpname}" run "rm #{tmpname}" end desc "Upload deployed database.yml" task :upload_deployed_database_yml, :roles => :app do data = File.read("config/virtualserver/deployed_database.yml") put data, "#{release_path}/config/database.yml", :mode => 0664 end desc "Upload deployed mailer.yml" task :upload_deployed_mailer_yml, :roles => :app do data = File.read("config/virtualserver/deployed_mailer.yml") put data, "#{release_path}/config/mailer.yml", :mode => 0664 end desc "Upload S3 data files" task :put_s3_data, :roles => :app do data = File.read("config/virtualserver/deployed_s3.yml") put data, "#{release_path}/config/s3.yml", :mode => 0664 data = File.read("config/virtualserver/fymp-public.pem") put data, "#{release_path}/config/fymp-public.pem", :mode => 0664 end task :link_to_data, :roles => :app do data_dir = "#{deploy_to}/shared/cached-copy/data" run "if [ -d #{data_dir} ]; then ln -s #{data_dir} #{release_path}/data ; else echo cap deploy put_data first ; fi" end desc 'put data to server' task :put_data, :roles => :app do data_dir = "#{deploy_to}/shared/cached-copy/data" - if overwrite - run "if [ -d #{data_dir} ]; then echo #{data_dir} exists ; else mkdir #{data_dir} ; fi" - - run "rm #{data_dir}/FYMP_all.txt" - put_data data_dir, 'FYMP_all.txt' - - run "rm #{data_dir}/constituencies.txt" - put_data data_dir, 'constituencies.txt' - - if test_deploy - run "rm #{data_dir}/postcodes.txt" - put_data data_dir, 'postcodes.txt' - else - run "rm #{data_dir}/#{master_data_file}" - put_data data_dir, "#{master_data_file}" - end - end + # if overwrite + # run "if [ -d #{data_dir} ]; then echo #{data_dir} exists ; else mkdir #{data_dir} ; fi" + # + # run "rm #{data_dir}/FYMP_all.txt" + # put_data data_dir, 'FYMP_all.txt' + # + # run "rm #{data_dir}/constituencies.txt" + # put_data data_dir, 'constituencies.txt' + # + # if test_deploy + # run "rm #{data_dir}/postcodes.txt" + # put_data data_dir, 'postcodes.txt' + # else + # run "rm #{data_dir}/#{master_data_file}" + # put_data data_dir, "#{master_data_file}" + # end + # end log_dir = "#{deploy_to}/shared/log" run "if [ -d #{log_dir} ]; then echo #{log_dir} exists ; else mkdir #{log_dir} ; fi" run "if [ -d #{deploy_to}/shared/system ]; then echo exists ; else mkdir #{deploy_to}/shared/system ; fi" rc_rake_file = "#{release_path}/vendor/plugins/resource_controller/tasks/gem.rake" run "if [ -f #{rc_rake_file} ]; then mv #{rc_rake_file} #{rc_rake_file}.bak ; else echo not found ; fi" end def put_data data_dir, file data_file = "#{data_dir}/#{file}" run "if [ -f #{data_file} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' puts "sending #{file}" data = File.read("data/#{file.gsub('\\','')}") put data, "#{data_file}", :mode => 0664 else puts "#{file} #{message}" end end end - def prompt_for_value(var) - puts "" - puts "*************************************" - answer = "" - message = "Do you want to overwrite the data?\n\nIf yes, type: YES, OVERWRITE!!\n(To continue without overwriting, just hit return)\n" - answer = Capistrano::CLI.ui.ask(message) - if answer == "YES, OVERWRITE!!" - set var, true - else - set var, false - end - end + # def prompt_for_value(var) + # puts "" + # puts "*************************************" + # answer = "" + # message = "Do you want to overwrite the data?\n\nIf yes, type: YES, OVERWRITE!!\n(To continue without overwriting, just hit return)\n" + # answer = Capistrano::CLI.ui.ask(message) + # if answer == "YES, OVERWRITE!!" + # set var, true + # else + # set var, false + # end + # end def check_correct_ip puts "" puts "*************************************" answer = "n" servers = roles[:app].servers.uniq!.join(", ") message = "You are about to deploy to: #{servers} do you want to continue? (y/N)\n" answer = Capistrano::CLI.ui.ask(message) answer = "n" if answer == "" unless answer.downcase == 'y' # answer.first.downcase == "y" raise "Deploy aborted by user" end end desc "Restarting apache and clearing the cache" task :restart, :roles => :app do sudo "/usr/sbin/apache2ctl restart" run "cd #{current_path}; rake fymp:cache:expire_pages RAILS_ENV='production'" end desc "Perform rake tasks" task :rake_tasks, :roles => :app, :except => { :no_release => true } do run "cd #{current_path}; gem list bundler | grep 'bundler ('" do |channel, stream, message| unless message =~ /bundler \(\d+\.\d+\.d+/ run "cd #{current_path}; gem install bundler" end end run "cd #{current_path}; bundle install" run "cd #{current_path}; rake db:migrate RAILS_ENV='production'" - if overwrite - run "cd #{current_path}; rake fymp:constituencies RAILS_ENV='production'" - run "cd #{current_path}; rake fymp:members RAILS_ENV='production'" - - unless test_deploy - postcode_source = "" - message = "Which postcodes data file?\n\ne.g. data/NSPDF_MAY_2009_UK_1M_FP.txt\n" - postcode_source = Capistrano::CLI.ui.ask(message) - if File.exist?(postcode_source) - run "cd #{current_path}; rake fymp:parse_postcodes source=#{postcode_source} RAILS_ENV='production'" - else - raise "cannot find postcodes file: #{postcode_source}" - end - end - run "cd #{current_path}; rake fymp:populate RAILS_ENV='production'" - end + # if overwrite + # run "cd #{current_path}; rake fymp:constituencies RAILS_ENV='production'" + # run "cd #{current_path}; rake fymp:members RAILS_ENV='production'" + # + # unless test_deploy + # postcode_source = "" + # message = "Which postcodes data file?\n\ne.g. data/NSPDF_MAY_2009_UK_1M_FP.txt\n" + # postcode_source = Capistrano::CLI.ui.ask(message) + # if File.exist?(postcode_source) + # run "cd #{current_path}; rake fymp:parse_postcodes source=#{postcode_source} RAILS_ENV='production'" + # else + # raise "cannot find postcodes file: #{postcode_source}" + # end + # end + # run "cd #{current_path}; rake fymp:populate RAILS_ENV='production'" + # end run "cd #{current_path}; rake fymp:load_manual_postcodes RAILS_ENV='production'" run "cd #{current_path}; rake fymp:load_postcode_districts RAILS_ENV='production'" end task :check_folder_setup, :roles => :app do - if is_first_run? - set :overwrite, true - else - prompt_for_value(:overwrite) - end + # if is_first_run? + # set :overwrite, true + # else + # prompt_for_value(:overwrite) + # end puts 'checking folders...' run "if [ -d #{deploy_to} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' folders = deploy_to.split("/") folderpath = "" folders.each do |folder| if folder != "" folderpath << "/" << folder run "if [ -d #{folderpath} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' sudo "mkdir #{folderpath}" end end end end sudo "chown #{user} #{folderpath}" run "mkdir #{folderpath}/releases" end end puts 'checks complete!' end task :check_server, :roles => :app do check_correct_ip run "git --help" do |channel, stream, message| if message =~ /No such file or directory/ raise "You need to install git before proceeding" end end end task :check_site_setup, :roles => :app do if is_first_run? site_setup else rake_tasks end end task :site_setup, :roles => :app do puts 'entering first time only setup...' sudo "touch /etc/apache2/sites-available/#{application}" sudo "chown #{user} /etc/apache2/sites-available/#{application}" source = File.read("config/findyourmp.apache.example") data = "" source.each { |line| line.gsub!("[RELEASE-PATH]", deploy_to) data << line } put data, "/etc/apache2/sites-available/#{application}", :mode => 0664 sudo "sudo ln -s -f /etc/apache2/sites-available/#{application} /etc/apache2/sites-enabled/000-default" run "sudo mysql -uroot -p", :pty => true do |ch, stream, data| # puts data if data =~ /Enter password:/ ch.send_data(sql_server_password + "\n") else ch.send_data("create database #{application}_production CHARACTER SET utf8 COLLATE utf8_unicode_ci; \n") ch.send_data("create database #{application}_development CHARACTER SET utf8 COLLATE utf8_unicode_ci; \n") ch.send_data("create user '#{sql_backup_user}'@'localhost' identified by '#{sql_backup_password}'; \n") ch.send_data("grant SELECT, LOCK TABLES on #{application}_production.* to '#{sql_backup_user}'@'localhost'; \n") ch.send_data("grant SHOW DATABASES, RELOAD on *.* to '#{sql_backup_user}'@'localhost'; \n") ch.send_data("FLUSH PRIVILEGES; \n") ch.send_data("exit \n") end end sudo "gem sources -a http://gems.github.com" sudo "gem install hpricot" sudo "gem install morph" sudo "gem install unicode" sudo "gem install treetop" sudo "gem install term-ansicolor" sudo "gem install aws-s3 --version '0.5.1'" sudo "gem install adzap-ar_mailer --version '2.1.5'" sudo "cp /var/lib/gems/1.8/bin/ar_sendmail /usr/local/bin/ar_sendmail" rake_tasks sudo "/usr/sbin/apache2ctl restart" puts 'first time only setup complete!' end [:start, :stop].each do |t| desc "#{t} task is not used with mod_rails" task t, :roles => :app do ; end end def is_first_run? run "if [ -f /etc/apache2/sites-available/#{application} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' return true else return false end end end desc "Update postcodes" task :update_postcodes, :roles => :app do file = "data/diff_postcodes.txt" if File.exist?(file) data = File.read(file) put data, "#{current_path}/data/diff_postcodes.txt", :mode => 0664 run "cd #{current_path}; rake fymp:update_postcodes RAILS_ENV='production'" run "cd #{current_path}; rake fymp:load_postcode_districts RAILS_ENV='production'" else puts 'USAGE EXAMPLE:' puts 'rake fymp:diff_postcodes old=data/NSPDF_FEB_2009_UK_1M.txt new=data/NSPDF_MAY_2009_UK_1M_FP.txt' puts 'cap deploy:update_postcodes' end end desc "Analyze postcodes" task :analyze_postcode_update, :roles => :app do file = "data/diff_postcodes.txt" if File.exist?(file) data = File.read(file) put data, "#{current_path}/data/diff_postcodes.txt", :mode => 0664 run "cd #{current_path}; rake fymp:analyze_postcode_update RAILS_ENV='production'" else puts 'USAGE EXAMPLE:' puts 'rake fymp:diff_postcodes old=data/NSPDF_FEB_2009_UK_1M.txt new=data/NSPDF_MAY_2009_UK_1M_FP.txt' puts 'cap deploy:analyze_postcode_update' end end end before 'deploy:update_code', 'deploy:check_server', 'deploy:check_folder_setup' after 'deploy:update_code', 'deploy:upload_deployed_database_yml', 'deploy:upload_deployed_mailer_yml', 'deploy:put_s3_data', 'deploy:put_data', 'deploy:link_to_data' after 'deploy:symlink', 'deploy:check_site_setup' namespace :fymp do namespace :cache do set :remote_rake_cmd, "/usr/local/bin/rake" desc "Expire page cache" task :expire_pages, :roles => :app do run("export RAILS_ENV=production; cd #{deploy_to}/current; #{remote_rake_cmd} fymp:cache:expire_pages") end end end
robertbrook/findyourmp
a3c224ef7c99cd3d18b6e0192815a083289c0a51
added magic incantations to make capistrano work again
diff --git a/Gemfile b/Gemfile index d5965ff..4301fe2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,33 +1,35 @@ source "http://rubygems.org" gem 'rake', '10.1.0' gem 'rails', '2.3.17' gem 'rdoc' gem 'haml', '3.1.8' gem 'authlogic', '2.1.9' gem 'friendly_id', '2.3.4', :require => "friendly_id" gem 'xss_terminate' gem 'hpricot' gem 'nokogiri' gem 'aws-s3' gem 'mysql2', '0.2.6' gem 'unicode' gem 'resource_controller' gem 'rest-client' gem 'newrelic_rpm' group :test do gem 'test-unit', '1.2.3' gem 'webrat' gem 'simplecov' gem 'rspec', '1.3.2' gem 'rspec-rails', '1.3.2' gem "capybara", "1.1.1" gem "gherkin", "2.5.0" gem 'cucumber', '1.1.0' gem 'cucumber-rails', '0.3.2' end group :development do gem 'capistrano', '2.15.5' + gem 'rvm-capistrano' + gem 'net-ssh', '2.7.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 6078d57..03b2b73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,153 +1,157 @@ GEM remote: http://rubygems.org/ specs: actionmailer (2.3.17) actionpack (= 2.3.17) actionpack (2.3.17) activesupport (= 2.3.17) rack (~> 1.1.0) activerecord (2.3.17) activesupport (= 2.3.17) activeresource (2.3.17) activesupport (= 2.3.17) activesupport (2.3.17) authlogic (2.1.9) activerecord (~> 2.3.0) activesupport (~> 2.3.0) aws-s3 (0.6.3) builder mime-types xml-simple builder (3.2.2) capistrano (2.15.5) highline net-scp (>= 1.0.0) net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.1.0) capybara (1.1.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (~> 2.0) xpath (~> 0.1.4) chardet (0.9.0) childprocess (0.5.1) ffi (~> 1.0, >= 1.0.11) cucumber (1.1.0) builder (>= 2.1.2) diff-lcs (>= 1.1.2) gherkin (~> 2.5.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) cucumber-rails (0.3.2) cucumber (>= 0.8.0) diff-lcs (1.2.5) docile (1.1.3) ffi (1.9.3) friendly_id (2.3.4) activerecord (>= 2.2) activesupport (>= 2.2) gherkin (2.5.0) json (>= 1.4.6) haml (3.1.8) highline (1.6.21) hoe (3.9.0) rake (>= 0.8, < 11.0) hpricot (0.8.6) html5 (0.10.0) chardet (>= 0.9.0) hoe (>= 1.2.0) json (1.8.1) mime-types (2.1) mini_portile (0.5.2) multi_json (1.9.0) mysql2 (0.2.6) net-scp (1.1.2) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (2.8.0) + net-ssh (2.7.0) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) newrelic_rpm (3.7.3.204) nokogiri (1.6.1) mini_portile (~> 0.5.0) rack (1.1.6) rack-test (0.6.2) rack (>= 1.0) rails (2.3.17) actionmailer (= 2.3.17) actionpack (= 2.3.17) activerecord (= 2.3.17) activeresource (= 2.3.17) activesupport (= 2.3.17) rake (>= 0.8.3) rake (10.1.0) rdoc (4.1.1) json (~> 1.4) resource_controller (0.6.6) rest-client (1.6.7) mime-types (>= 1.16) rspec (1.3.2) rspec-rails (1.3.2) rack (>= 1.0.0) rspec (>= 1.3.0) rubyzip (1.1.0) + rvm-capistrano (1.5.1) + capistrano (~> 2.15.4) selenium-webdriver (2.40.0) childprocess (>= 0.5.0) multi_json (~> 1.0) rubyzip (~> 1.0) websocket (~> 1.0.4) simplecov (0.8.2) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) term-ansicolor (1.3.0) tins (~> 1.0) test-unit (1.2.3) hoe (>= 1.5.1) tins (1.0.0) unicode (0.4.4.1) webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) websocket (1.0.7) xml-simple (1.1.3) xpath (0.1.4) nokogiri (~> 1.3) xss_terminate (0.22) html5 (>= 0.10.0) PLATFORMS ruby DEPENDENCIES authlogic (= 2.1.9) aws-s3 capistrano (= 2.15.5) capybara (= 1.1.1) cucumber (= 1.1.0) cucumber-rails (= 0.3.2) friendly_id (= 2.3.4) gherkin (= 2.5.0) haml (= 3.1.8) hpricot mysql2 (= 0.2.6) + net-ssh (= 2.7.0) newrelic_rpm nokogiri rails (= 2.3.17) rake (= 10.1.0) rdoc resource_controller rest-client rspec (= 1.3.2) rspec-rails (= 1.3.2) + rvm-capistrano simplecov test-unit (= 1.2.3) unicode webrat xss_terminate diff --git a/config/deploy.rb b/config/deploy.rb index ba80a9b..6b485d2 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,385 +1,399 @@ +require "rvm/capistrano" + load File.expand_path(File.dirname(__FILE__) + '/virtualserver/deploy_secrets.rb') default_run_options[:pty] = true set :repository, "git://github.com/robertbrook/findyourmp.git" set :scm, :git ssh_options[:forward_agent] = true set :branch, "master" set :deploy_via, :remote_cache set :git_enable_submodules, 1 role :app, domain role :web, domain role :db, domain, :primary => true set :test_deploy, true set :master_data_file, 'NSPDC_AUG_2008_UK_100M.txt' +namespace :rvm do + task :trust_rvmrc do + run "rvm rvmrc trust #{release_path}" + end +end + namespace :deploy do set :user, deployuser set :password, deploypassword desc "Set sitemap cron job" task :set_sitemap_cron_job, :roles => :app do freq_in_minutes = ENV['freq_in_minutes'] unless freq_in_minutes puts puts 'must supply freq_in_minutes when setting cron job' puts 'USAGE: cap deploy:set_sitemap_cron_job freq_in_minutes=59' puts else cmd = "*/#{freq_in_minutes} * * * * cd #{deploy_to}/current; rake fymp:make_sitemap RAILS_ENV=production" set_cron_job cmd, 'make_sitemap' end end desc "Set delete stored messages cron job" task :set_delete_message_contents_cron_job, :roles => :app do weeks_to_keep = ENV['weeks_to_keep'] unless weeks_to_keep puts puts 'must supply weeks_to_keep when setting cron job' puts 'USAGE: cap deploy:set_delete_message_contents_cron_job weeks_to_keep=6' puts else cmd = "35 4 * * * cd #{deploy_to}/current; rake fymp:delete_stored_message_contents weeks_to_keep=#{weeks_to_keep} RAILS_ENV=production" set_cron_job cmd, 'delete_stored_message_contents' end end desc "Set delete stored messages cron job" task :set_delete_messages_cron_job, :roles => :app do months_to_keep = ENV['months_to_keep'] unless months_to_keep puts puts 'must supply months_to_keep when setting cron job' puts 'USAGE: cap deploy:set_delete_messages_cron_job months_to_keep=6' puts else cmd = "05 4 * * * cd #{deploy_to}/current; rake fymp:delete_stored_messages months_to_keep=#{months_to_keep} RAILS_ENV=production" set_cron_job cmd, 'delete_stored_messages' end end desc "Set ar_sendmail cron job" task :set_ar_sendmail_cron_job, :roles => :app do batch_size = ENV['batch_size'] freq_in_minutes = ENV['freq_in_mins'] unless batch_size && freq_in_minutes puts puts 'must supply batch_size and freq_in_minutes when setting cron job' puts 'USAGE: cap deploy:set_ar_sendmail_cron_job batch_size=100 freq_in_mins=5' puts else cmd = "*/#{freq_in_minutes} * * * * cd #{deploy_to}/current; rake fymp:run_ar_sendmail batch_size=#{batch_size} deploy_dir=#{deploy_to}/current environment=production" set_cron_job cmd, 'ar_sendmail' end end desc "Set db backup cron job" task :set_db_backup_cron_job, :roles => :app do cmd = "02 3 * * * #{deploy_to}/current; rake fymp:backup_db_s3 path=db/backup RAILS_ENV='production'" set_cron_job cmd, 'backup_database_to_S3' end desc "Set db backup cleanup cron job" task :set_db_backup_cleanup_cron_job, :roles => :app do cmd = "42 3 * * * cd #{deploy_to}/current; rake fymp:cleanup_db_backup files_to_keep=42 RAILS_ENV='production'" set_cron_job cmd, 'S3_backup_cleanup' end def set_cron_job cmd, identifier tmpname = "/tmp/appname-crontab.#{Time.now.strftime('%s')}" run "(crontab -l || echo '') | grep -v '#{identifier}' > #{tmpname}" run %Q|echo "#{cmd}" >> #{tmpname}| run "crontab #{tmpname}" run "rm #{tmpname}" end desc "Upload deployed database.yml" task :upload_deployed_database_yml, :roles => :app do data = File.read("config/virtualserver/deployed_database.yml") put data, "#{release_path}/config/database.yml", :mode => 0664 end desc "Upload deployed mailer.yml" task :upload_deployed_mailer_yml, :roles => :app do data = File.read("config/virtualserver/deployed_mailer.yml") put data, "#{release_path}/config/mailer.yml", :mode => 0664 end desc "Upload S3 data files" task :put_s3_data, :roles => :app do data = File.read("config/virtualserver/deployed_s3.yml") put data, "#{release_path}/config/s3.yml", :mode => 0664 data = File.read("config/virtualserver/fymp-public.pem") put data, "#{release_path}/config/fymp-public.pem", :mode => 0664 end task :link_to_data, :roles => :app do data_dir = "#{deploy_to}/shared/cached-copy/data" run "if [ -d #{data_dir} ]; then ln -s #{data_dir} #{release_path}/data ; else echo cap deploy put_data first ; fi" end desc 'put data to server' task :put_data, :roles => :app do data_dir = "#{deploy_to}/shared/cached-copy/data" if overwrite run "if [ -d #{data_dir} ]; then echo #{data_dir} exists ; else mkdir #{data_dir} ; fi" run "rm #{data_dir}/FYMP_all.txt" put_data data_dir, 'FYMP_all.txt' run "rm #{data_dir}/constituencies.txt" put_data data_dir, 'constituencies.txt' if test_deploy run "rm #{data_dir}/postcodes.txt" put_data data_dir, 'postcodes.txt' else run "rm #{data_dir}/#{master_data_file}" put_data data_dir, "#{master_data_file}" end end log_dir = "#{deploy_to}/shared/log" run "if [ -d #{log_dir} ]; then echo #{log_dir} exists ; else mkdir #{log_dir} ; fi" run "if [ -d #{deploy_to}/shared/system ]; then echo exists ; else mkdir #{deploy_to}/shared/system ; fi" rc_rake_file = "#{release_path}/vendor/plugins/resource_controller/tasks/gem.rake" run "if [ -f #{rc_rake_file} ]; then mv #{rc_rake_file} #{rc_rake_file}.bak ; else echo not found ; fi" end def put_data data_dir, file data_file = "#{data_dir}/#{file}" run "if [ -f #{data_file} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' puts "sending #{file}" data = File.read("data/#{file.gsub('\\','')}") put data, "#{data_file}", :mode => 0664 else puts "#{file} #{message}" end end end def prompt_for_value(var) puts "" puts "*************************************" answer = "" message = "Do you want to overwrite the data?\n\nIf yes, type: YES, OVERWRITE!!\n(To continue without overwriting, just hit return)\n" answer = Capistrano::CLI.ui.ask(message) if answer == "YES, OVERWRITE!!" set var, true else set var, false end end def check_correct_ip puts "" puts "*************************************" answer = "n" servers = roles[:app].servers.uniq!.join(", ") message = "You are about to deploy to: #{servers} do you want to continue? (y/N)\n" answer = Capistrano::CLI.ui.ask(message) answer = "n" if answer == "" unless answer.downcase == 'y' # answer.first.downcase == "y" raise "Deploy aborted by user" end end desc "Restarting apache and clearing the cache" task :restart, :roles => :app do sudo "/usr/sbin/apache2ctl restart" run "cd #{current_path}; rake fymp:cache:expire_pages RAILS_ENV='production'" end desc "Perform rake tasks" task :rake_tasks, :roles => :app, :except => { :no_release => true } do + run "cd #{current_path}; gem list bundler | grep 'bundler ('" do |channel, stream, message| + unless message =~ /bundler \(\d+\.\d+\.d+/ + run "cd #{current_path}; gem install bundler" + end + end + run "cd #{current_path}; bundle install" + run "cd #{current_path}; rake db:migrate RAILS_ENV='production'" - if overwrite run "cd #{current_path}; rake fymp:constituencies RAILS_ENV='production'" run "cd #{current_path}; rake fymp:members RAILS_ENV='production'" unless test_deploy postcode_source = "" message = "Which postcodes data file?\n\ne.g. data/NSPDF_MAY_2009_UK_1M_FP.txt\n" postcode_source = Capistrano::CLI.ui.ask(message) if File.exist?(postcode_source) run "cd #{current_path}; rake fymp:parse_postcodes source=#{postcode_source} RAILS_ENV='production'" else raise "cannot find postcodes file: #{postcode_source}" end end run "cd #{current_path}; rake fymp:populate RAILS_ENV='production'" end run "cd #{current_path}; rake fymp:load_manual_postcodes RAILS_ENV='production'" run "cd #{current_path}; rake fymp:load_postcode_districts RAILS_ENV='production'" end task :check_folder_setup, :roles => :app do if is_first_run? set :overwrite, true else prompt_for_value(:overwrite) end puts 'checking folders...' run "if [ -d #{deploy_to} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' folders = deploy_to.split("/") folderpath = "" folders.each do |folder| if folder != "" folderpath << "/" << folder run "if [ -d #{folderpath} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' sudo "mkdir #{folderpath}" end end end end sudo "chown #{user} #{folderpath}" run "mkdir #{folderpath}/releases" end end puts 'checks complete!' end task :check_server, :roles => :app do check_correct_ip run "git --help" do |channel, stream, message| if message =~ /No such file or directory/ raise "You need to install git before proceeding" end end end task :check_site_setup, :roles => :app do if is_first_run? site_setup else rake_tasks end end task :site_setup, :roles => :app do puts 'entering first time only setup...' sudo "touch /etc/apache2/sites-available/#{application}" sudo "chown #{user} /etc/apache2/sites-available/#{application}" source = File.read("config/findyourmp.apache.example") data = "" source.each { |line| line.gsub!("[RELEASE-PATH]", deploy_to) data << line } put data, "/etc/apache2/sites-available/#{application}", :mode => 0664 sudo "sudo ln -s -f /etc/apache2/sites-available/#{application} /etc/apache2/sites-enabled/000-default" run "sudo mysql -uroot -p", :pty => true do |ch, stream, data| # puts data if data =~ /Enter password:/ ch.send_data(sql_server_password + "\n") else ch.send_data("create database #{application}_production CHARACTER SET utf8 COLLATE utf8_unicode_ci; \n") ch.send_data("create database #{application}_development CHARACTER SET utf8 COLLATE utf8_unicode_ci; \n") ch.send_data("create user '#{sql_backup_user}'@'localhost' identified by '#{sql_backup_password}'; \n") ch.send_data("grant SELECT, LOCK TABLES on #{application}_production.* to '#{sql_backup_user}'@'localhost'; \n") ch.send_data("grant SHOW DATABASES, RELOAD on *.* to '#{sql_backup_user}'@'localhost'; \n") ch.send_data("FLUSH PRIVILEGES; \n") ch.send_data("exit \n") end end sudo "gem sources -a http://gems.github.com" sudo "gem install hpricot" sudo "gem install morph" sudo "gem install unicode" sudo "gem install treetop" sudo "gem install term-ansicolor" sudo "gem install aws-s3 --version '0.5.1'" sudo "gem install adzap-ar_mailer --version '2.1.5'" sudo "cp /var/lib/gems/1.8/bin/ar_sendmail /usr/local/bin/ar_sendmail" rake_tasks sudo "/usr/sbin/apache2ctl restart" puts 'first time only setup complete!' end [:start, :stop].each do |t| desc "#{t} task is not used with mod_rails" task t, :roles => :app do ; end end def is_first_run? run "if [ -f /etc/apache2/sites-available/#{application} ]; then echo exists ; else echo not there ; fi" do |channel, stream, message| if message.strip == 'not there' return true else return false end end end desc "Update postcodes" task :update_postcodes, :roles => :app do file = "data/diff_postcodes.txt" if File.exist?(file) data = File.read(file) put data, "#{current_path}/data/diff_postcodes.txt", :mode => 0664 run "cd #{current_path}; rake fymp:update_postcodes RAILS_ENV='production'" run "cd #{current_path}; rake fymp:load_postcode_districts RAILS_ENV='production'" else puts 'USAGE EXAMPLE:' puts 'rake fymp:diff_postcodes old=data/NSPDF_FEB_2009_UK_1M.txt new=data/NSPDF_MAY_2009_UK_1M_FP.txt' puts 'cap deploy:update_postcodes' end end desc "Analyze postcodes" task :analyze_postcode_update, :roles => :app do file = "data/diff_postcodes.txt" if File.exist?(file) data = File.read(file) put data, "#{current_path}/data/diff_postcodes.txt", :mode => 0664 run "cd #{current_path}; rake fymp:analyze_postcode_update RAILS_ENV='production'" else puts 'USAGE EXAMPLE:' puts 'rake fymp:diff_postcodes old=data/NSPDF_FEB_2009_UK_1M.txt new=data/NSPDF_MAY_2009_UK_1M_FP.txt' puts 'cap deploy:analyze_postcode_update' end end end before 'deploy:update_code', 'deploy:check_server', 'deploy:check_folder_setup' after 'deploy:update_code', 'deploy:upload_deployed_database_yml', 'deploy:upload_deployed_mailer_yml', 'deploy:put_s3_data', 'deploy:put_data', 'deploy:link_to_data' after 'deploy:symlink', 'deploy:check_site_setup' namespace :fymp do namespace :cache do set :remote_rake_cmd, "/usr/local/bin/rake" desc "Expire page cache" task :expire_pages, :roles => :app do run("export RAILS_ENV=production; cd #{deploy_to}/current; #{remote_rake_cmd} fymp:cache:expire_pages") end end end
robertbrook/findyourmp
7a76ff735e4ca6d9298954a5f94a2e5983d16809
rake version in gemfile
diff --git a/Gemfile b/Gemfile index 4b8eaa3..d5965ff 100644 --- a/Gemfile +++ b/Gemfile @@ -1,33 +1,33 @@ source "http://rubygems.org" -gem 'rake' +gem 'rake', '10.1.0' gem 'rails', '2.3.17' gem 'rdoc' gem 'haml', '3.1.8' gem 'authlogic', '2.1.9' gem 'friendly_id', '2.3.4', :require => "friendly_id" gem 'xss_terminate' gem 'hpricot' gem 'nokogiri' gem 'aws-s3' gem 'mysql2', '0.2.6' gem 'unicode' gem 'resource_controller' gem 'rest-client' gem 'newrelic_rpm' group :test do gem 'test-unit', '1.2.3' gem 'webrat' gem 'simplecov' gem 'rspec', '1.3.2' gem 'rspec-rails', '1.3.2' gem "capybara", "1.1.1" gem "gherkin", "2.5.0" gem 'cucumber', '1.1.0' gem 'cucumber-rails', '0.3.2' end group :development do gem 'capistrano', '2.15.5' end diff --git a/Gemfile.lock b/Gemfile.lock index cac26ad..6078d57 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,138 +1,153 @@ GEM remote: http://rubygems.org/ specs: actionmailer (2.3.17) actionpack (= 2.3.17) actionpack (2.3.17) activesupport (= 2.3.17) rack (~> 1.1.0) activerecord (2.3.17) activesupport (= 2.3.17) activeresource (2.3.17) activesupport (= 2.3.17) activesupport (2.3.17) authlogic (2.1.9) activerecord (~> 2.3.0) activesupport (~> 2.3.0) aws-s3 (0.6.3) builder mime-types xml-simple builder (3.2.2) + capistrano (2.15.5) + highline + net-scp (>= 1.0.0) + net-sftp (>= 2.0.0) + net-ssh (>= 2.0.14) + net-ssh-gateway (>= 1.1.0) capybara (1.1.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (~> 2.0) xpath (~> 0.1.4) chardet (0.9.0) - childprocess (0.3.9) + childprocess (0.5.1) ffi (~> 1.0, >= 1.0.11) cucumber (1.1.0) builder (>= 2.1.2) diff-lcs (>= 1.1.2) gherkin (~> 2.5.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) cucumber-rails (0.3.2) cucumber (>= 0.8.0) diff-lcs (1.2.5) - docile (1.1.1) + docile (1.1.3) ffi (1.9.3) friendly_id (2.3.4) activerecord (>= 2.2) activesupport (>= 2.2) gherkin (2.5.0) json (>= 1.4.6) haml (3.1.8) - hoe (3.7.1) + highline (1.6.21) + hoe (3.9.0) rake (>= 0.8, < 11.0) hpricot (0.8.6) html5 (0.10.0) chardet (>= 0.9.0) hoe (>= 1.2.0) json (1.8.1) - mime-types (2.0) + mime-types (2.1) mini_portile (0.5.2) - multi_json (1.8.2) + multi_json (1.9.0) mysql2 (0.2.6) - newrelic_rpm (3.7.2.195) - nokogiri (1.6.0) + net-scp (1.1.2) + net-ssh (>= 2.6.5) + net-sftp (2.1.2) + net-ssh (>= 2.6.5) + net-ssh (2.8.0) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + newrelic_rpm (3.7.3.204) + nokogiri (1.6.1) mini_portile (~> 0.5.0) rack (1.1.6) rack-test (0.6.2) rack (>= 1.0) rails (2.3.17) actionmailer (= 2.3.17) actionpack (= 2.3.17) activerecord (= 2.3.17) activeresource (= 2.3.17) activesupport (= 2.3.17) rake (>= 0.8.3) rake (10.1.0) - rdoc (4.0.1) + rdoc (4.1.1) json (~> 1.4) resource_controller (0.6.6) rest-client (1.6.7) mime-types (>= 1.16) rspec (1.3.2) rspec-rails (1.3.2) rack (>= 1.0.0) rspec (>= 1.3.0) - rubyzip (1.0.0) - selenium-webdriver (2.37.0) - childprocess (>= 0.2.5) + rubyzip (1.1.0) + selenium-webdriver (2.40.0) + childprocess (>= 0.5.0) multi_json (~> 1.0) - rubyzip (~> 1.0.0) + rubyzip (~> 1.0) websocket (~> 1.0.4) simplecov (0.8.2) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) - term-ansicolor (1.2.2) - tins (~> 0.8) + term-ansicolor (1.3.0) + tins (~> 1.0) test-unit (1.2.3) hoe (>= 1.5.1) - tins (0.13.1) - unicode (0.4.4) + tins (1.0.0) + unicode (0.4.4.1) webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) websocket (1.0.7) - xml-simple (1.1.2) + xml-simple (1.1.3) xpath (0.1.4) nokogiri (~> 1.3) xss_terminate (0.22) html5 (>= 0.10.0) PLATFORMS ruby DEPENDENCIES authlogic (= 2.1.9) aws-s3 + capistrano (= 2.15.5) capybara (= 1.1.1) cucumber (= 1.1.0) cucumber-rails (= 0.3.2) friendly_id (= 2.3.4) gherkin (= 2.5.0) haml (= 3.1.8) hpricot mysql2 (= 0.2.6) newrelic_rpm nokogiri rails (= 2.3.17) - rake + rake (= 10.1.0) rdoc resource_controller rest-client rspec (= 1.3.2) rspec-rails (= 1.3.2) simplecov test-unit (= 1.2.3) unicode webrat xss_terminate