From 1aaf0c4d30ed9a52bf9f3b93caed3908e70856f9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 22 Jan 2017 15:38:12 +0100 Subject: [PATCH] Fix store handle class name to fit convention --- libimagruby/src/entry.rs | 10 +++++----- libimagruby/src/store.rs | 18 +++++++++--------- libimagruby/test/test_ruby.rb | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/libimagruby/src/entry.rs b/libimagruby/src/entry.rs index dcb3f0d5..0e544d2a 100644 --- a/libimagruby/src/entry.rs +++ b/libimagruby/src/entry.rs @@ -55,10 +55,10 @@ impl FileLockEntryHandle { } wrappable_struct!(FileLockEntryHandle, FileLockEntryWrapper, FLE_WRAPPER); -class!(RFileLockEntry); -impl_unwrap!(RFileLockEntry, FileLockEntryHandle, FLE_WRAPPER); +class!(RFileLockEntryHandle); impl_wrap!(FileLockEntryHandle, FLE_WRAPPER); -impl_verified_object!(RFileLockEntry); +impl_unwrap!(RFileLockEntryHandle, FileLockEntryHandle, FLE_WRAPPER); +impl_verified_object!(RFileLockEntryHandle); /// Helper macro for operating on RUBY_STORE_CACHE object /// @@ -119,7 +119,7 @@ macro_rules! call_on_fle_from_store { methods!( - RFileLockEntry, + RFileLockEntryHandle, itself, fn r_get_location() -> AnyObject { @@ -252,7 +252,7 @@ class!(REntry); impl_unwrap!(REntry, Entry, ENTRY_WRAPPER); pub fn setup_filelockentry() -> Class { - let mut class = Class::new("RFileLockEntry", None); + let mut class = Class::new("RFileLockEntryHandle", None); class.define(|itself| { itself.def("location", r_get_location); itself.def("header" , r_get_header); diff --git a/libimagruby/src/store.rs b/libimagruby/src/store.rs index 32a69c20..e1d16a17 100644 --- a/libimagruby/src/store.rs +++ b/libimagruby/src/store.rs @@ -31,14 +31,14 @@ use util::Wrap; use util::Unwrap; use storeid::RStoreId; -use entry::RFileLockEntry; +use entry::RFileLockEntryHandle; use cache::StoreHandle; wrappable_struct!(StoreHandle, StoreWrapper, STORE_WRAPPER); -class!(RStore); +class!(RStoreHandle); impl_wrap!(StoreHandle, STORE_WRAPPER); -impl_unwrap!(RStore, StoreHandle, STORE_WRAPPER); -impl_verified_object!(RStore); +impl_unwrap!(RStoreHandle, StoreHandle, STORE_WRAPPER); +impl_verified_object!(RStoreHandle); macro_rules! call_on_store_by_handle { { @@ -141,7 +141,7 @@ macro_rules! call_on_store { } methods!( - RStore, + RStoreHandle, itself, // Build a new Store object, return a handle to it. @@ -403,7 +403,7 @@ methods!( // On success: Nil // On error: Nil + Exception // - fn update(fle: RFileLockEntry) -> NilClass { + fn update(fle: RFileLockEntryHandle) -> NilClass { let fle = typecheck!(fle).unwrap().fle_handle().clone(); call_on_store! { @@ -450,7 +450,7 @@ methods!( // On success: Nil // On error: Nil + Exception // - fn save_to(fle: RFileLockEntry, sid: RStoreId) -> NilClass { + fn save_to(fle: RFileLockEntryHandle, sid: RStoreId) -> NilClass { let fle = typecheck!(fle).unwrap().fle_handle().clone(); let sid = typecheck!(sid).unwrap().clone(); @@ -475,7 +475,7 @@ methods!( // On success: Nil // On error: Nil + Exception // - fn save_as(fle: RFileLockEntry, sid: RStoreId) -> NilClass { + fn save_as(fle: RFileLockEntryHandle, sid: RStoreId) -> NilClass { let fle = typecheck!(fle).unwrap().fle_handle().clone(); let sid = typecheck!(sid).unwrap().clone(); @@ -540,7 +540,7 @@ methods!( ); pub fn setup() -> Class { - let mut class = Class::new("RStore", None); + let mut class = Class::new("RStoreHandle", None); class.define(|itself| { itself.def_self("new" , new); itself.def("create" , create); diff --git a/libimagruby/test/test_ruby.rb b/libimagruby/test/test_ruby.rb index c1a32fdd..fe1d7d54 100644 --- a/libimagruby/test/test_ruby.rb +++ b/libimagruby/test/test_ruby.rb @@ -36,14 +36,14 @@ end puts "---" -works "RStoreId.new_baseless" , (not RStoreId.new_baseless("test").nil?) -works "RStore.respond_to? :new" , (RStore.respond_to? :new) -works "RStore.instance_methods.include? :create" , (RStore.instance_methods.include? :create) -works "RStore.instance_methods.include? :get" , (RStore.instance_methods.include? :get) -works "RStore.instance_methods.include? :retrieve" , (RStore.instance_methods.include? :retrieve) -works "RStore.instance_methods.include? :delete" , (RStore.instance_methods.include? :delete) -works "RStore.instance_methods.include? :update" , (RStore.instance_methods.include? :update) -works "RStore.instance_methods.include? :move_by_id" , (RStore.instance_methods.include? :move_by_id) -works "RStore.instance_methods.include? :save_as" , (RStore.instance_methods.include? :save_as) -works "RStore.instance_methods.include? :save_to" , (RStore.instance_methods.include? :save_to) +works "RStoreId.new_baseless" , (not RStoreId.new_baseless("test").nil?) +works "RStoreHandle.respond_to? :new" , (RStoreHandle.respond_to? :new) +works "RStoreHandle.instance_methods.include? :create" , (RStoreHandle.instance_methods.include? :create) +works "RStoreHandle.instance_methods.include? :get" , (RStoreHandle.instance_methods.include? :get) +works "RStoreHandle.instance_methods.include? :retrieve" , (RStoreHandle.instance_methods.include? :retrieve) +works "RStoreHandle.instance_methods.include? :delete" , (RStoreHandle.instance_methods.include? :delete) +works "RStoreHandle.instance_methods.include? :update" , (RStoreHandle.instance_methods.include? :update) +works "RStoreHandle.instance_methods.include? :move_by_id" , (RStoreHandle.instance_methods.include? :move_by_id) +works "RStoreHandle.instance_methods.include? :save_as" , (RStoreHandle.instance_methods.include? :save_as) +works "RStoreHandle.instance_methods.include? :save_to" , (RStoreHandle.instance_methods.include? :save_to)