04-02-2022

375 words 2 minutes

Useful CLI Tools

  • tree - prints a directory structure to terminal
  • dos2unix - takes a file with CRLF '/r/n' encoding and switches it to LF '/n' encoding
  • weasyprint - complex html to pdf

Today's Foci

Focus 1

  1. Rush through the Pair challenge to completion, in order to understand the goals
  2. Having Read through

Topic

Friday Challenge

User Stories

As a marketeer
So that I can see my name in lights
I would like to register my name before playing an online game
As a marketeer
So that I can enjoy myself away from the daily grind
I would like to be able to play rock/paper/scissors

Tree output for future reference

.
├── app.rb
├── check.sh
├── config.ru
├── CONTRIBUTING.md
├── coverage
├── docs
│   └── review.md
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
└── spec
    ├── features
    │   └── test_page_spec.rb
    └── spec_helper.rb

Extra User Stories

User Story Tables

NounVerbProp
Gameplay
Playername

Am I gonna build the backend first? maybe.

uggghhhh.

Well my thoughts were do extra user stories.

But - that's not the point of this. This is about making a functional UI.

sigh. For this purpose, UI first, backend after. Is this standard? idk.

Plan done

That was Useful

revised class table something like

ClassMethodAttribute
Gameplay
name

where play takes a paramater of rock or paper or scissors, via a button (SVG rock / paper / scissors? )

what tests do I need?

  • does localhost:port/ have fill_in :name

  • does / have submit

  • does / click_button take to /game?

  • does /game display Game.name?

  • does /game display buttons rock / paper / scissors?

  • does /game click_button submit (page) have "You win / lose?"

something like if game.result show you win/lose

but set game.result as nil

right, time for a break


post lunch

had to convert a the svg file from CRLF formatting to LF formatting using dos2unix tool. Good to know that works

I think it changes '/r/n' into '/n'

tiem to build a spec in the ./spec/features folder for the UI, using capybara / rspec features/scenario kwords.

use the RSpec 'skip' keyword or preppend with 'x' - 'it' -> ''xit', 'scenarion' -> 'xscenario'

Terminal CTRL-A is MAGIC how did I not know this?!?!

Servers

We spent this afternoon looking at servers. yes, we're not supposed to - but this person had written their code. They missed a typo in a DSL that we've used for four days, having no previous experience of web frameworks.

Then we talked about servers. We got there. We followed the flow. How does the data transfer?

form posts to routeA, routeA assigns params to variable, variable into routeB, routeB interpolates the variable

it worked. we got there. Genuinely, I cannot think of a better use of my time. magic.