textmagic / textmagic-rest-ruby

MIT License
1 stars 4 forks source link

Request: review my latest changes to examples/chats.rb. . . #32

Closed matthewcummings closed 9 years ago

matthewcummings commented 9 years ago

And the other two example scripts I created: send_message.rb and receive_message.rb. I'd like to update all of the examples to use a similar format. I find it more readable and educational - the existing examples look and feel like unit tests. I've been adding comments with links back to the corresponding doc pages (on your site) where possible too.

Let me know your thoughts on that Andrey. Since github doesn't allow messaging, I created this issue to send this message.
Thanks, Matt

matthewcummings commented 9 years ago

Note that I added the auth_helper. rb script to encourage users not to copy/paste their credentials directly into the scripts. Two benefits here:

matthewcummings commented 9 years ago

I probably should move auth_helper in ./lib and wrap it in the Textmagic module hierarchy.

matthewcummings commented 9 years ago

To elaborate a bit more, when you run an example like contacts.rb, the output doesn't give any clue as to what it refers to. E.g.

 *** Running contact examples *** 
true
true
. . .
true
true
 *** Finish contact examples *** 
andreylarionov commented 9 years ago

Hi, Matthew Actually, the existing examples look like unit tests (initially they were designed for this purpose). It is a very good idea to make it a more readable using similar format like you did in chats.rb. Thanks.

matthewcummings commented 9 years ago

OK, great Andrey. I will continue updating the existing examples. I may add some new ones too.