Commit 4eae46ea55d958a191695dea976b16c67167186f

Authored by Sergey Nartimov
2 parents d65c67d8 2bbcf2db
Exists in master and in 1 other branch production

Merge pull request #322 from nfedyashev/fix_whitespace_issues

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