greyscale_rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21e71af3947b0cc815cb95463fb059f8f6c0c2c7
4
- data.tar.gz: f0300f7d0d2a42f81a330457aed57c8b132afd0d
3
+ metadata.gz: 984cae198df2327656e62f9891ce915cdbc7ccfb
4
+ data.tar.gz: 89b9840c4b9387d4a9eff4e41a3f79badd687b96
5
5
  SHA512:
6
- metadata.gz: eb71e778325000ea30ef6ba12a0c03d85db5c4f9598efc02052987fc55ed80c04371046ffed39f2c3ed6ca07fa8e9c2a618faa16186f714bba372028c7bb3214
7
- data.tar.gz: a1abe9d7eddeb54d09d0e7d3788806bd451bc604d851cff03ce8820c27f8cf2ac107ecd7013fb002f548ddf8e2d91585693febcde3fda37c765d7a049c9ac251
6
+ metadata.gz: 6de5f85a79f875a22777ffbef647828cc567da21a7b75546d2aeecf4ca8cde0bf7816d655fca7d37026b61aa8aef36654300579cfacc5c87b1cff4ea2c564292
7
+ data.tar.gz: 7ccbb32bf7e11de4de1117ebad021ff15fafac641ba0cf0fcc6e0b08ea033b35c5039d980934ee2d213d7d4671170f297bbb4b9bf9ebb1241da777c7303d955e
data/README.md CHANGED
@@ -38,6 +38,7 @@ test:
38
38
  driver: yaml
39
39
  data_root: test/db/fixtures
40
40
 
41
+ # in progress. For now production should use yaml or your own API with drivers
41
42
  production:
42
43
  driver: greyscale
43
44
  data_root: http://api.greyscale.io
@@ -50,9 +51,10 @@ Here's what all the fields are:
50
51
 
51
52
  * `driver`: tells the application to load the proper data fetcher. The options are
52
53
  * `yaml`: will load yaml files from your local file system folder, specified by `data_root`
53
- * `greyscale`: will load data from a remote server that complies to the Greyscale.io API standard
54
+ * `greyscale`: will load data from a remote server that complies to the Greyscale.io API standard (in progress)
54
55
  * `data_root`: the root path of the source from which you want to load your data
55
56
  * `revision_root`: the root path of the source from which you load data [previews](#patchable)
57
+ * `live_reload`: reloads the data from source on every page load. Not recommended in production.
56
58
  * `app_id`: Your app's Greyscale.io API id
57
59
  * `app_key`: Your app's Greyscale.io API key
58
60
 
@@ -18,6 +18,7 @@ module GreyscaleRails
18
18
  GreyscaleRails.patch_driver = config.greyscale.patch_driver
19
19
  end
20
20
 
21
+ GreyscaleRecord.live_reload = config.greyscale.live_reload
21
22
  end
22
23
 
23
24
  private
@@ -34,6 +35,8 @@ module GreyscaleRails
34
35
  config.greyscale.patch_driver = data_driver yaml.merge( data_root: yaml[ :revision_root ] )
35
36
  end
36
37
 
38
+ config.greyscale.live_reload = yaml[ :live_reload ] || false
39
+
37
40
  rescue => e
38
41
  raise "Failed to process #{config.greyscale.config_path}. Make sure the file exists and is not malformed. Error: \"#{e}\""
39
42
  end
@@ -47,7 +50,7 @@ module GreyscaleRails
47
50
  root = yaml[ :data_root ]
48
51
 
49
52
  driver_class = DRIVER_TYPES[type]
50
- raise "Grreyscale Rails error: #{type} is not a valid driver. Please choose from: #{DRIVER_TYPES.keys.join(", ")}" unless driver_class
53
+ raise "Greyscale Rails error: #{type} is not a valid driver. Please choose from: #{DRIVER_TYPES.keys.join(", ")}" unless driver_class
51
54
 
52
55
  driver = driver_class.new root
53
56
 
@@ -1,3 +1,3 @@
1
1
  module GreyscaleRails
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greyscale_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Orlov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails