magic_data 1.0.4 → 1.0.5

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: 0cd4d87961452dae777da459bc745cb08d213de9
4
- data.tar.gz: e19f9b84f0f57f9e8a9f2fe6a2056f9f7d06c8a7
3
+ metadata.gz: bc665153e5b22cefc2e11dead325e4851a1629ea
4
+ data.tar.gz: e6ccb8705b90940cbadd8b9c3cc937f696a76b82
5
5
  SHA512:
6
- metadata.gz: b5bca7504cf9d2b8c188b1f8d125d53e406908f84da4a3c44ea19de10164a5722663b662b1118d8fb1f8638fee756fc7f99256a18c937975f0999031ea5f1c2f
7
- data.tar.gz: a2d92a264b4f27358a065bd19f2a6595b36cccbcd2ff43e52778af41d696a3c46ed1c48ea14970114754c2b4e15232655302498779a832b8e4c81f6547bf551a
6
+ metadata.gz: a2ea8d898f4d1c3371ebce712356edc657dcb4be0e7e90eaa35a0daa68c877ccce9a096c17d41d41bbeebaafca4fd71cd705f10c6351d3b3ac52c33feefe9f3e
7
+ data.tar.gz: be6af5707e858dd9736f695d48367305b50156cc36da9d4c3b5c3a78fda1a1d81af580d2960412eb10fad10c48f2eaad10b8d263295186b301d761651214be5a
@@ -7,13 +7,14 @@ class MagicData
7
7
 
8
8
  class << self
9
9
 
10
- def process(fields, diff_only=false)
10
+ def process(fields)
11
11
  modified = {}
12
12
  fields.each do |key, value|
13
13
  @saved["latest_#{value}"]= modified[key] = @magic[value].call if @magic.key?(value)
14
14
  modified[key] = @saved[value] if @saved.key?(value)
15
15
  end
16
- diff_only ? modified : fields.merge(modified)
16
+ MagicLogger.log('magic_data_modified', modified)
17
+ fields.merge(modified)
17
18
  end
18
19
 
19
20
  def set(key, value = nil, &block)
@@ -22,10 +23,14 @@ class MagicData
22
23
 
23
24
  def get(key)
24
25
  @saved["latest_#{key}"]= @magic[key].call
26
+ MagicLogger.log('magic_data_generated', @saved["latest_#{key}"])
27
+ @saved["latest_#{key}"]
25
28
  end
26
29
 
27
30
  def get_latest(key)
28
31
  @saved["latest_#{key}"]
32
+ MagicLogger.log('magic_data_retrieved', @saved["latest_#{key}"])
33
+ @saved["latest_#{key}"]
29
34
  end
30
35
 
31
36
  end
data/lib/magic_data.rb CHANGED
@@ -1 +1,2 @@
1
- require 'magic_data/magic_data'
1
+ require 'magic_data/magic_data'
2
+ require 'magic_logger'
data/magic_data.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'magic_data'
7
- spec.version = '1.0.4'
7
+ spec.version = '1.0.5'
8
8
  spec.authors = ['Justin Commu']
9
9
  spec.email = ['Justin.Commu@loblaw.ca']
10
10
  spec.summary = 'Dynamic data library for Ruby.'
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.platform = Gem::Platform::RUBY
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ['lib']
19
- end
20
19
 
21
20
 
21
+ spec.add_runtime_dependency 'magic_logger', '>= 0.0.1'
22
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Commu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: magic_logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.1
13
27
  description: magic_data allows a user to setup dynamic keys at runtime and lets them
14
28
  retrieve the most recently generated value
15
29
  email:
@@ -50,3 +64,4 @@ signing_key:
50
64
  specification_version: 4
51
65
  summary: Dynamic data library for Ruby.
52
66
  test_files: []
67
+ has_rdoc: