From eb59bdfa5c548436cc3714d884ad3887fdf8a4f2 Mon Sep 17 00:00:00 2001 From: bogdanRada Date: Tue, 27 May 2014 13:33:23 +0300 Subject: [PATCH] remove virtus --- Gemfile | 1 - lib/washout_builder/document/exception_model.rb | 2 +- ...rtus_model_spec.rb => exception_model_spec.rb} | 6 +++--- spec/lib/washout_builder_spec.rb | 3 --- spec/support/exceptions/another_exception.rb | 7 ------- spec/support/exceptions/base_exception.rb | 15 --------------- spec/support/exceptions/custom2.rb | 7 ------- spec/support/exceptions/ex_model.rb | 8 -------- spec/support/exceptions/name_mod.rb | 5 ----- spec/support/exceptions/name_model.rb | 5 ----- spec/support/exceptions/value_object_model.rb | 8 -------- washout_builder.gemspec | 1 - 12 files changed, 4 insertions(+), 64 deletions(-) rename spec/lib/washout_builder/document/{virtus_model_spec.rb => exception_model_spec.rb} (75%) delete mode 100644 spec/support/exceptions/another_exception.rb delete mode 100644 spec/support/exceptions/base_exception.rb delete mode 100644 spec/support/exceptions/custom2.rb delete mode 100644 spec/support/exceptions/ex_model.rb delete mode 100644 spec/support/exceptions/name_mod.rb delete mode 100644 spec/support/exceptions/name_model.rb delete mode 100644 spec/support/exceptions/value_object_model.rb diff --git a/Gemfile b/Gemfile index aa598c9..104300a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ gemspec gem 'wash_out', git: 'git://github.com/inossidabile/wash_out.git' -gem 'virtus' gem 'wasabi' gem 'savon' gem 'httpi' diff --git a/lib/washout_builder/document/exception_model.rb b/lib/washout_builder/document/exception_model.rb index 0193f55..9f72dd2 100644 --- a/lib/washout_builder/document/exception_model.rb +++ b/lib/washout_builder/document/exception_model.rb @@ -94,7 +94,7 @@ def self.extract_nested_complex_types(complex_class, complex_types) param_class.send :extend, WashoutBuilder::Document::ExceptionModel param_class.get_fault_class_ancestors( complex_types) elsif param_class.present? && !WashoutBuilder::Type.valid_fault_class?(param_class) - raise RuntimeError, "Non-existent use of `#{param_class}` type name or this class does not use Virtus.model. Consider using classified types that include Virtus.mode for exception atribute types." + raise RuntimeError, "Non-existent use of `#{param_class}` type name or this class does not inherit from SoapError. Consider using classified types that include SoapError for exception classes." end end end diff --git a/spec/lib/washout_builder/document/virtus_model_spec.rb b/spec/lib/washout_builder/document/exception_model_spec.rb similarity index 75% rename from spec/lib/washout_builder/document/virtus_model_spec.rb rename to spec/lib/washout_builder/document/exception_model_spec.rb index 0ac68a4..dc9202f 100644 --- a/spec/lib/washout_builder/document/virtus_model_spec.rb +++ b/spec/lib/washout_builder/document/exception_model_spec.rb @@ -5,14 +5,14 @@ class SOAPError < WashOut::Dispatcher::SOAPError end -describe WashoutBuilder::Document::VirtusModel do +describe WashoutBuilder::Document::ExceptionModel do let(:subject) { SOAPError} it "gets the strcuture" do - subject.get_virtus_model_structure.should eq({"code"=>{:primitive=>"Integer", :member_type=>nil}, "message"=>{:primitive=>"String", :member_type=>nil}, "backtrace"=>{:primitive=>"String", :member_type=>nil}}) + subject.get_virtus_model_structure.should eq({"code"=>{:primitive=>"integer", :member_type=>nil}, "message"=>{:primitive=>"string", :member_type=>nil}, "backtrace"=>{:primitive=>"string", :member_type=>nil}}) end it "gets the member type for arrays" do @@ -29,7 +29,7 @@ class SOAPError < WashOut::Dispatcher::SOAPError it "gets the strcuture" do - subject.remove_fault_type_inheritable_elements(["code"]).should eq({ "message"=>{:primitive=>"String", :member_type=>nil}, "backtrace"=>{:primitive=>"String", :member_type=>nil}}) + subject.remove_fault_type_inheritable_elements(["code"]).should eq({ "message"=>{:primitive=>"string", :member_type=>nil}, "backtrace"=>{:primitive=>"string", :member_type=>nil}}) end end \ No newline at end of file diff --git a/spec/lib/washout_builder_spec.rb b/spec/lib/washout_builder_spec.rb index a103ff3..59b6f22 100644 --- a/spec/lib/washout_builder_spec.rb +++ b/spec/lib/washout_builder_spec.rb @@ -595,9 +595,6 @@ def bad end - it "intanstiates correctly a custom exception" do - soap_exception.attributes.should eq({:code=>error_code, :message=>error_message, :backtrace=>nil}) - end end diff --git a/spec/support/exceptions/another_exception.rb b/spec/support/exceptions/another_exception.rb deleted file mode 100644 index 5d4d759..0000000 --- a/spec/support/exceptions/another_exception.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AnotherException < WashOut::Dispatcher::SOAPError - - attribute :ex3_name, String - attribute :ex3_id, Integer - -end - diff --git a/spec/support/exceptions/base_exception.rb b/spec/support/exceptions/base_exception.rb deleted file mode 100644 index 1dc3f08..0000000 --- a/spec/support/exceptions/base_exception.rb +++ /dev/null @@ -1,15 +0,0 @@ -Dir["#{File.dirname(__FILE__)}/**/*.rb"].each { |f| require f } -class BaseException < AnotherException - - attribute :custom_attribute, String - attribute :other_custom_attribute, Integer - attribute :errors,Array[Integer] - attribute :custom, Array[ExModel] - attribute :custom2, ExModel - attribute :errors_2, Array[Custom2] - attribute :error, Custom2 - attribute :module, NameModel - attribute :geo, ValueObjectModel - -end - diff --git a/spec/support/exceptions/custom2.rb b/spec/support/exceptions/custom2.rb deleted file mode 100644 index 02ab59f..0000000 --- a/spec/support/exceptions/custom2.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Custom2 < WashOut::Dispatcher::SOAPError - - attribute :ex2_name, String - attribute :ex2_id, Integer - -end - diff --git a/spec/support/exceptions/ex_model.rb b/spec/support/exceptions/ex_model.rb deleted file mode 100644 index 3d68dbb..0000000 --- a/spec/support/exceptions/ex_model.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ExModel - include Virtus.model - - attribute :name, String - attribute :id, Integer - -end - diff --git a/spec/support/exceptions/name_mod.rb b/spec/support/exceptions/name_mod.rb deleted file mode 100644 index 118e7c1..0000000 --- a/spec/support/exceptions/name_mod.rb +++ /dev/null @@ -1,5 +0,0 @@ -module NameMod - include Virtus.module - - attribute :name, String -end \ No newline at end of file diff --git a/spec/support/exceptions/name_model.rb b/spec/support/exceptions/name_model.rb deleted file mode 100644 index 393180b..0000000 --- a/spec/support/exceptions/name_model.rb +++ /dev/null @@ -1,5 +0,0 @@ -require_relative "./name_mod" - -class NameModel - include NameMod -end \ No newline at end of file diff --git a/spec/support/exceptions/value_object_model.rb b/spec/support/exceptions/value_object_model.rb deleted file mode 100644 index a736f86..0000000 --- a/spec/support/exceptions/value_object_model.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ValueObjectModel - include Virtus.value_object - - values do - attribute :latitude, Float - attribute :longitude, Float - end -end \ No newline at end of file diff --git a/washout_builder.gemspec b/washout_builder.gemspec index 859b599..ea6ca41 100644 --- a/washout_builder.gemspec +++ b/washout_builder.gemspec @@ -16,5 +16,4 @@ Gem::Specification.new do |s| s.test_files = s.files.grep(/^(spec)/) s.require_paths = ["lib"] s.add_runtime_dependency 'wash_out', '~> 0.9', '>= 0.9.1' - #s.add_runtime_dependency 'virtus', '~> 1.0', '>= 1.0.0' end