Skip to content

Instantly share code, notes, and snippets.

View benaskins's full-sized avatar
🍑
Peachy

Ben Askins benaskins

🍑
Peachy
View GitHub Profile
// X and Y axis labels and captions default to global style if not provided
// - X Axis Labels
if (!this.settings.xAxisLabelColor) {
this.settings.xAxisLabelColor = this.settings.labelColor;
}
if (!this.settings.xAxisLabelFont) {
this.settings.xAxisLabelFont = this.settings.labelFont;
}
if (!this.settings.xAxisLabelFontSize) {
this.settings.xAxisLabelFontSize = this.settings.labelFontSize;
class DataElement
attr_reader :value, :name
def initialize(name, xml_elem)
@name = name
@value = (!xml_elem || xml_elem.inner_html.blank?) ? "n/a" : xml_elem.inner_html
@attributes = xml_elem ? xml_elem.attributes : {}
end
def hash
# BONUS PARTY GAME - Choose 1 or make your own! Is this DRY gone mad?
# A
named_scope :leads, :conditions => ["dancers.lead = ?", true], :joins => :dancer
named_scope :follows, :conditions => ["dancers.lead = ?", false], :joins => :dancer
# B
[
[:leads, true],
[:follows, false]
--> Checking if ruby_enterprise is already installed for roles: app
--> Verifying ruby_enterprise...
*** [err :: 67.207.140.180] test:
*** [err :: 67.207.140.180] missing argument after `='
*** [err :: 67.207.140.180]
--> Installing ruby_enterprise for roles: app
/Library/Ruby/Gems/1.8/gems/capistrano-2.5.1/lib/capistrano/command.rb:173:in `process!': failed: "sh -c \"sudo -p 'sudo password: ' bash -c 'cd /usr/local/build/ruby-enterprise-1.8.6-20090113 && echo -en \\\"\\\\n/usr/local/ruby-enterprise\\\\n\\\" | sudo ./installer >> ruby_enterprise-install.log 2>&1'\"" on 67.207.140.180 (Capistrano::CommandError)
from /Library/Ruby/Gems/1.8/gems/capistrano-2.5.1/lib/capistrano/command.rb:133:in `process'
--> Checking if ruby_enterprise is already installed for roles: app
--> Verifying ruby_enterprise...
*** [err :: 67.207.140.180] test: missing argument after `='
--> Installing ruby_enterprise for roles: app
/Library/Ruby/Gems/1.8/gems/capistrano-2.5.1/lib/capistrano/command.rb:173:in `process!': failed: "sh -c \"sudo -p 'sudo password: ' bash -c 'cd /usr/local/build/ruby-enterprise-1.8.6-20090113 && echo -en \\\"\\\\n/usr/local/ruby-enterprise\\\\n\\\" | sudo ./installer >> ruby_enterprise-install.log 2>&1'\"" on 67.207.140.180 (Capistrano::CommandError)
~/Development/client_projects/swellnet $ script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/Library/Ruby/Site/1.8/rubygems.rb:149:in `activate': can't activate rubyforge (= 0.4.5, runtime), already activated rubyforge-1.0.2 (Gem::Exception)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:35:in `require'
%ol.autocomplete
%li
%label
Weatherzone Location:
= text_field_with_auto_complete :location, :wz_locality_name, {}, {:url => formatted_wz_localities_path(:js), :method => :get, :param_name => 'search', :skip_style =>
NoMethodError in Weather#index
Showing app/views/layouts/application.haml where line #171 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
Extracted source (around line #171):
>> NewsItem.most_popular
Cache miss: NewsItem.most.popular ({})
NewsItem Load (0.4ms) SELECT * FROM `contents` WHERE ( (`contents`.`type` = 'NewsItem' ) ) ORDER BY view_count desc
Cache write (will save 1.13ms): NewsItem.most.popular
=> [#<NewsItem id: 602878370, category_id: 932759408, user_id: 549584997, view_count: 0, type: "NewsItem", title: "Choosing your first board", introduction: "<p>Intro</p>", full_description: "<p>News item details</p>", terms: nil, display_from: "2009-01-22", display_to: "2009-01-29", featured_item: true, allow_comments: false, created_at: "2009-01-19 23:04:32", updated_at: "2009-01-19 23:13:34">, #<NewsItem id: 602878371, category_id: 6924875, user_id: 325502115, view_count: 0, type: "NewsItem", title: "Learning to surf", introduction: "Intro", full_description: "News item details", terms: nil, display_from: "2009-01-22", display_to: "2009-01-29", featured_item: nil, allow_comments: nil, created_at: "2009-01-19 23:04:32", updated_at: "2009-01-19 23:04:32">]
>>
~/Development/gems/weatherzone (testable)$ ruby test/test_forecast.rb
Loaded suite test/test_forecast
Started
....
Finished in 0.169275 seconds.