aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-24 13:28:45 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-24 15:47:41 +0100
commit49750cc61904ba17060521bd345c6ae526fb1bf8 (patch)
tree8aa8c06a7d6ec58c62dd0741011e8357a19c8b8d /ruby
parent75f48bbb1ae368febe984c10c2db2d0b5cbd7cec (diff)
downloadpaludis-49750cc61904ba17060521bd345c6ae526fb1bf8.tar.gz
paludis-49750cc61904ba17060521bd345c6ae526fb1bf8.tar.xz
FSEntry -> FSPath, FSStat
Fixes: ticket:967
Diffstat (limited to 'ruby')
-rw-r--r--ruby/action.cc2
-rw-r--r--ruby/contents.cc4
-rw-r--r--ruby/dep_tag.cc8
-rw-r--r--ruby/environment.cc10
-rw-r--r--ruby/environment_TEST.rb2
-rw-r--r--ruby/filter.cc4
-rw-r--r--ruby/metadata_key.cc20
-rw-r--r--ruby/package_id.cc2
-rw-r--r--ruby/paludis_ruby.hh1
-rw-r--r--ruby/repository.cc4
-rw-r--r--ruby/repository_TEST.rb2
11 files changed, 29 insertions, 30 deletions
diff --git a/ruby/action.cc b/ruby/action.cc
index 1afef7657..42dd6643f 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -700,7 +700,7 @@ namespace
return pretend_action_options_to_value(std::static_pointer_cast<PretendAction>(*p)->options);
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
diff --git a/ruby/contents.cc b/ruby/contents.cc
index 10caa1f47..0dd642a89 100644
--- a/ruby/contents.cc
+++ b/ruby/contents.cc
@@ -174,7 +174,7 @@ namespace
if (1 == argc)
{
ptr = new std::shared_ptr<const ContentsEntry>(std::make_shared<A_>(
- FSEntry(StringValuePtr(argv[0]))));
+ FSPath(StringValuePtr(argv[0]))));
}
else
{
@@ -200,7 +200,7 @@ namespace
if (2 == argc)
{
ptr = new std::shared_ptr<const ContentsEntry>(std::make_shared<ContentsSymEntry>(
- FSEntry(StringValuePtr(argv[0])), StringValuePtr(argv[1])));
+ FSPath(StringValuePtr(argv[0])), StringValuePtr(argv[1])));
}
else
{
diff --git a/ruby/dep_tag.cc b/ruby/dep_tag.cc
index e0d971616..5d4309751 100644
--- a/ruby/dep_tag.cc
+++ b/ruby/dep_tag.cc
@@ -136,7 +136,7 @@ namespace
try
{
ptr = new std::shared_ptr<const DepTag>(std::make_shared<GLSADepTag>(StringValuePtr(argv[0]), StringValuePtr(argv[1]),
- FSEntry(StringValuePtr(argv[2]))));
+ FSPath(StringValuePtr(argv[2]))));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const DepTag> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
return tdata;
@@ -240,8 +240,8 @@ namespace
*
* Fetch our GLSA file.
*/
- template <typename T_, const FSEntry (T_::* m_) () const>
- struct DepTagFSEntryThings
+ template <typename T_, const FSPath (T_::* m_) () const>
+ struct DepTagFSPathThings
{
static VALUE
fetch(VALUE self)
@@ -286,7 +286,7 @@ namespace
rb_define_singleton_method(c_glsa_dep_tag, "new", RUBY_FUNC_CAST(&glsa_dep_tag_new), -1);
rb_define_method(c_glsa_dep_tag, "glsa_title", RUBY_FUNC_CAST((&DepTagThings<GLSADepTag,
&GLSADepTag::glsa_title>::fetch)), 0);
- rb_define_method(c_glsa_dep_tag, "glsa_file", RUBY_FUNC_CAST((&DepTagFSEntryThings<GLSADepTag,
+ rb_define_method(c_glsa_dep_tag, "glsa_file", RUBY_FUNC_CAST((&DepTagFSPathThings<GLSADepTag,
&GLSADepTag::glsa_file>::fetch)), 0);
/*
diff --git a/ruby/environment.cc b/ruby/environment.cc
index f348018f9..a33172a70 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -331,7 +331,7 @@ namespace
try
{
std::string write_cache, master_repository_name;
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
if (1 == argc)
{
write_cache = "/var/empty/";
@@ -356,7 +356,7 @@ namespace
for (int i(0) ; i < RARRAY_LEN(argv[3]) ; ++i)
{
VALUE entry(rb_ary_entry(argv[3], i));
- extra_repository_dirs->push_back(stringify(StringValuePtr(entry)));
+ extra_repository_dirs->push_back(FSPath(stringify(StringValuePtr(entry))));
}
}
else
@@ -380,7 +380,7 @@ namespace
n::extra_repository_dirs() = extra_repository_dirs,
n::master_repository_name() = master_repository_name,
n::profiles_if_not_auto() = "",
- n::repository_dir() = FSEntry(path),
+ n::repository_dir() = FSPath(path),
n::repository_type() = no_config_environment::ncer_auto,
n::write_cache() = write_cache
)));
@@ -494,9 +494,9 @@ namespace
rb_define_method(c_environment, "format_key",
RUBY_FUNC_CAST((&EnvironmentKey<MetadataValueKey<std::string> , &Environment::format_key>::fetch)), 0);
rb_define_method(c_environment, "config_location_key",
- RUBY_FUNC_CAST((&EnvironmentKey<MetadataValueKey<FSEntry>, &Environment::config_location_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&EnvironmentKey<MetadataValueKey<FSPath>, &Environment::config_location_key>::fetch)), 0);
rb_define_method(c_environment, "preferred_root_key",
- RUBY_FUNC_CAST((&EnvironmentKey<MetadataValueKey<FSEntry>, &Environment::preferred_root_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&EnvironmentKey<MetadataValueKey<FSPath>, &Environment::preferred_root_key>::fetch)), 0);
/*
* Document-class: Paludis::PaludisEnvironment
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index fd068b890..22ac5c4c1 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -400,7 +400,7 @@ module Paludis
def test_config_location_key
assert_respond_to env, :config_location_key
assert_not_nil env.config_location_key
- assert_kind_of MetadataFSEntryKey, env.config_location_key
+ assert_kind_of MetadataFSPathKey, env.config_location_key
assert_equal Dir.getwd().to_s + "/environment_TEST_dir/home/.paludis", env.config_location_key.value
assert_respond_to ncenv, :config_location_key
diff --git a/ruby/filter.cc b/ruby/filter.cc
index f669ce14f..a148d2102 100644
--- a/ruby/filter.cc
+++ b/ruby/filter.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -83,7 +83,7 @@ namespace
Filter * ptr(0);
try
{
- FSEntry root(StringValuePtr(root_v));
+ FSPath root(StringValuePtr(root_v));
ptr = new filter::InstalledAtRoot(root);
VALUE data(Data_Wrap_Struct(self, 0, &Common<Filter>::free, ptr));
rb_obj_call_init(data, 1, &root_v);
diff --git a/ruby/metadata_key.cc b/ruby/metadata_key.cc
index 3a9cba2a7..313bde609 100644
--- a/ruby/metadata_key.cc
+++ b/ruby/metadata_key.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2007, 2008 Richard Brown
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -152,7 +152,7 @@ namespace
new std::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataValueKey<FSEntry> &)
+ void visit(const MetadataValueKey<FSPath> &)
{
value = Data_Wrap_Struct(c_metadata_fsentry_key, 0, &Common<std::shared_ptr<const MetadataKey> >::free,
new std::shared_ptr<const MetadataKey>(mm));
@@ -188,7 +188,7 @@ namespace
new std::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataCollectionKey<FSEntrySequence> &)
+ void visit(const MetadataCollectionKey<FSPathSequence> &)
{
value = Data_Wrap_Struct(c_metadata_fsentry_sequence_key, 0, &Common<std::shared_ptr<const MetadataKey> >::free,
new std::shared_ptr<const MetadataKey>(mm));
@@ -348,7 +348,7 @@ namespace
{
std::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, std::shared_ptr<const MetadataKey>, self_ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const MetadataValueKey<FSEntry> >(*self_ptr))->value()).c_str());
+ return rb_str_new2(stringify((std::static_pointer_cast<const MetadataValueKey<FSPath> >(*self_ptr))->value()).c_str());
}
catch (const std::exception & e)
{
@@ -700,11 +700,11 @@ namespace
rb_define_method(c_metadata_size_key, "value", RUBY_FUNC_CAST(&metadata_size_key_value), 0);
/*
- * Document-class: Paludis::MetadataFSEntryKey
+ * Document-class: Paludis::MetadataFSPathKey
*
- * Metadata class for FSEntry.
+ * Metadata class for FSPath.
*/
- c_metadata_fsentry_key = rb_define_class_under(paludis_module(), "MetadataFSEntryKey", c_metadata_key);
+ c_metadata_fsentry_key = rb_define_class_under(paludis_module(), "MetadataFSPathKey", c_metadata_key);
rb_define_method(c_metadata_fsentry_key, "value", RUBY_FUNC_CAST(&metadata_fsentry_key_value), 0);
/*
@@ -756,12 +756,12 @@ namespace
rb_define_method(c_metadata_package_id_sequence_key, "value", RUBY_FUNC_CAST((&SetValue<PackageIDSequence>::fetch)), 0);
/*
- * Document-class: Paludis::MetadataFSEntrySequenceKey
+ * Document-class: Paludis::MetadataFSPathSequenceKey
*
* Metadata class for filesystem sequences.
*/
- c_metadata_fsentry_sequence_key = rb_define_class_under(paludis_module(), "MetadataFSEntrySequenceKey", c_metadata_key);
- rb_define_method(c_metadata_fsentry_sequence_key, "value", RUBY_FUNC_CAST((&SetValue<FSEntrySequence>::fetch)), 0);
+ c_metadata_fsentry_sequence_key = rb_define_class_under(paludis_module(), "MetadataFSPathSequenceKey", c_metadata_key);
+ rb_define_method(c_metadata_fsentry_sequence_key, "value", RUBY_FUNC_CAST((&SetValue<FSPathSequence>::fetch)), 0);
/*
* Document-class: Paludis::MetadataStringSetKey
diff --git a/ruby/package_id.cc b/ruby/package_id.cc
index 9f9f8e5df..45ac02b2c 100644
--- a/ruby/package_id.cc
+++ b/ruby/package_id.cc
@@ -534,7 +534,7 @@ namespace
rb_define_method(c_package_id, "from_repositories_key", RUBY_FUNC_CAST((&KeyValue<MetadataCollectionKey<Set<std::string> >,
&PackageID::from_repositories_key>::fetch)), 0);
rb_define_method(c_package_id, "fs_location_key", RUBY_FUNC_CAST((
- &KeyValue<MetadataValueKey<FSEntry>, &PackageID::fs_location_key>::fetch)), 0);
+ &KeyValue<MetadataValueKey<FSPath>, &PackageID::fs_location_key>::fetch)), 0);
rb_define_method(c_package_id, "fetches_key", RUBY_FUNC_CAST((
&KeyValue<MetadataSpecTreeKey<FetchableURISpecTree>, &PackageID::fetches_key>::fetch)), 0);
rb_define_method(c_package_id, "choices_key", RUBY_FUNC_CAST((
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 0155f7b24..8ac703083 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -26,7 +26,6 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/singleton.hh>
#include <paludis/environment.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
diff --git a/ruby/repository.cc b/ruby/repository.cc
index ef58486d7..944d038bb 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -643,9 +643,9 @@ namespace
rb_define_method(c_repository, "format_key",
RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<std::string> , &Repository::format_key>::fetch)), 0);
rb_define_method(c_repository, "location_key",
- RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSEntry>, &Repository::location_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSPath>, &Repository::location_key>::fetch)), 0);
rb_define_method(c_repository, "installed_root_key",
- RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSEntry>, &Repository::installed_root_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSPath>, &Repository::installed_root_key>::fetch)), 0);
rb_define_method(c_repository, "get_environment_variable", RUBY_FUNC_CAST(&repository_get_environment_variable), 2);
rb_define_method(c_repository, "accept_keywords_key",
RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<std::string> , &Repository::accept_keywords_key>::fetch)), 0);
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 2acea00e6..7a5b788db 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -386,7 +386,7 @@ module Paludis
def test_installed_root_key
assert_nil repo.installed_root_key
- assert_kind_of MetadataFSEntryKey, installed_repo.installed_root_key
+ assert_kind_of MetadataFSPathKey, installed_repo.installed_root_key
assert_equal '/', installed_repo.installed_root_key.value
end