Login Register






Github - Simple: Ruby Library, Progess Thread filter_list
Author
Message
Github - Simple: Ruby Library, Progess Thread #1
So a couple of days a go i posted an example of one of the Methods from a Ruby library i've been building and well i now have it on Github. This will be my update thread so i dont need to keep posting new.

Project Hosting: Github.com/Simple-Ruby

Code Example, Simple / Standard:
[Image: duPgt9X.png]

So far this library only has 10 methods, it mostly works with arrays doing those little tasks which annoy and distract me from the larger problems.

So far i have completed:
  • list()
  • file_array()
  • simple_error()
  • display_errors()
  • error_number()
  • export_errors()
  • clear_errors()
  • filter()
  • simple_split()
  • search_array()
  • is_array()
  • is_int()
  • is_string()
  • back_space()

not only have i been trying to make coding faster but also shorten the amount i have to code in the long run. After coding the same script, once with simple once without it was found that the simple one was shorter.

Now, im not forcing anyone into using Simple as it was a project purly for my benefit but i thought "what harm could it do sharing" so anyway, if you have any ideas on extra little methods/functions that you always find yourself doing when coding let me know, doesn't matter what language as i will just code it in Ruby.

Reply

Github - Simple: Ruby Library, Progess Thread #2
So a couple of days a go i posted an example of one of the Methods from a Ruby library i've been building and well i now have it on Github. This will be my update thread so i dont need to keep posting new.

Project Hosting: Github.com/Simple-Ruby

Code Example, Simple / Standard:
[Image: duPgt9X.png]

So far this library only has 10 methods, it mostly works with arrays doing those little tasks which annoy and distract me from the larger problems.

So far i have completed:
  • list()
  • file_array()
  • simple_error()
  • display_errors()
  • error_number()
  • export_errors()
  • clear_errors()
  • filter()
  • simple_split()
  • search_array()
  • is_array()
  • is_int()
  • is_string()
  • back_space()

not only have i been trying to make coding faster but also shorten the amount i have to code in the long run. After coding the same script, once with simple once without it was found that the simple one was shorter.

Now, im not forcing anyone into using Simple as it was a project purly for my benefit but i thought "what harm could it do sharing" so anyway, if you have any ideas on extra little methods/functions that you always find yourself doing when coding let me know, doesn't matter what language as i will just code it in Ruby.

Reply

RE: Github - Simple: Ruby Library, Progess Thread #3
I have some questions. It seems to me that the standard library of Ruby already provides some of the functions you implemented.
See: http://www.tutorialspoint.com/ruby/ruby_arrays.htm

E.g.
array.reverse <-> reverse_array(array)
array.index(obj) <-> search_array(array, obj)

Why don't you use them?

Code:
def is_array(simple_data_type) if simple_data_type.kind_of?(Array) return true else return false end end

You can just do:

Code:
def is_array(simple_data_type) return simple_data_type.kind_of?(Array) end
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Github - Simple: Ruby Library, Progess Thread #4
I have some questions. It seems to me that the standard library of Ruby already provides some of the functions you implemented.
See: http://www.tutorialspoint.com/ruby/ruby_arrays.htm

E.g.
array.reverse <-> reverse_array(array)
array.index(obj) <-> search_array(array, obj)

Why don't you use them?

Code:
def is_array(simple_data_type) if simple_data_type.kind_of?(Array) return true else return false end end

You can just do:

Code:
def is_array(simple_data_type) return simple_data_type.kind_of?(Array) end
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Github - Simple: Ruby Library, Progess Thread #5
Ahh damn, i searched around on the reverse and when i came up empty i built the method, good spot. As for the .index(obj) im sticking with search_array() just as at a glance it seems easier to read. Also for the is_array() i didnt think but ye the condition will return boolean so no need for the if. Thanks.

Reply

RE: Github - Simple: Ruby Library, Progess Thread #6
Ahh damn, i searched around on the reverse and when i came up empty i built the method, good spot. As for the .index(obj) im sticking with search_array() just as at a glance it seems easier to read. Also for the is_array() i didnt think but ye the condition will return boolean so no need for the if. Thanks.

Reply

RE: Github - Simple: Ruby Library, Progess Thread #7
Updated with some fresh methods, improved/built more on the error handling, i use simple for many of my projects now just because of the error handling. Also added some basic methods which just extend on to pre-existing ones and more data type check methods to improve readability.

Reply

RE: Github - Simple: Ruby Library, Progess Thread #8
(05-07-2014, 04:19 PM)Godric Wrote: Updated with some fresh methods, improved/built more on the error handling, i use simple for many of my projects now just because of the error handling. Also added some basic methods which just extend on to pre-existing ones and more data type check methods to improve readability.

You should describe your methods on the wiki and not on the README.md as it is for introducing what your project is about.

You can create a wiki and add the link to README.md and that would be nice else the descriptions make the page unnecessarily long.
[Image: OilyCostlyEwe.gif]

Reply

RE: Github - Simple: Ruby Library, Progess Thread #9
(05-07-2014, 08:23 PM)Psycho_Coder Wrote: You should describe your methods on the wiki and not on the README.md as it is for introducing what your project is about.

You can create a wiki and add the link to README.md and that would be nice else the descriptions make the page unnecessarily long.

Although you are right im not going to purly because i doubt many people will use this to warrant a wiki. Its really only for my development now... Plus i absolutely love the error handling methods, helps me keep on top of my projects so much better.

Reply