gorillib 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/Gemfile +11 -6
  2. data/Rakefile +6 -9
  3. data/VERSION +1 -1
  4. data/gorillib.gemspec +12 -45
  5. data/lib/gorillib/logger/log.rb +4 -3
  6. data/lib/gorillib/receiver.rb +1 -1
  7. data/spec/array/compact_blank_spec.rb +1 -1
  8. data/spec/array/extract_options_spec.rb +1 -1
  9. data/spec/datetime/flat_spec.rb +1 -1
  10. data/spec/datetime/parse_spec.rb +1 -1
  11. data/spec/enumerable/sum_spec.rb +1 -1
  12. data/spec/hash/compact_spec.rb +1 -1
  13. data/spec/hash/deep_compact_spec.rb +1 -1
  14. data/spec/hash/deep_merge_spec.rb +1 -1
  15. data/spec/hash/keys_spec.rb +1 -1
  16. data/spec/hash/reverse_merge_spec.rb +1 -1
  17. data/spec/hash/slice_spec.rb +1 -1
  18. data/spec/hash/zip_spec.rb +1 -1
  19. data/spec/hashlike/behave_same_as_hash_spec.rb +1 -1
  20. data/spec/hashlike/deep_hash_spec.rb +1 -4
  21. data/spec/hashlike/hashlike_via_accessors_spec.rb +1 -1
  22. data/spec/hashlike_spec.rb +1 -1
  23. data/spec/logger/log_spec.rb +11 -6
  24. data/spec/metaprogramming/aliasing_spec.rb +1 -1
  25. data/spec/metaprogramming/cattr_accessor_spec.rb +1 -1
  26. data/spec/metaprogramming/class_attribute_spec.rb +1 -1
  27. data/spec/metaprogramming/delegation_spec.rb +1 -1
  28. data/spec/metaprogramming/mattr_accessor_spec.rb +1 -2
  29. data/spec/metaprogramming/singleton_class_spec.rb +1 -1
  30. data/spec/numeric/clamp_spec.rb +1 -1
  31. data/spec/object/blank_spec.rb +1 -1
  32. data/spec/object/try_dup_spec.rb +1 -2
  33. data/spec/object/try_spec.rb +1 -2
  34. data/spec/receiver/acts_as_hash_spec.rb +1 -1
  35. data/spec/receiver_spec.rb +10 -4
  36. data/spec/string/constantize_spec.rb +1 -1
  37. data/spec/string/human_spec.rb +2 -2
  38. data/spec/string/inflections_spec.rb +2 -2
  39. data/spec/string/truncate_spec.rb +1 -1
  40. data/spec/struct/acts_as_hash_fuzz_spec.rb +1 -1
  41. data/spec/struct/acts_as_hash_spec.rb +1 -5
  42. metadata +17 -138
data/Gemfile CHANGED
@@ -6,12 +6,17 @@ gem "json"
6
6
  # Include everything needed to run rake, tests, features, etc.
7
7
  group :development do
8
8
  gem 'bundler', "~> 1"
9
- gem 'yard', "~> 0.6.7"
10
- gem 'jeweler', "~> 1.6.4"
11
- gem 'rspec', "~> 2.5.0"
12
- gem 'spork', "~> 0.9.0.rc5"
13
- gem 'RedCloth' # for yard
14
- # only interesting for coverage testing
9
+ gem 'jeweler', "~> 1.6"
10
+ gem 'rspec', "~> 2.5"
11
+ gem 'yard', "~> 0.6"
12
+ end
13
+
14
+ group :docs do
15
+ gem 'RedCloth'
16
+ end
17
+
18
+ group :test do
19
+ gem 'spork', "~> 0.9.0.rc5", :platform => :mri
15
20
  gem 'rcov', ">= 0.9.9"
16
21
  gem 'watchr'
17
22
  end
data/Rakefile CHANGED
@@ -19,14 +19,6 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.email = "coders@infochimps.org"
20
20
  gem.authors = ["Infochimps"]
21
21
 
22
- gem.add_development_dependency 'bundler', "~> 1.0.12"
23
- gem.add_development_dependency 'yard', "~> 0.6.7"
24
- gem.add_development_dependency 'jeweler', "~> 1.5.2"
25
- gem.add_development_dependency 'rspec', "~> 2.5.0"
26
- gem.add_development_dependency 'rcov', ">= 0.9.9"
27
- gem.add_development_dependency 'spork', "~> 0.9.0.rc5"
28
- gem.add_development_dependency 'watchr'
29
-
30
22
  ignores = File.readlines(".gitignore").grep(/^[^#]\S+/).map{|s| s.chomp }
31
23
  dotfiles = [".gemtest", ".gitignore", ".rspec", ".yardopts"]
32
24
  gem.files = dotfiles + Dir["**/*"].
@@ -41,10 +33,12 @@ Jeweler::RubygemsDotOrgTasks.new
41
33
  require 'rspec/core'
42
34
  require 'rspec/core/rake_task'
43
35
  RSpec::Core::RakeTask.new(:spec) do |spec|
36
+ Bundler.setup(:default, :development, :test)
44
37
  spec.pattern = FileList['spec/**/*_spec.rb']
45
38
  end
46
39
 
47
40
  RSpec::Core::RakeTask.new(:rcov) do |spec|
41
+ Bundler.setup(:default, :development, :test)
48
42
  spec.pattern = 'spec/**/*_spec.rb'
49
43
  spec.rcov = true
50
44
  spec.rcov_opts = %w[ --exclude .rvm --no-comments --text-summary]
@@ -53,7 +47,10 @@ end
53
47
  task :default => :spec
54
48
 
55
49
  require 'yard'
56
- YARD::Rake::YardocTask.new
50
+ YARD::Rake::YardocTask.new do
51
+ Bundler.setup(:default, :development, :docs)
52
+ require 'redcloth'
53
+ end
57
54
 
58
55
  # App-specific tasks
59
56
  Dir[File.dirname(__FILE__)+'/lib/tasks/**/*.rake'].sort.each{|f| load f }
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
data/gorillib.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gorillib"
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Infochimps"]
12
- s.date = "2011-10-22"
12
+ s.date = "2011-12-11"
13
13
  s.description = "Gorillib: infochimps lightweight subset of ruby convenience methods"
14
14
  s.email = "coders@infochimps.org"
15
15
  s.extra_rdoc_files = [
@@ -138,7 +138,7 @@ Gem::Specification.new do |s|
138
138
  s.homepage = "http://infochimps.com/labs"
139
139
  s.licenses = ["MIT"]
140
140
  s.require_paths = ["lib"]
141
- s.rubygems_version = "1.8.10"
141
+ s.rubygems_version = "1.8.11"
142
142
  s.summary = "include only what you need. No dependencies, no creep"
143
143
  s.test_files = ["spec/array/compact_blank_spec.rb", "spec/array/extract_options_spec.rb", "spec/datetime/flat_spec.rb", "spec/datetime/parse_spec.rb", "spec/enumerable/sum_spec.rb", "spec/hash/compact_spec.rb", "spec/hash/deep_compact_spec.rb", "spec/hash/deep_merge_spec.rb", "spec/hash/indifferent_access_spec.rb", "spec/hash/keys_spec.rb", "spec/hash/reverse_merge_spec.rb", "spec/hash/slice_spec.rb", "spec/hash/zip_spec.rb", "spec/hashlike/behave_same_as_hash_spec.rb", "spec/hashlike/deep_hash_spec.rb", "spec/hashlike/hashlike_behavior_spec.rb", "spec/hashlike/hashlike_via_accessors_spec.rb", "spec/hashlike_spec.rb", "spec/logger/log_spec.rb", "spec/metaprogramming/aliasing_spec.rb", "spec/metaprogramming/cattr_accessor_spec.rb", "spec/metaprogramming/class_attribute_spec.rb", "spec/metaprogramming/delegation_spec.rb", "spec/metaprogramming/mattr_accessor_spec.rb", "spec/metaprogramming/singleton_class_spec.rb", "spec/numeric/clamp_spec.rb", "spec/object/blank_spec.rb", "spec/object/try_dup_spec.rb", "spec/object/try_spec.rb", "spec/receiver/acts_as_hash_spec.rb", "spec/receiver_spec.rb", "spec/spec_helper.rb", "spec/string/constantize_spec.rb", "spec/string/human_spec.rb", "spec/string/inflections_spec.rb", "spec/string/inflector_test_cases.rb", "spec/string/truncate_spec.rb", "spec/struct/acts_as_hash_fuzz_spec.rb", "spec/struct/acts_as_hash_spec.rb", "spec/support/hashlike_fuzzing_helper.rb", "spec/support/hashlike_helper.rb", "spec/support/hashlike_struct_helper.rb", "spec/support/hashlike_via_delegation.rb", "spec/support/kcode_test_helper.rb", "spec/support/matchers/be_array_eql.rb", "spec/support/matchers/be_hash_eql.rb", "spec/support/matchers/enumerate_method.rb", "spec/support/matchers/evaluate_to_true.rb"]
144
144
 
@@ -148,55 +148,22 @@ Gem::Specification.new do |s|
148
148
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
149
149
  s.add_runtime_dependency(%q<json>, [">= 0"])
150
150
  s.add_development_dependency(%q<bundler>, ["~> 1"])
151
- s.add_development_dependency(%q<yard>, ["~> 0.6.7"])
152
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
153
- s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
154
- s.add_development_dependency(%q<spork>, ["~> 0.9.0.rc5"])
155
- s.add_development_dependency(%q<RedCloth>, [">= 0"])
156
- s.add_development_dependency(%q<rcov>, [">= 0.9.9"])
157
- s.add_development_dependency(%q<watchr>, [">= 0"])
158
- s.add_development_dependency(%q<bundler>, ["~> 1.0.12"])
159
- s.add_development_dependency(%q<yard>, ["~> 0.6.7"])
160
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
161
- s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
162
- s.add_development_dependency(%q<rcov>, [">= 0.9.9"])
163
- s.add_development_dependency(%q<spork>, ["~> 0.9.0.rc5"])
164
- s.add_development_dependency(%q<watchr>, [">= 0"])
151
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
152
+ s.add_development_dependency(%q<rspec>, ["~> 2.5"])
153
+ s.add_development_dependency(%q<yard>, ["~> 0.6"])
165
154
  else
166
155
  s.add_dependency(%q<json>, [">= 0"])
167
156
  s.add_dependency(%q<bundler>, ["~> 1"])
168
- s.add_dependency(%q<yard>, ["~> 0.6.7"])
169
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
170
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
171
- s.add_dependency(%q<spork>, ["~> 0.9.0.rc5"])
172
- s.add_dependency(%q<RedCloth>, [">= 0"])
173
- s.add_dependency(%q<rcov>, [">= 0.9.9"])
174
- s.add_dependency(%q<watchr>, [">= 0"])
175
- s.add_dependency(%q<bundler>, ["~> 1.0.12"])
176
- s.add_dependency(%q<yard>, ["~> 0.6.7"])
177
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
178
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
179
- s.add_dependency(%q<rcov>, [">= 0.9.9"])
180
- s.add_dependency(%q<spork>, ["~> 0.9.0.rc5"])
181
- s.add_dependency(%q<watchr>, [">= 0"])
157
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
158
+ s.add_dependency(%q<rspec>, ["~> 2.5"])
159
+ s.add_dependency(%q<yard>, ["~> 0.6"])
182
160
  end
183
161
  else
184
162
  s.add_dependency(%q<json>, [">= 0"])
185
163
  s.add_dependency(%q<bundler>, ["~> 1"])
186
- s.add_dependency(%q<yard>, ["~> 0.6.7"])
187
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
188
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
189
- s.add_dependency(%q<spork>, ["~> 0.9.0.rc5"])
190
- s.add_dependency(%q<RedCloth>, [">= 0"])
191
- s.add_dependency(%q<rcov>, [">= 0.9.9"])
192
- s.add_dependency(%q<watchr>, [">= 0"])
193
- s.add_dependency(%q<bundler>, ["~> 1.0.12"])
194
- s.add_dependency(%q<yard>, ["~> 0.6.7"])
195
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
196
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
197
- s.add_dependency(%q<rcov>, [">= 0.9.9"])
198
- s.add_dependency(%q<spork>, ["~> 0.9.0.rc5"])
199
- s.add_dependency(%q<watchr>, [">= 0"])
164
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
165
+ s.add_dependency(%q<rspec>, ["~> 2.5"])
166
+ s.add_dependency(%q<yard>, ["~> 0.6"])
200
167
  end
201
168
  end
202
169
 
@@ -8,7 +8,8 @@ require 'logger'
8
8
  ::Log = Logger.new($stderr) unless defined?(::Log)
9
9
 
10
10
  def Log.dump *args
11
- debug args.map(&:inspect).join("\t")
11
+ self.debug([
12
+ args.map(&:inspect),
13
+ caller.first
14
+ ].join("\t"))
12
15
  end unless Log.respond_to?(:dump)
13
-
14
-
@@ -212,7 +212,7 @@ public
212
212
  # @param *args [Array] arguments to pass to the constructor
213
213
  # @return [Object] a new instance
214
214
  def receive *args
215
- hsh = args.pop
215
+ hsh = args.pop || {}
216
216
  raise ArgumentError, "Can't receive (it isn't hashlike): {#{hsh.inspect}} -- the hsh should be the *last* arg" unless hsh.respond_to?(:[]) && hsh.respond_to?(:has_key?)
217
217
  obj = self.new(*args)
218
218
  obj.receive!(hsh)
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/array/compact_blank'
3
3
 
4
4
  describe Array do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/array/extract_options'
3
3
 
4
4
  class HashSubclass < Hash
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/datetime/flat'
3
3
  require 'gorillib/datetime/parse'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/datetime/flat'
3
3
  require 'gorillib/datetime/parse'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/enumerable/sum'
3
3
 
4
4
  Payment = Struct.new(:price)
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/compact'
3
3
 
4
4
  describe Hash do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/deep_compact'
3
3
  require 'gorillib/array/deep_compact'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/deep_merge'
3
3
 
4
4
  describe Hash do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/keys'
3
3
 
4
4
  describe Hash do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/reverse_merge'
3
3
 
4
4
  describe Hash do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/slice'
3
3
 
4
4
  class HashSubclass < Hash ; end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hash/zip'
3
3
 
4
4
  describe Hash do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'enumerator'
3
3
  require 'gorillib/hashlike'
4
4
  require 'gorillib/enumerable/sum'
@@ -1,10 +1,7 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
- require 'gorillib/receiver_model'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
3
2
  require 'gorillib/hashlike/deep_hash'
4
3
 
5
-
6
4
  class AwesomeHash < Hash
7
- # include Gorillib::ReceiverModel
8
5
  include Gorillib::Hashlike::DeepHash
9
6
  end
10
7
  class AwesomeHashSubclass < AwesomeHash ; end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hashlike'
3
3
  require 'gorillib/hashlike/hashlike_via_accessors'
4
4
  require GORILLIB_ROOT_DIR('spec/support/hashlike_via_delegation')
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__)+'/spec_helper')
1
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hashlike'
3
3
  require GORILLIB_ROOT_DIR('spec/support/hashlike_via_delegation')
4
4
  require GORILLIB_ROOT_DIR('spec/support/hashlike_helper')
@@ -1,11 +1,16 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
2
- CODE_FILE = File.dirname(__FILE__)+'/../../lib/gorillib/logger/log.rb'
3
- require CODE_FILE
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
+ require 'gorillib/logger/log'
3
+
4
4
 
5
5
  describe 'Logger' do
6
+ # so we can practice loading and unloading
7
+ def logger_code_file
8
+ GORILLIB_ROOT_DIR('lib/gorillib/logger/log.rb')
9
+ end
10
+
6
11
  describe '#dump' do
7
12
  it 'inspects each arg and sends tab-separated to Log.debug' do
8
- Log.should_receive(:debug).with(%Q{{:hi=>"there"}\t3\t"bye"})
13
+ Log.should_receive(:debug).with(%r{\{:hi=>"there"\}\t3\t\"bye\".*#{__FILE__}:.*in })
9
14
  Log.dump({ :hi => "there" }, 3, "bye")
10
15
  end
11
16
  end
@@ -13,7 +18,7 @@ describe 'Logger' do
13
18
  it 'does not create a log if one exists' do
14
19
  dummy = 'dummy'
15
20
  Object.instance_eval{ remove_const(:Log) rescue nil ; ::Log = dummy }
16
- load(CODE_FILE)
21
+ load(logger_code_file)
17
22
  ::Log.should equal(dummy)
18
23
  Object.instance_eval{ remove_const(:Log) rescue nil }
19
24
  end
@@ -22,7 +27,7 @@ describe 'Logger' do
22
27
  @old_stderr = $stderr
23
28
  $stderr = StringIO.new
24
29
  Object.instance_eval{ remove_const(:Log) rescue nil }
25
- load(CODE_FILE)
30
+ load(logger_code_file)
26
31
  Log.info 'hi mom'
27
32
  $stderr.string.should =~ /hi mom/
28
33
  $stderr = @old_stderr
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/aliasing'
3
3
 
4
4
  module BarMethodAliaser
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/cattr_accessor'
3
3
 
4
4
  describe 'metaprogramming' do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/class_attribute'
3
3
 
4
4
  describe 'metaprogramming' do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/delegation'
3
3
 
4
4
  module One
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/mattr_accessor'
3
3
 
4
4
  describe Module do
@@ -43,4 +43,3 @@ describe Module do
43
43
  end
44
44
  end
45
45
  end
46
-
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/singleton_class'
3
3
 
4
4
  describe 'Singleton Class' do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/numeric/clamp'
3
3
 
4
4
  describe Numeric do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/object/blank'
3
3
 
4
4
  describe 'object/blank' do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/object/try_dup'
3
3
 
4
4
  describe "try_dup" do
@@ -44,4 +44,3 @@ describe "try_dup" do
44
44
  obj.object_id.should == oth.object_id
45
45
  end
46
46
  end
47
-
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/object/try'
3
3
 
4
4
  class Foo
@@ -18,4 +18,3 @@ describe Object do
18
18
  end
19
19
  end
20
20
  end
21
-
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/receiver'
3
3
  require 'gorillib/metaprogramming/class_attribute'
4
4
  require 'gorillib/hashlike'
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/spec_helper.rb'
1
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/metaprogramming/class_attribute'
3
3
  require 'gorillib/object/blank'
4
4
  require 'time'
@@ -76,11 +76,18 @@ describe Receiver do
76
76
  ret = @klass.receive(:a, :b, {})
77
77
  end
78
78
 
79
- it 'accepts an empty arg set (receives an empty hash)' do
79
+ it 'accepts an empty arg set (as if it got an empty hash)' do
80
80
  obj = mock
81
81
  @klass.should_receive(:new).and_return(obj)
82
82
  obj.should_receive(:receive!).with({})
83
- @klass.receive(nil)
83
+ @klass.receive()
84
+ end
85
+
86
+ it 'accepts an empty hash' do
87
+ obj = mock
88
+ @klass.should_receive(:new).and_return(obj)
89
+ obj.should_receive(:receive!).with({})
90
+ @klass.receive({})
84
91
  end
85
92
 
86
93
  it 'uses the *last* arg as the hsh to receive' do
@@ -542,4 +549,3 @@ describe Receiver do
542
549
 
543
550
  end
544
551
  end
545
-
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/string/constantize'
3
3
 
4
4
  module Ace
@@ -1,5 +1,5 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
2
- require File.dirname(__FILE__)+'/inflector_test_cases'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path('inflector_test_cases', File.dirname(__FILE__))
3
3
  require 'gorillib/string/human'
4
4
 
5
5
  include InflectorTestCases
@@ -1,5 +1,5 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
2
- require File.dirname(__FILE__)+'/inflector_test_cases'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path('inflector_test_cases', File.dirname(__FILE__))
3
3
  require 'gorillib/string/inflections'
4
4
 
5
5
  include InflectorTestCases
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require GORILLIB_ROOT_DIR('spec/support/kcode_test_helper')
3
3
  require 'gorillib/string/truncate'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hashlike'
3
3
  require 'gorillib/struct/acts_as_hash'
4
4
  require 'gorillib/hash/indifferent_access'
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+'/../spec_helper'
1
+ require File.expand_path('../spec_helper', File.dirname(__FILE__))
2
2
  require 'gorillib/hashlike'
3
3
  require 'gorillib/struct/acts_as_hash'
4
4
  require GORILLIB_ROOT_DIR('spec/support/hashlike_via_delegation')
@@ -7,10 +7,6 @@ require GORILLIB_ROOT_DIR('spec/support/hashlike_fuzzing_helper')
7
7
  require GORILLIB_ROOT_DIR('spec/support/hashlike_struct_helper')
8
8
  require GORILLIB_ROOT_DIR('spec/hashlike/hashlike_behavior_spec')
9
9
 
10
-
11
-
12
-
13
-
14
10
  describe Gorillib::Struct::ActsAsHash do
15
11
 
16
12
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorillib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-22 00:00:00.000000000Z
12
+ date: 2011-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70201672947260 !ruby/object:Gem::Requirement
16
+ requirement: &70235557316000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70201672947260
24
+ version_requirements: *70235557316000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70201672948900 !ruby/object:Gem::Requirement
27
+ requirement: &70235557315520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,161 +32,40 @@ dependencies:
32
32
  version: '1'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70201672948900
36
- - !ruby/object:Gem::Dependency
37
- name: yard
38
- requirement: &70201672977960 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- version: 0.6.7
44
- type: :development
45
- prerelease: false
46
- version_requirements: *70201672977960
35
+ version_requirements: *70235557315520
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: jeweler
49
- requirement: &70201673162180 !ruby/object:Gem::Requirement
38
+ requirement: &70235557315040 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ~>
53
42
  - !ruby/object:Gem::Version
54
- version: 1.6.4
43
+ version: '1.6'
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *70201673162180
46
+ version_requirements: *70235557315040
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: rspec
60
- requirement: &70201673161340 !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ~>
64
- - !ruby/object:Gem::Version
65
- version: 2.5.0
66
- type: :development
67
- prerelease: false
68
- version_requirements: *70201673161340
69
- - !ruby/object:Gem::Dependency
70
- name: spork
71
- requirement: &70201673160540 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- version: 0.9.0.rc5
77
- type: :development
78
- prerelease: false
79
- version_requirements: *70201673160540
80
- - !ruby/object:Gem::Dependency
81
- name: RedCloth
82
- requirement: &70201673159920 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: *70201673159920
91
- - !ruby/object:Gem::Dependency
92
- name: rcov
93
- requirement: &70201673158980 !ruby/object:Gem::Requirement
94
- none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: 0.9.9
99
- type: :development
100
- prerelease: false
101
- version_requirements: *70201673158980
102
- - !ruby/object:Gem::Dependency
103
- name: watchr
104
- requirement: &70201673158340 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: *70201673158340
113
- - !ruby/object:Gem::Dependency
114
- name: bundler
115
- requirement: &70201673157620 !ruby/object:Gem::Requirement
49
+ requirement: &70235557314560 !ruby/object:Gem::Requirement
116
50
  none: false
117
51
  requirements:
118
52
  - - ~>
119
53
  - !ruby/object:Gem::Version
120
- version: 1.0.12
54
+ version: '2.5'
121
55
  type: :development
122
56
  prerelease: false
123
- version_requirements: *70201673157620
57
+ version_requirements: *70235557314560
124
58
  - !ruby/object:Gem::Dependency
125
59
  name: yard
126
- requirement: &70201673156840 !ruby/object:Gem::Requirement
127
- none: false
128
- requirements:
129
- - - ~>
130
- - !ruby/object:Gem::Version
131
- version: 0.6.7
132
- type: :development
133
- prerelease: false
134
- version_requirements: *70201673156840
135
- - !ruby/object:Gem::Dependency
136
- name: jeweler
137
- requirement: &70201673156060 !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ~>
141
- - !ruby/object:Gem::Version
142
- version: 1.5.2
143
- type: :development
144
- prerelease: false
145
- version_requirements: *70201673156060
146
- - !ruby/object:Gem::Dependency
147
- name: rspec
148
- requirement: &70201673155460 !ruby/object:Gem::Requirement
149
- none: false
150
- requirements:
151
- - - ~>
152
- - !ruby/object:Gem::Version
153
- version: 2.5.0
154
- type: :development
155
- prerelease: false
156
- version_requirements: *70201673155460
157
- - !ruby/object:Gem::Dependency
158
- name: rcov
159
- requirement: &70201673154740 !ruby/object:Gem::Requirement
160
- none: false
161
- requirements:
162
- - - ! '>='
163
- - !ruby/object:Gem::Version
164
- version: 0.9.9
165
- type: :development
166
- prerelease: false
167
- version_requirements: *70201673154740
168
- - !ruby/object:Gem::Dependency
169
- name: spork
170
- requirement: &70201673148440 !ruby/object:Gem::Requirement
60
+ requirement: &70235557314080 !ruby/object:Gem::Requirement
171
61
  none: false
172
62
  requirements:
173
63
  - - ~>
174
64
  - !ruby/object:Gem::Version
175
- version: 0.9.0.rc5
176
- type: :development
177
- prerelease: false
178
- version_requirements: *70201673148440
179
- - !ruby/object:Gem::Dependency
180
- name: watchr
181
- requirement: &70201673147460 !ruby/object:Gem::Requirement
182
- none: false
183
- requirements:
184
- - - ! '>='
185
- - !ruby/object:Gem::Version
186
- version: '0'
65
+ version: '0.6'
187
66
  type: :development
188
67
  prerelease: false
189
- version_requirements: *70201673147460
68
+ version_requirements: *70235557314080
190
69
  description: ! 'Gorillib: infochimps lightweight subset of ruby convenience methods'
191
70
  email: coders@infochimps.org
192
71
  executables: []
@@ -327,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
327
206
  version: '0'
328
207
  segments:
329
208
  - 0
330
- hash: 471934101699992642
209
+ hash: 763551312686502089
331
210
  required_rubygems_version: !ruby/object:Gem::Requirement
332
211
  none: false
333
212
  requirements:
@@ -336,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
215
  version: '0'
337
216
  requirements: []
338
217
  rubyforge_project:
339
- rubygems_version: 1.8.10
218
+ rubygems_version: 1.8.11
340
219
  signing_key:
341
220
  specification_version: 3
342
221
  summary: include only what you need. No dependencies, no creep