From b955f88473f4d67516fb9c778de049fc5ff42832 Mon Sep 17 00:00:00 2001 From: plukevdh Date: Tue, 31 May 2011 14:31:24 -0400 Subject: [PATCH 1/2] remove dependence on jeweler, update specs to use RSpec2, ADD ALL UR DEPENDENCIES --- .gitignore | 4 + Gemfile | 3 + Rakefile | 35 ++------ barometer.gemspec | 211 ++++---------------------------------------- spec/spec_helper.rb | 4 +- 5 files changed, 35 insertions(+), 222 deletions(-) create mode 100644 Gemfile diff --git a/.gitignore b/.gitignore index 6479880..cc39a83 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ pkg lib/attic coverage *.gem + +.rvmrc + +Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a1b93f3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source :rubygems + +gemspec diff --git a/Rakefile b/Rakefile index b5ec9d0..5163c12 100644 --- a/Rakefile +++ b/Rakefile @@ -1,40 +1,19 @@ require 'rubygems' require 'rake' -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "barometer" - gem.summary = "A multi API consuming weather forecasting superstar." - gem.description = "A multi API consuming weather forecasting superstar." - gem.email = "barometer@attackcorp.com" - gem.homepage = "http://github.com/attack/barometer" - gem.authors = ["Mark G"] - - gem.add_dependency 'httparty', '>= 0.4.5' - gem.add_dependency 'tzinfo', '>= 0.3.14' - - #gem.add_development_dependency "mocha" - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" -end +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' -require 'spec/rake/spectask' -Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' - spec.spec_files = FileList['spec/**/*_spec.rb'] - spec.spec_opts = ["-c"] +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = 'spec/**/*_spec.rb' + spec.rspec_opts = ["-c"] end -Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.libs << 'lib' << 'spec' +RSpec::Core::RakeTask.new(:rcov) do |spec| spec.pattern = 'spec/**/*_spec.rb' spec.rcov = true end - task :default => :spec require 'rake/rdoctask' @@ -50,4 +29,4 @@ Rake::RDocTask.new do |rdoc| rdoc.title = "barometer #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') -end \ No newline at end of file +end diff --git a/barometer.gemspec b/barometer.gemspec index 437aa18..c62fd70 100644 --- a/barometer.gemspec +++ b/barometer.gemspec @@ -1,6 +1,3 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command # -*- encoding: utf-8 -*- Gem::Specification.new do |s| @@ -8,201 +5,31 @@ Gem::Specification.new do |s| s.version = "0.6.7" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.rubygems_version = %q{1.3.5} + s.authors = ["Mark G"] + s.email = %q{barometer@attackcorp.com} s.date = %q{2010-02-10} - s.default_executable = %q{barometer} + + s.summary = %q{A multi API consuming weather forecasting superstar.} s.description = %q{A multi API consuming weather forecasting superstar.} - s.email = %q{barometer@attackcorp.com} - s.executables = ["barometer"] - s.extra_rdoc_files = [ - "LICENSE", - "README.rdoc", - "TODO" - ] - s.files = [ - ".document", - ".gitignore", - "LICENSE", - "README.rdoc", - "Rakefile", - "TODO", - "VERSION.yml", - "barometer.gemspec", - "bin/barometer", - "lib/barometer.rb", - "lib/barometer/base.rb", - "lib/barometer/data.rb", - "lib/barometer/data/distance.rb", - "lib/barometer/data/geo.rb", - "lib/barometer/data/local_datetime.rb", - "lib/barometer/data/local_time.rb", - "lib/barometer/data/location.rb", - "lib/barometer/data/pressure.rb", - "lib/barometer/data/speed.rb", - "lib/barometer/data/sun.rb", - "lib/barometer/data/temperature.rb", - "lib/barometer/data/units.rb", - "lib/barometer/data/zone.rb", - "lib/barometer/extensions/httparty.rb", - "lib/barometer/formats.rb", - "lib/barometer/formats/coordinates.rb", - "lib/barometer/formats/format.rb", - "lib/barometer/formats/geocode.rb", - "lib/barometer/formats/icao.rb", - "lib/barometer/formats/postalcode.rb", - "lib/barometer/formats/short_zipcode.rb", - "lib/barometer/formats/weather_id.rb", - "lib/barometer/formats/zipcode.rb", - "lib/barometer/measurements/measurement.rb", - "lib/barometer/measurements/result.rb", - "lib/barometer/measurements/result_array.rb", - "lib/barometer/query.rb", - "lib/barometer/services.rb", - "lib/barometer/translations/icao_country_codes.yml", - "lib/barometer/translations/weather_country_codes.yml", - "lib/barometer/translations/zone_codes.yml", - "lib/barometer/weather.rb", - "lib/barometer/weather_services/google.rb", - "lib/barometer/weather_services/noaa.rb", - "lib/barometer/weather_services/service.rb", - "lib/barometer/weather_services/weather_bug.rb", - "lib/barometer/weather_services/weather_dot_com.rb", - "lib/barometer/weather_services/wunderground.rb", - "lib/barometer/weather_services/yahoo.rb", - "lib/barometer/web_services/geocode.rb", - "lib/barometer/web_services/timezone.rb", - "lib/barometer/web_services/weather_id.rb", - "lib/barometer/web_services/web_service.rb", - "lib/demometer/demometer.rb", - "lib/demometer/public/css/master.css", - "lib/demometer/public/css/print.css", - "lib/demometer/public/css/syntax.css", - "lib/demometer/public/images/go.png", - "lib/demometer/public/images/link-out.gif", - "lib/demometer/views/about.erb", - "lib/demometer/views/contributing.erb", - "lib/demometer/views/forecast.erb", - "lib/demometer/views/index.erb", - "lib/demometer/views/layout.erb", - "lib/demometer/views/measurement.erb", - "lib/demometer/views/readme.erb", - "spec/barometer_spec.rb", - "spec/data/distance_spec.rb", - "spec/data/geo_spec.rb", - "spec/data/local_datetime_spec.rb", - "spec/data/local_time_spec.rb", - "spec/data/location_spec.rb", - "spec/data/pressure_spec.rb", - "spec/data/speed_spec.rb", - "spec/data/sun_spec.rb", - "spec/data/temperature_spec.rb", - "spec/data/units_spec.rb", - "spec/data/zone_spec.rb", - "spec/fixtures/formats/weather_id/90210.xml", - "spec/fixtures/formats/weather_id/atlanta.xml", - "spec/fixtures/formats/weather_id/from_USGA0028.xml", - "spec/fixtures/formats/weather_id/ksfo.xml", - "spec/fixtures/formats/weather_id/new_york.xml", - "spec/fixtures/geocode/40_73.json", - "spec/fixtures/geocode/40_73.xml", - "spec/fixtures/geocode/90210.json", - "spec/fixtures/geocode/90210.xml", - "spec/fixtures/geocode/T5B4M9.json", - "spec/fixtures/geocode/T5B4M9.xml", - "spec/fixtures/geocode/atlanta.json", - "spec/fixtures/geocode/atlanta.xml", - "spec/fixtures/geocode/calgary_ab.json", - "spec/fixtures/geocode/calgary_ab.xml", - "spec/fixtures/geocode/ksfo.json", - "spec/fixtures/geocode/ksfo.xml", - "spec/fixtures/geocode/newyork_ny.json", - "spec/fixtures/geocode/newyork_ny.xml", - "spec/fixtures/services/google/calgary_ab.xml", - "spec/fixtures/services/weather_bug/90210_current.xml", - "spec/fixtures/services/weather_bug/90210_forecast.xml", - "spec/fixtures/services/weather_dot_com/90210.xml", - "spec/fixtures/services/wunderground/current_calgary_ab.xml", - "spec/fixtures/services/wunderground/forecast_calgary_ab.xml", - "spec/fixtures/services/yahoo/90210.xml", - "spec/formats/coordinates_spec.rb", - "spec/formats/format_spec.rb", - "spec/formats/geocode_spec.rb", - "spec/formats/icao_spec.rb", - "spec/formats/postalcode_spec.rb", - "spec/formats/short_zipcode_spec.rb", - "spec/formats/weather_id_spec.rb", - "spec/formats/zipcode_spec.rb", - "spec/measurements/measurement_spec.rb", - "spec/measurements/result_array_spec.rb", - "spec/measurements/result_spec.rb", - "spec/query_spec.rb", - "spec/spec_helper.rb", - "spec/weather_services/google_spec.rb", - "spec/weather_services/services_spec.rb", - "spec/weather_services/weather_bug_spec.rb", - "spec/weather_services/weather_dot_com_spec.rb", - "spec/weather_services/wunderground_spec.rb", - "spec/weather_services/yahoo_spec.rb", - "spec/weather_spec.rb", - "spec/web_services/geocode_spec.rb", - "spec/web_services/web_services_spec.rb" - ] s.homepage = %q{http://github.com/attack/barometer} - s.rdoc_options = ["--charset=UTF-8"] + + s.default_executable = %q{barometer} + + s.files = `git ls-files`.split("\n") + 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"] - s.rubygems_version = %q{1.3.5} - s.summary = %q{A multi API consuming weather forecasting superstar.} - s.test_files = [ - "spec/barometer_spec.rb", - "spec/data/distance_spec.rb", - "spec/data/geo_spec.rb", - "spec/data/local_datetime_spec.rb", - "spec/data/local_time_spec.rb", - "spec/data/location_spec.rb", - "spec/data/pressure_spec.rb", - "spec/data/speed_spec.rb", - "spec/data/sun_spec.rb", - "spec/data/temperature_spec.rb", - "spec/data/units_spec.rb", - "spec/data/zone_spec.rb", - "spec/formats/coordinates_spec.rb", - "spec/formats/format_spec.rb", - "spec/formats/geocode_spec.rb", - "spec/formats/icao_spec.rb", - "spec/formats/postalcode_spec.rb", - "spec/formats/short_zipcode_spec.rb", - "spec/formats/weather_id_spec.rb", - "spec/formats/zipcode_spec.rb", - "spec/measurements/measurement_spec.rb", - "spec/measurements/result_array_spec.rb", - "spec/measurements/result_spec.rb", - "spec/query_spec.rb", - "spec/spec_helper.rb", - "spec/weather_services/google_spec.rb", - "spec/weather_services/services_spec.rb", - "spec/weather_services/weather_bug_spec.rb", - "spec/weather_services/weather_dot_com_spec.rb", - "spec/weather_services/wunderground_spec.rb", - "spec/weather_services/yahoo_spec.rb", - "spec/weather_spec.rb", - "spec/web_services/geocode_spec.rb", - "spec/web_services/web_services_spec.rb" - ] - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 + s.rdoc_options = ["--charset=UTF-8"] + + s.add_dependency(%q, ">= 0.4.5") + s.add_dependency(%q, ">= 0.3.14") + s.add_dependency("nokogiri") - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0.4.5"]) - s.add_runtime_dependency(%q, [">= 0.3.14"]) - else - s.add_dependency(%q, [">= 0.4.5"]) - s.add_dependency(%q, [">= 0.3.14"]) - end - else - s.add_dependency(%q, [">= 0.4.5"]) - s.add_dependency(%q, [">= 0.3.14"]) - end + s.add_development_dependency("rspec", "~> 2.6") + s.add_development_dependency("mocha") + s.add_development_dependency("fakeweb") end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 199d75e..ac12767 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ require 'rubygems' -require 'spec' +require 'rspec' require 'mocha' require 'cgi' @@ -12,6 +12,6 @@ Barometer.google_geocode_key = "ABC123" Barometer.yahoo_placemaker_app_id = "YAHOO" -Spec::Runner.configure do |config| +RSpec.configure do |config| end From 1925baafa8c6cd7dec6868e0df9459b5fd24540b Mon Sep 17 00:00:00 2001 From: plukevdh Date: Tue, 31 May 2011 14:31:34 -0400 Subject: [PATCH 2/2] fix spec. api change? --- spec/data/zone_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/data/zone_spec.rb b/spec/data/zone_spec.rb index 84972fe..298443c 100644 --- a/spec/data/zone_spec.rb +++ b/spec/data/zone_spec.rb @@ -65,7 +65,7 @@ zone.code.should be_nil zone = Data::Zone.new(@timezone) - zone.code.should == "CET" + zone.code.should == "CEST" end it "responds to dst?" do @@ -360,4 +360,4 @@ end -end \ No newline at end of file +end