using_yaml 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ rdoc
19
19
  pkg
20
20
 
21
21
  ## PROJECT::SPECIFIC
22
+ using_yaml*.gem
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Marc Bowes
1
+ Copyright (c) 2010 Marc Bowes
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,6 +1,47 @@
1
- = somegem
1
+ = Using Yaml
2
2
 
3
- Description goes here.
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.0
1
+ 0.1.1
data/lib/using_yaml.rb CHANGED
@@ -52,7 +52,7 @@ module UsingYAML
52
52
  data = UsingYAML.cache[pathname]
53
53
  return data if data
54
54
 
55
- data = YAML.load_file(pathname).to_ohash(pathname)
55
+ data = YAML.load_file(pathname).to_ohash(pathname) rescue nil
56
56
  UsingYAML.cache[pathname] = data
57
57
  end
58
58
  end
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.0"
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-11}
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.0
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-11 00:00:00 +02:00
12
+ date: 2010-02-12 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency