https://github.com/gutenye/tagen.js
An extension to Javascript, inspired by Ruby syntax.
https://github.com/gutenye/tagen.js
Last synced: 2 months ago
JSON representation
An extension to Javascript, inspired by Ruby syntax.
- Host: GitHub
- URL: https://github.com/gutenye/tagen.js
- Owner: gutenye
- License: gpl-3.0
- Created: 2011-10-21T15:24:42.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-03-10T05:27:32.000Z (over 10 years ago)
- Last Synced: 2025-03-15T01:08:34.333Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tagenjs, bring Ruby into Javascript world.
===================================| Homepage: | https://github.com/GutenYe/tagenjs |
|----------------|------------------------------------------------------ |
| Author: | Guten |
| License: | GPL |
| Issue Tracker: | https://github.com/GutenYe/tagenjs/issues |Features
--------* Ruby compability. let's write javascript as easy as Ruby.
* Extend Javascript prototype without confict. e.g. `#_`
* Inspried by underscore.Getting Started
----------arr = [1, 2]
arr._isEmpty() #=> falsefor Object, use `_(x).constructorName()`
others are extend prorotype, so `[].isEmpty()`
and don't use Object for data directly, use Hash instead, `H(a: 1).isEmpty()`
API
------Number
.
max(a, b) min(a, b)String
#
isEmpty()
toInteger()
endsWith(str)
pluralize() capitalize()
reverse()
chop()Array
#
isEmpty()
contains(x)
equals(x)
random()Math
.
mod(val, mod)window
.
pd()
getInnerWidth() getInnerHeight()...
see source code.
INSTALL
-------with rails 3.1
# Gemfile
gem "tagenjs"# app/assets/javascripts/application.js
//= require 'tagenjs'Resources
---------* [ruby](http://www.ruby-lang.org/en): A Programmer's Best Friend.
* [coffee-script](http://coffeescript.org/): Unfancy JavaScript.
* [rake-pipeline](https://github.com/livingsocial/rake-pipeline): this project build by rake-pipeline.
* [underscore](http://underscorejs.org/) a utility-belt library.Copyright
---------Copyright 2011-2012 Guten Ye
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .