Skip to content

Commit adcc3aa

Browse files
committed
yard
1 parent 947f775 commit adcc3aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2952
-2596
lines changed

.yardoc/checksums

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/iqeo/configuration.rb 0790c6ed002a1b1e69afc4f38e218756c5ac480f
2+
lib/iqeo/configuration/version.rb dad9c52c1d00b3028d333907df8e3ad45d475d93

.yardoc/object_types

609 Bytes
Binary file not shown.

.yardoc/objects/root.dat

9.43 KB
Binary file not shown.

.yardoc/proxy_types

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{I" Object:EF:
2+
class

Gemfile.lock

+8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ GEM
77
remote: https://rubygems.org/
88
specs:
99
diff-lcs (1.1.3)
10+
json (1.7.1)
1011
rake (0.9.2.2)
12+
rdoc (3.12)
13+
json (~> 1.4)
14+
redcarpet (2.1.1)
1115
rspec (2.9.0)
1216
rspec-core (~> 2.9.0)
1317
rspec-expectations (~> 2.9.0)
@@ -16,11 +20,15 @@ GEM
1620
rspec-expectations (2.9.1)
1721
diff-lcs (~> 1.1.3)
1822
rspec-mocks (2.9.0)
23+
yard (0.8.1)
1924

2025
PLATFORMS
2126
ruby
2227

2328
DEPENDENCIES
2429
iqeo-conf!
2530
rake (~> 0.9.2)
31+
rdoc (~> 3.12.0)
32+
redcarpet (~> 2.1.1)
2633
rspec (~> 2.9.0)
34+
yard (~> 0.8.1)

README.md

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Iqeo::Configuration
2+
3+
A DSL representing configuration files.
4+
5+
## Installation
6+
7+
It`s a gem...
8+
9+
$ gem install iqeo-conf
10+
11+
## Usage
12+
13+
Require 'iqeo/configuration' and optionally include Iqeo namespace:
14+
15+
require 'iqeo/configuration'
16+
include Iqeo
17+
18+
### Create configuration
19+
20+
There are three ways to create configurations; explicit, block DSL, eval DSL.
21+
22+
#### Explicit
23+
24+
Call Configuration#new without a block.
25+
Explicitly call methods on instance to configure instance.
26+
27+
conf = Configuration.new
28+
conf.alpha 1
29+
conf.bravo 2.0
30+
conf.charlie :three
31+
conf.delta "four"
32+
33+
#### Block DSL
34+
35+
Call Configuration#new with a block that expects a variable, a new instance will be yielded.
36+
Within block, call methods on yielded instance to configure.
37+
38+
conf = Configuration.new do |c|
39+
c.alpha 1
40+
c.bravo 2.0
41+
c.charlie :three
42+
c.delta "four"
43+
end
44+
45+
#### Eval DSL
46+
47+
Call Configuration#new with a block that does not expect a variable, contents of the block are eval`d in the context of the new instance.
48+
Call methods with implied self to configure instance.
49+
50+
conf = Configuration.new do
51+
alpha 1
52+
bravo 2.0
53+
charlie :three
54+
delta "four"
55+
end
56+
57+
### Read configuration
58+
59+
All examples above result in the same configuration.
60+
Configuration settings can be retrieved directly or indirectly.
61+
62+
#### Directly
63+
64+
##### Named method
65+
66+
conf.alpha # => 1
67+
conf.bravo # => 2.0
68+
conf.charlie # => :three
69+
conf.delta # => "four"
70+
71+
##### [ 'string' ]
72+
73+
conf['alpha'] # => 1
74+
conf['bravo'] # => 2.0
75+
conf['charlie'] # => :three
76+
conf['delta'] # => "four"
77+
78+
##### [ :symbol ]
79+
80+
conf[:alpha] # => 1
81+
conf[:bravo] # => 2.0
82+
conf[:charlie] # => :three
83+
conf[:delta] # => "four"
84+
85+
#### Indirectly
86+
87+
The underlying storage is an indifferent hash, so the usual Hash and Enumerable methods work.
88+
89+
##### Hash & Enumerable methods
90+
91+
conf.size # => 4
92+
conf.keys # => [ 'alpha', 'bravo', 'charlie', 'delta' ]
93+
conf.collect { |key,value| value } # => [ 1, 2.0, :three, 'four' ]
94+
95+
## Features
96+
97+
* settings by named methods
98+
* settings by '[]' & '[]='
99+
* settings & locals with '='
100+
* referencing existing settings
101+
* nested configurations
102+
* inheritance & override
103+
* read from string, at creation, or after - merged & nested
104+
* load from filename, at creation, or after - merged & nested
105+
* todo: merge configurations
106+
* todo: defaults
107+
* todo: blank slate
108+
109+
## Fancy usage
110+
111+
* Dynamic settings by '[]' & '[]=' & 'self'
112+
* Multiple configuration files
113+
* Hierarchial configuration files
114+
115+
## License
116+
117+
Copyright Gerard Fowley ([email protected]).
118+
119+
Licensed under GPL Version 3 license.
120+
See LICENSE file.

README.rdoc

-116
This file was deleted.

Rakefile

+7
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ RDoc::Task.new do |rdoc|
1212
rdoc.options << "--all" << "--verbose"
1313
end
1414

15+
require 'yard'
16+
#require 'yard/rake/yardoc_task'
17+
YARD::Rake::YardocTask.new do |yard|
18+
yard.files = %w( lib/**/*.rb )
19+
yard.options = %w( --main README.md --exclude hash_with_indifferent_access.rb )
20+
end
21+
1522
task :default => :spec

0 commit comments

Comments
 (0)