fig_magic 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +3 -0
  3. data/README.md +37 -11
  4. data/lib/fig_magic/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9a794f495dcbdcd59132d32cfd304c263c9c162
4
- data.tar.gz: ef377b953fcb75707ec632b319f9db93f6213f83
3
+ metadata.gz: bf044e9dc6a0ce8bd0a41ff6e0a232e2613f8dd0
4
+ data.tar.gz: fd8981061fd4be2f898faf21defc21811b3b04f1
5
5
  SHA512:
6
- metadata.gz: d1f4769c65d3a439df5a6df81c4126cd999fd1a2e9d9da21ee92d1c0137ff0a3aba9a2df378402236c4819e6fd4b285afbbc851da1a8ab726bd770c035198296
7
- data.tar.gz: 9b0f55ed9e0807f3f8fc3710ac3da624c9cdc66ffc007b7f43fb165a3529c546232fbb6a705357e93e8f91545fa9b5605b00df65ed539ba8ea75c9a7b96038a9
6
+ metadata.gz: 60580d5c8822b2540e62cbec36bd9b7ee7c5fa330ca6947d750e730ce9e2d7c69a6afc012bf894aa30492ab74700d43b92bc5b76fa385dee345577fec1b75ec8
7
+ data.tar.gz: 0b7875cc837a6cc28026657be73a328880f2ddcda108db8b6cbe3e7c19de8ca2b76c72fa9509d42805e4de02e0abcabe34f7fce2a1ed5843a8a1222d223314b6
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ === Version 0.3 / 2015-11-20
2
+ Updated README to detail why this gem exists and give thanks to Jeff Morgan
3
+
1
4
  === Version 0.2 / 2015-11-20
2
5
  Fixed Require Statements
3
6
 
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # fig_magic
2
2
 
3
- [![Build Status](http://travis-ci.org/cheezy/fig_magic.png)](http://travis-ci.org/cheezy/fig_magic)
4
-
5
- An easy to use gem that provides datasets that can be used by your application
6
- and tests. The data is stored in yaml files.
3
+ Jeff Morgan (@cheezy) made 2 very awesome gems called DataMagic & FigNewtown. I love them both, but I feel dirty having to do 2 initializations in my projects. initializing both for the same location & file. hate having to initialize
4
+ By combining the 2 gems into a single package, you can have all the functions of each gem, but only one file page set + file load. Moreover, you can use a single namespace for
5
+ both direct hash calls & hash of hashes calls.
7
6
 
8
7
  ## Using
9
8
 
@@ -13,7 +12,7 @@ In order to use _fig_magic_ you will have to inform the gem where it can find th
13
12
  FigMagic.yml_directory = 'data/yml'
14
13
  ````
15
14
 
16
- If you do not specify a directory the gem will default to using a directory named _config/data_.
15
+ If you do not specify a directory the gem will default to using a directory named _config/.
17
16
 
18
17
  After setting the directory you must load a file. This can be accomplished by calling the _load_ method.
19
18
 
@@ -23,9 +22,36 @@ FigMagic.load 'filename.yml'
23
22
 
24
23
  If you do not specify a filename the gem will attempt to use a file named _default.yml_. If you are using this for testing you will more than likely want to call load before each test to load the proper data for the specific test, or use the namespaced keys method, detailed below.
25
24
 
26
- Another option is to set an environment variable DATA_MAGIC_FILE. When this is set it will be used instead of the _default.yml_ file.
25
+ Another option is to set an environment variable FIG_MAGIC_FILE. When this is set it will be used instead of the _default.yml_ file.
26
+
27
+
28
+ Next we simply begin calling methods on the FigMagic module that match our keys. Let's assume the system_test.yml file contains the following entries:
29
+
30
+ base_url: http://system_test.mycompany.com
31
+ database_user: cheezy
32
+ database_password: secret
33
+
34
+
35
+ In our code we can call methods that match the keys. Here is an example PageObject where we are using the `base_url` entry:
36
+
37
+ ````ruby
38
+ class MyPage
39
+ include PageObject
40
+
41
+ page_url "#{FigMagic.base_url}/my_page.html"
42
+ end
43
+ ````
44
+
45
+ We can also supply default values which will be returned if the property does not exist:
46
+ ````ruby
47
+ class MyPage
48
+ include PageObject
49
+
50
+ page_url "#{FigMagic.base_url("http://cheezyworld.com")}/my_page.html"
51
+ end
52
+ ````
27
53
 
28
- The final thing to do is use the data. The gem has a `data_for` method that will return the data for a specific key. The most common way to use this is to include the _FigMagic_ module in a [page-object](https://github.com/cheezy/page-object) and then populate a page with the data. Here's an example:
54
+ If you have more complex data then you can utilize the `data_for` method that will return the data for a specific key. The most common way to use this is to include the _FigMagic_ module in a [page-object](https://github.com/cheezy/page-object) and then populate a page with the data. Here's an example:
29
55
 
30
56
  ````ruby
31
57
  class MyPage
@@ -120,15 +146,15 @@ FigMagic.add_translator MyData # this line must go in the same file as the modul
120
146
 
121
147
  ## Documentation
122
148
 
123
- The rdocs for this project can be found at [rubydoc.info](http://rubydoc.info/github/cheezy/fig_magic/master/frames).
149
+ The rdocs for this project can be found at [rubydoc.info](http://rubydoc.info/github/tk8817/fig_magic/master/frames).
124
150
 
125
- To see the changes from release to release please look at the [ChangeLog](https://raw.github.com/cheezy/fig_magic/master/ChangeLog)
151
+ To see the changes from release to release please look at the [ChangeLog](https://raw.github.com/tk8817/fig_magic/master/ChangeLog)
126
152
 
127
153
 
128
154
 
129
155
  ## Known Issues
130
156
 
131
- See [http://github.com/cheezy/fig_magic/issues](http://github.com/cheezy/fig_magic/issues)
157
+ See [http://github.com/cheezy/fig_magic/issues](http://github.com/tk8817/fig_magic/issues)
132
158
 
133
159
  ## Contributing
134
160
 
@@ -142,4 +168,4 @@ Please ensure all contributions contain proper tests.
142
168
 
143
169
  ## Copyright
144
170
 
145
- Copyright (c) 2012-2013 Jeffrey S. Morgan. See LICENSE for details.
171
+ Copyright (c) 2012-2013 Jeffrey S. Morgan & Justin Commu See LICENSE for details.
@@ -1,3 +1,3 @@
1
1
  module FigMagic
2
- VERSION = "0.2"
2
+ VERSION = "0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig_magic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Commu