Skip to content

Commit a61f249

Browse files
committed
Fix typos and some minor syntax things found by RubyMine inspections
1 parent cf10907 commit a61f249

20 files changed

+35
-41
lines changed

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ begin
1212
t.pattern = "spec/**/*_spec.rb"
1313
t.rspec_opts =
1414
"--format d"
15-
t.rspec_opts += " --color" if !windows?
15+
t.rspec_opts += " --color" unless windows?
1616
# t.ruby_opts="-w"
1717
end
1818
rescue LoadError # swallow Heroku deploy error

app.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class InstallFest < Sinatra::Application # todo: use Sinatra::Base instead, wi
2525
include Erector::Mixin
2626

2727
# Set available locales in Array of Strings; this is also used when
28-
# checking availability in dynamic locale assigment, so must be as Strings.
28+
# checking availability in dynamic locale assignment, they must be strings.
2929
AVAILABLE_LOCALES = %w(en es)
3030

3131
configure do
@@ -102,7 +102,7 @@ def src
102102
end
103103

104104
def ext
105-
ext = $1 if doc_path.match(/\.(.*)/)
105+
$1 if doc_path.match(/\.(.*)/)
106106
end
107107

108108
def doc_path

lib/contents.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def site_page_files
3232
end
3333

3434
def content_for filename
35-
open("#{site_dir}/#{filename}").read()
35+
open("#{site_dir}/#{filename}").read
3636
end
3737

3838
def subpages_for filename
@@ -45,20 +45,20 @@ def subpages_for filename
4545
content.scan /[^!]\[.*?\]\((.*?)\)/ do |link, _|
4646
next if (link =~ /^http/)
4747
next if (link =~ %r(^//)) # protocol-less absolute links e.g. //google.com
48-
links.push(link) if !links.include? link
48+
links.push(link)
4949
end
5050

5151
# (stepfiles) links of the form: link "next page"
5252
content.scan /link\s*["'](.*?)["']/ do |link, _|
53-
links.push(link) if !links.include? link
53+
links.push(link)
5454
end
5555

5656
# (stepfiles) links of the form: site_desc "some site"
5757
content.scan /site_desc\s*["'](.*?)["']/ do |link, _|
58-
links.push('/' + link) if !links.include? link
58+
links.push('/' + link)
5959
end
6060

61-
links
61+
links.uniq
6262
end
6363

6464
def next_step_for filename

lib/media_wiki.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def mw2md md
77
gsub(/^\*\*\* /, " * ").
88

99
# square-bullet lists (turn into regular bullets)
10-
gsub(/^\# /, "\n* ").
11-
gsub(/^\#\# /, " * ").
12-
gsub(/^\#\#\# /, " * ").
10+
gsub(/^# /, "\n* ").
11+
gsub(/^## /, " * ").
12+
gsub(/^### /, " * ").
1313

1414
# headings
1515
gsub(/^==== ?(.*)( *====)\s*$/, "### \\1").
@@ -50,7 +50,7 @@ def mw2md md
5050
gsub(/^\{\|(.*)$/) {"<table #{$1}>\n<tr>\n"}.
5151
gsub(/^\|-/, "<tr>").
5252
gsub(/^\|\+(.*)/, "<tr><th>\\1<tr>").
53-
gsub(/^\! /, "<th>").
53+
gsub(/^! /, "<th>").
5454
gsub(/^\| /, "<td>").
5555
gsub(/^\|\}/, "</table>")
5656
end

lib/step.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def fuzzy_result fuzzed_text
305305
span I18n.t("captions.fuzzy_result")
306306
remaining_text = fuzzed_text
307307
pre do
308-
while match = remaining_text.match(/(.*?){FUZZY}(.*?){\/FUZZY}(.*)/m)
308+
while match = remaining_text.match(/(.*?)\{FUZZY}(.*?)\{\/FUZZY}(.*)/m)
309309
text match[1]
310310
span match[2], :class => 'fuzzy-lightened'
311311
remaining_text = match[3]

public/css/header.scss

+4-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ nav *, nav *:before, nav *:after {
3030
list-style: none;
3131
background-color: #fff;
3232
border: 1px solid #ccc;
33-
border: 1px solid rgba(0, 0, 0, 0.15);
33+
border-color: rgba(0, 0, 0, 0.15);
3434
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
3535
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
3636
background-clip: padding-box;
@@ -39,14 +39,13 @@ nav *, nav *:before, nav *:after {
3939

4040
&:before {
4141
content: "";
42-
border-color: transparent transparent white transparent;
4342
position: absolute;
4443
height: 0;
4544
width: 0;
4645
top: -19px;
4746
left: 148px;
48-
border-width: 10px;
49-
border-style: solid;
47+
border: 10px solid transparent;
48+
border-bottom-color: white;
5049
}
5150

5251
li {
@@ -62,7 +61,6 @@ nav *, nav *:before, nav *:after {
6261
padding: 3px 20px;
6362
font-weight: normal;
6463
line-height: 1.428571429;
65-
color: #333;
6664
white-space: nowrap;
6765
}
6866
}
@@ -111,9 +109,7 @@ nav *, nav *:before, nav *:after {
111109
> a {
112110
position: relative;
113111
display: block;
114-
padding: 10px 15px;
115-
padding-top: 15px;
116-
padding-bottom: 15px;
112+
padding: 15px;
117113
line-height: 20px;
118114
}
119115

public/css/step.css

+1-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ div.back:before {
163163

164164
table.bordered td,
165165
table.bordered tr {
166-
border-style: solid;
167-
border-width: 1px;
168-
border-color: black;
166+
border: 1px solid black;
169167
padding-left: 5px;
170168
padding-right: 5px;
171169
}

sites/en/frontend/frontend.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ message <<-MARKDOWN
22

33
### Goal
44

5-
Our aim is to get you aquainted with HTML, CSS, and JavaScript, the most essential building blocks
5+
Our aim is to get you acquainted with HTML, CSS, and JavaScript, the most essential building blocks
66
of web experiences. You'll create a basic static web page about yourself and possibly deploy
77
it to the web. You'll:
88

sites/en/intermediate-rails/add_other_features_of_your_choosing.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Suggestions:
88
* Easy user profile pictures with [Gravatar](https://gravatar.com/).
99
* Add login options with [Omniauth](https://github.com/intridea/omniauth), including Twitter, Facebook, Github, Google, and more.
1010
* Check out the Devise [documentation for integrating with Omniauth](https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview).
11-
* Fiddle with the layout of the show page so it doesnt look bad. If it looks bad. It probably looks great.
11+
* Fiddle with the layout of the show page so it doesn't look bad. If it looks bad. It probably looks great.
1212
* Perhaps fancier post markup with Markdown or something similar.
1313
* Deploy to Heroku and send your message board to all your friends!
1414

sites/en/intermediate-rails/add_pages_to_create_and_look_at_individual_posts.step

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ requirements do
22
message <<-MARKDOWN
33
* The user should be able to create a post with a title, author, date published, and content. The author should be the current user.
44
* The complete post should appear on its own page (aka its show page).
5-
* If the user doesnt submit all required fields, they should see some error messaging, but shouldnt lose any of their work.
5+
* If the user doesn't submit all required fields, they should see some error messaging, but shouldn't lose any of their work.
66
MARKDOWN
77
table do
88
tr do
@@ -50,7 +50,7 @@ message <<-MARKDOWN
5050
* Rails has some built in ways to associate one model with another. See the RailsGuides link above for hints on how to make a user the owner of a post!
5151
* Don't hand code the form! You don't have to! Rails will help. See RailsGuide link above!
5252
* Rails has a built-in way to note when something was stored in the database. Probably handy for showing the date / time a post was created.
53-
* For now, we're going to use the user's email address when displaying a posts's author. You can add names or other identifiers later! (Also, even though you're going to get the current user's email address from the User model, you'll still need a user parameter for your Post resource.)
53+
* For now, we're going to use the user's email address when displaying a post's author. You can add names or other identifiers later! (Also, even though you're going to get the current user's email address from the User model, you'll still need a user parameter for your Post resource.)
5454
* You need a `create` method to store your post data - scroll down a little bit in this section of the Getting Started guide for very helpful information and to see an example of a create method: <http://guides.rubyonrails.org/getting_started.html#creating-new-posts>.
5555
MARKDOWN
5656
end

sites/en/intermediate-rails/add_replying.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ message <<-MARKDOWN
33
* The user should see a 'New Reply' link or button on a post's show page which takes them to a form. The form should include the title of the post being replied to.
44
* The user should be able to create a new reply to a post using the 'New Reply' form.
55
* The user should see all the replies to a post on the post’s show page.
6-
* If the user doesnt submit all required fields, they should see some error messaging, but they shouldnt lose any of their work.
6+
* If the user doesn't submit all required fields, they should see some error messaging, but they shouldn't lose any of their work.
77
MARKDOWN
88
table do
99
tr do

sites/en/intermediate-rails/install_devise.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
requirements do
22
message <<-MARKDOWN
33
* The user should be able to create an account and log in.
4-
* The user should see a prompt to log in if they arent logged in.
4+
* The user should see a prompt to log in if they aren't logged in.
55
* Once logged in, the user should see a static page with some kind of greeting.
66
* The page should display the logged-in user's email address and a link to log out.
77
* You, the developer, should explain to a teacher, TA, or fellow student how Rails knows to render the home view.

sites/en/intermediate-rails/intermediate-rails.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ message <<-MARKDOWN
2626

2727
* Each time you get your app into a functional state, before adding any more features, COMMIT TO GIT! The new features will probably break things, which is neat, but you’ll want to be able to roll back to a prior version if necessary.
2828

29-
MAJORLY IMPORTANT NOTE: We called the sections challenges because they are challenging! This curriculum will be most fun as a collaboration — talk things through with your teacher, TAs, and other students. This is a very different style of curriculum than Suggestotron, so don’t be discouraged if you arent quite sure what to do next.
29+
MAJORLY IMPORTANT NOTE: We called the sections challenges because they are challenging! This curriculum will be most fun as a collaboration — talk things through with your teacher, TAs, and other students. This is a very different style of curriculum than Suggestotron, so don’t be discouraged if you aren't quite sure what to do next.
3030

3131
## How to use this curriculum
3232
* Challenges are the big chunks of stuff to work on at a given time. These are gated by requirements — once you (or your group) has completed a set of requirements, go on to the next set.

sites/en/workshop/ruby_for_beginners.deck.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Create a variable whose name has:
227227

228228
* a number anywhere (like `y2k`)
229229

230-
* a number at the start (like '101dalmations')
230+
* a number at the start (like '101dalmatians')
231231

232232
* a number at the end (like 'starwars2')
233233

spec/app_deck_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def app
3434

3535
sites_dir = dir "sites" do
3636
dir "meals" do
37-
f = file "breakfast.deck.md", breakfast
37+
file "breakfast.deck.md", breakfast
3838
end
3939
end
4040
Site.stub(:sites_dir) { sites_dir }

spec/sites/meals/_find_utensils.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Maybe they are in the drawer?
1+
message "Maybe they are in the drawer?"

spec/sites/meals/eat_a_meal.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Put the food in your mouth!
1+
message "Put the food in your mouth!"
22

33
next_step "clean_up"

spec/sites/meals/prepare_a_meal.step

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Are you
1+
message "Are you"
22
link "vegetarian"
3-
or
3+
message "or"
44
link "omnivorous"

spec/sites/meals/vegetarian.step

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Make sure not to use any meat!
1+
message "Make sure not to use any meat!"
22

33
insert 'find_utensils'
44

spec/step_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def step_obj_for(path)
5757

5858
anchors = html_doc.css("a")
5959
names = anchors.map{|a| a["name"]}
60-
assert { names == ["step1", "happy_step"] }
60+
assert { names == %w(step1 happy_step) }
6161
end
6262

6363
it "nests anchor numbers" do
@@ -73,11 +73,11 @@ def step_obj_for(path)
7373
RUBY
7474

7575
titles = html_doc.css('.step').map{|div| div["title"]}
76-
assert { titles == ["breakfast", "cereal", "eggs", "lunch", "salad", "sandwich"] }
76+
assert { titles == %w(breakfast cereal eggs lunch salad sandwich) }
7777

7878
anchors = html_doc.css("a")
7979
names = anchors.map{|a| a["name"]}
80-
assert { names == ["step1", "step1-1", "step1-2", "step2", "step2-1", "step2-2"] }
80+
assert { names == %w(step1 step1-1 step1-2 step2 step2-1 step2-2) }
8181
end
8282

8383
describe 'link' do

0 commit comments

Comments
 (0)