magic_data 1.0.6 → 2.0.0

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: 9d6b6749e84b91dc5352c5443ce50b7a784897b9
4
- data.tar.gz: a81e6d43ea2849cd8de4484cae1be13a4b327d6a
3
+ metadata.gz: 2c52a7967798ad5fe237581b4cfc6a258ceac10a
4
+ data.tar.gz: 374e275a7bbda0f2d4fbce98d92df5153fde2713
5
5
  SHA512:
6
- metadata.gz: 10ff8a50aac854213376043b9da0905814c0fe92041d196f710247ab4d395ab6545c1bc29e8b2554f90e45ae47d98afe57acb3255bc13205e4dc0ab2abc54019
7
- data.tar.gz: 191d112a583058d8f8b06db89d9098c83da98c0c8e45e2f674460ecd554215118284dd834a62022be624f2834e788946e4b4d14e5ae54cc1489431f8edde6e47
6
+ metadata.gz: 9e924fb7d7326697fd66237eb16493e171751164f145195b4cb5bb109491a6798c113bdf37d7988efab211fbfb7fb7ca47b5362a722cf22da22a50705e7c7c8b
7
+ data.tar.gz: 4fdfa425f2c510a2bc9aaddc74a94a77103b48d33dc5cd67efb7d79d176c743207aa83b0e6ca728112959e4d72dcbd966083372d1bad095855544f9476672d43
data/lib/magic_data.rb CHANGED
@@ -1,2 +1 @@
1
- require 'magic_data/magic_data'
2
- require 'magic_logger'
1
+ require 'magic_data/magic_data'
@@ -7,14 +7,13 @@ class MagicData
7
7
 
8
8
  class << self
9
9
 
10
- def process(fields)
10
+ def process(fields, diff_only = false)
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
- MagicLogger.log('magic_data', modified)
17
- fields.merge(modified)
16
+ diff_only ? modified : fields.merge(modified)
18
17
  end
19
18
 
20
19
  def set(key, value = nil, &block)
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.6'
7
+ spec.version = '2.0.0'
8
8
  spec.authors = ['Justin Commu']
9
9
  spec.email = ['Justin.Commu@loblaw.ca']
10
10
  spec.summary = 'Dynamic data library for Ruby.'
@@ -18,5 +18,4 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
 
21
- spec.add_runtime_dependency 'magic_logger', '>= 0.0.1'
22
21
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 2.0.0
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-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
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: magic_data allows a user to setup dynamic keys at runtime and lets them
28
14
  retrieve the most recently generated value
29
15
  email: