using_yaml 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/LICENSE +1 -1
- data/README.rdoc +43 -2
- data/VERSION +1 -1
- data/lib/using_yaml.rb +1 -1
- data/using_yaml.gemspec +2 -2
- metadata +2 -2
data/.gitignore
CHANGED
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,6 +1,47 @@
|
|
1
|
-
=
|
1
|
+
= Using Yaml
|
2
2
|
|
3
|
-
|
3
|
+
This Gem allows you to easily associate YAML files with classes
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
From Gemcutter:
|
8
|
+
|
9
|
+
sudo gem install using_yaml
|
10
|
+
|
11
|
+
== Usage
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'using_yaml'
|
15
|
+
|
16
|
+
class ExampleUsage
|
17
|
+
include UsingYAML
|
18
|
+
|
19
|
+
using_yaml :some, :settings
|
20
|
+
end
|
21
|
+
|
22
|
+
example = ExampleUsage.new
|
23
|
+
|
24
|
+
# Load "OpenHash" from pathname.join('some.yml')
|
25
|
+
example.some #=> { "key" => "value" }
|
26
|
+
|
27
|
+
# Behaves like a normal hash
|
28
|
+
example.some['key'] #=> "value"
|
29
|
+
|
30
|
+
# AND like an object
|
31
|
+
example.some.key #=> "value"
|
32
|
+
|
33
|
+
# Setter methods work too
|
34
|
+
example.some.key = "another value"
|
35
|
+
|
36
|
+
# Saves to original location
|
37
|
+
example.save #=> writes
|
38
|
+
|
39
|
+
# .. and the same for settings
|
40
|
+
example.settings #=> "{ ... }"
|
41
|
+
|
42
|
+
== Pathname
|
43
|
+
|
44
|
+
Coming soon!
|
4
45
|
|
5
46
|
== Note on Patches/Pull Requests
|
6
47
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/using_yaml.rb
CHANGED
data/using_yaml.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{using_yaml}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marc Bowes"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-12}
|
13
13
|
s.description = %q{"Load, save and use YAML files as if they were objects"}
|
14
14
|
s.email = %q{marcbowes@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: using_yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Bowes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-12 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|