Skip to content

Commit 4cfa6ab

Browse files
committed
Update Lint Errors and Update to Ruby 2.2.1
* Fixed jsdoc issues * Upgraded gems to current and Ruby to current 2.2.1 * Added brakeman rakefile
1 parent aee9216 commit 4cfa6ab

File tree

13 files changed

+108
-97
lines changed

13 files changed

+108
-97
lines changed

Diff for: .ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.5
1+
2.2.1

Diff for: Gemfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source "https://rubygems.org"
2-
ruby "2.1.5"
2+
ruby "2.2.1"
33

44
#
55
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
@@ -68,6 +68,8 @@ group :development, :test do
6868
gem "brakeman", require: false
6969

7070
gem "bundler-audit", require: false
71+
72+
gem "rainbow"
7173
end
7274

7375
gem "spring-commands-rspec", group: :development

Diff for: Gemfile.lock

+30-33
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ GEM
3636
minitest (~> 5.1)
3737
thread_safe (~> 0.3, >= 0.3.4)
3838
tzinfo (~> 1.1)
39-
addressable (2.3.7)
39+
addressable (2.3.8)
4040
arel (6.0.0)
4141
ast (2.0.0)
4242
astrolabe (1.3.0)
4343
parser (>= 2.2.0.pre.3, < 3.0)
44-
autoprefixer-rails (5.1.8)
44+
autoprefixer-rails (5.1.11)
4545
execjs
4646
json
4747
binding_of_caller (0.7.2)
@@ -63,33 +63,33 @@ GEM
6363
bundler-audit (0.3.1)
6464
bundler (~> 1.2)
6565
thor (~> 0.18)
66-
byebug (4.0.3)
66+
byebug (5.0.0)
6767
columnize (= 0.9.0)
6868
capybara (2.4.4)
6969
mime-types (>= 1.16)
7070
nokogiri (>= 1.3.3)
7171
rack (>= 1.0.0)
7272
rack-test (>= 0.5.4)
7373
xpath (~> 2.0)
74-
capybara-screenshot (1.0.7)
74+
capybara-screenshot (1.0.9)
7575
capybara (>= 1.0, < 3)
7676
launchy
77-
capybara-webkit (1.4.1)
77+
capybara-webkit (1.5.1)
7878
capybara (>= 2.3.0, < 2.5.0)
7979
json
8080
coffee-rails (4.1.0)
8181
coffee-script (>= 2.2.0)
8282
railties (>= 4.0.0, < 5.0)
83-
coffee-script (2.3.0)
83+
coffee-script (2.4.1)
8484
coffee-script-source
8585
execjs
86-
coffee-script-source (1.9.1)
86+
coffee-script-source (1.9.1.1)
8787
columnize (0.9.0)
8888
database_cleaner (1.4.1)
8989
debug_inspector (0.0.2)
9090
diff-lcs (1.2.5)
9191
erubis (2.7.0)
92-
execjs (2.4.0)
92+
execjs (2.5.2)
9393
factory_girl (4.5.0)
9494
activesupport (>= 3.0.0)
9595
factory_girl_rails (4.5.0)
@@ -98,14 +98,13 @@ GEM
9898
fastercsv (1.5.5)
9999
foreman (0.78.0)
100100
thor (~> 0.19.1)
101-
globalid (0.3.3)
101+
globalid (0.3.5)
102102
activesupport (>= 4.1.0)
103103
haml (4.0.6)
104104
tilt
105105
highline (1.6.21)
106-
hike (1.2.3)
107106
i18n (0.7.0)
108-
jbuilder (2.2.12)
107+
jbuilder (2.2.16)
109108
activesupport (>= 3.0.0, < 5)
110109
multi_json (~> 1.2)
111110
jquery-rails (4.0.3)
@@ -116,21 +115,21 @@ GEM
116115
kgio (2.9.3)
117116
launchy (2.4.3)
118117
addressable (~> 2.3)
119-
loofah (2.0.1)
118+
loofah (2.0.2)
120119
nokogiri (>= 1.5.9)
121120
mail (2.6.3)
122121
mime-types (>= 1.16, < 3)
123-
mime-types (2.4.3)
122+
mime-types (2.5)
124123
mini_portile (0.6.2)
125-
minitest (5.5.1)
124+
minitest (5.6.1)
126125
multi_json (1.11.0)
127126
nokogiri (1.6.6.2)
128127
mini_portile (~> 0.6.0)
129-
parser (2.2.0.3)
128+
parser (2.2.2.3)
130129
ast (>= 1.1, < 3.0)
131-
pg (0.18.1)
132-
powerpack (0.1.0)
133-
rack (1.6.0)
130+
pg (0.18.2)
131+
powerpack (0.1.1)
132+
rack (1.6.1)
134133
rack-test (0.6.3)
135134
rack (>= 1.0)
136135
rails (4.2.1)
@@ -167,9 +166,9 @@ GEM
167166
rake (10.4.2)
168167
rdoc (4.2.0)
169168
json (~> 1.4)
170-
rspec-core (3.2.2)
169+
rspec-core (3.2.3)
171170
rspec-support (~> 3.2.0)
172-
rspec-expectations (3.2.0)
171+
rspec-expectations (3.2.1)
173172
diff-lcs (>= 1.2.0, < 2.0)
174173
rspec-support (~> 3.2.0)
175174
rspec-mocks (3.2.1)
@@ -184,14 +183,14 @@ GEM
184183
rspec-mocks (~> 3.2.0)
185184
rspec-support (~> 3.2.0)
186185
rspec-support (3.2.2)
187-
rubocop (0.29.1)
186+
rubocop (0.31.0)
188187
astrolabe (~> 1.3)
189-
parser (>= 2.2.0.1, < 3.0)
188+
parser (>= 2.2.2.1, < 3.0)
190189
powerpack (~> 0.1)
191190
rainbow (>= 1.99.1, < 3.0)
192191
ruby-progressbar (~> 1.4)
193-
ruby-lint (2.0.3)
194-
parser (~> 2.1, >= 2.1.1)
192+
ruby-lint (2.0.4)
193+
parser (~> 2.2)
195194
slop (~> 3.4, >= 3.4.7)
196195
ruby-progressbar (1.7.5)
197196
ruby2ruby (2.1.4)
@@ -200,29 +199,26 @@ GEM
200199
ruby_parser (3.6.6)
201200
sexp_processor (~> 4.1)
202201
sass (3.4.13)
203-
sass-rails (5.0.1)
202+
sass-rails (5.0.3)
204203
railties (>= 4.0.0, < 5.0)
205204
sass (~> 3.1)
206205
sprockets (>= 2.8, < 4.0)
207206
sprockets-rails (>= 2.0, < 4.0)
208207
tilt (~> 1.1)
209-
scss-lint (0.37.0)
208+
scss-lint (0.38.0)
210209
rainbow (~> 2.0)
211210
sass (~> 3.4.1)
212211
sdoc (0.4.1)
213212
json (~> 1.7, >= 1.7.7)
214213
rdoc (~> 4.0)
215214
sexp_processor (4.5.1)
216215
slop (3.6.0)
217-
spring (1.3.3)
216+
spring (1.3.6)
218217
spring-commands-rspec (1.0.4)
219218
spring (>= 0.9.1)
220-
sprockets (2.12.3)
221-
hike (~> 1.2)
222-
multi_json (~> 1.0)
219+
sprockets (3.1.0)
223220
rack (~> 1.0)
224-
tilt (~> 1.1, != 1.3.0)
225-
sprockets-rails (2.2.4)
221+
sprockets-rails (2.3.1)
226222
actionpack (>= 3.0)
227223
activesupport (>= 3.0)
228224
sprockets (>= 2.8, < 4.0)
@@ -238,7 +234,7 @@ GEM
238234
uglifier (2.7.1)
239235
execjs (>= 0.3.0)
240236
json (>= 1.8.0)
241-
unicorn (4.8.3)
237+
unicorn (4.9.0)
242238
kgio (~> 2.6)
243239
rack
244240
raindrops (~> 0.7)
@@ -273,6 +269,7 @@ DEPENDENCIES
273269
rails (~> 4.2)
274270
rails-html-sanitizer
275271
rails_12factor
272+
rainbow
276273
rspec-rails
277274
rubocop
278275
ruby-lint

Diff for: client/assets/javascripts/FluxAlt.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import Alt from 'alt';
22
const alt = new Alt();
33

4+
/**
5+
* See https://github.com/goatslacker/alt
6+
*/
47
export default alt;

Diff for: client/assets/javascripts/actions/CommentActions.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ class CommentActions {
55
/**
66
* Fetch comments from server.
77
*
8-
* @param {String} url
9-
* @param {Boolean} displaySpinner
10-
* @returns {undefined}
8+
* @param {String} url - Url used for remote request.
9+
* @param {Boolean} displaySpinner - Flag whether to show wait spinner
10+
* @return {void}
1111
*/
1212
fetchComments(url, displaySpinner) {
1313
this.dispatch(displaySpinner);
1414
CommentsManager.fetchComments(url)
1515
.then((comments) => this.actions.updateComments(comments),
16-
(errorMessage) => this.actions.updateCommentsError(errorMessage));
16+
(errorMessage) => this.actions.updateCommentsError(errorMessage));
1717
}
1818

1919
/**
2020
* A new list of comments is available, refresh the store.
2121
*
22-
* @param {Array} comments
23-
* @returns {undefined}
22+
* @param {Array} comments - New comments to replace those in the store
23+
* @return {void}
2424
*/
2525
updateComments(comments) {
2626
this.dispatch(comments);
@@ -29,8 +29,8 @@ class CommentActions {
2929
/**
3030
* An error occurred while fetching comments, dispatch error message.
3131
*
32-
* @param {String} errorMessage
33-
* @returns {undefined}
32+
* @param {String} errorMessage - Error message received from server.
33+
* @return {void}
3434
*/
3535
updateCommentsError(errorMessage) {
3636
this.dispatch(errorMessage);
@@ -39,13 +39,12 @@ class CommentActions {
3939
/**
4040
* A new comment has been submitted to the server, dispatch it.
4141
*
42-
* @param {Array} comment
43-
* @returns {undefined}
42+
* @param {String} comment - New comment from UI.
43+
* @return {void}
4444
*/
4545
addComment(comment) {
4646
this.dispatch(comment);
4747
}
48-
4948
}
5049

5150
export default alt.createActions(CommentActions);

Diff for: client/assets/javascripts/actions/FormActions.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class FormActions {
66
/**
77
* Text is being entered in the comment form, update the state.
88
*
9-
* @param {String} comment
10-
* @returns {undefined}
9+
* @param {String} comment - Comment to update from form input.
10+
* @return {void}
1111
*/
1212
updateComment(comment) {
1313
this.dispatch(comment);
@@ -16,8 +16,9 @@ class FormActions {
1616
/**
1717
* Submit a new comment to the server.
1818
*
19-
* @param {String} comment
20-
* @returns {undefined}
19+
* @param {String} url - Url used for remote request to sumbmit the comment.
20+
* @param {String} comment - New comment from UI to send to the server.
21+
* @return {void}
2122
*/
2223
submitComment(url, comment) {
2324
this.dispatch();

Diff for: client/assets/javascripts/utils/CommentsManager.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const CommentsManager = {
44
/**
55
* Retrieve comments from server using AJAX call.
66
*
7-
* @param {String} url
8-
* @returns {Object}
7+
* @param {String} url - Url of server to retrieve comments.
8+
* @returns {Deferred} - jqXHR result of ajax call.
99
*/
1010
fetchComments(url) {
1111
return $.ajax({
@@ -17,9 +17,9 @@ const CommentsManager = {
1717
/**
1818
* Submit new comment to server using AJAX call.
1919
*
20-
* @param {String} url
21-
* @param {Object} comment
22-
* @returns {Object}
20+
* @param {String} url - Url of where to post comment.
21+
* @param {Object} comment - Comment body to post.
22+
* @returns {Deferred} - jqXHR result of ajax call.
2323
*/
2424
submitComment(url, comment) {
2525
return $.ajax({

Diff for: config/unicorn.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Process.kill "QUIT", Process.pid
1010
end
1111

12-
defined?(ActiveRecord::Base) && ActiveRecord::Base.connection.disconnect!
12+
defined?(ActiveRecord::Base) && ActiveRecord::Base.connection.disconnect!
1313
end
1414

1515
# noinspection RubyUnusedLocalVariable

Diff for: lib/tasks/brakeman.rake

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace :brakeman do
2+
3+
desc "Run Brakeman"
4+
task :run, :output_files do |t, args|
5+
require 'brakeman'
6+
7+
files = args[:output_files].split(' ') if args[:output_files]
8+
Brakeman.run :app_path => ".", :output_files => files, :print_report => true
9+
end
10+
11+
desc "Check your code with Brakeman"
12+
task :check do
13+
require 'brakeman'
14+
result = Brakeman.run app_path: '.', print_report: true
15+
exit Brakeman::Warnings_Found_Exit_Code unless result.filtered_warnings.empty?
16+
end
17+
end

Diff for: lib/tasks/ci.rake

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ if Rails.env.development?
22
# See tasks/linters.rake
33

44
task :bundle_audit do
5-
puts "Running security audit on gems (bundle_audit)".green
5+
puts Rainbow("Running security audit on gems (bundle_audit)").green
66
Rake::Task["bundle_audit"].invoke
77
end
88

99
task :security_audit do
10-
puts "Running security audit on code (brakeman)".green
10+
puts Rainbow("Running security audit on code (brakeman)").green
1111
Rake::Task["brakeman:run"].invoke("tmp/brakeman-report.html")
1212
end
1313

1414
namespace :ci do
1515
desc "Run all audits and tests"
1616
task all: [:environment, :lint, :spec, :bundle_audit, :security_audit] do
1717
begin
18-
puts "PASSED".green
18+
puts Rainbow("PASSED").green
1919
puts ""
2020
rescue Exception => e
2121
puts "#{e}"
22-
puts "FAILED".red
22+
puts Rainbow("FAILED").red
2323
puts ""
2424
raise(e)
2525
end

Diff for: spec/.rubocop.yml

-8
This file was deleted.

0 commit comments

Comments
 (0)