yaml_model 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.3
@@ -0,0 +1,9 @@
1
+ require 'yaml_model'
2
+
3
+ class YamlModel
4
+ class Rails < ::YamlModel
5
+ def self.yaml_file
6
+ @yaml_file ||= ::Rails.root + "/config/#{name.to_s.underscore.pluralize}.yml"
7
+ end
8
+ end
9
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ require 'rubygems'
3
5
  require 'yaml_model'
4
6
  require 'spec'
5
7
  require 'spec/autorun'
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ require 'active_support/inflector'
4
+ require 'yaml_model/rails'
5
+
6
+ module Rails; end unless defined? ::Rails
7
+
8
+ class ExampleOne < YamlModel::Rails
9
+
10
+ end
11
+
12
+ describe YamlModel::Rails do
13
+ it 'should automagically set the yaml_model path' do
14
+ ::Rails.should_receive(:root).and_return('/abc/def')
15
+ ExampleOne.yaml_file.should == '/abc/def/config/example_ones.yml'
16
+ end
17
+ end
data/yaml_model.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{yaml_model}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Bleigh"]
12
- s.date = %q{2010-04-01}
12
+ s.date = %q{2010-04-13}
13
13
  s.description = %q{A basic ORM-like setup for reading YAML files.}
14
14
  s.email = %q{michael@intridea.com}
15
15
  s.extra_rdoc_files = [
@@ -24,8 +24,10 @@ Gem::Specification.new do |s|
24
24
  "Rakefile",
25
25
  "VERSION",
26
26
  "lib/yaml_model.rb",
27
+ "lib/yaml_model/rails.rb",
27
28
  "spec/spec.opts",
28
29
  "spec/spec_helper.rb",
30
+ "spec/yaml_model/rails_spec.rb",
29
31
  "spec/yaml_model_spec.rb",
30
32
  "yaml_model.gemspec"
31
33
  ]
@@ -36,6 +38,7 @@ Gem::Specification.new do |s|
36
38
  s.summary = %q{A basic ORM-like setup for reading YAML files.}
37
39
  s.test_files = [
38
40
  "spec/spec_helper.rb",
41
+ "spec/yaml_model/rails_spec.rb",
39
42
  "spec/yaml_model_spec.rb"
40
43
  ]
41
44
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Bleigh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-01 00:00:00 -04:00
17
+ date: 2010-04-13 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,8 +48,10 @@ files:
48
48
  - Rakefile
49
49
  - VERSION
50
50
  - lib/yaml_model.rb
51
+ - lib/yaml_model/rails.rb
51
52
  - spec/spec.opts
52
53
  - spec/spec_helper.rb
54
+ - spec/yaml_model/rails_spec.rb
53
55
  - spec/yaml_model_spec.rb
54
56
  - yaml_model.gemspec
55
57
  has_rdoc: true
@@ -84,4 +86,5 @@ specification_version: 3
84
86
  summary: A basic ORM-like setup for reading YAML files.
85
87
  test_files:
86
88
  - spec/spec_helper.rb
89
+ - spec/yaml_model/rails_spec.rb
87
90
  - spec/yaml_model_spec.rb