debian/0000755000000000000000000000000012133006372007163 5ustar debian/rules0000755000000000000000000000070412133006372010244 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) export DH_RUBY_IGNORE_TESTS=ruby1.8 # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby debian/compat0000644000000000000000000000000212133006372010361 0ustar 7 debian/copyright0000644000000000000000000000252412133006372011121 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: yaml_db Source: https://github.com/lostapathy/yaml_db Files: * Copyright: 200? Orion Henry and Adam Wiggins of Heroku License: Expat Files: debian/* Copyright: 2013 Ondřej Surý License: Expat License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/source/0000755000000000000000000000000012133006372010463 5ustar debian/source/format0000644000000000000000000000001412133006372011671 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000014312133006372010212 0ustar version=3 http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/yaml_db .*/yaml_db-(.*).tar.gz debian/ruby-tests.rake0000644000000000000000000000022312133006372012145 0ustar require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = './spec/**/*_spec.rb' end task :default => :spec debian/patches/0000755000000000000000000000000012133006372010612 5ustar debian/patches/kill-rubygems.patch0000644000000000000000000000022712133006372014422 0ustar --- a/lib/yaml_db.rb +++ b/lib/yaml_db.rb @@ -1,4 +1,3 @@ -require 'rubygems' require 'yaml' require 'active_record' require 'serialization_helper' debian/patches/series0000644000000000000000000000004112133006372012022 0ustar gitlab.patch kill-rubygems.patch debian/patches/gitlab.patch0000644000000000000000000000644312133006372013104 0ustar diff --git a/spec/yaml_dump_spec.rb b/spec/yaml_dump_spec.rb index 3a73d9a..f808d3e 100644 --- a/spec/yaml_dump_spec.rb +++ b/spec/yaml_dump_spec.rb @@ -1,55 +1,50 @@ require File.dirname(__FILE__) + '/base' describe YamlDb::Dump do - - before do - silence_warnings { ActiveRecord::Base = mock('ActiveRecord::Base', :null_object => true) } - ActiveRecord::Base.stub(:connection).and_return(stub('connection').as_null_object) - ActiveRecord::Base.connection.stub!(:tables).and_return([ 'mytable', 'schema_info', 'schema_migrations' ]) - ActiveRecord::Base.connection.stub!(:columns).with('mytable').and_return([ mock('a',:name => 'a', :type => :string), mock('b', :name => 'b', :type => :string) ]) - ActiveRecord::Base.connection.stub!(:select_one).and_return({"count"=>"2"}) - ActiveRecord::Base.connection.stub!(:select_all).and_return([ { 'a' => 1, 'b' => 2 }, { 'a' => 3, 'b' => 4 } ]) - YamlDb::Utils.stub!(:quote_table).with('mytable').and_return('mytable') - end - - before(:each) do - File.stub!(:new).with('dump.yml', 'w').and_return(StringIO.new) - @io = StringIO.new - end - - it "should return a formatted string" do - YamlDb::Dump.table_record_header(@io) - @io.rewind - @io.read.should == " records: \n" - end - - - it "should return a yaml string that contains a table header and column names" do - YamlDb::Dump.stub!(:table_column_names).with('mytable').and_return([ 'a', 'b' ]) - YamlDb::Dump.dump_table_columns(@io, 'mytable') - @io.rewind - @io.read.should == < true) } + ActiveRecord::Base.stub(:connection).and_return(stub('connection').as_null_object) + ActiveRecord::Base.connection.stub!(:tables).and_return([ 'mytable', 'schema_info', 'schema_migrations' ]) + ActiveRecord::Base.connection.stub!(:columns).with('mytable').and_return([ mock('a',:name => 'a', :type => :string), mock('b', :name => 'b', :type => :string) ]) + ActiveRecord::Base.connection.stub!(:select_one).and_return({"count"=>"2"}) + ActiveRecord::Base.connection.stub!(:select_all).and_return([ { 'a' => 1, 'b' => 2 }, { 'a' => 3, 'b' => 4 } ]) + YamlDb::Utils.stub!(:quote_table).with('mytable').and_return('mytable') + end + + before(:each) do + File.stub!(:new).with('dump.yml', 'w').and_return(StringIO.new) + @io = StringIO.new + end + + it "should return a formatted string" do + YamlDb::Dump.table_record_header(@io) + @io.rewind + @io.read.should == " records: \n" + end + + it "should return a yaml string that contains a table header and column names" do + YamlDb::Dump.stub!(:table_column_names).with('mytable').and_return([ 'a', 'b' ]) + YamlDb::Dump.dump_table_columns(@io, 'mytable') + @io.rewind + @io.read.should == < Uploaders: Ondřej Surý DM-Upload-Allowed: yes Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~), ruby-rails-3.2, ruby-rspec Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-ruby-extras/ruby-yaml-db.git Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/ruby-yaml-db.git;a=summary Homepage: http://github.com/ludicast/yaml_db XS-Ruby-Versions: all Package: ruby-yaml-db Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Description: library to export/import of database into/from yaml files YamlDb is a database-independent format for dumping and restoring data from any database that has an ActiveRecord adapter. . This can be used as a replacement for mysqldump or pg_dump, but only for the databases typically used by Rails apps. Users, permissions, schemas, triggers, and other advanced database features are not supported - by design. debian/changelog0000644000000000000000000000055112133006372011036 0ustar ruby-yaml-db (0.2.3-1) unstable; urgency=low * Initial release (Closes: #705477) * debian/patches: + Add gitlab patch to fix tests + Add patch to kill rubygems dependency * debian/control: Require whole ruby-rails-3.2 stack for tests * debian/rules: Ignore tests on ruby1.8 -- Ondřej Surý Mon, 15 Apr 2013 16:17:37 +0200