Skip to content

Commit a86718c

Browse files
committed
Merged from red_dot
2 parents 6e5d46c + a93022c commit a86718c

File tree

423 files changed

+3629
-3490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+3629
-3490
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
- mongodb
88
- redis-server
99
before_install:
10-
- wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.deb
11-
- sudo dpkg -i elasticsearch-0.20.5.deb
10+
- wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.13.deb
11+
- sudo dpkg -i elasticsearch-0.90.13.deb
1212
- sudo service elasticsearch start
1313
- gem update --system
1414
- travis_retry gem install bundler --pre

Gemfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,17 @@ gem 'resque'
7474
gem 'resque-scheduler'
7575
gem 'resque_mailer'
7676

77+
gem 'sidekiq'
78+
gem 'sinatra'
79+
7780
# Payment processing
7881
gem 'stripe', github: 'stripe/stripe-ruby'
7982

8083
# RSS parsing
8184
gem 'feedjira'
8285

8386
# ElasticSearch client
84-
gem 'tire', '~> 0.4.1'
87+
gem 'tire'
8588

8689
# A/B testing
8790
gem 'split', require: 'split/dashboard'
@@ -140,10 +143,8 @@ group :development do
140143
gem 'better_errors'
141144
gem 'flog'
142145
gem 'fukuzatsu'
143-
gem 'git_stats', require: false
144146
gem 'guard-rspec'
145147
gem 'rails-erd'
146-
gem 'rubocop'
147148
gem 'spring'
148149
gem 'spring-commands-rspec'
149150
gem 'travis'

Gemfile.lock

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ GIT
4040

4141
GIT
4242
remote: git://github.com/stripe/stripe-ruby.git
43-
revision: ca0d2e603db1cae4e7a4f716a57e42a9ee741367
43+
revision: 9cf5089dc15534b7ed581e0ce4d84fa82f592efb
4444
specs:
4545
stripe (1.14.0)
4646
json (~> 1.8.1)
47-
mime-types (~> 1.25)
47+
mime-types (>= 1.25, < 3.0)
4848
rest-client (~> 1.4)
4949

5050
GEM
@@ -85,6 +85,7 @@ GEM
8585
annotate (2.6.5)
8686
activerecord (>= 2.3.0)
8787
rake (>= 0.8.7)
88+
ansi (1.4.3)
8889
arel (3.0.3)
8990
ast (2.0.0)
9091
awesome_print (1.2.0)
@@ -155,6 +156,7 @@ GEM
155156
sass (~> 3.2.19)
156157
compass-rails (2.0.0)
157158
compass (>= 0.12.2)
159+
connection_pool (2.0.0)
158160
cookiejar (0.3.2)
159161
coolline (0.4.4)
160162
crack (0.4.2)
@@ -267,14 +269,6 @@ GEM
267269
multi_json (~> 1.0)
268270
net-http-persistent (>= 2.7)
269271
net-http-pipeline
270-
git_stats (1.0.8)
271-
actionpack
272-
activesupport
273-
haml
274-
i18n
275-
lazy_high_charts
276-
thor
277-
tilt
278272
github-markdown (0.6.5)
279273
grackle (0.3.0)
280274
json
@@ -300,7 +294,6 @@ GEM
300294
sprockets
301295
tilt
302296
handlebars-source (1.3.0)
303-
hash-deep-merge (0.1.1)
304297
hashie (1.2.0)
305298
hashr (0.0.22)
306299
heroku_rails_deflate (1.0.3)
@@ -339,9 +332,6 @@ GEM
339332
kramdown (1.4.0)
340333
launchy (2.4.2)
341334
addressable (~> 2.3)
342-
lazy_high_charts (1.5.4)
343-
bundler (>= 1.0)
344-
hash-deep-merge
345335
linkedin (0.4.6)
346336
hashie (>= 1.2, < 2.1)
347337
multi_json (~> 1.0)
@@ -453,7 +443,6 @@ GEM
453443
polyglot (0.3.5)
454444
poro_plus (1.0.2)
455445
posix-spawn (0.3.8)
456-
powerpack (0.0.9)
457446
pry (0.9.12.6)
458447
coderay (~> 1.0)
459448
method_source (~> 0.8)
@@ -529,7 +518,6 @@ GEM
529518
rake (>= 0.8.7)
530519
rdoc (~> 3.4)
531520
thor (>= 0.14.6, < 2.0)
532-
rainbow (2.0.0)
533521
rake (10.3.2)
534522
rakismet (1.5.0)
535523
rb-fsevent (0.9.4)
@@ -559,7 +547,7 @@ GEM
559547
rspec-core (>= 3.0.0)
560548
rspec-expectations (>= 3.0.0)
561549
rspec-mocks (>= 3.0.0)
562-
rest-client (1.7.1)
550+
rest-client (1.7.2)
563551
mime-types (>= 1.16, < 3.0)
564552
netrc (~> 0.7)
565553
rocket_tag (0.5.6)
@@ -585,12 +573,6 @@ GEM
585573
rspec-mocks (~> 3.0.0)
586574
rspec-support (~> 3.0.0)
587575
rspec-support (3.0.2)
588-
rubocop (0.23.0)
589-
json (>= 1.7.7, < 2)
590-
parser (~> 2.1.9)
591-
powerpack (~> 0.0.6)
592-
rainbow (>= 1.99.1, < 3.0)
593-
ruby-progressbar (~> 1.4)
594576
ruby-graphviz (1.0.9)
595577
ruby-progressbar (1.5.1)
596578
ruby_parser (3.6.1)
@@ -610,6 +592,12 @@ GEM
610592
sax-machine (0.2.1)
611593
nokogiri (~> 1.6.0)
612594
sexp_processor (4.4.3)
595+
sidekiq (3.2.1)
596+
celluloid (>= 0.15.2)
597+
connection_pool (>= 2.0.0)
598+
json
599+
redis (>= 3.0.6)
600+
redis-namespace (>= 1.3.1)
613601
simple-random (1.0.0)
614602
simple_form (2.1.1)
615603
actionpack (~> 3.0)
@@ -654,10 +642,12 @@ GEM
654642
tilt (1.4.1)
655643
timecop (0.7.1)
656644
timers (1.1.0)
657-
tire (0.4.3)
645+
tire (0.6.2)
658646
activemodel (>= 3.0)
647+
activesupport
648+
ansi
659649
hashr (~> 0.0.19)
660-
multi_json (~> 1.0)
650+
multi_json (~> 1.3)
661651
rake
662652
rest-client (~> 1.6)
663653
travis (1.6.9)
@@ -738,7 +728,6 @@ DEPENDENCIES
738728
fukuzatsu
739729
fuubar (= 2.0.0.rc1)
740730
geocoder
741-
git_stats
742731
github-markdown
743732
grackle
744733
guard-rspec
@@ -800,13 +789,14 @@ DEPENDENCIES
800789
rest-client
801790
rocket_tag
802791
rspec-rails
803-
rubocop
804792
ruby-progressbar
805793
sanitize
806794
sass (~> 3.2.9)
807795
sass-rails (~> 3.2.6)
796+
sidekiq
808797
simple_form
809798
simplecov
799+
sinatra
810800
split
811801
spring
812802
spring-commands-rspec
@@ -815,7 +805,7 @@ DEPENDENCIES
815805
strong_parameters
816806
syntax
817807
timecop
818-
tire (~> 0.4.1)
808+
tire
819809
travis
820810
tweet-button
821811
twitter

app/controllers/accounts_controller.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def update
4848

4949
def webhook
5050
data = JSON.parse request.body.read
51-
if data[:type] == 'invoice.payment_succeeded'
51+
if data[:type] == "invoice.payment_succeeded"
5252
invoice_id = data['data']['object']['id']
5353
customer_id = data['data']['object']['customer']
5454
team = Team.where('account.stripe_customer_token' => customer_id).first
@@ -64,7 +64,7 @@ def webhook
6464
def send_invoice
6565
@team = Team.find(params[:team_id])
6666
@team.account.send_invoice_for(1.month.ago)
67-
redirect_to teamname_path(slug: @team.slug), notice: "sent invoice for #{1.month.ago.strftime('%B')} to #{@team.account.admin.email}"
67+
redirect_to teamname_path(slug: @team.slug), notice: "sent invoice for #{1.month.ago.strftime("%B")} to #{@team.account.admin.email}"
6868
end
6969

7070
private
@@ -84,20 +84,21 @@ def determine_plan
8484
end
8585

8686
def ensure_eligibility
87-
return redirect_to(teamname_path(@team.slug), notice: 'you must complete at least 6 sections of the team profile before posting jobs') unless @team.has_specified_enough_info?
87+
return redirect_to(teamname_path(@team.slug), notice: "you must complete at least 6 sections of the team profile before posting jobs") unless @team.has_specified_enough_info?
8888
end
8989

9090
def plan_capability(plan, team)
91-
message = ''
91+
message = ""
9292
if plan.subscription?
9393
message = "You can now post up to #{team.number_of_jobs_to_show} jobs at any time"
9494
elsif plan.one_time?
95-
message = 'You can now post one job for 30 days'
95+
message = "You can now post one job for 30 days"
9696
end
9797
message
9898
end
9999

100100
def paying_user_context
101101
Honeybadger.context(user_email: current_user.try(:email)) if current_user
102102
end
103+
103104
end

app/controllers/achievements_controller.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def show
1414
end
1515

1616
def award
17+
1718
award_params = params.permit(:badge, :twitter, :linkedin, :github, :date)
1819

1920
provider = pick_a_provider(award_params)
@@ -34,23 +35,23 @@ def award
3435
return render json: { message: "don't have permission to do that. contact support@coderwall.com", status: 403 }.to_json
3536
end
3637
end
37-
rescue => e
38-
return render json: { message: 'something went wrong with your request or the end point may not be ready. contact support@coderwall.com' }.to_json
38+
rescue Exception => e
39+
return render json: { message: "something went wrong with your request or the end point may not be ready. contact support@coderwall.com" }.to_json
3940
end
4041

4142
private
4243

4344
def ensure_valid_api_key
4445
@api_key = params.permit(:api_key)[:api_key]
4546
@api_access = ApiAccess.for(@api_key) unless @api_key.nil?
46-
return render json: { message: 'no/invalid api_key provided. get your api_key from coderwall.com/settings' }.to_json if @api_access.nil?
47+
return render json: { message: "no/invalid api_key provided. get your api_key from coderwall.com/settings" }.to_json if @api_access.nil?
4748
end
4849

4950
def badge_class_factory(requested_badge_name)
5051
BADGES_LIST.select { |badge_name| badge_name == requested_badge_name }.first.constantize
5152
end
5253

5354
def pick_a_provider(award_params)
54-
(User::LINKABLE_PROVIDERS & award_params.keys.select { |key| %w(twitter linkedin github).include?(key) }).first
55+
(User::LINKABLE_PROVIDERS & award_params.keys.select { |key| %w{twitter linkedin github}.include?(key) }).first
5556
end
5657
end

app/controllers/admin_controller.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class AdminController < BaseAdminController
2+
23
def index
34
end
45

@@ -11,14 +12,14 @@ def failed_jobs
1112
@per_page = params[:per_page].try(:to_i) || 10
1213

1314
@total_failed = Delayed::Job.
14-
where('last_error IS NOT NULL').
15+
where("last_error IS NOT NULL").
1516
count
1617

1718
@jobs = Delayed::Job.
18-
where('last_error IS NOT NULL').
19+
where("last_error IS NOT NULL").
1920
offset((@page - 1) * @per_page).
2021
limit(@per_page).
21-
order('updated_at DESC')
22+
order("updated_at DESC")
2223
end
2324

2425
if Rails.env.development?
@@ -31,12 +32,13 @@ def toggle_premium_team
3132
end
3233
team.premium = !team.premium
3334
team.save!
34-
redirect_to('/')
35+
return redirect_to('/')
3536
end
3637

3738
end
3839

3940
def teams
41+
4042
end
4143

4244
def sections_teams

app/controllers/alerts_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def authenticate_caller
3434

3535
case @alert[:type].to_sym
3636
when :traction, :google_analytics
37-
valid = (@alert[:key] == '3fEtu89_W13k1')
37+
valid = (@alert[:key] == "3fEtu89_W13k1")
3838
else
3939
valid = false
4040
end
@@ -78,7 +78,7 @@ def can_report_traction?(url)
7878
Time.at(REDIS.get(last_sent_key(:traction, url)).to_i) < TRACTION_ALERT_INTERVAL.ago
7979
end
8080

81-
def last_sent_key(type, subkey = nil)
81+
def last_sent_key(type, subkey=nil)
8282
key = "alert:#{type}:last_sent"
8383
key += ":#{subkey}" unless subkey.nil?
8484
key
@@ -99,4 +99,4 @@ def update_stats
9999
def update_history
100100
REDIS.zadd(history_key(@alert[:type]), Time.now.to_i, @alert[:data])
101101
end
102-
end
102+
end

0 commit comments

Comments
 (0)