Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab 7 - Issues & Observations #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

t-siddharth
Copy link

Thanks for the comparison examples and the exercises. Here are some observations that might help others:

Observation 1 - Use IRB

For part 3 of the README.md, there should be an instruction/tip to use IRB right before this statement:

require '~/devrampup/week7/example_ruby_scripts.rb'

A possible replacement:

Type IRB at the command prompt to launch the Interactive Ruby Shell. Then enter the following command, though replace the command path with the absolute path to the directory where the example ruby scripts file lives:
require '~/devrampup/week7/example_ruby_scripts.rb'


Observation 2

Not sure if these commands were meant to be tried out - they give the following error messages:

1.9.3p327 :017 > name = params['name']

1.9.3p327 :017 > name = params['name']
NameError: undefined local variable or method params' for main:Object from (irb):17 from /usr/local/bin/irb:12:in

'

1.9.3p327 :018 > Blog.posts.where(‘author.name = ?’, name)

1.9.3p327 :018 > Blog.posts.where(‘author.name = ?’, name)
NameError: uninitialized constant Blog
from (irb):18
from /usr/local/bin/irb:12:in `

'

@t-siddharth
Copy link
Author

Bonus section

Observation 3

Start getting error messages from the git fetch master command:
$ git branch
/* feature/cool_feature
master

$ git fetch master
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.

$ git status
"# On branch feature/cool_feature"
"nothing to commit, working directory clean"

@t-siddharth
Copy link
Author

Observation 3b

Error messages continue from that fetch command point in the bonus file:
$ git checkout master
Switched to branch 'master'
$ git pull origin master
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

@deanxorr
Copy link
Member

Hey @siddtewari thanks for the comments; I've updated a few things.

  1. You're right that you have to open the ruby interpreter with irb before you can run the 'require' command. I've updated the readme.

  2. Those commands should not work--they were just hypothetical; consider them a sneak-peek of some magic to come...

3a) It should be git fetch origin...my bad. Sorry about that.

3b) I need to see your origin...can you post the output of your 'git remote -v'?

Thanks!

-Dean

=> [1, 2, 3]

=> What do you think the exclamation mark indicates?
Bang makes a permanent change to the object. In this case the array [3,1,2] gets over written by the array [1,2,3]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though it's probably more correct to think of it as array is assigned the 'value' [3,1,2], rather than overwritten, since the variable 'array' is actually the same object after the sort!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Dean! That's good to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants