Skip to content

Commit 2162e71

Browse files
committed
Consolidate 'working effectively' text into two versions instead of four
1 parent 8c4583a commit 2162e71

File tree

7 files changed

+46
-77
lines changed

7 files changed

+46
-77
lines changed

lib/step.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def insert file
4242
# todo: unify into common 'find & process a document file' unit
4343
dir = File.dirname(@doc_path)
4444

45-
# todo: other file types
46-
47-
possible_paths = ["_#{file}.step", "#{file}.step", "#{file}.md"].map do |path|
48-
File.join(dir, path)
45+
possible_paths = ['step', 'md'].each_with_object([]) do |ext, paths|
46+
paths << File.join(dir, "#{file}.#{ext}")
47+
path_dir, path_file = file.match(%r{(.*/)?(.*)}).captures
48+
paths << File.join(dir, "#{path_dir}_#{path_file}.#{ext}")
4949
end
5050

5151
possible_paths.each do |path|
@@ -60,7 +60,7 @@ def insert file
6060
end
6161
end
6262

63-
raise "Couldn't find a partial for #{file}!"
63+
raise "Couldn't find a partial for #{file}! Searched in #{possible_paths}"
6464
end
6565

6666
## steps
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Working Effectively and Efficiently
2+
3+
We highly recommend you do the following:
4+
5+
* Open your browser fresh or hide any windows you already have open.
6+
* Bring up one window with two tabs
7+
* One for this content
8+
* One for interacting with your app.
9+
* Open your text editor and _do not ever close it_. We're not quitters.
10+
* Hide all extra applications. Turn off twitter, IM, and all other distractions.
11+
12+
By minimizing the number of things you interact with, you reduce the
13+
amount of time spent switching between them and the context lost as
14+
you work through the lessons. Having 50 tabs open in your web
15+
browser gets confusing and wastes time.

sites/en/frontend/frontend.step

+2-17
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,8 @@ Optional tools if you're deploying to GitHub:
3838

3939
* Git
4040
* Your [GitHub](http://github.com) account
41-
42-
### Working Effectively and Efficiently
43-
44-
We highly recommend you do the following:
45-
46-
* Open your browser fresh or hide any windows you already have open.
47-
* Bring up one window with two tabs
48-
* One for this content
49-
* One for interacting with your app.
50-
* Open your text editor and _do not ever close it_. We're not quitters.
51-
* Hide all extra applications. Turn off twitter, IM, and all other distractions.
52-
53-
By minimizing the number of things you interact with, you reduce the
54-
amount of time spent switching between them and the context lost as
55-
you work through the lessons. Having 50 tabs open in your web
56-
browser gets confusing and wastes time.
57-
5841
MARKDOWN
5942

43+
insert 'working_effectively_and_efficiently'
44+
6045
next_step 'introduction_to_html'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Working Effectively and Efficiently
2+
3+
We highly recommend you do the following:
4+
5+
* Bring up your terminal and open 2 tabs:
6+
* One is for regular terminal stuffs
7+
* One will be for irb (a.k.a. Rails console). We'll explain later.
8+
* Open your browser fresh or hide any windows you already have open.
9+
* Bring up one window with two tabs
10+
* One for this content
11+
* One for interacting with your app.
12+
* Open your text editor and _do not ever close it_. We're not quitters.
13+
* Hide all extra applications. Turn off Twitter, IM, and all other distractions.
14+
15+
By minimizing the number of things you interact with, you reduce the
16+
amount of time spent switching between them and the context lost as
17+
you work through the lessons. Having 50 tabs open in your web
18+
browser gets confusing and wastes time.

sites/en/intro-to-rails/intro-to-rails.step

+3-18
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,11 @@ $
6262
</div>
6363

6464
If you can do that, you are probably good to go.
65+
MARKDOWN
6566

66-
### Working Effectively and Efficiently
67-
68-
I highly recommend you do the following:
69-
70-
* Bring up your terminal and open 2 tabs:
71-
* One is for regular terminal stuffs
72-
* One will be for irb (aka rails console). We'll explain later
73-
* Open your browser fresh or hide any windows you already have open.
74-
* Bring up one window with two tabs
75-
* One for this content
76-
* One for interacting with your app.
77-
* Open your text editor and _do not ever close it_. We're not quitters.
78-
* Hide all extra applications. Turn off twitter, IM, and all other distractions.
79-
80-
By minimizing the number of things you interact with, you reduce the
81-
amount of time spent switching between them and the context lost as
82-
you work through the lessons. Having 50 tabs open in your web
83-
browser gets confusing and wastes time.
67+
insert 'working_effectively_and_efficiently'
8468

69+
message <<-MARKDOWN
8570
### Format
8671

8772
Each lesson will look like this:

sites/en/javascript/javascript.step

+2-17
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,8 @@ Optional tools if you're checking in to GitHub:
3434

3535
* Git
3636
* Your [GitHub](http://github.com) account
37-
38-
### Working Effectively and Efficiently
39-
40-
We highly recommend you do the following:
41-
42-
* Open your browser fresh or hide any windows you already have open.
43-
* Bring up one window with two tabs
44-
* One for this content
45-
* One for interacting with your app.
46-
* Open your text editor and _do not ever close it_. We're not quitters.
47-
* Hide all extra applications. Turn off twitter, IM, and all other distractions.
48-
49-
By minimizing the number of things you interact with, you reduce the
50-
amount of time spent switching between them and the context lost as
51-
you work through the lessons. Having 50 tabs open in your web
52-
browser gets confusing and wastes time.
53-
5437
MARKDOWN
5538

39+
insert '../frontend/working_effectively_and_efficiently'
40+
5641
next_step 'javascript_not_java'

sites/en/job-board/job-board.step

+1-20
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,7 @@ message <<-MARKDOWN
2424
* When adding code, it's awesome for students to walk through the code line by line and say out loud what is happening. (i.e., "The string is being stored in the instance variable" or "The method `snorgle` is being defined"). If you do it every time, you'll get really comfortable with the vocabulary of Rails!
2525
* Error messages are your friend! Read them carefully, and practice understanding what Rails is telling you. Seeing an error and just diving back into your code is a natural reaction, but stop! Then read, think, and talk about what the error means before fixing it.
2626
MARKDOWN
27-
message <<-MARKDOWN
28-
# Working Effectively and Efficiently
29-
30-
I highly recommend you do the following:
31-
32-
* Bring up your terminal and open 2 tabs:
33-
* One is for regular terminal stuffs
34-
* One will be for irb (a.k.a. Rails console). We'll explain later.
35-
* Open your browser fresh or hide any windows you already have open.
36-
* Bring up one window with two tabs
37-
* One for this content
38-
* One for interacting with your app.
39-
* Open your text editor and _do not ever close it_. We're not quitters.
40-
* Hide all extra applications. Turn off Twitter, IM, and all other distractions.
4127

42-
By minimizing the number of things you interact with, you reduce the
43-
amount of time spent switching between them and the context lost as
44-
you work through the lessons. Having 50 tabs open in your web
45-
browser gets confusing and wastes time.
46-
47-
MARKDOWN
28+
insert '../intro-to-rails/working_effectively_and_efficiently'
4829

4930
next_step "create_a_rails_app"

0 commit comments

Comments
 (0)