excom 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2e0ab278ff802a81618b2db0f1549d450a96f41
4
- data.tar.gz: ca066ba4969cec14ba67359d08c7eb93b01832b4
3
+ metadata.gz: f3ce8ddb0d9f3eb163e404bb331a5b188e4b7231
4
+ data.tar.gz: 7e0b3a4cbb11420002803618328faa4f39e651ee
5
5
  SHA512:
6
- metadata.gz: 6f6c5e50e2e88fba4387545edfd7fd28834739b2e10a44c43a71802d0e06e3a0a464e854cb0024f647be6b81b7717b871b9c63f5cccdc635977839624abfc6f8
7
- data.tar.gz: 72c07a6cd427a26c6c9fd2dc342499a39af0db3aef6524b4fa41f1ab8fac4ffacb9d0962f322c9e34a28b5964615c6ad24c688b974e4e32743139045c5bcdfc1
6
+ metadata.gz: e47af5a9296b59a8bf194c9fb081f592c73df2056c7ba00e79e0e40b4cafd79daf6e00b2ad63160514e881cfceecfb7a37fca3e6c0525d572fdf6c08c1759522
7
+ data.tar.gz: 7ba40674e28405799fe22b33308190328073b56268db1bd0a5ff6dd7bc570da84cf4c452f03b6626d444fce64083b9fe5c5bcb05a01f42167c78e17847d6a15d
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Flexible and highly extensible Commands (Service Objects) for business logic.
4
4
 
5
5
  [![build status](https://secure.travis-ci.org/akuzko/excom.png)](http://travis-ci.org/akuzko/excom)
6
+ [![github release](https://img.shields.io/github/release/akuzko/excom.svg)](https://github.com/akuzko/excom/releases)
6
7
 
7
8
  ## Installation
8
9
 
@@ -129,6 +130,8 @@ Please read about core API and available class and instance methods on [wiki](ht
129
130
 
130
131
  ### Command Extensions (Plugins)
131
132
 
133
+ Read full version on [wiki](https://github.com/akuzko/excom/wiki/Plugins).
134
+
132
135
  Excom is built with extensions in mind. Even core functionality is organized in plugins that are
133
136
  used in base `Excom::Command` class. Bellow you can see a list of plugins with some description
134
137
  and examples that are shipped with `excom`:
@@ -2,28 +2,26 @@ module Excom
2
2
  module Plugins::Context
3
3
  Plugins.register :context, self
4
4
 
5
- def initialize(*)
6
- @local_context = {}
7
- super
8
- end
9
-
10
- def initialize_clone(*)
11
- @local_context = @local_context.dup
12
- super
13
- end
5
+ attr_accessor :local_context
6
+ protected :local_context, :local_context=
14
7
 
15
8
  def context
16
9
  global_context = ::Excom.context
10
+ return global_context if local_context.nil?
11
+
17
12
  global_context.respond_to?(:merge) ?
18
- global_context.merge(local_context) :
13
+ (global_context.merge(local_context) rescue local_context) :
19
14
  local_context
20
15
  end
21
16
 
22
17
  def with_context(ctx)
23
- clone.tap{ |copy| copy.local_context.merge!(ctx) }
18
+ clone.tap do |copy|
19
+ copy.local_context =
20
+ copy.local_context.respond_to?(:merge) ? copy.local_context.merge(ctx) : ctx
21
+ end
24
22
  end
25
23
 
26
- protected def local_context
24
+ def local_context
27
25
  @local_context
28
26
  end
29
27
 
@@ -37,7 +35,7 @@ module Excom
37
35
  end
38
36
 
39
37
  def context
40
- Thread.current[:excom_context] || {}
38
+ Thread.current[:excom_context]
41
39
  end
42
40
  end
43
41
  end
data/lib/excom/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Excom
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Kuzko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-03 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler