Permalink
Browse files

Version fixing

* Downgraded HAML
* Upgraded blueprint
* Upgraded hoptoad
* Removed sudo from rake newb
* Removed tsaleh from most of the build/test scripts
  • Loading branch information...
1 parent 344f2f5 commit 1f88fd43fdfe1080e19471873c4ae594837e78f9 Tammer Saleh committed Jan 15, 2010
View
@@ -1,23 +1,20 @@
desc "Configure initial environment for development"
task :newb => %w(newb:guard_env
- newb:gems
+ newb:heroku_gems
+ gems:install
db:create:all
db:migrate
db:seed
db:test:prepare
test)
-task "newb:gems" do
+task "newb:heroku_gems" do
%w(heroku taps).each do |gem|
unless Gem.available? gem
- puts "sudo gem install #{gem}"
- system("sudo gem install #{gem}")
+ puts "gem install #{gem}"
+ system("gem install #{gem}")
end
end
-
- puts "Installing system wide gems"
- out = %x{sudo rake gems:install}
- raise RuntimeError.new("Error running `sudo rake gems:install`: #{out}") unless $? == 0
end
task "newb:guard_env" do
View
@@ -3,13 +3,13 @@
set -e
if [ $# == 1 ]; then
- echo "gold vs tsaleh-test-app"
- diff -wB gold/$1 /tmp/tsaleh-test-app/$1 | less
+ echo "gold vs ${USER}-test-app"
+ diff -wB gold/$1 /tmp/${USER}-test-app/$1 | less
else
diff -wBrq -x '*.swp' \
-x '.git' \
-x 'database.yml' \
- gold /tmp/tsaleh-test-app | less
+ gold /tmp/${USER}-test-app | less
fi
@@ -11,7 +11,7 @@
load(heroku_env) if File.exists?(heroku_env)
Rails::Initializer.run do |config|
- config.gem 'haml', :version => '>= 2.2.14'
+ config.gem 'haml', :version => '>= 2.2.3'
config.gem 'master_may_i', :version => '>= 0.6.0'
config.gem 'will_paginate', :version => '>= 2.3.11'
config.gem 'paperclip', :version => '>= 2.3.1'
View
@@ -1,23 +1,20 @@
desc "Configure initial environment for development"
task :newb => %w(newb:guard_env
- newb:gems
+ newb:heroku_gems
+ gems:install
db:create:all
db:migrate
db:seed
db:test:prepare
test)
-task "newb:gems" do
+task "newb:heroku_gems" do
%w(heroku taps).each do |gem|
unless Gem.available? gem
- puts "sudo gem install #{gem}"
- system("sudo gem install #{gem}")
+ puts "gem install #{gem}"
+ system("gem install #{gem}")
end
end
-
- puts "Installing system wide gems"
- out = %x{sudo rake gems:install}
- raise RuntimeError.new("Error running `sudo rake gems:install`: #{out}") unless $? == 0
end
task "newb:guard_env" do
@@ -12,7 +12,8 @@
----------------------------------------------------------------------- */
/* reset.css */
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
+article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;}
body {line-height:1.5;}
table {border-collapse:separate;border-spacing:0;}
caption, th, td {text-align:left;font-weight:normal;}
@@ -98,8 +99,8 @@ form.inline p {margin-bottom:0;}
/* grid.css */
.container {width:950px;margin:0 auto;}
.showgrid {background:url(src/grid.png);}
-.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
-.last, div.last {margin-right:0;}
+.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;}
+.last {margin-right:0;}
.span-1 {width:30px;}
.span-2 {width:70px;}
.span-3 {width:110px;}
@@ -123,7 +124,7 @@ form.inline p {margin-bottom:0;}
.span-21 {width:830px;}
.span-22 {width:870px;}
.span-23 {width:910px;}
-.span-24, div.span-24 {width:950px;margin-right:0;}
+.span-24 {width:950px;margin-right:0;}
input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;}
input.span-1, textarea.span-1 {width:18px!important;}
input.span-2, textarea.span-2 {width:58px!important;}
@@ -1,15 +1,14 @@
/* --------------------------------------------------------------
- grid.css
- * Sets up an easy-to-use grid of 24 columns.
- By default, the grid is 950px wide, with 24 columns
- spanning 30px, and a 10px margin between columns.
+ grid.css
+ * Sets up an easy-to-use grid of 24 columns.
- If you need fewer or more columns, namespaces or semantic
- element names, use the compressor script (lib/compress.rb)
+ By default, the grid is 950px wide, with 24 columns
+ spanning 30px, and a 10px margin between columns.
+
+ If you need fewer or more columns, namespaces or semantic
+ element names, use the compressor script (lib/compress.rb)
- Note: Changes made in this file will not be applied when
- using the compressor: make changes in lib/blueprint/grid.css.rb
-------------------------------------------------------------- */
/* A container should group all your columns. */
@@ -28,13 +27,13 @@
-------------------------------------------------------------- */
/* Sets up basic grid floating and margin. */
-.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {
+.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {
float: left;
margin-right: 10px;
}
/* The last column in a row needs this class. */
-.last, div.last { margin-right: 0; }
+.last { margin-right: 0; }
/* Use these classes to set the width of a column. */
.span-1 {width: 30px;}
@@ -61,7 +60,7 @@
.span-21 {width: 830px;}
.span-22 {width: 870px;}
.span-23 {width: 910px;}
-.span-24, div.span-24 { width:950px; margin-right:0; }
+.span-24 {width:950px; margin-right:0;}
/* Use these classes to set the width of an input. */
input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {
@@ -1,16 +1,18 @@
-/* --------------------------------------------------------------
-
+/* --------------------------------------------------------------
+
reset.css
* Resets default browser CSS.
-
+
-------------------------------------------------------------- */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, code,
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, dialog, figure, footer, header,
+hgroup, nav, section {
margin: 0;
padding: 0;
border: 0;
@@ -21,8 +23,13 @@ table, caption, tbody, tfoot, thead, tr, th, td {
vertical-align: baseline;
}
-body {
- line-height: 1.5;
+article, aside, dialog, figure, footer, header,
+hgroup, nav, section {
+ display:block;
+}
+
+body {
+ line-height: 1.5;
}
/* Tables still need 'cellspacing="0"' in the markup. */
@@ -201,8 +201,8 @@ notices generated using #notify when you don't expect it to. You can
use code like this in your test_helper.rb to redefine that method so those
errors are not reported while running tests.
- module HoptoadNotifier::Catcher
- def notify(thing)
+ module HoptoadNotifier
+ def self.notify(thing)
# do nothing.
end
end
@@ -28,4 +28,5 @@ def create_scenario(version)
# Rails 2.3.3 has broken params filtering
# config.scenarios << create_scenario("2.3.3")
config.scenarios << create_scenario("2.3.4")
+ config.scenarios << create_scenario("2.3.5")
end
@@ -11,7 +11,7 @@
# Plugin for applications to automatically post errors to the Hoptoad of their choice.
module HoptoadNotifier
- VERSION = "2.0.18"
+ VERSION = "2.0.19"
API_VERSION = "2.0"
LOG_PREFIX = "** [Hoptoad] "
@@ -58,11 +58,7 @@ def write_verbose_log(message)
# Look for the Rails logger currently defined
def logger
- if defined?(Rails.logger)
- Rails.logger
- elsif defined?(RAILS_DEFAULT_LOGGER)
- RAILS_DEFAULT_LOGGER
- end
+ self.configuration.logger
end
# Call this method to modify defaults in your initializers.
@@ -77,6 +77,9 @@ class Configuration
# The url of the notifier library being used to send notifications
attr_accessor :notifier_url
+ # The logger used by HoptoadNotifier
+ attr_accessor :logger
+
DEFAULT_PARAMS_FILTERS = %w(password password_confirmation).freeze
DEFAULT_BACKTRACE_FILTERS = [
@@ -0,0 +1,16 @@
+module HoptoadNotifier
+ # used to initialize Rails-specific code
+ class RailsInitializer
+ def self.initialize
+ rails_logger = if defined?(Rails.logger)
+ Rails.logger
+ elsif defined?(RAILS_DEFAULT_LOGGER)
+ RAILS_DEFAULT_LOGGER
+ end
+
+ HoptoadNotifier.configure(true) do |config|
+ config.logger = rails_logger
+ end
+ end
+ end
+end
@@ -15,7 +15,7 @@ def initialize(options = {})
#
# @param [String] data The XML notice to be sent off
def send_to_hoptoad(data)
- logger.debug { "Sending request to #{url.to_s}:\n#{data}" }
+ logger.debug { "Sending request to #{url.to_s}:\n#{data}" } if logger
http =
Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass).
@@ -2,6 +2,9 @@
ActionController::Base.send(:include, HoptoadNotifier::Catcher)
end
+require File.join(File.dirname(__FILE__), '..', 'lib', 'hoptoad_notifier', 'rails_initializer')
+HoptoadNotifier::RailsInitializer.initialize
+
HoptoadNotifier.configure(true) do |config|
config.environment_name = RAILS_ENV
config.project_root = RAILS_ROOT
@@ -11,6 +11,7 @@ class ConfigurationTest < Test::Unit::TestCase
assert_config_default :proxy_pass, nil
assert_config_default :project_root, nil
assert_config_default :environment_name, nil
+ assert_config_default :logger, nil
assert_config_default :notifier_version, HoptoadNotifier::VERSION
assert_config_default :notifier_name, 'Hoptoad Notifier'
assert_config_default :notifier_url, 'http://hoptoadapp.com'
@@ -67,6 +68,7 @@ class ConfigurationTest < Test::Unit::TestCase
assert_config_overridable :notifier_url
assert_config_overridable :environment_name
assert_config_overridable :development_lookup
+ assert_config_overridable :logger
end
should "have an api key" do
@@ -164,6 +166,12 @@ class ConfigurationTest < Test::Unit::TestCase
assert config.public?
end
+ should "use the assigned logger if set" do
+ config = HoptoadNotifier::Configuration.new
+ config.logger = "CUSTOM LOGGER"
+ assert_equal "CUSTOM LOGGER", config.logger
+ end
+
def assert_config_default(option, default_value, config = nil)
config ||= HoptoadNotifier::Configuration.new
assert_equal default_value, config.send(option)
@@ -235,4 +235,3 @@ def fatal(*args); end
end
RAILS_DEFAULT_LOGGER = FakeLogger.new
-
@@ -42,7 +42,7 @@ def configure
should "not report that notifier is ready when internally configured" do
stub_verbose_log
- HoptoadNotifier.configure(true) { |config | }
+ HoptoadNotifier.configure(true) { |config| }
assert_not_logged /.*/
end
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/helper'
+require File.join(File.dirname(__FILE__), '..', 'lib', 'hoptoad_notifier', 'rails_initializer')
+
+class RailsInitializerTest < Test::Unit::TestCase
+ include DefinesConstants
+
+ should "trigger use of Rails' logger if logger isn't set and Rails' logger exists" do
+ rails = Module.new do
+ def self.logger
+ "RAILS LOGGER"
+ end
+ end
+ define_constant("Rails", rails)
+ HoptoadNotifier::RailsInitializer.initialize
+ assert_equal "RAILS LOGGER", HoptoadNotifier.logger
+ end
+
+ should "trigger use of Rails' default logger if logger isn't set and Rails.logger doesn't exist" do
+ define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
+
+ HoptoadNotifier::RailsInitializer.initialize
+ assert_equal "RAILS DEFAULT LOGGER", HoptoadNotifier.logger
+ end
+
+ should "allow overriding of the logger if already assigned" do
+ define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
+ HoptoadNotifier::RailsInitializer.initialize
+
+ HoptoadNotifier.configure(true) do |config|
+ config.logger = "OVERRIDDEN LOGGER"
+ end
+
+ assert_equal "OVERRIDDEN LOGGER", HoptoadNotifier.logger
+ end
+end
View
8 run.sh
@@ -8,11 +8,11 @@ rm -f gold/log/*.log
rm -f gold/db/schema.rb
cd /tmp
- if (heroku list | grep -x tsaleh-test-app-staging); then
- heroku destroy --app tsaleh-test-app-staging
+ if (heroku list | grep -x ${USER}-test-app-staging); then
+ heroku destroy --app ${USER}-test-app-staging
fi
- rm -rf tsaleh-test-app
- rails tsaleh-test-app \
+ rm -rf ${USER}-test-app
+ rails ${USER}-test-app \
-m /Users/tsaleh/code/tsaleh-bushido/template.rb \
-- \
--hoptoad_key=HOPTOAD_KEY \
View
@@ -60,7 +60,7 @@ def get_value(name, question)
gem 'paperclip', :version => '>= 2.3.1'
gem 'will_paginate', :version => '>= 2.3.11'
gem 'master_may_i', :version => '>= 0.6.0'
-gem 'haml', :version => '>= 2.2.14'
+gem 'haml', :version => '>= 2.2.3'
# Test gems
gem 'nokogiri', :env => "test", :lib => false

0 comments on commit 1f88fd4

Please sign in to comment.