Skip to content

Commit

Permalink
Development updates.
Browse files Browse the repository at this point in the history
* Updated rspec
* Moved dev deps to gemfile
* Updated gemspec
* Removed need for redis, etc.
  • Loading branch information
jnunemaker committed Jan 26, 2011
1 parent 00921d7 commit 6166e21
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 108 deletions.
10 changes: 9 additions & 1 deletion Gemfile
@@ -1,3 +1,11 @@
source :rubygems
gemspec
gem 'adapter', :git => 'git@github.com:newtoy/adapter.git'

group(:development) do
gem 'rake', '~> 0.8.7'
gem 'rspec', '~> 2.3'
gem 'timecop', '~> 0.3.5'
gem 'tzinfo', '~> 0.3.23'
gem 'log_buddy', '~> 0.5.0'
gem 'adapter-memcached', '~> 0.5.1'
end
63 changes: 32 additions & 31 deletions Gemfile.lock
@@ -1,34 +1,38 @@
GIT
remote: git@github.com:newtoy/adapter.git
revision: ff2952f6fffb38085d4d3150794a4106e96b5454
specs:
adapter (0.1)

PATH
remote: .
specs:
toystore (0.0.1)
activemodel (= 3)
activesupport (= 3)
simple_uuid
activemodel (~> 3.0.3)
activesupport (~> 3.0.3)
adapter (~> 0.5.1)
simple_uuid (~> 0.1.1)

GEM
remote: http://rubygems.org/
specs:
SystemTimer (1.2)
activemodel (3.0.0)
activesupport (= 3.0.0)
activemodel (3.0.3)
activesupport (= 3.0.3)
builder (~> 2.1.2)
i18n (~> 0.4.1)
activesupport (3.0.0)
i18n (~> 0.4)
activesupport (3.0.3)
adapter (0.5.1)
adapter-memcached (0.5.1)
adapter (~> 0.5.1)
memcached (~> 1.0.2)
builder (2.1.2)
diff-lcs (1.1.2)
i18n (0.4.1)
i18n (0.5.0)
log_buddy (0.5.0)
memcached (1)
memcached (1.0.2)
rake (0.8.7)
redis (2.0.11)
rspec (1.3.0)
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)
diff-lcs (~> 1.1.2)
rspec-mocks (2.4.0)
simple_uuid (0.1.1)
timecop (0.3.5)
tzinfo (0.3.23)
Expand All @@ -37,17 +41,14 @@ PLATFORMS
ruby

DEPENDENCIES
SystemTimer
activemodel (= 3)
activesupport (= 3)
adapter!
diff-lcs
log_buddy
memcached
rake
redis
rspec (= 1.3.0)
simple_uuid
timecop
activemodel (~> 3.0.3)
activesupport (~> 3.0.3)
adapter (~> 0.5.1)
adapter-memcached (~> 0.5.1)
log_buddy (~> 0.5.0)
rake (~> 0.8.7)
rspec (~> 2.3)
simple_uuid (~> 0.1.1)
timecop (~> 0.3.5)
toystore!
tzinfo
tzinfo (~> 0.3.23)
51 changes: 5 additions & 46 deletions Rakefile
@@ -1,48 +1,7 @@
require 'rubygems'
require 'bundler/setup'
require 'rake'
require 'rake/testtask'
require 'spec/rake/spectask'
require File.expand_path('../lib/toy/version', __FILE__)
require 'bundler'
Bundler::GemHelper.install_tasks

def gemspec
@gemspec ||= begin
file = File.expand_path('../toy.gemspec', __FILE__)
eval(File.read(file), binding, file)
end
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

Rake::TestTask.new do |t|
t.ruby_opts << '-rubygems'
t.test_files = ['test/lint_test.rb']
t.verbose = true
end

Spec::Rake::SpecTask.new do |t|
t.ruby_opts << '-rubygems'
end
task :default => :spec
task :default => :test

desc 'Vaildate the gem specification'
task :gemspec do
gemspec.validate
end

desc 'Builds the gem'
task :build => :gemspec do
sh "gem build toy.gemspec"
end

desc 'Builds and installs the gem'
task :install => :build do
sh "gem install toy-#{Toy::Version}"
end

desc 'Tags version, pushes to remote, and pushes gem'
task :release => :build do
sh "git tag v#{Toy::Version}"
sh "git push origin master"
sh "git push origin v#{Toy::Version}"
sh "gem push toy-#{Toy::Version}.gem"
end
task :default => :spec
31 changes: 17 additions & 14 deletions spec/helper.rb
@@ -1,22 +1,25 @@
require 'bundler/setup'
$:.unshift(File.expand_path('../../lib', __FILE__))

require 'pathname'
require 'logger'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path = root_path.join('lib')
log_path = root_path.join('log')
root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path = root_path.join('lib')
log_path = root_path.join('log')
log_path.mkpath
$:.unshift(lib_path)

require 'rubygems'
require 'bundler'

Bundler.require(:default, :development)

require 'toy'
require 'spec'
require 'timecop'
require 'log_buddy'
require 'adapter/memory'
require 'adapter/memcached'

require 'support/constants'
require 'support/identity_map_matcher'
require 'support/name_and_number_key_factory'
require 'adapter/memory'
require 'adapter/memcached'

Logger.new(log_path.join('test.log')).tap do |log|
LogBuddy.init(:logger => log)
Expand All @@ -25,11 +28,11 @@

$memcached = Memcached.new

Spec::Runner.configure do |config|
config.include(Support::Constants)
config.include(IdentityMapMatcher)
Rspec.configure do |c|
c.include(Support::Constants)
c.include(IdentityMapMatcher)

config.before(:each) do
c.before(:each) do
Toy.clear
Toy.reset
end
Expand Down
6 changes: 3 additions & 3 deletions spec/toy/extensions/time_spec.rb
Expand Up @@ -55,12 +55,12 @@
describe "Time.from_store without Time.zone" do
it "should be time in utc" do
time = Time.now
Time.from_store(time).should be_close(time.utc, 1)
Time.from_store(time).should be_within(1).of(time.utc)
end

it "should be time if string" do
time = Time.now
Time.from_store(time.to_s).should be_close(time, 1)
Time.from_store(time.to_s).should be_within(1).of(time)
end

it "should be nil if nil" do
Expand All @@ -85,7 +85,7 @@

it "should be time if string" do
time = Time.zone.now
Time.from_store(time.to_s).should be_close(time, 1)
Time.from_store(time.to_s).should be_within(1).of(time)
end

it "should be nil if nil" do
Expand Down
17 changes: 4 additions & 13 deletions toystore.gemspec
Expand Up @@ -12,17 +12,8 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.files = Dir.glob("{examples,lib,spec}/**/*") + %w[LICENSE README.md]

s.add_dependency 'simple_uuid'
s.add_dependency 'activemodel', '3'
s.add_dependency 'activesupport', '3'

s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '1.3.0'
s.add_development_dependency 'timecop'
s.add_development_dependency 'tzinfo'
s.add_development_dependency 'log_buddy'
s.add_development_dependency 'diff-lcs'
s.add_development_dependency 'redis'
s.add_development_dependency 'SystemTimer'
s.add_development_dependency 'memcached'
s.add_dependency 'adapter', '~> 0.5.1'
s.add_dependency 'activemodel', '~> 3.0.3'
s.add_dependency 'activesupport', '~> 3.0.3'
s.add_dependency 'simple_uuid', '~> 0.1.1'
end

0 comments on commit 6166e21

Please sign in to comment.