Categories: None [Edit]
inventory
Inventory
Inventory keeps track of the contents of your Ruby¹ projects. Such an
inventory can be used to load the project, create gem specifications and
gems, run unit tests, compile extensions, and verify that the project’s
content is what you think it is.
¹ See http://ruby-lang.org/
§ Usage
Let’s begin by discussing the project structure that Inventory expects you
to use. It’s pretty much exactly the same as the standard Ruby project
structure¹:
├── README
├── Rakefile
├── lib
│ ├── foo-1.0
│ │ ├── bar.rb
│ │ └── version.rb
│ └── foo-1.0.rb
└── test
└── unit
├── foo-1.0
│ ├── bar.rb
│ └── version.rb
└── foo-1.0.rb
Here you see a simplified version of a project called “Foo”’s project
structure. The only real difference from the standard is that the main
entry point into the library is named “foo-1.0.rb” instead of “foo.rb” and
that the root sub-directory of “lib” is similarly named “foo-1.0” instead
of “foo”. The difference is the inclusion of the API version. This must
be the major version of the project followed by a constant “.0”. The
reason for this is that it allows concurrent installations of different
major versions of the project and means that the wrong version will never
accidentally be loaded with require.
There’s a bigger difference in the content of the files.
‹Lib/foo-1.0/version.rb› will contain our inventory instead of a String:
require 'inventory-1.0'
class Foo
Version = Foo.new(1, 4, 0){
authors{
author 'A. U. Thor', '[email protected]'
}
homepage 'http://example.org/'
licenses{
license 'LGPLv3+',
'GNU Lesser General Public License, version 3 or later',
'http://www.gnu.org/licenses/'
}
def dependencies
...
Total
Ranking: 22,630 of 183,107
Downloads: 58,827
Daily
Ranking: 17,444 of 183,092
Downloads: 17
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|---|---|
33,429 | 34,289 | lookout |
34,575 | 32,744 | inventory-rake |
34,879 | 32,346 | inventory-rake-tasks-yard |
40,638 | 26,534 | value |
51,549 | 19,282 | yard-heuristics |
54,369 | 17,931 | yard-value |
61,713 | 15,140 | lookout-rake |
67,556 | 13,309 | ame |
77,690 | 10,829 | u |
95,882 | 7,765 | yard-method-overrides |
99,593 | 7,289 | lookout-rack |
133,240 | 4,157 | value-yard |
Depends on
Rank | Downloads | Name |
---|---|---|
224 | 158,681,269 | yard |
33,429 | 34,289 | lookout |
34,575 | 32,744 | inventory-rake |
34,879 | 32,346 | inventory-rake-tasks-yard |
51,549 | 19,282 | yard-heuristics |
61,713 | 15,140 | lookout-rake |
Owners
# | Gravatar | Handle |
---|---|---|
1 | now |