ruby_ext 0.4.20 → 0.4.21

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rspec_ext.rb CHANGED
@@ -124,4 +124,19 @@ class String
124
124
  File.expand_path(self + "/..")
125
125
  end
126
126
  end
127
+ end
128
+
129
+ class Rspec::FuzzyHash < Hash
130
+ def == o
131
+ return true if super
132
+
133
+ if o.respond_to? :each
134
+ o.each do |k, v|
135
+ return false if (self[k.to_sym] || self[k.to_s]) != v
136
+ end
137
+ return true
138
+ end
139
+
140
+ false
141
+ end
127
142
  end
@@ -126,9 +126,9 @@ Module.class_eval do
126
126
  m.to_sym
127
127
  end
128
128
 
129
- def require_attr *attrs
129
+ def attr_required *attrs
130
130
  attrs.each do |attr|
131
- define_method(attr){instance_variable_get(:"@#{attr}") || raise("key :#{attr} not defined!")}
131
+ define_method(attr){instance_variable_get(:"@#{attr}") || raise("attribute :#{attr} not defined!")}
132
132
  end
133
133
  end
134
134
 
data/lib/ruby_ext/core.rb CHANGED
@@ -21,5 +21,5 @@ require 'ruby_ext/fixes'
21
21
  open_object
22
22
  deep_clone
23
23
  multiple_inheritance
24
- micelaneous
24
+ miscellaneous
25
25
  ).each{|f| require "ruby_ext/core/#{f}"}
data/lib/ruby_ext/more.rb CHANGED
@@ -7,5 +7,5 @@ require 'ruby_ext/core'
7
7
  synchronize
8
8
  tuple
9
9
  safe_hash
10
- micelaneous
10
+ miscellaneous
11
11
  ).each{|f| require "ruby_ext/more/#{f}"}
data/readme.md CHANGED
@@ -61,7 +61,7 @@ These are just a small part of all handy methods and extensions, for more detail
61
61
 
62
62
  require 'ruby_ext'
63
63
 
64
- Copyright (c) Alexey Petrushin [http://4ire.net](http://4ire.net), released under the MIT license.
64
+ Copyright (c) Alexey Petrushin, http://petrush.in, released under the MIT license.
65
65
 
66
66
  # TODO
67
67
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.20
4
+ version: 0.4.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-05 00:00:00 +04:00
13
+ date: 2011-07-29 00:00:00 +04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -37,7 +37,7 @@ files:
37
37
  - lib/ruby_ext/core/file.rb
38
38
  - lib/ruby_ext/core/hash.rb
39
39
  - lib/ruby_ext/core/kernel.rb
40
- - lib/ruby_ext/core/micelaneous.rb
40
+ - lib/ruby_ext/core/miscellaneous.rb
41
41
  - lib/ruby_ext/core/module.rb
42
42
  - lib/ruby_ext/core/multiple_inheritance.rb
43
43
  - lib/ruby_ext/core/must.rb
@@ -52,7 +52,7 @@ files:
52
52
  - lib/ruby_ext/fixes.rb
53
53
  - lib/ruby_ext/gems.rb
54
54
  - lib/ruby_ext/more/declarative_cache.rb
55
- - lib/ruby_ext/more/micelaneous.rb
55
+ - lib/ruby_ext/more/miscellaneous.rb
56
56
  - lib/ruby_ext/more/observable2.rb
57
57
  - lib/ruby_ext/more/open_constructor.rb
58
58
  - lib/ruby_ext/more/safe_hash.rb