Skip to content
Browse files

Switch to bundler for management and clean some stuff up.

  • Loading branch information...
1 parent 3d08945 commit 237943f605e405587b5242aa52e0db1ca64674ac @jnunemaker committed Jun 21, 2011
Showing with 47 additions and 43 deletions.
  1. +2 −0 .gitignore
  2. +7 −4 Gemfile
  3. +5 −13 Rakefile
  4. +20 −2 spec/spec_helper.rb
  5. +13 −24 user-agent.gemspec
View
2 .gitignore
@@ -1 +1,3 @@
+log
+Gemfile.lock
.bundle
View
11 Gemfile
@@ -1,5 +1,8 @@
-source :gemcutter
+source "http://rubygems.org"
+gemspec
-gem "rake"
-gem "echoe"
-gem "rspec"
+group(:development) do
+ gem 'rake', '~> 0.8.7'
+ gem 'rspec', '~> 2.5.0'
+ gem 'log_buddy', '~> 0.5.0'
+end
View
18 Rakefile
@@ -1,15 +1,7 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
-$:.unshift 'lib'
-require 'user-agent'
-require 'rubygems'
-require 'rake'
-require 'echoe'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new
-Echoe.new "user-agent", Agent::VERSION do |p|
- p.author = "TJ Holowaychuk"
- p.email = "tj@vision-media.ca"
- p.summary = "User agent parser"
- p.runtime_dependencies = []
-end
-
-Dir['tasks/**/*.rake'].sort.each { |f| load f }
+task :default => :spec
View
22 spec/spec_helper.rb
@@ -1,3 +1,21 @@
+$:.unshift(File.expand_path('../../lib', __FILE__))
-$:.unshift File.dirname(__FILE__) + '/../lib'
-require 'user-agent'
+require 'user-agent'
+require 'pathname'
+require 'logger'
+
+root_path = Pathname(__FILE__).dirname.join('..').expand_path
+lib_path = root_path.join('lib')
+log_path = root_path.join('log')
+log_path.mkpath
+
+require 'rubygems'
+require 'bundler'
+
+Bundler.require(:development)
+
+logger = Logger.new(log_path.join('test.log'))
+LogBuddy.init(:logger => logger)
+
+Rspec.configure do |c|
+end
View
37 user-agent.gemspec
@@ -1,30 +1,19 @@
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "user-agent/version"
Gem::Specification.new do |s|
- s.name = %q{user-agent}
- s.version = "1.0.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
- s.authors = ["TJ Holowaychuk"]
- s.date = %q{2009-10-08}
+ s.name = "user-agent"
+ s.version = Agent::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["TJ Holowaychuk"]
+ s.email = ['tj@vision-media.ca']
+ s.homepage = ''
+ s.summary = %q{User agent parser}
s.description = %q{User agent parser}
- s.email = %q{tj@vision-media.ca}
- s.extra_rdoc_files = ["README.rdoc", "lib/user-agent.rb", "lib/user-agent/agent.rb", "lib/user-agent/version.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
- s.files = ["History.rdoc", "Manifest", "README.rdoc", "Rakefile", "lib/user-agent.rb", "lib/user-agent/agent.rb", "lib/user-agent/version.rb", "spec/agent_spec.rb", "spec/agents_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake", "user-agent.gemspec"]
- s.homepage = %q{}
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "User-agent", "--main", "README.rdoc"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{user-agent}
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{User agent parser}
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
+ s.files = `git ls-files`.split("\n") - ['specs.watchr']
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
end

0 comments on commit 237943f

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