From 18109e31321c0e97d6b1e37eb8dd10c8e134e1d6 Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Sat, 29 Oct 2011 12:10:36 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- Gemfile.lock | 122 +++++++++--------- Rakefile | 4 +- config/database.yml | 4 +- db/migrate/001_create_cuddlers.rb | 2 +- db/migrate/002_update_lat_and_long_columns.rb | 2 +- environment.rb | 12 +- features/hello_world.feature | 2 +- features/step_definitions/web_steps.rb | 6 +- lib/team_fun/form_builder.rb | 28 ++-- lib/team_fun/helpers.rb | 14 +- models/cuddler.rb | 10 +- public/dtc.js | 26 ++-- 12 files changed, 116 insertions(+), 116 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2004076..0f3c8a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,119 +1,119 @@ ---- -dependencies: - activerecord: - group: +--- +dependencies: + activerecord: + group: - :default version: ">= 3.0.0.rc" - require: + require: - active_record - pg: - group: + pg: + group: - :default version: ">= 0" - haml: - group: + haml: + group: - :default version: ">= 0" - sqlite3-ruby: - group: + sqlite3-ruby: + group: - :default version: ">= 0" - rspec: - group: + rspec: + group: - :test version: ">= 0" - require: + require: - spec/expectations - sinatra: - group: + sinatra: + group: - :default version: ">= 0" - factory_girl: - group: + factory_girl: + group: - :test version: ">= 0" - postgres: - group: + postgres: + group: - :default version: ">= 0" - cucumber: - group: + cucumber: + group: - :test version: ">= 0" - launchy: - group: + launchy: + group: - :test version: ">= 0" - capybara: - group: + capybara: + group: - :test version: ">= 0" -specs: -- rake: +specs: +- rake: version: 0.8.7 -- activesupport: +- activesupport: version: 3.0.0.rc -- builder: +- builder: version: 2.1.2 -- i18n: +- i18n: version: 0.4.1 -- activemodel: +- activemodel: version: 3.0.0.rc -- arel: +- arel: version: 0.4.0 -- tzinfo: +- tzinfo: version: 0.3.23 -- activerecord: +- activerecord: version: 3.0.0.rc -- culerity: +- culerity: version: 0.2.12 -- mime-types: +- mime-types: version: "1.16" -- nokogiri: +- nokogiri: version: 1.4.3.1 -- rack: +- rack: version: 1.2.1 -- rack-test: +- rack-test: version: 0.5.4 -- ffi: +- ffi: version: 0.6.3 -- json_pure: +- json_pure: version: 1.4.6 -- rubyzip: +- rubyzip: version: 0.9.4 -- selenium-webdriver: +- selenium-webdriver: version: 0.0.28 -- capybara: +- capybara: version: 0.3.9 -- configuration: +- configuration: version: 1.1.0 -- diff-lcs: +- diff-lcs: version: 1.1.2 -- trollop: +- trollop: version: 1.16.2 -- gherkin: +- gherkin: version: 2.1.5 -- term-ansicolor: +- term-ansicolor: version: 1.0.5 -- cucumber: +- cucumber: version: 0.8.5 -- factory_girl: +- factory_girl: version: 1.3.2 -- haml: +- haml: version: 3.0.17 -- launchy: +- launchy: version: 0.3.7 -- pg: +- pg: version: 0.9.0 -- postgres: +- postgres: version: 0.7.9.2008.01.28 -- rspec: +- rspec: version: 1.3.0 -- sinatra: +- sinatra: version: "1.0" -- sqlite3-ruby: +- sqlite3-ruby: version: 1.3.1 hash: afe5ad7afc4ebb3571d4f9fe29fbe336146055bc -sources: -- Rubygems: +sources: +- Rubygems: uri: http://gemcutter.org diff --git a/Rakefile b/Rakefile index 01a0e05..245c466 100644 --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,7 @@ namespace :db do ActiveRecord::Migration.verbose = true ActiveRecord::Migrator.migrate("db/migrate") end - + task(:rollback => :environment) do require 'logger' ActiveRecord::Base.logger = Logger.new(STDOUT) @@ -24,7 +24,7 @@ desc 'Loads up this project\'s environment' task :environment do require File.join(File.dirname(__FILE__), 'environment') end - + desc 'Runs irb in this project\'s context' task :irb do |t| exec "irb -I lib -r '#{File.join(File.dirname(__FILE__), 'environment')}'" diff --git a/config/database.yml b/config/database.yml index 561808a..aaf15b0 100644 --- a/config/database.yml +++ b/config/database.yml @@ -4,11 +4,11 @@ development: adapter: postgresql user: user database: dtc_dev - + production: adapter: sqlite3 database: db/production.sqlite.db - + test: adapter: sqlite3 database: db/test.sqlite.db \ No newline at end of file diff --git a/db/migrate/001_create_cuddlers.rb b/db/migrate/001_create_cuddlers.rb index b873cca..cab53f8 100644 --- a/db/migrate/001_create_cuddlers.rb +++ b/db/migrate/001_create_cuddlers.rb @@ -6,7 +6,7 @@ def self.up t.float :long end end - + def self.down drop_table :cuddlers end diff --git a/db/migrate/002_update_lat_and_long_columns.rb b/db/migrate/002_update_lat_and_long_columns.rb index 3cdaadc..0f5ccd3 100644 --- a/db/migrate/002_update_lat_and_long_columns.rb +++ b/db/migrate/002_update_lat_and_long_columns.rb @@ -3,7 +3,7 @@ def self.up change_column :cuddlers, :lat, :decimal, :scale => 14, :precision => 17 change_column :cuddlers, :long, :decimal, :scale => 14, :precision => 17 end - + def self.down change_column :cuddlers, :lat, :float change_column :cuddlers, :long, :float diff --git a/environment.rb b/environment.rb index c598ac6..a2b7085 100644 --- a/environment.rb +++ b/environment.rb @@ -4,7 +4,7 @@ $: << File.dirname(__FILE__) class Environment - + def self.reload! [:models, :lib].each do |dir| Dir[File.join(dir.to_s, '*')].each do |file| @@ -16,26 +16,26 @@ def self.reload! end ActiveRecord::Base.establish_connection Config.database[ENV['RACK_ENV'].downcase.underscore] end - + module Config class << self def set(key, value) @store ||= {} @store[key.to_sym] = value end - + def get(key) @store[key.to_sym] end - + def [](key) get(key) end - + def []=(key, value) set(key, value) end - + def method_missing(key) get(key) end diff --git a/features/hello_world.feature b/features/hello_world.feature index 7147f47..a8f88e3 100644 --- a/features/hello_world.feature +++ b/features/hello_world.feature @@ -2,7 +2,7 @@ Feature: Say Hello World! In order to get a warm feeling As a Sinatra and Cucumber User I want to have a working installation - + Scenario: Saying Hello! When I go to "/" Then I should see "Hello, world!" within "h1" \ No newline at end of file diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index ff6f1f9..36d0465 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -183,7 +183,7 @@ def with_scope(locator) end end end - + Then /^(?:|I )should be on "(.+)"$/ do |page_name| current_path = URI.parse(current_url).path if current_path.respond_to? :should @@ -197,8 +197,8 @@ def with_scope(locator) query = URI.parse(current_url).query actual_params = query ? CGI.parse(query) : {} expected_params = {} - expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} - + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + if actual_params.respond_to? :should actual_params.should == expected_params else diff --git a/lib/team_fun/form_builder.rb b/lib/team_fun/form_builder.rb index 74e6968..aa0f482 100644 --- a/lib/team_fun/form_builder.rb +++ b/lib/team_fun/form_builder.rb @@ -1,57 +1,57 @@ class ::TeamFun::FormBuilder - + attr_reader :template, :options, :object - + def initialize(options, object, template) @options, @object, @template = options, object, template end - + [:text, :email, :password].each do |name| define_method name.to_s + '_field' do |field| input name, field end end - + def textarea(field) "" end - + def input(type, field) "" end - + def submit_button(text=nil) "" end - + def label(field, text=nil) "" end - + private - + def class_with_errors(field) " class='error'" if object.errors[field] end - + def obj_id @obj_id ||= "#{object_name}#{'_'+object.id.to_s unless object.new_record?}" end - + def object_name @object_name ||= object.class.name.underscore end - + def input_name(field) object_name+"[#{field.to_s}]" end - + def save_text object.new_record? ? 'Create' : 'Update' end - + end \ No newline at end of file diff --git a/lib/team_fun/helpers.rb b/lib/team_fun/helpers.rb index 657df5b..6963277 100644 --- a/lib/team_fun/helpers.rb +++ b/lib/team_fun/helpers.rb @@ -11,7 +11,7 @@ def form_for(object, options = {}, &block) options[:action] ||= "/#{object.class.name.pluralize.underscore}" end end - + form = "
\n" form << haml_indent << " \n" if method block = capture_haml(::TeamFun::FormBuilder.new(options, object, self), &block) @@ -20,29 +20,29 @@ def form_for(object, options = {}, &block) end form + "
" end - + def link_to(location, text = nil, options = {}) "#{text||location.to_s}" end - + def uri_for(object) return object.to_uri if object.respond_to?(:to_uri) return object.to_s if object.kind_of? String "/#{object.class.name.pluralize.underscore}/#{object.id}" end - + def redirect_to(object) redirect uri_for(object) end - + def options_to_attributes(options) options.inject('') { |str, hash| str << " #{hash[0].to_s}='#{hash[1].to_s}'" } end - + def script_tag(location) "" end - + def render_partial(sym) haml sym, :layout => false end diff --git a/models/cuddler.rb b/models/cuddler.rb index e065f57..4389f6a 100644 --- a/models/cuddler.rb +++ b/models/cuddler.rb @@ -1,15 +1,15 @@ class Cuddler < ActiveRecord::Base - + validates :lat, :long, :presence => true - + attr_accessible :lat, :long - + def self.with_distance(lat, lng) select("ACOS(COS(RADIANS(lat)) * COS(RADIANS(long)) * COS(RADIANS(#{lat})) * COS(RADIANS(#{lng})) + COS(RADIANS(lat)) * SIN(RADIANS(long)) * COS(RADIANS(#{lat})) * SIN(RADIANS(#{lng})) + SIN(RADIANS(#{lat}))*SIN(RADIANS(lat))) * 3963.1 as distance") end - + def self.within(distance, options = {}) where("ACOS(COS(RADIANS(lat)) * COS(RADIANS(long)) * COS(RADIANS(#{options[:of][:lat]})) * COS(RADIANS(#{options[:of][:lng]})) + COS(RADIANS(lat)) * SIN(RADIANS(long)) * COS(RADIANS(#{options[:of][:lat]})) * SIN(RADIANS(#{options[:of][:lng]})) + SIN(RADIANS(#{options[:of][:lat]}))*SIN(RADIANS(lat))) * 3963.1 < ?", distance) end - + end \ No newline at end of file diff --git a/public/dtc.js b/public/dtc.js index 1b3d080..fdd0e4d 100644 --- a/public/dtc.js +++ b/public/dtc.js @@ -1,6 +1,6 @@ (function(){ - - + + // Dude, it's like jQuery but without all of the stuff that nobody // really uses and without all of the browser compatibility and jank. // ... Also it is way faster. @@ -32,12 +32,12 @@ } }; q.open(method, url, true); - q.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + q.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); q.send(parameters); } - + // and now we get into the stuff that I didn't write as a general purpose library - + var notify = function(field, title, message){ done_loading(); var field = $i(field), h1 = $t('h1',field)[0], p = $t('p',field)[0]; @@ -65,10 +65,10 @@ dialog = function(text){ replaceText($i('dialog'), text).style.display = 'block'; }; - + window.addEventListener('load',function(){ var loc = null; - + $i('map').style.height = window.innerHeight + 'px'; document.body.style.height = '500px'; @@ -81,9 +81,9 @@ $i('im_down').style.top = window.innerHeight - 47 + 'px'; $i('im_down').style.width = window.innerWidth - 8 + 'px'; $i('im_down').style.left = '4px'; - + $('.info').style.width = window.innerWidth - 6 + 'px'; - + $i('im_down').parentNode.addEventListener('submit',function(e){ e.preventDefault(); if (navigator.notification){ @@ -95,8 +95,8 @@ }); }); - - + + if (navigator.geolocation) { var myOptions = { zoom: 15, @@ -121,8 +121,8 @@ var map = new google.maps.Map($i("map"), myOptions); latlng = new google.maps.LatLng(location.coords.latitude, location.coords.longitude); var marker = new google.maps.Marker({ - position: latlng, - map: map, + position: latlng, + map: map, title:"You are here!" }); map.panTo(latlng);