data_magic 0.7 → 0.8

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ === Version 0.8 / 2012-6-9
2
+ * Enhancements
3
+ * Made yml writable
4
+ * Updated yml_reader dependency to version 0.2
5
+
1
6
  === Version 0.7 / 2012-5-17
2
7
  * Enhancements
3
8
  * Refactored to use yml_reader to remove duplication
data/README.md CHANGED
@@ -13,7 +13,7 @@ In order to use _data_magic_ you will have to inform the gem where it can find t
13
13
  DataMagic.yml_directory = 'data/yml'
14
14
  ````
15
15
 
16
- If you do not specify a directory the gem will default to using a directory named _config_. You should only have to set the directory once.
16
+ If you do not specify a directory the gem will default to using a directory named _config/data_. You should only have to set the directory once.
17
17
 
18
18
  After setting the directory you must load a file. This can be accomplished by calling the _load_ method.
19
19
 
@@ -0,0 +1,3 @@
1
+ dm:
2
+ value1: this is value 1
3
+ value2: this is value 2
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ["lib"]
18
18
 
19
19
  gem.add_dependency 'faker', '>= 1.0.1'
20
- gem.add_dependency 'yml_reader', '>= 0.1'
20
+ gem.add_dependency 'yml_reader', '>= 0.2'
21
21
 
22
22
  gem.add_development_dependency 'rspec', '>= 2.6.0'
23
23
  gem.add_development_dependency 'cucumber', '>= 1.1.0'
@@ -1,7 +1,7 @@
1
1
  Feature: Functionality of the data_magic gem
2
2
 
3
3
  Background:
4
- Given I have read the yaml file
4
+ Given I have read the yaml file from features/yaml
5
5
  When I ask for the data for "dm"
6
6
 
7
7
  Scenario: Getting basic data from the yaml
@@ -0,0 +1,8 @@
1
+ Feature: Default file and directory functionality of the data_magic gem
2
+
3
+ Scenario: Using the default file and directory
4
+ Given I have read the default yaml file from the default location
5
+ When I ask for the data for "dm"
6
+ Then the value for "value1" should be "this is value 1"
7
+ And the value for "value2" should be "this is value 2"
8
+
@@ -3,10 +3,15 @@ class TestClass
3
3
  end
4
4
 
5
5
 
6
- Given /^I have read the yaml file$/ do
6
+ Given /^I have read the yaml file from features\/yaml$/ do
7
+ DataMagic.yml_directory = 'features/yaml'
7
8
  DataMagic.load "example.yml"
8
9
  end
9
10
 
11
+ Given /^I have read the default yaml file from the default location$/ do
12
+
13
+ end
14
+
10
15
  When /^I ask for the data for "(.+)"$/ do |key|
11
16
  @data = TestClass.new.data_for key
12
17
  end
@@ -3,4 +3,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
3
3
  require 'rspec/expectations'
4
4
  require 'data_magic'
5
5
 
6
- DataMagic.yml_directory = 'features/yaml'
6
+ Before do
7
+ DataMagic.yml_directory = nil
8
+ DataMagic.yml = nil
9
+ end
@@ -27,7 +27,7 @@ module DataMagic
27
27
  end
28
28
 
29
29
  class << self
30
- attr_reader :yml
30
+ attr_accessor :yml
31
31
 
32
32
  def default_directory
33
33
  'config/data'
@@ -1,3 +1,3 @@
1
1
  module DataMagic
2
- VERSION = "0.7"
2
+ VERSION = "0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_magic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-17 00:00:00.000000000 Z
12
+ date: 2012-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faker
16
- requirement: &70261596978060 !ruby/object:Gem::Requirement
16
+ requirement: &70281851755420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: 1.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70261596978060
24
+ version_requirements: *70281851755420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: yml_reader
27
- requirement: &70261596977560 !ruby/object:Gem::Requirement
27
+ requirement: &70281851754920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: '0.1'
32
+ version: '0.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70261596977560
35
+ version_requirements: *70281851754920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70261596977100 !ruby/object:Gem::Requirement
38
+ requirement: &70281851754460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.6.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70261596977100
46
+ version_requirements: *70281851754460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cucumber
49
- requirement: &70261596976640 !ruby/object:Gem::Requirement
49
+ requirement: &70281851754000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 1.1.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70261596976640
57
+ version_requirements: *70281851754000
58
58
  description: Provides datasets to application stored in YAML files
59
59
  email:
60
60
  - jeff.morgan@leandog.com
@@ -72,9 +72,11 @@ files:
72
72
  - LICENSE
73
73
  - README.md
74
74
  - Rakefile
75
+ - config/data/default.yml
75
76
  - cucumber.yml
76
77
  - data_magic.gemspec
77
78
  - features/data_magic.feature
79
+ - features/defaults.feature
78
80
  - features/step_definitions/data_magic_steps.rb
79
81
  - features/support/env.rb
80
82
  - features/yaml/another.yml
@@ -111,6 +113,7 @@ specification_version: 3
111
113
  summary: Provides datasets to application via YAML files
112
114
  test_files:
113
115
  - features/data_magic.feature
116
+ - features/defaults.feature
114
117
  - features/step_definitions/data_magic_steps.rb
115
118
  - features/support/env.rb
116
119
  - features/yaml/another.yml