Code Monkey home page Code Monkey logo

crystal_on_steroids's Introduction

Crystal on Steroids Build Status

A group of methods to make Crystal more programmer friendly. Methods taken from Rails ActiveSupport, Powerpack and others.

Api Docs

Installation

Add this to your application's shard.yml:

dependencies:
  crystal_on_steroids:
    github: werner/crystal_on_steroids

Usage

require "crystal_on_steroids"

Methods

AliasMethod

  • alias_method

Object

  • present?
  • presence
  • to_query
  • to_param
  • in?
  • presence_in

Array

  • second
  • third
  • fourth
  • fifth
  • rest
  • not_last
  • split
  • from
  • to
  • slice

Hash

  • compact
  • compact!

Enumerable

  • blank?
  • many?
  • pluck
  • excludes?
  • without
  • avg (average)
  • exactly?
  • frecuencies

Time

  • prev_day
  • next_day
  • yesterday
  • tomorrow
  • today?

String

  • remove
  • truncate
  • truncate_words
  • squish

Int

  • multiple_of?
  • ordinal
  • ordinalize

Number

  • bytes
  • kilobytes
  • megabytes
  • gigabytes
  • terabytes
  • petabytes
  • exabytes

Regex

  • match?

Range

  • overlaps?

More details in docs

Contributing

  1. Fork it ( https://github.com/werner/crystal_on_steroids/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • werner Werner Echezuría - creator, maintainer

crystal_on_steroids's People

Contributors

coderhs avatar werner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crystal_on_steroids's Issues

incorrect to_query

crystal eval 'require "crystal_on_steroids"; h = {data: "⬤"}.to_query; p h'
"%7Bdata%3A%20%22%E2%AC%A4%22%7D"
ruby -e 'require "active_support/all"; h = {data: "⬤"}.to_query; p h'
"data=%E2%AC%A4"

List of methods to be implemented

Listing out the methods that is pending to be implemented. Methods information taken from ActiveSupport - core_ext

  • Array#in_groups
  • Array#from
  • Array#to
  • Array#without
  • Array#wrap
  • Array#

Break down big classes to smaller classes

With each addition of new features the size of the single class is increasing. May I suggest we break up a class in the following format.

+-- arrays/
|   +-- grouping/
|         +-- in_groups.cr
|         +-- split.cr
|   +-- grouping.cr

So that the code will be more organised. If people want to just include the grouping of array they can do crystal_on_steroids/arrays/grouping or if the one just a specific method they can do crystal_on_steroids/arrays/grouping/in_groups.

The above require is just an added benefit the main thing is to make the code more organised as we are going to add more methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.