百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

powerpack

> 编程语言
开源

对核心 Ruby 类的一些有用扩展

273 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

对核心 Ruby 类的一些有用扩展

Powerpack

Powerpack offers some useful extensions to the standard Ruby classes (kind of like ActiveSupport, but less ambitious and more modular).

The project has several design goals:

  • minimalistic - we don't add every possible extensions, we focus only on the stuff that are commonly requested and would be often useful in practice
  • modular - all extensions can be loaded individually (often they are just individual methods)
  • safe - you can't end up accidentally overriding some existing method definition with Powerpack's extensions

Installation

Add this line to your application's Gemfile (if you're using bundler, that is):

gem 'powerpack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install powerpack

Extensions

  • Array
    • #butfirst
    • #butlast
  • Enumerable
    • #average
    • #drop_last
    • #drop_last_while
    • #exactly?
    • #frequencies
    • #several?
    • #sum
    • #take_last
    • #take_last_while
  • Hash
    • #symbolize_keys
  • Numeric
    • #pos?
    • #neg?
    • #hundred
    • #thousand
    • #million
    • #billion
    • #trillion
    • #quadrillion
  • String
    • #ascii_only
    • #ascii_only!
    • #blank?
    • #format
    • #remove
    • #remove!
    • #remove_prefix
    • #remove_prefix!
    • #remove_suffix
    • #remove_suffix!
    • #strip_indent
    • #strip_margin
    • #squish
    • #squish!

Documentation

A listing of the extensions provided by Powerpack is available here.

Usage

To load the entire powerpack do:

require 'powerpack'

To load only the String extensions do:

require 'powerpack/string'

To load only a specific extension like String#format do:

require 'powerpack/string/format'

Changelog

Powerpack's changelog is available here.

Contributing

  1. Fork it
  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 new Pull Request

Issues· 6 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言