Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use bundler and rspec 2

  • Loading branch information...
commit ed5b15d826e5b917a0657b4efa3987a552aa730d 1 parent abfb6f1
@djsun authored
View
2  .bundle/config
@@ -0,0 +1,2 @@
+---
+BUNDLE_DISABLE_SHARED_GEMS: "1"
View
7 Gemfile
@@ -0,0 +1,7 @@
+source :rubygems
+
+group :development do
+ gem 'jeweler', '~> 1.5.1'
+end
+
+gemspec
View
31 Gemfile.lock
@@ -0,0 +1,31 @@
+PATH
+ remote: .
+ specs:
+ kronos (0.1.9)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ diff-lcs (1.1.2)
+ git (1.2.5)
+ jeweler (1.5.1)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ rake (0.8.7)
+ rspec (2.2.0)
+ rspec-core (~> 2.2)
+ rspec-expectations (~> 2.2)
+ rspec-mocks (~> 2.2)
+ rspec-core (2.2.1)
+ rspec-expectations (2.2.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.2.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jeweler (~> 1.5.1)
+ kronos!
+ rspec (~> 2.2)
View
59 Rakefile
@@ -1,45 +1,26 @@
require 'rubygems'
require 'rake'
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "kronos"
- gem.summary = %Q{Simple and flexible date parsing.}
- gem.description = %Q{Kronos provides flexible date parsing. Currently just a thin layer on top of ParseDate.}
- gem.email = "djames@sunlightfoundation.com"
- gem.homepage = "http://github.com/djsun/kronos"
- gem.authors = ["David James"]
- gem.add_development_dependency "rspec", ">= 1.2.9"
- # 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: gem install jeweler"
+require 'jeweler'
+require File.expand_path('../lib/version', __FILE__)
+Jeweler::Tasks.new do |gem|
+ gem.name = "kronos"
+ gem.version = Kronos::Version::STRING
+ gem.summary = %Q{Simple and flexible date parsing.}
+ gem.description = %Q{Kronos provides flexible date parsing. Currently just a thin layer on top of ParseDate.}
+ gem.email = "djames@sunlightfoundation.com"
+ gem.homepage = "http://github.com/djsun/kronos"
+ gem.authors = ["David James"]
+ gem.add_development_dependency "rspec", "~> 2.2"
+ gem.rubyforge_project = 'kronos'
+ # gem is a Gem::Specification
+ # see http://www.rubygems.org/read/chapter/20 for additional settings
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
-
-task :spec => :check_dependencies
-
-task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "kronos #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+require 'rspec/core/rake_task'
+desc "Run specs"
+RSpec::Core::RakeTask.new do |t|
+ t.rspec_opts = %w(--color)
+ # t.rspec_opts = %w(-fs --color)
+ # t.ruby_opts = %w(-w)
end
View
1  VERSION
@@ -1 +0,0 @@
-0.1.8
View
52 kronos.gemspec
@@ -1,50 +1,48 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{kronos}
- s.version = "0.1.8"
+ s.version = "0.1.9"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["David James"]
- s.date = %q{2010-10-17}
+ s.date = %q{2010-12-10}
s.description = %q{Kronos provides flexible date parsing. Currently just a thin layer on top of ParseDate.}
s.email = %q{djames@sunlightfoundation.com}
s.extra_rdoc_files = [
"LICENSE",
- "README.md"
+ "README.md"
]
s.files = [
".document",
- ".gitignore",
- "LICENSE",
- "README.md",
- "Rakefile",
- "VERSION",
- "kronos.gemspec",
- "lib/kronos.rb",
- "spec/compare_spec.rb",
- "spec/from_hash_spec.rb",
- "spec/parse_spec.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb",
- "spec/to_s_spec.rb",
- "spec/valid_spec.rb"
+ "LICENSE",
+ "README.md",
+ "Rakefile",
+ "kronos.gemspec",
+ "lib/kronos.rb",
+ "spec/compare_spec.rb",
+ "spec/from_hash_spec.rb",
+ "spec/parse_spec.rb",
+ "spec/spec.opts",
+ "spec/spec_helper.rb",
+ "spec/to_s_spec.rb",
+ "spec/valid_spec.rb"
]
s.homepage = %q{http://github.com/djsun/kronos}
- s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
+ s.rubyforge_project = %q{kronos}
s.rubygems_version = %q{1.3.7}
s.summary = %q{Simple and flexible date parsing.}
s.test_files = [
"spec/compare_spec.rb",
- "spec/from_hash_spec.rb",
- "spec/parse_spec.rb",
- "spec/spec_helper.rb",
- "spec/to_s_spec.rb",
- "spec/valid_spec.rb"
+ "spec/from_hash_spec.rb",
+ "spec/parse_spec.rb",
+ "spec/spec_helper.rb",
+ "spec/to_s_spec.rb",
+ "spec/valid_spec.rb"
]
if s.respond_to? :specification_version then
@@ -52,12 +50,12 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_development_dependency(%q<rspec>, ["~> 2.2"])
else
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<rspec>, ["~> 2.2"])
end
else
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<rspec>, ["~> 2.2"])
end
end
View
1  lib/kronos.rb
@@ -1,3 +1,4 @@
+require File.expand_path("../version", __FILE__)
require 'parsedate'
class Kronos
View
11 lib/version.rb
@@ -0,0 +1,11 @@
+class Kronos
+
+ module Version
+ MAJOR = 0
+ MINOR = 1
+ PATCH = 9
+ BUILD = nil
+ STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
+ end
+
+end
View
13 spec/spec_helper.rb
@@ -1,9 +1,8 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
-require 'kronos'
-require 'spec'
-require 'spec/autorun'
+require 'bundler/setup'
+require 'rspec'
+require File.expand_path('../../lib/kronos', __FILE__)
-Spec::Runner.configure do |config|
-end
+Rspec.configure do |c|
+ c.mock_with :rspec
+end
Please sign in to comment.
Something went wrong with that request. Please try again.