Skip to content

Commit

Permalink
Fix typos and some minor syntax things found by RubyMine inspections
Browse files Browse the repository at this point in the history
  • Loading branch information
tjgrathwell committed Jun 18, 2014
1 parent cf10907 commit a61f249
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ begin
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts =
"--format d"
t.rspec_opts += " --color" if !windows?
t.rspec_opts += " --color" unless windows?
# t.ruby_opts="-w"
end
rescue LoadError # swallow Heroku deploy error
Expand Down
4 changes: 2 additions & 2 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InstallFest < Sinatra::Application # todo: use Sinatra::Base instead, wi
include Erector::Mixin

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

configure do
Expand Down Expand Up @@ -102,7 +102,7 @@ def src
end

def ext
ext = $1 if doc_path.match(/\.(.*)/)
$1 if doc_path.match(/\.(.*)/)
end

def doc_path
Expand Down
10 changes: 5 additions & 5 deletions lib/contents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def site_page_files
end

def content_for filename
open("#{site_dir}/#{filename}").read()
open("#{site_dir}/#{filename}").read
end

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

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

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

links
links.uniq
end

def next_step_for filename
Expand Down
8 changes: 4 additions & 4 deletions lib/media_wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ def mw2md md
gsub(/^\*\*\* /, " * ").

# square-bullet lists (turn into regular bullets)
gsub(/^\# /, "\n* ").
gsub(/^\#\# /, " * ").
gsub(/^\#\#\# /, " * ").
gsub(/^# /, "\n* ").
gsub(/^## /, " * ").
gsub(/^### /, " * ").

# headings
gsub(/^==== ?(.*)( *====)\s*$/, "### \\1").
Expand Down Expand Up @@ -50,7 +50,7 @@ def mw2md md
gsub(/^\{\|(.*)$/) {"<table #{$1}>\n<tr>\n"}.
gsub(/^\|-/, "<tr>").
gsub(/^\|\+(.*)/, "<tr><th>\\1<tr>").
gsub(/^\! /, "<th>").
gsub(/^! /, "<th>").
gsub(/^\| /, "<td>").
gsub(/^\|\}/, "</table>")
end
Expand Down
2 changes: 1 addition & 1 deletion lib/step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def fuzzy_result fuzzed_text
span I18n.t("captions.fuzzy_result")
remaining_text = fuzzed_text
pre do
while match = remaining_text.match(/(.*?){FUZZY}(.*?){\/FUZZY}(.*)/m)
while match = remaining_text.match(/(.*?)\{FUZZY}(.*?)\{\/FUZZY}(.*)/m)
text match[1]
span match[2], :class => 'fuzzy-lightened'
remaining_text = match[3]
Expand Down
12 changes: 4 additions & 8 deletions public/css/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nav *, nav *:before, nav *:after {
list-style: none;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-color: rgba(0, 0, 0, 0.15);
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
Expand All @@ -39,14 +39,13 @@ nav *, nav *:before, nav *:after {

&:before {
content: "";
border-color: transparent transparent white transparent;
position: absolute;
height: 0;
width: 0;
top: -19px;
left: 148px;
border-width: 10px;
border-style: solid;
border: 10px solid transparent;
border-bottom-color: white;
}

li {
Expand All @@ -62,7 +61,6 @@ nav *, nav *:before, nav *:after {
padding: 3px 20px;
font-weight: normal;
line-height: 1.428571429;
color: #333;
white-space: nowrap;
}
}
Expand Down Expand Up @@ -111,9 +109,7 @@ nav *, nav *:before, nav *:after {
> a {
position: relative;
display: block;
padding: 10px 15px;
padding-top: 15px;
padding-bottom: 15px;
padding: 15px;
line-height: 20px;
}

Expand Down
4 changes: 1 addition & 3 deletions public/css/step.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ div.back:before {

table.bordered td,
table.bordered tr {
border-style: solid;
border-width: 1px;
border-color: black;
border: 1px solid black;
padding-left: 5px;
padding-right: 5px;
}
Expand Down
2 changes: 1 addition & 1 deletion sites/en/frontend/frontend.step
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ message <<-MARKDOWN

### Goal

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ requirements do
message <<-MARKDOWN
* The user should be able to create a post with a title, author, date published, and content. The author should be the current user.
* The complete post should appear on its own page (aka its show page).
* If the user doesnt submit all required fields, they should see some error messaging, but shouldnt lose any of their work.
* If the user doesn't submit all required fields, they should see some error messaging, but shouldn't lose any of their work.
MARKDOWN
table do
tr do
Expand Down Expand Up @@ -50,7 +50,7 @@ message <<-MARKDOWN
* 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!
* Don't hand code the form! You don't have to! Rails will help. See RailsGuide link above!
* 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.
* 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.)
* 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.)
* 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>.
MARKDOWN
end
Expand Down
2 changes: 1 addition & 1 deletion sites/en/intermediate-rails/add_replying.step
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message <<-MARKDOWN
* 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.
* The user should be able to create a new reply to a post using the 'New Reply' form.
* The user should see all the replies to a post on the post’s show page.
* If the user doesnt submit all required fields, they should see some error messaging, but they shouldnt lose any of their work.
* If the user doesn't submit all required fields, they should see some error messaging, but they shouldn't lose any of their work.
MARKDOWN
table do
tr do
Expand Down
2 changes: 1 addition & 1 deletion sites/en/intermediate-rails/install_devise.step
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requirements do
message <<-MARKDOWN
* The user should be able to create an account and log in.
* The user should see a prompt to log in if they arent logged in.
* The user should see a prompt to log in if they aren't logged in.
* Once logged in, the user should see a static page with some kind of greeting.
* The page should display the logged-in user's email address and a link to log out.
* You, the developer, should explain to a teacher, TA, or fellow student how Rails knows to render the home view.
Expand Down
2 changes: 1 addition & 1 deletion sites/en/intermediate-rails/intermediate-rails.step
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ message <<-MARKDOWN

* 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.

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.
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.

## How to use this curriculum
* 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.
Expand Down
2 changes: 1 addition & 1 deletion sites/en/workshop/ruby_for_beginners.deck.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Create a variable whose name has:

* a number anywhere (like `y2k`)

* a number at the start (like '101dalmations')
* a number at the start (like '101dalmatians')

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

Expand Down
2 changes: 1 addition & 1 deletion spec/app_deck_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def app

sites_dir = dir "sites" do
dir "meals" do
f = file "breakfast.deck.md", breakfast
file "breakfast.deck.md", breakfast
end
end
Site.stub(:sites_dir) { sites_dir }
Expand Down
2 changes: 1 addition & 1 deletion spec/sites/meals/_find_utensils.step
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Maybe they are in the drawer?
message "Maybe they are in the drawer?"
2 changes: 1 addition & 1 deletion spec/sites/meals/eat_a_meal.step
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Put the food in your mouth!
message "Put the food in your mouth!"

next_step "clean_up"
4 changes: 2 additions & 2 deletions spec/sites/meals/prepare_a_meal.step
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Are you
message "Are you"
link "vegetarian"
or
message "or"
link "omnivorous"
2 changes: 1 addition & 1 deletion spec/sites/meals/vegetarian.step
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Make sure not to use any meat!
message "Make sure not to use any meat!"

insert 'find_utensils'

Expand Down
6 changes: 3 additions & 3 deletions spec/step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def step_obj_for(path)

anchors = html_doc.css("a")
names = anchors.map{|a| a["name"]}
assert { names == ["step1", "happy_step"] }
assert { names == %w(step1 happy_step) }
end

it "nests anchor numbers" do
Expand All @@ -73,11 +73,11 @@ def step_obj_for(path)
RUBY

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

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

describe 'link' do
Expand Down

0 comments on commit a61f249

Please sign in to comment.