From b8dfb13ffb0591f4d25a5a507c544f94e17874a6 Mon Sep 17 00:00:00 2001 From: John Faucett Date: Tue, 31 Dec 2013 20:51:15 +0100 Subject: [PATCH 1/5] Use Rspec remove jeweler --- .travis.yml | 6 +++++ Gemfile | 11 +-------- Gemfile.lock | 45 +++++++++++++++++------------------ Rakefile | 48 ++++---------------------------------- kontoapi-ruby.gemspec | 36 +++++++--------------------- spec/kontoapi-ruby_spec.rb | 2 +- spec/spec_helper.rb | 8 ++----- 7 files changed, 44 insertions(+), 112 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..03379f4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: ruby + rvm: + - 1.9.3 + - 2.0.0 + - 2.1.0 + - jruby-19mode \ No newline at end of file diff --git a/Gemfile b/Gemfile index 0178adf..c80ee36 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,3 @@ source "http://rubygems.org" -gem 'addressable' -gem 'yajl-ruby' - -group :development do - gem "rspec", "~> 2.3.0" - gem "bundler", "~> 1.0.0" - gem "jeweler", "~> 1.5.2" - gem "rcov", ">= 0" - gem "fakeweb" -end +gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 73e25e2..8514972 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,34 +1,33 @@ +PATH + remote: . + specs: + kontoapi-ruby (0.2.0) + addressable + yajl-ruby + GEM remote: http://rubygems.org/ specs: - addressable (2.2.5) - diff-lcs (1.1.2) + addressable (2.3.5) + diff-lcs (1.2.5) fakeweb (1.3.0) - git (1.2.5) - jeweler (1.5.2) - bundler (~> 1.0.0) - git (>= 1.2.5) - rake rake (0.8.7) - rcov (0.9.9) - rspec (2.3.0) - rspec-core (~> 2.3.0) - rspec-expectations (~> 2.3.0) - rspec-mocks (~> 2.3.0) - rspec-core (2.3.1) - rspec-expectations (2.3.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.3.0) - yajl-ruby (0.8.2) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.7) + rspec-expectations (2.14.4) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.4) + yajl-ruby (1.2.0) PLATFORMS ruby DEPENDENCIES - addressable - bundler (~> 1.0.0) + bundler fakeweb - jeweler (~> 1.5.2) - rcov - rspec (~> 2.3.0) - yajl-ruby + kontoapi-ruby! + rake + rspec diff --git a/Rakefile b/Rakefile index 50474fd..5606c45 100644 --- a/Rakefile +++ b/Rakefile @@ -1,50 +1,10 @@ require 'rubygems' -require 'bundler' -begin - Bundler.setup(:default, :development) -rescue Bundler::BundlerError => e - $stderr.puts e.message - $stderr.puts "Run `bundle install` to install missing gems" - exit e.status_code -end -require 'rake' +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' -require 'jeweler' -Jeweler::Tasks.new do |gem| - # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options - gem.name = "kontoapi-ruby" - gem.homepage = "http://github.com/GeneralScripting/kontoapi-ruby" - gem.license = "MIT" - gem.summary = %Q{Konto API Ruby Library} - gem.description = %Q{A ruby library to access the Konto API (https://www.kontoapi.de/), a webservice that performs validity checks and other services regarding german bank accounts.} - gem.email = "jan@general-scripting.com" - gem.authors = ["Jan Schwenzien"] - # Include your dependencies below. Runtime dependencies are required when using your gem, - # and development dependencies are only needed for development (ie running rake tasks, tests, etc) - # gem.add_runtime_dependency 'jabber4r', '> 0.1' - # gem.add_development_dependency 'rspec', '> 1.2.3' -end -Jeweler::RubygemsDotOrgTasks.new -require 'rspec/core' -require 'rspec/core/rake_task' -RSpec::Core::RakeTask.new(:spec) do |spec| +RSpec::Core::RakeTask.new(:test) do |spec| spec.pattern = FileList['spec/**/*_spec.rb'] end -RSpec::Core::RakeTask.new(:rcov) do |spec| - spec.pattern = 'spec/**/*_spec.rb' - spec.rcov = true -end - -task :default => :spec - -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "kontoapi-ruby #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end +task :default => :test diff --git a/kontoapi-ruby.gemspec b/kontoapi-ruby.gemspec index f9cf804..df9ce7f 100644 --- a/kontoapi-ruby.gemspec +++ b/kontoapi-ruby.gemspec @@ -38,34 +38,14 @@ Gem::Specification.new do |s| "spec/spec_helper.rb" ] - if s.respond_to? :specification_version then - s.specification_version = 3 + + s.add_runtime_dependency 'addressable' + s.add_runtime_dependency 'yajl-ruby' + + s.add_development_dependency 'bundler' + s.add_development_dependency 'rake' + s.add_development_dependency 'rspec' + s.add_development_dependency 'fakeweb' - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) - s.add_runtime_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, ["~> 2.3.0"]) - s.add_development_dependency(%q, ["~> 1.0.0"]) - s.add_development_dependency(%q, ["~> 1.5.2"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, ["~> 2.3.0"]) - s.add_dependency(%q, ["~> 1.0.0"]) - s.add_dependency(%q, ["~> 1.5.2"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - end - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, ["~> 2.3.0"]) - s.add_dependency(%q, ["~> 1.0.0"]) - s.add_dependency(%q, ["~> 1.5.2"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - end end diff --git a/spec/kontoapi-ruby_spec.rb b/spec/kontoapi-ruby_spec.rb index 04a282e..363e1c6 100644 --- a/spec/kontoapi-ruby_spec.rb +++ b/spec/kontoapi-ruby_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') +require 'spec_helper' describe "KontoAPI" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1c8be9a..64aefd5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,9 @@ -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(File.dirname(__FILE__)) + +$LOAD_PATH << File.expand_path('../../lib', __FILE__ ) require 'rspec' require 'kontoapi-ruby' require 'fakeweb' -# Requires supporting files with custom matchers and macros, etc, -# in ./support/ and its subdirectories. -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} - RSpec.configure do |config| end From a609ccb3cda14d5dcc2f6796384ca60ae4016b83 Mon Sep 17 00:00:00 2001 From: John Faucett Date: Tue, 31 Dec 2013 21:00:48 +0100 Subject: [PATCH 2/5] Travis build status and yml --- .travis.yml | 17 ++++++++++++----- README.markdown | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03379f4..afb3ea9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,13 @@ language: ruby - rvm: - - 1.9.3 - - 2.0.0 - - 2.1.0 - - jruby-19mode \ No newline at end of file + +rvm: + - 1.9.3 + - 2.0.0 + - jruby-19mode + +script: + - bundle exec rake test + +branches: + only: + - master \ No newline at end of file diff --git a/README.markdown b/README.markdown index c3aa6c1..b2d658c 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,9 @@ Konto API Ruby Library ====================== + +[![Build Status](https://travis-ci.org/https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png)](https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png) + This library provides an easy way to access the [Konto API](https://www.kontoapi.de/), a webservice that performs validity checks and other services regarding german and international bank accounts. INSTALLATION From 10b8f2eec722b2abf2fdcf84447a7d80abe23e70 Mon Sep 17 00:00:00 2001 From: John Faucett Date: Tue, 31 Dec 2013 21:04:04 +0100 Subject: [PATCH 3/5] Fix build status image --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index b2d658c..2c56236 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,7 @@ Konto API Ruby Library ====================== -[![Build Status](https://travis-ci.org/https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png)](https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png) +[![Build Status](https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png)](https://travis-ci.org/jwaterfaucett/kontoapi-ruby.png) This library provides an easy way to access the [Konto API](https://www.kontoapi.de/), a webservice that performs validity checks and other services regarding german and international bank accounts. From 8e299a6d28c1613606da35102c8708fed94c4128 Mon Sep 17 00:00:00 2001 From: John Faucett Date: Tue, 31 Dec 2013 21:07:17 +0100 Subject: [PATCH 4/5] Update outdated Rake --- Gemfile.lock | 2 +- spec/spec_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8514972..75ad651 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GEM addressable (2.3.5) diff-lcs (1.2.5) fakeweb (1.3.0) - rake (0.8.7) + rake (10.1.1) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 64aefd5..0af08b9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,5 +5,5 @@ require 'fakeweb' RSpec.configure do |config| - + config.color_enabled = true end From f133bbd74126d60d327d4e4379b5471cd8d4ff6f Mon Sep 17 00:00:00 2001 From: John Faucett Date: Tue, 31 Dec 2013 21:16:17 +0100 Subject: [PATCH 5/5] Remove yajl dependency --- .travis.yml | 2 ++ Gemfile.lock | 4 ++-- kontoapi-ruby.gemspec | 2 +- lib/kontoapi-ruby.rb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index afb3ea9..c748882 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,9 @@ language: ruby rvm: - 1.9.3 - 2.0.0 + - ruby-head - jruby-19mode + - jruby-head script: - bundle exec rake test diff --git a/Gemfile.lock b/Gemfile.lock index 75ad651..6b869fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ PATH specs: kontoapi-ruby (0.2.0) addressable - yajl-ruby + json GEM remote: http://rubygems.org/ @@ -11,6 +11,7 @@ GEM addressable (2.3.5) diff-lcs (1.2.5) fakeweb (1.3.0) + json (1.8.1) rake (10.1.1) rspec (2.14.1) rspec-core (~> 2.14.0) @@ -20,7 +21,6 @@ GEM rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.4) - yajl-ruby (1.2.0) PLATFORMS ruby diff --git a/kontoapi-ruby.gemspec b/kontoapi-ruby.gemspec index df9ce7f..c7c5f2e 100644 --- a/kontoapi-ruby.gemspec +++ b/kontoapi-ruby.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'addressable' - s.add_runtime_dependency 'yajl-ruby' + s.add_runtime_dependency 'json' s.add_development_dependency 'bundler' s.add_development_dependency 'rake' diff --git a/lib/kontoapi-ruby.rb b/lib/kontoapi-ruby.rb index a5f3089..93cd73f 100644 --- a/lib/kontoapi-ruby.rb +++ b/lib/kontoapi-ruby.rb @@ -1,5 +1,5 @@ require 'addressable/uri' -require 'yajl/json_gem' +require 'json' require 'net/http' require 'net/https'