Sha256: 82e39ef6f57766b2d63f45500fd919e01e91e22f7c11ae7611bfd8be0819210b

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

1 What is Rubymisc (Ruby miscellaneous | /ˈru:bi ˌmisəˈleiniəs/)
  Miscellaneous and humble tool-set of useful Ruby (RUBY_VERSION >= 1.9.2)

  [https://secure.travis-ci.org/ipoval/rubymisc.png]

  1.1 Installation
    gem install rubymisc

2 Usage

  2.1 Rbm::Regex

    e1: puts Rbm::Regex.man
    e2: Rbm::Regex.email
    e3: Rbm::Regex.url
    e4: Rbm::Regex.zip
    e5: Rbm::Regex.ipv4
    e6: Rbm::Regex.mac_address
    e7: Rbm::Regex.hexcode
    e8: Rbm::Regex.usd

  2.2 Object

    #in?
      e9: 100.in? [1, 2, 3, 4, 5, 100]  # => true

    #not functor
      e10: 100.not.instance_of? Fixnum  # => false

    #and_try functor
      e11: nil.and_try.size             # => nil

    #errors_with_message
      e12: begin
             raise 'Timeout socket'
           rescue errors_with_message /socket/
             p 'socket E'
           end

  2.3 Integer

    #percent_of
      e13: 50.percent_of(100)           # => 50.0

  2.4 String

    #^, #xor
      e14: 'rubymisc'.xor 'test'        # => "\u0006\u0010\u0011\r\u0019\f\u0000\u0017"

  2.5 ActiveRecord::Base

    .validates_url
    .validates_email
    .validates_image_url

3 Development

  - `gem install bundler`
  - `bundle install`
  - `bundle exec rake spec`

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubymisc-0.1.0 README