Skip to content
Browse files

Switch to Bundler for gem management and Guard for autotesting.

  • Loading branch information...
1 parent f1fdd29 commit d01a163b6927c4edf997560ad14094db6a1b6ab3 Michael Bleigh committed Jul 22, 2011
Showing with 73 additions and 132 deletions.
  1. +6 −0 .travis.yml
  2. +1 −11 Gemfile
  3. +23 −22 Gemfile.lock
  4. +5 −0 Guardfile
  5. +3 −31 Rakefile
  6. +17 −68 hashie.gemspec
  7. +3 −0 lib/hashie/version.rb
  8. +15 −0 spec/hashie/methods_spec.rb
View
6 .travis.yml
@@ -0,0 +1,6 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - rbx
+ - ree
+ - ruby-head
View
12 Gemfile
@@ -1,12 +1,2 @@
-# A sample Gemfile
source 'http://rubygems.org'
-
-group :development do
- gem 'rake'
- gem 'json'
- gem 'jeweler'
-end
-
-group :test do
- gem 'rspec', '~> 2.0'
-end
+gemspec
View
45 Gemfile.lock
@@ -1,32 +1,33 @@
+PATH
+ remote: .
+ specs:
+ hashie (1.0.0)
+
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.2)
- gemcutter (0.6.1)
- git (1.2.5)
- jeweler (1.4.0)
- gemcutter (>= 0.1.0)
- git (>= 1.2.5)
- rubyforge (>= 2.0.0)
- json (1.4.3)
- json_pure (1.4.3)
- rake (0.8.7)
- rspec (2.4.0)
- rspec-core (~> 2.4.0)
- rspec-expectations (~> 2.4.0)
- rspec-mocks (~> 2.4.0)
- rspec-core (2.4.0)
- rspec-expectations (2.4.0)
+ guard (0.5.1)
+ thor (~> 0.14.6)
+ guard-rspec (0.4.0)
+ guard (>= 0.4.0)
+ rake (0.9.2)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.4.0)
- rubyforge (2.0.4)
- json_pure (>= 1.1.7)
+ rspec-mocks (2.6.0)
+ thor (0.14.6)
PLATFORMS
ruby
DEPENDENCIES
- jeweler
- json
- rake
- rspec (~> 2.0)
+ guard
+ guard-rspec
+ hashie!
+ rake (~> 0.9.2)
+ rspec (~> 2.5)
View
5 Guardfile
@@ -0,0 +1,5 @@
+guard 'rspec' do
+ watch(%r{^spec/.+_spec\.rb})
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+end
View
34 Rakefile
@@ -1,22 +1,8 @@
require 'rubygems'
-require 'rake'
+require 'bundler'
+Bundler.setup
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "hashie"
- gem.summary = %Q{Your friendly neighborhood hash toolkit.}
- gem.description = %Q{Hashie is a small collection of tools that make hashes more powerful. Currently includes Mash (Mocking Hash) and Dash (Discrete Hash).}
- gem.email = "michael@intridea.com"
- gem.homepage = "http://github.com/intridea/hashie"
- gem.authors = ["Michael Bleigh"]
- gem.add_development_dependency "rspec"
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |spec|
@@ -25,17 +11,3 @@ RSpec::Core::RakeTask.new do |spec|
end
task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION')
- version = File.read('VERSION')
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "hashie #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
85 hashie.gemspec
@@ -1,72 +1,21 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
-# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/hashie/version', __FILE__)
-Gem::Specification.new do |s|
- s.name = %q{hashie}
- s.version = "1.0.0"
+Gem::Specification.new do |gem|
+ gem.authors = ["Michael Bleigh"]
+ gem.email = ["michael@intridea.com"]
+ gem.description = %q{Hashie is a small collection of tools that make hashes more powerful. Currently includes Mash (Mocking Hash) and Dash (Discrete Hash).}
+ gem.summary = %q{Your friendly neighborhood hash toolkit.}
+ gem.homepage = 'https://github.com/intridea/hashie'
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Michael Bleigh"]
- s.date = %q{2011-01-27}
- s.description = %q{Hashie is a small collection of tools that make hashes more powerful. Currently includes Mash (Mocking Hash) and Dash (Discrete Hash).}
- s.email = %q{michael@intridea.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- ".rspec",
- "Gemfile",
- "Gemfile.lock",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "hashie.gemspec",
- "lib/hashie.rb",
- "lib/hashie/clash.rb",
- "lib/hashie/dash.rb",
- "lib/hashie/hash.rb",
- "lib/hashie/hash_extensions.rb",
- "lib/hashie/mash.rb",
- "lib/hashie/trash.rb",
- "spec/hashie/clash_spec.rb",
- "spec/hashie/dash_spec.rb",
- "spec/hashie/hash_spec.rb",
- "spec/hashie/mash_spec.rb",
- "spec/hashie/trash_spec.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb"
- ]
- s.homepage = %q{http://github.com/intridea/hashie}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Your friendly neighborhood hash toolkit.}
- s.test_files = [
- "spec/hashie/clash_spec.rb",
- "spec/hashie/dash_spec.rb",
- "spec/hashie/hash_spec.rb",
- "spec/hashie/mash_spec.rb",
- "spec/hashie/trash_spec.rb",
- "spec/spec_helper.rb"
- ]
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.name = "hashie"
+ gem.require_paths = ['lib']
+ gem.version = Hashie::VERSION
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 0"])
- else
- s.add_dependency(%q<rspec>, [">= 0"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 0"])
- end
+ gem.add_development_dependency 'rake', '~> 0.9.2'
+ gem.add_development_dependency 'rspec', '~> 2.5'
+ gem.add_development_dependency 'guard'
+ gem.add_development_dependency 'guard-rspec'
end
-
View
3 lib/hashie/version.rb
@@ -0,0 +1,3 @@
+module Hashie
+ VERSION = '1.0.0'
+end
View
15 spec/hashie/methods_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe Hashie::Methods::DeepMerge do
+ class DeepHash < Hash; include Hashie::Methods::DeepMerge end
+ subject{ DeepHash.new }
+
+ describe '#deep_update' do
+ it 'should merge two hashes together and preserve subhashes' do
+ pending
+ subject[:abc] = {:def => 'ghi'}
+ subject.deep_update :abc => {:jkl => 'mno'}
+ subject[:abc].should == {:def => 'ghi', :jkl => 'mno'}
+ end
+ end
+end

0 comments on commit d01a163

Please sign in to comment.
Something went wrong with that request. Please try again.