Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glossarist gem is very difficult to use #81

Closed
ronaldtse opened this issue Nov 13, 2023 · 2 comments · Fixed by #90
Closed

Glossarist gem is very difficult to use #81

ronaldtse opened this issue Nov 13, 2023 · 2 comments · Fixed by #90
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Member

Today I was trying to create a Concept object.

And imagine the frustration with creating such an object without any documentation. That's right -- the Glossarist gem has no documentation, and the specs do not even show any complete example.

I had the hardest time figuring out that this line doesn't work.

Glossarist::Concept.new(designations: [{designation: "xyz", type: "expression", normative_status: "preferred"}])
# => works

The reason is the designation object must be using "string encoded" hashes, not symbol ones.

Glossarist::Concept.new(designations: [{"designation" => "xyz", "type" => "expression", "normative_status"
 => "preferred"}])
# => works

This is because of this code:

module Glossarist
  module Designation
    class Base < Model
    # ...
      def self.from_h(hash)
        type = hash["type"]

        if type.nil? || /\w/ !~ type
          raise ArgumentError, "designation type is missing"
        end

This is not acceptable...

@ronaldtse
Copy link
Member Author

This is the problem of a gem that is only being used by one developer -- only the same developer is familiar with the oddities of the gem, but no one knows how it actually works. All typical expectations, and the fear of other developers looking at the same code, are out the window.

This is not right. When we create a gem, it is expected to be USED BY OTHERs. This means we need proper code documentation, i.e. RDocs. At a minimum, provide a README on how to use the gem. Right now, none of that exists.

@ronaldtse ronaldtse added the bug Something isn't working label Nov 13, 2023
@HassanAkbar
Copy link
Member

@ronaldtse I'll start working on the documentation right after the following tasks are finalized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants