nakajima-nakajima 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ class Array
2
+ def extract_options!
3
+ last.is_a?(Hash) ? pop : { }
4
+ end unless [].respond_to?(:extract_options!)
5
+ end
@@ -0,0 +1,13 @@
1
+ # from activesupport
2
+ class Proc
3
+ def bind(object)
4
+ block, time = self, Time.now
5
+ (class << object; self end).class_eval do
6
+ method_name = "__bind_#{time.to_i}_#{time.usec}"
7
+ define_method(method_name, &block)
8
+ method = instance_method(method_name)
9
+ remove_method(method_name)
10
+ method
11
+ end.bind(object)
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class Symbol
2
+ def to_proc
3
+ Proc.new { |i| i.send(self) }
4
+ end
5
+ end unless :test.respond_to?(:to_proc)
data/lib/nakajima.rb CHANGED
@@ -7,9 +7,11 @@ require 'colored'
7
7
  require 'metaid'
8
8
 
9
9
  # core ruby extensions
10
+ require 'array'
11
+ require 'symbol'
10
12
  require 'proc'
11
13
  require 'object'
12
14
 
13
15
  module Nakajima
14
- VERSION = '0.0.1'
16
+ VERSION = '0.0.2'
15
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakajima-nakajima
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Nakajima
@@ -41,7 +41,10 @@ extra_rdoc_files: []
41
41
  files:
42
42
  - lib/nakajima
43
43
  - lib/nakajima/core_ext
44
+ - lib/nakajima/core_ext/array.rb
45
+ - lib/nakajima/core_ext/proc.rb
44
46
  - lib/nakajima/core_ext/object.rb
47
+ - lib/nakajima/core_ext/symbol.rb
45
48
  - lib/nakajima/ui
46
49
  - lib/nakajima/ui/progress.rb
47
50
  - lib/nakajima.rb