Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 48f9baa
Showing
7 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
pkg/* | |||
*.gem | |||
.bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
source :gemcutter | |||
|
|||
# Specify your gem's dependencies in ruby_extend.gemspec | |||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
require 'bundler' | |||
Bundler::GemHelper.install_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
require 'ruby_extend/hash_extendsions' | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
module RubyExtend | |||
module HashExtendsions | |||
def self.included(base) | |||
base.send :include, InstanceMethods | |||
end | |||
|
|||
module InstanceMethods | |||
def hash_reverse | |||
hash_new = {} | |||
self.each {|key,value| | |||
if not hash_new.has_key?(key) then hash_new[value] = key end | |||
} | |||
return hash_new | |||
end | |||
end | |||
end | |||
end | |||
|
|||
class Hash | |||
include RubyExtend::HashExtendsions | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
module RubyExtend | |||
VERSION = "0.0.1" | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
# -*- encoding: utf-8 -*- | |||
require File.expand_path("../lib/ruby_extend/version", __FILE__) | |||
|
|||
Gem::Specification.new do |s| | |||
s.name = "ruby_extend" | |||
s.version = RubyExtend::VERSION | |||
s.platform = Gem::Platform::RUBY | |||
s.authors = [] | |||
s.email = [] | |||
s.homepage = "http://rubygems.org/gems/ruby_extend" | |||
s.summary = "TODO: Write a gem summary" | |||
s.description = "TODO: Write a gem description" | |||
|
|||
s.required_rubygems_version = ">= 1.3.6" | |||
s.rubyforge_project = "ruby_extend" | |||
|
|||
s.add_development_dependency "bundler", ">= 1.0.0" | |||
|
|||
s.files = `git ls-files`.split("\n") | |||
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact | |||
s.require_path = 'lib' | |||
end |