Sha256: ecddd774c25f47d128a84b98786e31301d237fe43bc6058ed39e9a5fe77d2ea4

Contents?: true

Size: 1.83 KB

Versions: 4

Compression:

Stored size: 1.83 KB

Contents

== Module Documentation

=== Simple Example with a Barren Module

Given a file +lib/example.rb+ containing a minimally documented and
essentially barren class:

    # This module is documented.
    module ExampleModule
    end

Running the script through shomen command line interface, regardless of which
underlying parser is used, should produce a data structure conforming to the
Shomen standard data format having the following characteristics.

The data structure should have three entries.

  @shomen.keys.assert.include?('(metadata)')
  @shomen.keys.assert.include?('ExampleModule')
  @shomen.keys.assert.include?('/lib/example.rb')

The `ExampleModule` entry should have a "bang" type of `module`.

  @shomen['ExampleModule']['!']  #=> 'module'

It should have a name of `ExampleModule`.

  @shomen['ExampleModule']['name']  #=> 'ExampleModule'

While the namespace should be an empty string because the class is defined
at the toplevel.

  @shomen['ExampleModule']['namespace']  #=> ''

The full `path` field will be the same as the name for the same reason.

  @shomen['ExampleModule']['path']  #=> 'ExampleModule'

As a module it should not have a `superclass` entry.

  @shomen['ExampleModule'].refute.key?('superclass')

The `comment` field will as given in the script.

  @shomen['ExampleModule']['comment']  #=> "This module is documented."

And the `files` field should list only `lib/example.rb`.

  @shomen['ExampleModule']['files']  #=> ['/lib/example.rb']

Since out example class is barren the remaining fields will either be 
missing (i.e. `nil`) or empty collections.

  @shomen['ExampleModule']['constants'].to_a      #=> []
  @shomen['ExampleModule']['modules'].to_a        #=> []
  @shomen['ExampleModule']['classes'].to_a        #=> []
  @shomen['ExampleModule']['methods'].to_a        #=> []
  @shomen['ExampleModule']['class-methods'].to_a  #=> []

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
shomen-yard-0.1.0 spec/03_module.rdoc
shomen-rdoc-0.1.0 spec/03_module.rdoc
shomen-0.1.1 spec/03_module.rdoc
shomen-0.1.0 spec/03_module.rdoc