Project

flexus

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Inflector for strings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
>= 0
 Project Readme

This gem is unmaintained

As of 2017-11-07, this gem has merged with Dry::Inflector.

Dry::Inflector and Flexus were overlapping. The developers of both gems decided to join efforts for a greater good.

See: https://github.com/dry-rb/dry-inflector

So, as soon as you can, migrate your code to Dry::Inflector. The migration should be easy and smooth.

flexus

Gem Version Build Status Dependency Status Maintainability Test Coverage Coverage Status

This gem is a resurrection of inflecto

Inflecto is a standalone inflector ripped out from dm-core

The dm-core inflector originated from extlib

The extlib inflecto originated from active_support

Migration from inflecto

Remove inflecto and add flexus to your Gemfile.

gem 'flexus', '~> 1.0.0'

At your code, change all Inflecto references to Flexus and it should work out of the box for flexus version 1.0.0. Please report any issues.

Flexus will try the best to respect semantic versioning as http://semver.org/ So, expect api breaking changes on major version releases.

We'll make pre release gems for 2.0.0 version. To experiment with that you should add this to your Gemfile.

gem 'flexus', '>= 2.0.0.beta'

Examples

require 'flexus'

Flexus.underscore("CamelCase")
# => "camel_case"

inflector = Flexus.new

# This loads reasonably good defaults to english language
# singularization and pluralization.
inflector.load_defaults

inflector.pluralize("tomato")
# => "tomatoes"

# You can override rules on a per instance base
inflector.inflections do |inflect|
  inflect.plural(/(tomat)o\z/i, '\1ozechies')
end

inflector.pluralize("tomato")
# => "tomatozechies"

Flexus.pluralize("tomato")
# => "tomatoes" # <- Still default pluralization

Credits

The rails, merb & datamapper team

The original gem was extracted and maintained by Markus Schirp (mbj) with help from indrekj.

Current maintainers: Andrii Savchenko Ptico and Abinoam P. Marques Jr. abinoam

Contributing

  • If you want your code merged into the mainline, please discuss the proposed changes with me before doing any work on it. This library is still in early development, and the direction it is going may not always be clear. Some features may not be appropriate yet, may need to be deferred until later when the foundation for them is laid, or may be more applicable in a plugin.
  • Fork the project.
  • Make your feature addition or bug fix.
  • Add specs for it. This is important so I don't break it in a future version unintentionally. Tests must cover all branches within the code, and code must be fully covered.
  • Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
  • Send me a pull request. Bonus points for topic branches.

License

See LICENSE.txt for details