aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'ruby')
-rw-r--r--ruby/dep_list.cc2
-rw-r--r--ruby/dep_spec.cc8
-rw-r--r--ruby/dep_tag.cc2
-rw-r--r--ruby/mask.cc26
-rw-r--r--ruby/package_id_TEST.rb2
-rw-r--r--ruby/paludis_ruby.hh2
6 files changed, 21 insertions, 21 deletions
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 5b945b152..2c16c3d2d 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -1142,7 +1142,7 @@ namespace
{
rb_raise(rb_eArgError, "Expected one argument, not %d", argc);
}
- (*p)->push_back(std::bind(&override_license, _2));
+ (*p)->push_back(std::bind(&override_license, _1, _2));
}
else
{
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index e3ec5512c..358daad09 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -508,7 +508,7 @@ namespace
{
std::shared_ptr<WrappedSpecBase> * p;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, p);
- return package_dep_spec_to_value(std::make_shared<PackageDepSpec>(
+ return package_dep_spec_to_value(*std::make_shared<PackageDepSpec>(
std::static_pointer_cast<const WrappedSpec<BlockDepSpec> >(*p)->spec()->blocking()));
}
@@ -1348,10 +1348,10 @@ paludis::ruby::value_to_dep_tree(VALUE v)
}
VALUE
-paludis::ruby::package_dep_spec_to_value(const std::shared_ptr<const PackageDepSpec> & p)
+paludis::ruby::package_dep_spec_to_value(const PackageDepSpec & p)
{
std::shared_ptr<const WrappedSpecBase> * v_ptr(new std::shared_ptr<const WrappedSpecBase>(
- std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(p->clone()))));
+ std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(p.clone()))));
return Data_Wrap_Struct(c_package_dep_spec, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, v_ptr);
}
diff --git a/ruby/dep_tag.cc b/ruby/dep_tag.cc
index 5d4309751..908c0b83c 100644
--- a/ruby/dep_tag.cc
+++ b/ruby/dep_tag.cc
@@ -123,7 +123,7 @@ namespace
{
std::shared_ptr<const DepTag> * ptr;
Data_Get_Struct(self, std::shared_ptr<const DepTag>, ptr);
- return package_dep_spec_to_value((std::static_pointer_cast<const DependencyDepTag>(*ptr))->dependency());
+ return package_dep_spec_to_value(*(std::static_pointer_cast<const DependencyDepTag>(*ptr))->dependency());
}
VALUE
diff --git a/ruby/mask.cc b/ruby/mask.cc
index 0f58ae464..0cac96e19 100644
--- a/ruby/mask.cc
+++ b/ruby/mask.cc
@@ -130,19 +130,19 @@ namespace
* Document-method: unaccepted_key
*
* call-seq:
- * unaccepted_key -> MetadataKey or Nil
+ * unaccepted_key -> String
*
- * Fetch the metadata key that is not accepted.
+ * Fetch the name of the metadata key that is not accepted.
*/
/*
* Document-method: mask_key
*
* call-seq:
- * mask_key -> MetadataKey or Nil
+ * mask_key -> String
*
- * Fetch a metadata key explaining the mask.
+ * Fetch the name of a metadata key explaining the mask.
*/
- template <typename T_, const std::shared_ptr<const MetadataKey> (T_::* m_) () const>
+ template <typename T_, const std::string (T_::* m_) () const>
struct MaskMetadataKey
{
static VALUE
@@ -151,13 +151,13 @@ namespace
std::shared_ptr<const Mask> * ptr;
Data_Get_Struct(self, std::shared_ptr<const Mask>, ptr);
std::shared_ptr<const T_> cast_ptr(std::static_pointer_cast<const T_>(*ptr));
- return ((*cast_ptr).*m_)() ? metadata_key_to_value(((*cast_ptr).*m_)()) : Qnil;
+ return rb_str_new2(((*cast_ptr).*m_)().c_str());
}
};
/*
* call-seq:
- * associated_package -> PackageID or Nil
+ * associated_package_spec -> PackageDepSpec
*
* Fetch the associated package.
*/
@@ -167,7 +167,7 @@ namespace
std::shared_ptr<const Mask> * ptr;
Data_Get_Struct(self, std::shared_ptr<const Mask>, ptr);
std::shared_ptr<const AssociationMask> cast_ptr(std::static_pointer_cast<const AssociationMask>(*ptr));
- return (cast_ptr)->associated_package() ? package_id_to_value((cast_ptr)->associated_package()) : Qnil;
+ return package_dep_spec_to_value((cast_ptr)->associated_package_spec());
}
@@ -206,8 +206,8 @@ namespace
* (for example) a MetadataCollectionKey or MetadataSpecTreeKey is not accepted by user configuration.
*/
c_unaccepted_mask = rb_define_class_under(paludis_module(), "UnacceptedMask", c_mask);
- rb_define_method(c_unaccepted_mask, "unaccepted_key",
- RUBY_FUNC_CAST((&MaskMetadataKey<UnacceptedMask,&UnacceptedMask::unaccepted_key>::fetch)), 0);
+ rb_define_method(c_unaccepted_mask, "unaccepted_key_name",
+ RUBY_FUNC_CAST((&MaskMetadataKey<UnacceptedMask,&UnacceptedMask::unaccepted_key_name>::fetch)), 0);
/*
* Document-class: Paludis::RepositoryMask
@@ -215,8 +215,8 @@ namespace
* A RepositoryMask is a Mask that signifies that a PackageID has been marked as masked by a Repository.
*/
c_repository_mask = rb_define_class_under(paludis_module(), "RepositoryMask", c_mask);
- rb_define_method(c_repository_mask, "mask_key",
- RUBY_FUNC_CAST((&MaskMetadataKey<RepositoryMask,&RepositoryMask::mask_key>::fetch)), 0);
+ rb_define_method(c_repository_mask, "mask_key_name",
+ RUBY_FUNC_CAST((&MaskMetadataKey<RepositoryMask,&RepositoryMask::mask_key_name>::fetch)), 0);
/*
* Document-class: Paludis::UnsupportedMask
@@ -238,7 +238,7 @@ namespace
* masked by association.
*/
c_association_mask = rb_define_class_under(paludis_module(), "AssociationMask", c_mask);
- rb_define_method(c_association_mask, "associated_package", RUBY_FUNC_CAST(&association_mask_associated_package), 0);
+ rb_define_method(c_association_mask, "associated_package_spec", RUBY_FUNC_CAST(&association_mask_associated_package), 0);
}
}
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index 169adc23c..a6df86346 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -181,7 +181,7 @@ module Paludis
assert_equal 1, masks.length
mask = masks.first
assert_kind_of RepositoryMask, mask
- assert_equal "repository_mask", mask.mask_key.raw_name
+ assert_equal "repository_mask", mask.mask_key_name
end
def test_hash
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 6888fd28e..925bf2e02 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -99,7 +99,7 @@ namespace paludis
#endif
template <typename T_> VALUE dep_tree_to_value(const std::shared_ptr<const T_> &);
template <typename T_> std::shared_ptr<const T_> value_to_dep_tree(VALUE);
- VALUE package_dep_spec_to_value(const std::shared_ptr<const PackageDepSpec> &);
+ VALUE package_dep_spec_to_value(const PackageDepSpec &);
VALUE uri_label_to_value(const std::shared_ptr<const URILabel> &);
VALUE dependencies_label_to_value(const std::shared_ptr<const DependenciesLabel> &);
VALUE mask_to_value(std::shared_ptr<const Mask>);