Commit 4eae46ea55d958a191695dea976b16c67167186f
Exists in
master
and in
1 other branch
Merge pull request #322 from nfedyashev/fix_whitespace_issues
Fix whitespace issues
Showing
14 changed files
with
50 additions
and
50 deletions
Show diff stats
config/mongoid.example.yml
| ... | ... | @@ -30,4 +30,4 @@ production: |
| 30 | 30 | port: <%= ENV['MONGOID_PORT'] %> |
| 31 | 31 | username: <%= ENV['MONGOID_USERNAME'] %> |
| 32 | 32 | password: <%= ENV['MONGOID_PASSWORD'] %> |
| 33 | - database: <%= ENV['MONGOID_DATABASE'] %> | |
| 34 | 33 | \ No newline at end of file |
| 34 | + database: <%= ENV['MONGOID_DATABASE'] %> | ... | ... |
config/newrelic.example.yml
| ... | ... | @@ -31,13 +31,13 @@ common: &default_settings |
| 31 | 31 | # into a New Relic "application" on your home dashboard page. If you want |
| 32 | 32 | # to map this instance into multiple apps, like "AJAX Requests" and |
| 33 | 33 | # "All UI" then specify a semicolon-separated list of up to three |
| 34 | - # distinct names. If you comment this out, it defaults to the | |
| 34 | + # distinct names. If you comment this out, it defaults to the | |
| 35 | 35 | # capitalized RAILS_ENV (i.e., Production, Staging, etc) |
| 36 | 36 | app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> |
| 37 | 37 | |
| 38 | - # When "true", the agent collects performance data about your | |
| 38 | + # When "true", the agent collects performance data about your | |
| 39 | 39 | # application and reports this data to the New Relic service at |
| 40 | - # newrelic.com. This global switch is normally overridden for each | |
| 40 | + # newrelic.com. This global switch is normally overridden for each | |
| 41 | 41 | # environment below. (formerly called 'enabled') |
| 42 | 42 | monitor_mode: true |
| 43 | 43 | |
| ... | ... | @@ -72,11 +72,11 @@ common: &default_settings |
| 72 | 72 | |
| 73 | 73 | # Set your application's Apdex threshold value with the 'apdex_t' |
| 74 | 74 | # setting, in seconds. The apdex_t value determines the buckets used |
| 75 | - # to compute your overall Apdex score. | |
| 75 | + # to compute your overall Apdex score. | |
| 76 | 76 | # Requests that take less than apdex_t seconds to process will be |
| 77 | 77 | # classified as Satisfying transactions; more than apdex_t seconds |
| 78 | 78 | # as Tolerating transactions; and more than four times the apdex_t |
| 79 | - # value as Frustrating transactions. | |
| 79 | + # value as Frustrating transactions. | |
| 80 | 80 | # For more about the Apdex standard, see |
| 81 | 81 | # http://support.newrelic.com/faqs/general/apdex |
| 82 | 82 | apdex_t: 0.5 |
| ... | ... | @@ -97,7 +97,7 @@ common: &default_settings |
| 97 | 97 | # Rails: the RoR filter_parameter_logging excludes parameters |
| 98 | 98 | # Java: create a config setting called "ignored_params" and set it to |
| 99 | 99 | # a comma separated list of HTTP parameter names. |
| 100 | - # ex: ignored_params: credit_card, ssn, password | |
| 100 | + # ex: ignored_params: credit_card, ssn, password | |
| 101 | 101 | capture_params: false |
| 102 | 102 | |
| 103 | 103 | # Transaction tracer captures deep information about slow |
| ... | ... | @@ -136,7 +136,7 @@ common: &default_settings |
| 136 | 136 | # set to false when using other adapters. |
| 137 | 137 | # explain_enabled: true |
| 138 | 138 | |
| 139 | - # Threshold for query execution time below which query plans will not | |
| 139 | + # Threshold for query execution time below which query plans will not | |
| 140 | 140 | # not be captured. Relevant only when `explain_enabled` is true. |
| 141 | 141 | # explain_threshold: 0.5 |
| 142 | 142 | |
| ... | ... | @@ -149,10 +149,10 @@ common: &default_settings |
| 149 | 149 | # product level. |
| 150 | 150 | enabled: true |
| 151 | 151 | |
| 152 | - # Rails Only - tells error collector whether or not to capture a | |
| 153 | - # source snippet around the place of the error when errors are View | |
| 152 | + # Rails Only - tells error collector whether or not to capture a | |
| 153 | + # source snippet around the place of the error when errors are View | |
| 154 | 154 | # related. |
| 155 | - capture_source: true | |
| 155 | + capture_source: true | |
| 156 | 156 | |
| 157 | 157 | # To stop specific errors from reporting to New Relic, set this property |
| 158 | 158 | # to comma-separated values. Default is to ignore routing errors, |
| ... | ... | @@ -172,7 +172,7 @@ common: &default_settings |
| 172 | 172 | # disable_memcache_instrumentation: true |
| 173 | 173 | # disable_dj: true |
| 174 | 174 | |
| 175 | - # Certain types of instrumentation such as GC stats will not work if | |
| 175 | + # Certain types of instrumentation such as GC stats will not work if | |
| 176 | 176 | # you are running multi-threaded. Please let us know. |
| 177 | 177 | # multi_threaded = false |
| 178 | 178 | |
| ... | ... | @@ -190,15 +190,15 @@ development: |
| 190 | 190 | <<: *default_settings |
| 191 | 191 | # Turn off communication to New Relic service in development mode (also |
| 192 | 192 | # 'enabled'). |
| 193 | - # NOTE: for initial evaluation purposes, you may want to temporarily | |
| 193 | + # NOTE: for initial evaluation purposes, you may want to temporarily | |
| 194 | 194 | # turn agent communication on in development mode. |
| 195 | 195 | monitor_mode: false |
| 196 | 196 | |
| 197 | - # Rails Only - when running in Developer Mode, the New Relic Agent will | |
| 197 | + # Rails Only - when running in Developer Mode, the New Relic Agent will | |
| 198 | 198 | # present performance information on the last 100 transactions you have |
| 199 | 199 | # executed since starting the app server. |
| 200 | 200 | # NOTE: There is substantial overhead when running in developer mode. |
| 201 | - # Do not use for production or load testing. | |
| 201 | + # Do not use for production or load testing. | |
| 202 | 202 | developer_mode: true |
| 203 | 203 | |
| 204 | 204 | # Enable textmate links | ... | ... |
config/unicorn.rb
db/migrate/20110422152027_move_notices_to_separate_collection.rb
| ... | ... | @@ -5,10 +5,10 @@ class MoveNoticesToSeparateCollection < Mongoid::Migration |
| 5 | 5 | errs = mongo_db.collection("errs").find({ }, :fields => ["notices"]) |
| 6 | 6 | errs.each do |err| |
| 7 | 7 | next unless err['notices'] |
| 8 | - | |
| 8 | + | |
| 9 | 9 | # This Err was created after the Problem->Err->Notice redesign |
| 10 | 10 | next if err['app_id'].nil? or err['problem_id'] |
| 11 | - | |
| 11 | + | |
| 12 | 12 | e = Err.find(err['_id']) |
| 13 | 13 | # disable email notifications |
| 14 | 14 | old_notify = e.app.notify_on_errs? | ... | ... |
db/migrate/20111019163257_add_problem_comments_count.rb
db/migrate/20111102173347_cache_problem_statistics_fix.rb
db/migrate/20120822195841_set_first_notice_at_on_problems.rb
db/migrate/20120829034812_ensure_that_problems_last_notice_at_is_not_nil.rb
| ... | ... | @@ -2,15 +2,15 @@ class EnsureThatProblemsLastNoticeAtIsNotNil < Mongoid::Migration |
| 2 | 2 | def self.up |
| 3 | 3 | Problem.where("$or" => [{:last_notice_at => nil}, {:first_notice_at => nil}]).each do |problem| |
| 4 | 4 | first_notice = problem.notices.order_by([:created_at, :asc]).first |
| 5 | - | |
| 5 | + | |
| 6 | 6 | # Destroy problems with no notices |
| 7 | 7 | if first_notice.nil? |
| 8 | 8 | problem.destroy |
| 9 | 9 | next |
| 10 | 10 | end |
| 11 | - | |
| 11 | + | |
| 12 | 12 | last_notice = problem.notices.order_by([:created_at, :asc]).last |
| 13 | - | |
| 13 | + | |
| 14 | 14 | problem.update_attributes!({ |
| 15 | 15 | :first_notice_at => first_notice.created_at, |
| 16 | 16 | :last_notice_at => last_notice.created_at | ... | ... |
lib/tasks/errbit/bootstrap.rake
| 1 | 1 | require 'fileutils' |
| 2 | 2 | |
| 3 | 3 | namespace :errbit do |
| 4 | - | |
| 4 | + | |
| 5 | 5 | desc "Copys of example config files" |
| 6 | 6 | task :copy_configs do |
| 7 | 7 | configs = { |
| ... | ... | @@ -9,7 +9,7 @@ namespace :errbit do |
| 9 | 9 | 'deploy.example.rb' => 'deploy.rb', |
| 10 | 10 | (ENV['HEROKU'] ? 'mongoid.mongohq.yml' : 'mongoid.example.yml') => 'mongoid.yml' |
| 11 | 11 | } |
| 12 | - | |
| 12 | + | |
| 13 | 13 | puts "Copying example config files..." |
| 14 | 14 | configs.each do |old, new| |
| 15 | 15 | if File.exists?("config/#{new}") |
| ... | ... | @@ -20,7 +20,7 @@ namespace :errbit do |
| 20 | 20 | end |
| 21 | 21 | end |
| 22 | 22 | end |
| 23 | - | |
| 23 | + | |
| 24 | 24 | desc "Copy's over example files and seeds the database" |
| 25 | 25 | task :bootstrap do |
| 26 | 26 | Rake::Task['errbit:copy_configs'].execute |
| ... | ... | @@ -29,5 +29,5 @@ namespace :errbit do |
| 29 | 29 | puts "\n" |
| 30 | 30 | Rake::Task['db:mongoid:create_indexes'].invoke |
| 31 | 31 | end |
| 32 | - | |
| 33 | -end | |
| 34 | 32 | \ No newline at end of file |
| 33 | + | |
| 34 | +end | ... | ... |
spec/controllers/api/v1/problems_controller_spec.rb
| 1 | 1 | require 'spec_helper' |
| 2 | 2 | |
| 3 | -describe Api::V1::ProblemsController do | |
| 4 | - | |
| 3 | +describe Api::V1::ProblemsController do | |
| 4 | + | |
| 5 | 5 | context "when logged in" do |
| 6 | 6 | before do |
| 7 | 7 | @user = Fabricate(:user) |
| 8 | 8 | end |
| 9 | - | |
| 9 | + | |
| 10 | 10 | describe "GET /api/v1/problems" do |
| 11 | 11 | before do |
| 12 | 12 | 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 |
| 14 | 14 | Fabricate(:problem, :first_notice_at => Date.new(2012, 8, 21)) |
| 15 | 15 | Fabricate(:problem, :first_notice_at => Date.new(2012, 8, 30)) |
| 16 | 16 | end |
| 17 | - | |
| 18 | - | |
| 19 | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | 20 | it "should return JSON if JSON is requested" do |
| 21 | 21 | get :index, :auth_token => @user.authentication_token, :format => "json" |
| 22 | 22 | lambda { JSON.load(response.body) }.should_not raise_error(JSON::ParserError) |
| 23 | 23 | end |
| 24 | - | |
| 24 | + | |
| 25 | 25 | it "should return XML if XML is requested" do |
| 26 | 26 | get :index, :auth_token => @user.authentication_token, :format => "xml" |
| 27 | 27 | lambda { XML::Parser.string(response.body).parse }.should_not raise_error |
| 28 | 28 | end |
| 29 | - | |
| 29 | + | |
| 30 | 30 | it "should return JSON by default" do |
| 31 | 31 | get :index, :auth_token => @user.authentication_token |
| 32 | 32 | lambda { JSON.load(response.body) }.should_not raise_error(JSON::ParserError) |
| 33 | 33 | end |
| 34 | - | |
| 35 | - | |
| 36 | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | 37 | describe "given a date range" do |
| 38 | - | |
| 38 | + | |
| 39 | 39 | it "should return only the problems open during the date range" do |
| 40 | 40 | get :index, {:auth_token => @user.authentication_token, :start_date => "2012-08-20", :end_date => "2012-08-27"} |
| 41 | 41 | response.should be_success |
| 42 | 42 | problems = JSON.load response.body |
| 43 | 43 | problems.length.should == 2 |
| 44 | 44 | end |
| 45 | - | |
| 45 | + | |
| 46 | 46 | end |
| 47 | - | |
| 47 | + | |
| 48 | 48 | it "should return all problems" do |
| 49 | 49 | get :index, {:auth_token => @user.authentication_token} |
| 50 | 50 | response.should be_success |
| 51 | 51 | problems = JSON.load response.body |
| 52 | 52 | problems.length.should == 4 |
| 53 | 53 | end |
| 54 | - | |
| 54 | + | |
| 55 | 55 | end |
| 56 | 56 | end |
| 57 | - | |
| 57 | + | |
| 58 | 58 | end | ... | ... |
spec/fixtures/hoptoad_test_notice_with_one_line_of_backtrace.xml
spec/models/issue_trackers/bitbucket_issues_tracker_spec.rb
spec/models/notification_service/pushover_service_spec.rb
spec/models/problem_spec.rb
| ... | ... | @@ -24,7 +24,7 @@ describe Problem do |
| 24 | 24 | end |
| 25 | 25 | end |
| 26 | 26 | end |
| 27 | - | |
| 27 | + | |
| 28 | 28 | context '#last_notice_at' do |
| 29 | 29 | it "returns the created_at timestamp of the latest notice" do |
| 30 | 30 | err = Fabricate(:err) |
| ... | ... | @@ -113,7 +113,7 @@ describe Problem do |
| 113 | 113 | problem = Fabricate(:problem, :notices_count => 1) |
| 114 | 114 | original_notices_count = problem.notices_count |
| 115 | 115 | original_notices_count.should > 0 |
| 116 | - | |
| 116 | + | |
| 117 | 117 | problem.resolve! |
| 118 | 118 | problem.notices_count.should == original_notices_count |
| 119 | 119 | end | ... | ... |