Hello community, here is the log from the commit of package rubygem-moneta for openSUSE:Factory checked in at 2017-03-21 22:49:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-moneta (Old) and /work/SRC/openSUSE:Factory/.rubygem-moneta.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-moneta" Tue Mar 21 22:49:16 2017 rev:6 rq:479653 version:1.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-moneta/rubygem-moneta.changes 2016-12-29 22:45:48.296046157 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-moneta.new/rubygem-moneta.changes 2017-03-21 22:49:25.379852448 +0100 @@ -1,0 +2,12 @@ +Thu Mar 9 05:52:51 UTC 2017 - co...@suse.com + +- updated to version 1.0.0 + see installed CHANGES + + 1.0.0 + + * Adapters::Sequel - allow usage of Sequel extensions and connection validation + * ActiveSupport::Cache::MonetaStore - dup options before mutating them + * ActiveSupport::Cache::MonetaStore - allow writing raw values + +------------------------------------------------------------------- Old: ---- moneta-0.8.1.gem New: ---- moneta-1.0.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-moneta.spec ++++++ --- /var/tmp/diff_new_pack.5UP6I5/_old 2017-03-21 22:49:26.055756894 +0100 +++ /var/tmp/diff_new_pack.5UP6I5/_new 2017-03-21 22:49:26.059756328 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-moneta # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-moneta -Version: 0.8.1 +Version: 1.0.0 Release: 0 %define mod_name moneta %define mod_full_name %{mod_name}-%{version} ++++++ moneta-0.8.1.gem -> moneta-1.0.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGES new/CHANGES --- old/CHANGES 2016-12-13 15:01:21.000000000 +0100 +++ new/CHANGES 2017-03-08 10:44:08.000000000 +0100 @@ -1,3 +1,9 @@ +1.0.0 + +* Adapters::Sequel - allow usage of Sequel extensions and connection validation +* ActiveSupport::Cache::MonetaStore - dup options before mutating them +* ActiveSupport::Cache::MonetaStore - allow writing raw values + 0.8.1 * Adapters::TokyoTyrant - more consistent error handling diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CONTRIBUTORS new/CONTRIBUTORS --- old/CONTRIBUTORS 2016-12-13 15:01:21.000000000 +0100 +++ new/CONTRIBUTORS 2017-03-08 10:44:08.000000000 +0100 @@ -26,6 +26,8 @@ Quin Hoxie <q...@aboutus.org> Ryan T. Hosford <tad.hosf...@gmail.com> Scott Wadden <scott.wad...@gmail.com> +Timo Goebel <timo.goe...@dm.de> Tom Meier <ozme...@yahoo.co.uk> +Tony Han <h.bing...@gmail.com> Xavier Shay <xav...@rhnh.net> Yehuda Katz <wyc...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile --- old/Gemfile 2016-12-13 15:01:21.000000000 +0100 +++ new/Gemfile 2017-03-08 10:44:08.000000000 +0100 @@ -16,6 +16,7 @@ gem 'msgpack-jruby', platforms: :jruby gem 'bert', platforms: :ruby gem 'php_serialize' +gem 'nokogiri', '~> 1.6.0' # Compressors used by Transformer gem 'rbzip2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/LICENSE new/LICENSE --- old/LICENSE 2016-12-13 15:01:21.000000000 +0100 +++ new/LICENSE 2017-03-08 10:44:08.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2009 - 2014 Daniel Mendler, Yehuda Katz +Copyright (c) 2009 - 2017 Daniel Mendler, Yehuda Katz, Alastair Pharo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/cache/moneta_store.rb new/lib/active_support/cache/moneta_store.rb --- old/lib/active_support/cache/moneta_store.rb 2016-12-13 15:01:21.000000000 +0100 +++ new/lib/active_support/cache/moneta_store.rb 2017-03-08 10:44:08.000000000 +0100 @@ -38,7 +38,8 @@ end def write_entry(key, entry, options) - @store.store(key, entry, moneta_options(options)) + value = options[:raw] ? entry.value.to_s : entry + @store.store(key, value, moneta_options(options)) true end @@ -50,9 +51,9 @@ private def moneta_options(options) - options ||= {} - options[:expires] = options.delete(:expires_in).to_i if options.include?(:expires_in) - options + new_options = options ? options.dup : {} + new_options[:expires] = new_options.delete(:expires_in).to_i if new_options.include?(:expires_in) + new_options end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/moneta/adapters/sequel.rb new/lib/moneta/adapters/sequel.rb --- old/lib/moneta/adapters/sequel.rb 2016-12-13 15:01:21.000000000 +0100 +++ new/lib/moneta/adapters/sequel.rb 2017-03-08 10:44:08.000000000 +0100 @@ -17,15 +17,24 @@ # @param [Hash] options # @option options [String] :db Sequel database # @option options [String/Symbol] :table (:moneta) Table name + # @option options [Array] :extensions ([]) List of Sequel extensions + # @option options [Integer] :connection_validation_timeout (nil) Sequel connection_validation_timeout # @option options All other options passed to `Sequel#connect` # @option options [Sequel connection] :backend Use existing backend instance def initialize(options = {}) table = (options.delete(:table) || :moneta).to_sym + extensions = options.delete(:extensions) || [] + raise ArgumentError, 'Option :extensions must be an Array' unless extensions.is_a?(Array) + connection_validation_timeout = options.delete(:connection_validation_timeout) @backend = options[:backend] || begin raise ArgumentError, 'Option :db is required' unless db = options.delete(:db) ::Sequel.connect(db, options) end + extensions.each do |extension| + @backend.extension(extension.to_sym) + end + @backend.pool.connection_validation_timeout = connection_validation_timeout if connection_validation_timeout @backend.create_table?(table) do String :k, null: false, primary_key: true File :v diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/moneta/version.rb new/lib/moneta/version.rb --- old/lib/moneta/version.rb 2016-12-13 15:01:21.000000000 +0100 +++ new/lib/moneta/version.rb 2017-03-08 10:44:08.000000000 +0100 @@ -1,5 +1,5 @@ module Moneta # Moneta version number # @api public - VERSION = '0.8.1' + VERSION = '1.0.0' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-12-13 15:01:21.000000000 +0100 +++ new/metadata 2017-03-08 10:44:08.000000000 +0100 @@ -1,22 +1,24 @@ --- !ruby/object:Gem::Specification name: moneta version: !ruby/object:Gem::Version - version: 0.8.1 + version: 1.0.0 platform: ruby authors: - Daniel Mendler - Yehuda Katz - Hannes Georg +- Alastair Pharo autorequire: bindir: bin cert_chain: [] -date: 2016-12-14 00:00:00.000000000 Z +date: 2017-03-08 00:00:00.000000000 Z dependencies: [] description: A unified interface to key/value stores email: - m...@daniel-mendler.de - wyc...@gmail.com - hannes.ge...@googlemail.com +- asp...@gmail.com executables: [] extensions: [] extra_rdoc_files: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/moneta.gemspec new/moneta.gemspec --- old/moneta.gemspec 2016-12-13 15:01:21.000000000 +0100 +++ new/moneta.gemspec 2017-03-08 10:44:08.000000000 +0100 @@ -6,8 +6,8 @@ s.name = 'moneta' s.version = Moneta::VERSION s.date = Date.today.to_s - s.authors = ['Daniel Mendler', 'Yehuda Katz', 'Hannes Georg'] - s.email = %w{m...@daniel-mendler.de wyc...@gmail.com hannes.ge...@googlemail.com} + s.authors = ['Daniel Mendler', 'Yehuda Katz', 'Hannes Georg', 'Alastair Pharo'] + s.email = %w{m...@daniel-mendler.de wyc...@gmail.com hannes.ge...@googlemail.com asp...@gmail.com} s.description = 'A unified interface to key/value stores' s.extra_rdoc_files = %w{README.md SPEC.md LICENSE} s.files = `git ls-files`.split("\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/script/parallel-tests new/script/parallel-tests --- old/script/parallel-tests 2016-12-13 15:01:21.000000000 +0100 +++ new/script/parallel-tests 2017-03-08 10:44:08.000000000 +0100 @@ -68,6 +68,18 @@ parallel << serial end end + +# The activesupport cache specs also use memcached +activesupport_cache_specs = specs.grep(/active_support.+cache/) +specs -= activesupport_cache_specs + +if memcache_specs = parallel.find{ |serial| serial.all?{ |s| s.match /memcached/ } } + activesupport_cache_specs.each(&memcache_specs.method(:push)) +else + parallel += activesupport_cache_specs +end + +# All the left-overs parallel += specs.map {|s| [s] } threads = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/active_support/cache_moneta_store_spec.rb new/spec/active_support/cache_moneta_store_spec.rb --- old/spec/active_support/cache_moneta_store_spec.rb 2016-12-13 15:01:21.000000000 +0100 +++ new/spec/active_support/cache_moneta_store_spec.rb 2017-03-08 10:44:08.000000000 +0100 @@ -3,7 +3,20 @@ require 'active_support/cache/moneta_store' require 'ostruct' -describe ActiveSupport::Cache::MonetaStore do +module MonetaStoreHelpers + def with_notifications + described_class.instrument = true + yield + ensure + described_class.instrument = false + end +end + +RSpec.configure do |config| + config.include(MonetaStoreHelpers) +end + +describe "cache_moneta_store" do before(:all) do @events = [] ActiveSupport::Notifications.subscribe(/^cache_(.*)\.active_support$/) do |*args| @@ -13,185 +26,234 @@ before(:each) do @events.clear - @store = ActiveSupport::Cache::MonetaStore.new(store: Moneta.new(:Memory)) - @rabbit = OpenStruct.new name: 'bunny' - @white_rabbit = OpenStruct.new color: 'white' - - @store.write 'rabbit', @rabbit - @store.delete 'counter' - @store.delete 'rub-a-dub' end - it 'reads the data' do - @store.read('rabbit').should == @rabbit - end + # All stores should implement this basic behavior. + shared_examples :basic_store do + before(:each) do + @rabbit = OpenStruct.new name: 'bunny' + @white_rabbit = OpenStruct.new color: 'white' - it 'writes the data' do - @store.write 'rabbit', @white_rabbit - @store.read('rabbit').should == @white_rabbit - end + store.clear + store.write 'rabbit', @rabbit + end - it 'writes the data with expiration time' do - @store.write 'rabbit', @white_rabbit, expires_in: 1.second - @store.read('rabbit').should == @white_rabbit - sleep 2 - @store.read('rabbit').should be_nil - end + it 'reads the data' do + store.read('rabbit').should == @rabbit + end - it 'deletes data' do - @store.delete 'rabbit' - @store.read('rabbit').should be_nil - end + it 'writes the data' do + store.write 'rabbit', @white_rabbit + store.read('rabbit').should == @white_rabbit + end - it 'verifies existence of an object in the store' do - @store.exist?('rabbit').should == true - (!!@store.exist?('rab-a-dub')).should == false - end + it 'deletes data' do + store.delete 'rabbit' + store.read('rabbit').should be_nil + end - it 'fetches data' do - @store.fetch('rabbit').should == @rabbit - @store.fetch('rub-a-dub').should be_nil - @store.fetch('rub-a-dub') { 'Flora de Cana' } - @store.fetch('rub-a-dub').should == 'Flora de Cana' - @store.fetch('rabbit', force: true) # force cache miss - @store.fetch('rabbit', force: true, expires_in: 1.second) { @white_rabbit } - @store.fetch('rabbit').should == @white_rabbit - sleep 2 - @store.fetch('rabbit').should be_nil - end + it 'verifies existence of an object in the store' do + store.exist?('rabbit').should be true + (!!store.exist?('rab-a-dub')).should be false + end - it 'reads multiple keys' do - @store.write 'irish whisky', 'Jameson' - result = @store.read_multi 'rabbit', 'irish whisky' - result['rabbit'].should == @rabbit - result['irish whisky'].should == 'Jameson' - end + it 'fetches data' do + store.fetch('rabbit').should == @rabbit + store.fetch('rub-a-dub').should be_nil + store.fetch('rub-a-dub') { 'Flora de Cana' } + store.fetch('rub-a-dub').should == 'Flora de Cana' + end - it 'reads multiple keys and returns only the matched ones' do - @store.delete 'irish whisky' - result = @store.read_multi 'rabbit', 'irish whisky' - result.should_not include('irish whisky') - result.should include('rabbit') - end + it 'reads multiple keys' do + store.write 'irish whisky', 'Jameson' + result = store.read_multi 'rabbit', 'irish whisky' + result['rabbit'].should == @rabbit + result['irish whisky'].should == 'Jameson' + end - it 'increments a key' do - 3.times { @store.increment 'counter' } - @store.read('counter', raw: true).should == '3' + it 'reads multiple keys and returns only the matched ones' do + store.delete 'irish whisky' + result = store.read_multi 'rabbit', 'irish whisky' + result.should_not include('irish whisky') + result.should include('rabbit') + end end - it 'decrements a key' do - 3.times { @store.increment 'counter' } - 2.times { @store.decrement 'counter' } - @store.read('counter', raw: true).should == '1' - end + shared_examples :expiry do + it 'writes the data with expiration time' do + store.write 'rabbit', @white_rabbit, expires_in: 1.second + store.read('rabbit').should == @white_rabbit + sleep 2 + store.read('rabbit').should be_nil + end + + it "sets expiry on cache miss" do + store.fetch('rabbit', force: true) # force cache miss + store.fetch('rabbit', force: true, expires_in: 1.second) { @white_rabbit } + store.fetch('rabbit').should == @white_rabbit + sleep 2 + store.fetch('rabbit').should be_nil + end - it 'increments a key by given value' do - @store.increment 'counter', 3 - @store.read('counter', raw: true).should == '3' + it 'does not set expiry on cache hit' do + store.fetch('rabbit', expires_in: 1.second) { @white_rabbit }.should == @rabbit + sleep 2 + store.fetch('rabbit').should == @rabbit + end end - it 'decrements a key by given value' do - 3.times { @store.increment 'counter' } - @store.decrement 'counter', 2 - @store.read('counter', raw: true).should == '1' + # A store *may* implement this + shared_examples :increment_decrement do + it 'increments a key' do + store.write 'counter', 0, raw: true + 3.times { store.increment 'counter' } + store.read('counter', raw: true).to_i.should == 3 + end + + it 'decrements a key' do + store.write 'counter', 0, raw: true + 3.times { store.increment 'counter' } + 2.times { store.decrement 'counter' } + store.read('counter', raw: true).to_i.should == 1 + end + + it 'increments a key by given value' do + store.write 'counter', 0, raw: true + store.increment 'counter', 3 + store.read('counter', raw: true).to_i.should == 3 + end + + it 'decrements a key by given value' do + store.write 'counter', 0, raw: true + 3.times { store.increment 'counter' } + store.decrement 'counter', 2 + store.read('counter', raw: true).to_i.should == 1 + end end - describe 'notifications' do + shared_examples :basic_instrumentation do it 'notifies on #fetch' do with_notifications do - @store.fetch('radiohead') { 'House Of Cards' } + store.fetch('radiohead') { 'House Of Cards' } end - read, generate, write = @events - + read = @events.shift read.name.should == 'cache_read.active_support' read.payload.should == { key: 'radiohead', super_operation: :fetch } + generate = @events.shift generate.name.should == 'cache_generate.active_support' generate.payload.should == { key: 'radiohead' } + write = @events.shift write.name.should == 'cache_write.active_support' write.payload.should == { key: 'radiohead' } end it 'notifies on #read' do with_notifications do - @store.read 'metallica' + store.read 'metallica' end - read = @events.first + read = @events.shift read.name.should == 'cache_read.active_support' read.payload.should == { key: 'metallica', hit: false } end it 'notifies on #write' do with_notifications do - @store.write 'depeche mode', 'Enjoy The Silence' + store.write 'depeche mode', 'Enjoy The Silence' end - write = @events.first + write = @events.shift write.name.should == 'cache_write.active_support' write.payload.should == { key: 'depeche mode' } end it 'notifies on #delete' do with_notifications do - @store.delete 'the new cardigans' + store.delete 'the new cardigans' end - delete = @events.first + delete = @events.shift delete.name.should == 'cache_delete.active_support' delete.payload.should == { key: 'the new cardigans' } end it 'notifies on #exist?' do with_notifications do - @store.exist? 'the smiths' + store.exist? 'the smiths' end - exist = @events.first + exist = @events.shift exist.name.should == 'cache_exist?.active_support' exist.payload.should == { key: 'the smiths' } end + end + + # This doesn't seem to be documented at all, so we follow the + # behavior of MemCacheStore. + shared_examples :increment_decrement_instrumentation do it 'notifies on #increment' do with_notifications do - @store.increment 'pearl jam' + store.increment 'pearl jam' end - increment = @events.first + increment = @events.shift increment.name.should == 'cache_increment.active_support' increment.payload.should == { key: 'pearl jam', amount: 1 } end it 'notifies on #decrement' do with_notifications do - @store.decrement 'placebo' + store.decrement 'placebo' end - decrement = @events.first + decrement = @events.shift decrement.name.should == 'cache_decrement.active_support' decrement.payload.should == { key: 'placebo', amount: 1 } end + end - it 'should notify on clear' do + describe ActiveSupport::Cache::MonetaStore do + let(:store){ described_class.new(store: Moneta.new(:Memory)) } + + include_examples :basic_store + include_examples :expiry + include_examples :increment_decrement + include_examples :basic_instrumentation + include_examples :increment_decrement_instrumentation + + # FIXME: no other store does this -- perhaps this should be + # removed. + it 'notifies on #clear' do with_notifications do - @store.clear + store.clear end - clear = @events.first + clear = @events.shift clear.name.should == 'cache_clear.active_support' clear.payload.should == { key: nil } end end - private + describe ActiveSupport::Cache::MemoryStore do + let(:store){ described_class.new } - def with_notifications - ActiveSupport::Cache::MonetaStore.instrument = true - yield - ensure - ActiveSupport::Cache::MonetaStore.instrument = false + include_examples :basic_store + include_examples :expiry + include_examples :increment_decrement + include_examples :basic_instrumentation + end + + describe ActiveSupport::Cache::MemCacheStore do + let(:store){ described_class.new } + + include_examples :basic_store + include_examples :expiry + include_examples :increment_decrement + include_examples :basic_instrumentation + include_examples :increment_decrement_instrumentation end end -