Skip to content

Conversation

var114
Copy link

@var114 var114 commented Dec 19, 2013

No description provided.

@jwo
Copy link
Member

jwo commented Dec 20, 2013

Hi! is the "show" directory intended to me in the commit?

@jwo
Copy link
Member

jwo commented Dec 20, 2013

I'm going to assume "/show" shouldn't be here.... So, great job!

Of note, on https://github.com/var114/abtvar/blob/master/lib/abtvar/answers.rb#L3

  1. our variables should be :answer_x instead of :answer_y
  2. If you have a bunch of answers, might be better to store in an array (or a hash)
  3. Instead of "aboutVar", probably "about" would do

Your gem does this:

  def aboutVar(answer)
    if answer == 'Y'
      puts "Because she can code in Ruby"
    else
      puts "You suck JavaChips"
    end
  end

a Gem is a library, and so it shouldn't really "puts" --- it should just return data based on your input. In this case, it would

  def about(answer)
    if answer == 'Y'
      "Because she can code in Ruby"
    else
      "You suck JavaChips"
    end
  end

(JavaChips made me laugh) 😆

Then in your calling code,

puts Bio.new.about(answer)

@var114
Copy link
Author

var114 commented Dec 20, 2013

oh no. I don’t know how that go in there.
On Dec 20, 2013, at 11:29 AM, Jesse Wolgamott [email protected] wrote:

Hi! is the "show" directory intended to me in the commit?


Reply to this email directly or view it on GitHub.

@jwo
Copy link
Member

jwo commented Dec 20, 2013

About “show” —— it probably existed about you did a “git commit -am ‘message’”

That adds everything… To prevent those, you can “git status” to see what’s there that you want to commit… you’ll learn that over time.

Also, doing “git add -p” and then "git commit” as 2 separate commands is cool if you want TOTAL CONTROL OVER THE GITS. :)

On Friday, December 20, 2013 at 1:37 PM, var114 wrote:

oh no. I don’t know how that go in there.
On Dec 20, 2013, at 11:29 AM, Jesse Wolgamott <[email protected] (mailto:[email protected])> wrote:

Hi! is the "show" directory intended to me in the commit?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub (#5 (comment)).

Copy link
Member

Choose a reason for hiding this comment

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

Do you think this will work? I don't see the about.erb anywhere for this to render thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

sorry jesse,
the holidays are making me clumsy…I forgot to do a last repo update. now I have a layout.erb and about.erb in my views folder.
On Jan 2, 2014, at 10:28 AM, Jesse Wolgamott [email protected] wrote:

In niner.rb:

-Bundler.require
+require 'sinatra'
+require 'sinatra/reloader'
+
+Bundler.require
+
+enable :session
+
+x = Abtvar::Bio.new
+puts x.awesome_reply
+
+

  • get '/' do
  • session[:about] = Abtvar::Bio.new
  • @random_answer = session[:about].awesome_reply
  • erb :about
    Do you think this will work? I don't see the about.erb anywhere for this to render thoughts?


Reply to this email directly or view it on GitHub.

@jwo
Copy link
Member

jwo commented Jan 2, 2014

Looks great! Nicely done.

Do you have any question about gems?

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