inflector.cr alternatives and similar shards
Based on the "Misc" category.
Alternatively, view inflector.cr alternatives based on common mentions on social networks and blogs.
-
sentry
Build/Runs your crystal application, watches files, and rebuilds/restarts app on file changes -
immutable
Thread-safe, persistent, immutable collections for the Crystal language -
crystagiri
An Html parser library for Crystal (like Nokogiri for Ruby) -
crz
Functional programming library for https://github.com/crystal-lang/crystal -
crystal-web-framework-stars
โญ๏ธ Web frameworks for Crystal, most starred on Github -
crystal-futures
Future type implementation for Crystal language -
cron_scheduler
Simple job scheduler with crontab patterns for Crystal Language. -
aasm.cr
:arrows_clockwise: Easy to use finite state machine for Crystal classes -
kreal
Kreal is a model sharing & RPC library built on and works with Kemal seamlessly. -
retriable.cr
Retriable.cr is a simple DSL to retry failed code blocks -
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal -
CrSerializer
Extensible annotation based serialization/deserialization library -
circuit_breaker
Implementation of the circuit breaker pattern in crystal -
burocracia.cr
๐ Zero-dependency Crystal shard to validate, generate and format Brazilian burocracias (CPF, CNPJ, CEP) -
wikicr
Wiki in crystal, using Markdown and Git, inspired by dokuwiki. Last features to build are pretty hard, if you have some time to help... :) -
m3u8
Generate and parse m3u8 playlists for HTTP Live Streaming (HLS) in Crystal. -
message_verifier.cr
Rails compatible MessageVerifier for Crystal-lang apps -
defined
This shard provides facilities for checking whether a constant exists at compile time, and for a variety of different conditional compilation options. Code can be conditionally compiled based on the existence of a constant, version number constraints, or whether an environment variable is set truthy or not.
WorkOS - The modern identity platform for B2B SaaS
Do you think we are missing an alternative of inflector.cr or a related project?
README
Inflector (port of ActiveSupport::Inflector)
This is an attempt to bring ActiveSupport's Inflector to Crystal. It started as a test idea for another project (Native Ruby extensions in Crystal), but then worked well enough that I decided to turn it into its own project.
Installation
Add this to your application's shard.yml
:
dependencies:
inflector:
github: phoffer/inflector.cr
version: "~> 0.1.8"
Somewhere in your app initialization, require "inflector"
.
Inflector.cr passes specs with Crystal versions starting at 0.17.4
and continuing through 0.24.2
.
Additionally, there are core extensions to String
and Int
. If you want these, then require "inflector/core_ext
instead of the standard require
.
Usage
Some examples are probably best. There is a full set of examples in spec/inflector/readme_spec.cr
Inflector.camelize("active_model") # => "ActiveModel"
Inflector.underscore("ActiveModel") # => "active_model"
Inflector.humanize("employee_salary") # => "Employee salary"
Inflector.humanize("author_id") # => "Author"
Inflector.upcase_first("what a Lovely Day") # => "What a Lovely Day"
Inflector.titleize("x-men: the last stand") # => "X Men: The Last Stand"
Inflector.classify("ham_and_eggs") # => "HamAndEgg"
Inflector.demodulize("CoreExt::String::Inflections") # => "Inflections"
Inflector.deconstantize("Net::HTTP") # => "Net"
Inflector.foreign_key("Message") # => "message_id"
Inflector.ordinalize(1) # => "1st"
Inflector.ordinal(1) # => "st"
Inflector.dasherize("puni_puni") # => "puni-puni"
Additionally, these are available if you required the core extensions. Additional examples are in spec/inflector/core_ext_spec
1.ordinalize # => "1st"
1.ordinal # => "st"
"post".pluralize # => "posts"
"octopus".pluralize # => "octopi"
"posts".singularize # => "post"
"active_record".camelize # => "ActiveRecord"
"man from the boondocks".titleize # => "Man From The Boondocks"
"CoreExt::String::Inflections".demodulize # => "Inflections"
"Net::HTTP".deconstantize # => "Net"
"fancyCategory".tableize # => "fancy_categories"
"ham_and_eggs".classify # => "HamAndEgg"
"employee_salary".humanize # => "Employee salary"
"what a Lovely Day".upcase_first # => "What a Lovely Day"
"Message".foreign_key # => "message_id"
TODO
- [ ] Enable additional tests (tests have been mostly ported from ActiveSupport::Inflector)
- [x] Hook up Travis CI
Contributing
- Fork it ( https://github.com/phoffer/inflector.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request