diff --git a/config/mongoid.example.yml b/config/mongoid.example.yml index 67496d6..0bd7cbe 100644 --- a/config/mongoid.example.yml +++ b/config/mongoid.example.yml @@ -30,4 +30,4 @@ production: port: <%= ENV['MONGOID_PORT'] %> username: <%= ENV['MONGOID_USERNAME'] %> password: <%= ENV['MONGOID_PASSWORD'] %> - database: <%= ENV['MONGOID_DATABASE'] %> \ No newline at end of file + database: <%= ENV['MONGOID_DATABASE'] %> diff --git a/config/newrelic.example.yml b/config/newrelic.example.yml index 5af2fda..8f37f26 100644 --- a/config/newrelic.example.yml +++ b/config/newrelic.example.yml @@ -31,13 +31,13 @@ common: &default_settings # into a New Relic "application" on your home dashboard page. If you want # to map this instance into multiple apps, like "AJAX Requests" and # "All UI" then specify a semicolon-separated list of up to three - # distinct names. If you comment this out, it defaults to the + # distinct names. If you comment this out, it defaults to the # capitalized RAILS_ENV (i.e., Production, Staging, etc) app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> - # When "true", the agent collects performance data about your + # When "true", the agent collects performance data about your # application and reports this data to the New Relic service at - # newrelic.com. This global switch is normally overridden for each + # newrelic.com. This global switch is normally overridden for each # environment below. (formerly called 'enabled') monitor_mode: true @@ -72,11 +72,11 @@ common: &default_settings # Set your application's Apdex threshold value with the 'apdex_t' # setting, in seconds. The apdex_t value determines the buckets used - # to compute your overall Apdex score. + # to compute your overall Apdex score. # Requests that take less than apdex_t seconds to process will be # classified as Satisfying transactions; more than apdex_t seconds # as Tolerating transactions; and more than four times the apdex_t - # value as Frustrating transactions. + # value as Frustrating transactions. # For more about the Apdex standard, see # http://support.newrelic.com/faqs/general/apdex apdex_t: 0.5 @@ -97,7 +97,7 @@ common: &default_settings # Rails: the RoR filter_parameter_logging excludes parameters # Java: create a config setting called "ignored_params" and set it to # a comma separated list of HTTP parameter names. - # ex: ignored_params: credit_card, ssn, password + # ex: ignored_params: credit_card, ssn, password capture_params: false # Transaction tracer captures deep information about slow @@ -136,7 +136,7 @@ common: &default_settings # set to false when using other adapters. # explain_enabled: true - # Threshold for query execution time below which query plans will not + # Threshold for query execution time below which query plans will not # not be captured. Relevant only when `explain_enabled` is true. # explain_threshold: 0.5 @@ -149,10 +149,10 @@ common: &default_settings # product level. enabled: true - # Rails Only - tells error collector whether or not to capture a - # source snippet around the place of the error when errors are View + # Rails Only - tells error collector whether or not to capture a + # source snippet around the place of the error when errors are View # related. - capture_source: true + capture_source: true # To stop specific errors from reporting to New Relic, set this property # to comma-separated values. Default is to ignore routing errors, @@ -172,7 +172,7 @@ common: &default_settings # disable_memcache_instrumentation: true # disable_dj: true - # Certain types of instrumentation such as GC stats will not work if + # Certain types of instrumentation such as GC stats will not work if # you are running multi-threaded. Please let us know. # multi_threaded = false @@ -190,15 +190,15 @@ development: <<: *default_settings # Turn off communication to New Relic service in development mode (also # 'enabled'). - # NOTE: for initial evaluation purposes, you may want to temporarily + # NOTE: for initial evaluation purposes, you may want to temporarily # turn agent communication on in development mode. monitor_mode: false - # Rails Only - when running in Developer Mode, the New Relic Agent will + # Rails Only - when running in Developer Mode, the New Relic Agent will # present performance information on the last 100 transactions you have # executed since starting the app server. # NOTE: There is substantial overhead when running in developer mode. - # Do not use for production or load testing. + # Do not use for production or load testing. developer_mode: true # Enable textmate links diff --git a/config/unicorn.rb b/config/unicorn.rb index 7720400..31f3f45 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -2,4 +2,4 @@ worker_processes 3 # amount of unicorn workers to spin up timeout 30 # restarts workers that hang for 30 seconds -preload_app true \ No newline at end of file +preload_app true diff --git a/db/migrate/20110422152027_move_notices_to_separate_collection.rb b/db/migrate/20110422152027_move_notices_to_separate_collection.rb index 61f4285..4e76918 100644 --- a/db/migrate/20110422152027_move_notices_to_separate_collection.rb +++ b/db/migrate/20110422152027_move_notices_to_separate_collection.rb @@ -5,10 +5,10 @@ class MoveNoticesToSeparateCollection < Mongoid::Migration errs = mongo_db.collection("errs").find({ }, :fields => ["notices"]) errs.each do |err| next unless err['notices'] - + # This Err was created after the Problem->Err->Notice redesign next if err['app_id'].nil? or err['problem_id'] - + e = Err.find(err['_id']) # disable email notifications old_notify = e.app.notify_on_errs? diff --git a/db/migrate/20111019163257_add_problem_comments_count.rb b/db/migrate/20111019163257_add_problem_comments_count.rb index c9f724b..6c3f190 100644 --- a/db/migrate/20111019163257_add_problem_comments_count.rb +++ b/db/migrate/20111019163257_add_problem_comments_count.rb @@ -7,4 +7,4 @@ class AddProblemCommentsCount < Mongoid::Migration def self.down end -end \ No newline at end of file +end diff --git a/db/migrate/20111102173347_cache_problem_statistics_fix.rb b/db/migrate/20111102173347_cache_problem_statistics_fix.rb index 9d461bd..1f2b19b 100644 --- a/db/migrate/20111102173347_cache_problem_statistics_fix.rb +++ b/db/migrate/20111102173347_cache_problem_statistics_fix.rb @@ -30,4 +30,4 @@ class CacheProblemStatisticsFix < Mongoid::Migration counter end -end \ No newline at end of file +end diff --git a/db/migrate/20120822195841_set_first_notice_at_on_problems.rb b/db/migrate/20120822195841_set_first_notice_at_on_problems.rb index a81bbec..5c19c2c 100644 --- a/db/migrate/20120822195841_set_first_notice_at_on_problems.rb +++ b/db/migrate/20120822195841_set_first_notice_at_on_problems.rb @@ -7,4 +7,4 @@ class SetFirstNoticeAtOnProblems < Mongoid::Migration def self.down end -end \ No newline at end of file +end diff --git a/db/migrate/20120829034812_ensure_that_problems_last_notice_at_is_not_nil.rb b/db/migrate/20120829034812_ensure_that_problems_last_notice_at_is_not_nil.rb index 11a5bf9..df64baf 100644 --- a/db/migrate/20120829034812_ensure_that_problems_last_notice_at_is_not_nil.rb +++ b/db/migrate/20120829034812_ensure_that_problems_last_notice_at_is_not_nil.rb @@ -2,15 +2,15 @@ class EnsureThatProblemsLastNoticeAtIsNotNil < Mongoid::Migration def self.up Problem.where("$or" => [{:last_notice_at => nil}, {:first_notice_at => nil}]).each do |problem| first_notice = problem.notices.order_by([:created_at, :asc]).first - + # Destroy problems with no notices if first_notice.nil? problem.destroy next end - + last_notice = problem.notices.order_by([:created_at, :asc]).last - + problem.update_attributes!({ :first_notice_at => first_notice.created_at, :last_notice_at => last_notice.created_at diff --git a/lib/tasks/errbit/bootstrap.rake b/lib/tasks/errbit/bootstrap.rake index a752723..a74e5bf 100644 --- a/lib/tasks/errbit/bootstrap.rake +++ b/lib/tasks/errbit/bootstrap.rake @@ -1,7 +1,7 @@ require 'fileutils' namespace :errbit do - + desc "Copys of example config files" task :copy_configs do configs = { @@ -9,7 +9,7 @@ namespace :errbit do 'deploy.example.rb' => 'deploy.rb', (ENV['HEROKU'] ? 'mongoid.mongohq.yml' : 'mongoid.example.yml') => 'mongoid.yml' } - + puts "Copying example config files..." configs.each do |old, new| if File.exists?("config/#{new}") @@ -20,7 +20,7 @@ namespace :errbit do end end end - + desc "Copy's over example files and seeds the database" task :bootstrap do Rake::Task['errbit:copy_configs'].execute @@ -29,5 +29,5 @@ namespace :errbit do puts "\n" Rake::Task['db:mongoid:create_indexes'].invoke end - -end \ No newline at end of file + +end diff --git a/spec/controllers/api/v1/problems_controller_spec.rb b/spec/controllers/api/v1/problems_controller_spec.rb index f646b6b..aa53575 100644 --- a/spec/controllers/api/v1/problems_controller_spec.rb +++ b/spec/controllers/api/v1/problems_controller_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' -describe Api::V1::ProblemsController do - +describe Api::V1::ProblemsController do + context "when logged in" do before do @user = Fabricate(:user) end - + describe "GET /api/v1/problems" do before do Fabricate(:problem, :first_notice_at => Date.new(2012, 8, 01), :resolved_at => Date.new(2012, 8, 02)) @@ -14,45 +14,45 @@ describe Api::V1::ProblemsController do Fabricate(:problem, :first_notice_at => Date.new(2012, 8, 21)) Fabricate(:problem, :first_notice_at => Date.new(2012, 8, 30)) end - - - + + + it "should return JSON if JSON is requested" do get :index, :auth_token => @user.authentication_token, :format => "json" lambda { JSON.load(response.body) }.should_not raise_error(JSON::ParserError) end - + it "should return XML if XML is requested" do get :index, :auth_token => @user.authentication_token, :format => "xml" lambda { XML::Parser.string(response.body).parse }.should_not raise_error end - + it "should return JSON by default" do get :index, :auth_token => @user.authentication_token lambda { JSON.load(response.body) }.should_not raise_error(JSON::ParserError) end - - - + + + describe "given a date range" do - + it "should return only the problems open during the date range" do get :index, {:auth_token => @user.authentication_token, :start_date => "2012-08-20", :end_date => "2012-08-27"} response.should be_success problems = JSON.load response.body problems.length.should == 2 end - + end - + it "should return all problems" do get :index, {:auth_token => @user.authentication_token} response.should be_success problems = JSON.load response.body problems.length.should == 4 end - + end end - + end diff --git a/spec/fixtures/hoptoad_test_notice_with_one_line_of_backtrace.xml b/spec/fixtures/hoptoad_test_notice_with_one_line_of_backtrace.xml index fdd45ab..ffddd6b 100644 --- a/spec/fixtures/hoptoad_test_notice_with_one_line_of_backtrace.xml +++ b/spec/fixtures/hoptoad_test_notice_with_one_line_of_backtrace.xml @@ -72,4 +72,4 @@ /path/to/sample/project development - \ No newline at end of file + diff --git a/spec/models/issue_trackers/bitbucket_issues_tracker_spec.rb b/spec/models/issue_trackers/bitbucket_issues_tracker_spec.rb index 18894f9..ee428fc 100644 --- a/spec/models/issue_trackers/bitbucket_issues_tracker_spec.rb +++ b/spec/models/issue_trackers/bitbucket_issues_tracker_spec.rb @@ -10,7 +10,7 @@ describe IssueTrackers::BitbucketIssuesTracker do number = 123 @issue_link = "https://bitbucket.org/#{repo}/issue/#{number}/" - body = < 1) original_notices_count = problem.notices_count original_notices_count.should > 0 - + problem.resolve! problem.notices_count.should == original_notices_count end -- libgit2 0.21.2