docile 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: ba0cac2ae518dbcd219f26dfb0d8e8d556471a5043d69d9b4dc1e7300461a5a4
4
- data.tar.gz: 2d588448f977a59f9f28e92ff98249fb31e5c7fee4e8485b4aaa32a31b11d022
3
+ metadata.gz: 11815257ca44981c34b07c7f17fe1c2e6ca599783bc14aec836493812ebecd7b
4
+ data.tar.gz: f605e98ec83e48744601de31ea5809744b11227b89b3822c172c82c894498515
5
5
  SHA512:
6
- metadata.gz: 5bffdb49a9de2072292d8f78454e029f7d8545e9d36aac86ce8ed6360e4081be196a2dbb4b23c18764986b76b71446c9c6a3203c695b87c7b3aab980b4e22ec7
7
- data.tar.gz: 7c2b89a311f27559e735bc7c7d8c6a008240f2b86b2b527074a788e0ed085c6abe6f75d54dd9b45a5d89f8f0f3f084c12292f22fcb9cbe33abcf904b47c228b6
6
+ metadata.gz: 2eabf55eeea7884e053664c3c1dfab240ae7c6f808318de6dcc27d3d01b330d7ffe4e5983c4eeb95291462048b1ebd37d72a60018bc90bda55b0c3d6a6a5c746
7
+ data.tar.gz: 6bf630c901e53f09e3c7d6ee2f3c1c102dcfe45f8536b44cd619bc6bfcf0711b98a7fe0a415115dbd67d5f0fedb3bffd77fada17f1d11ec2d25ba36e72752003
data/HISTORY.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # HISTORY
2
2
 
3
- ## [Unreleased changes](http://github.com/ms-ati/docile/compare/v1.3.0...master)
3
+ ## [Unreleased changes](http://github.com/ms-ati/docile/compare/v1.3.1...master)
4
4
 
5
5
  - ...
6
6
 
7
+ ## [v1.3.1 (May 24, 2018)](http://github.com/ms-ati/docile/compare/v1.3.0...v1.3.1)
8
+
9
+ - Special thanks to Taichi Ishitani (@taichi-ishitani):
10
+ - Fix for when DSL object is also the block's context (#30)
11
+
7
12
  ## [v1.3.0 (Feb 7, 2018)](http://github.com/ms-ati/docile/compare/v1.2.0...v1.3.0)
8
13
 
9
14
  - Allow helper methods in block's context to call DSL methods
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
 
10
10
  [![Build Status](https://img.shields.io/travis/ms-ati/docile/master.svg)](https://travis-ci.org/ms-ati/docile)
11
11
  [![Code Coverage](https://img.shields.io/codecov/c/github/ms-ati/docile.svg)](https://codecov.io/github/ms-ati/docile)
12
- [![Dependency Status](https://gemnasium.com/ms-ati/docile.svg)](https://gemnasium.com/ms-ati/docile)
13
12
  [![Maintainability](https://api.codeclimate.com/v1/badges/79ca631bc123f7b83b34/maintainability)](https://codeclimate.com/github/ms-ati/docile/maintainability)
14
13
 
15
14
  Ruby makes it possible to create very expressive **Domain Specific
@@ -82,7 +81,7 @@ In short: **No**.
82
81
  Not if you want the code in the block to be able to refer to anything
83
82
  the block would normally have access to from the surrounding context.
84
83
 
85
- Let's be very specific. Docile internally uses `instance_exec` (see [execution.rb#25](lib/docile/execution.rb#L25)), adding a small layer to support referencing *local variables*, *instance variables*, and *methods* from the _block's context_ **or** the target _object's context_, interchangeably. This is "**the hard part**", where most folks making a DSL in Ruby throw up their hands.
84
+ Let's be very specific. Docile internally uses `instance_exec` (see [execution.rb#26](lib/docile/execution.rb#L26)), adding a small layer to support referencing *local variables*, *instance variables*, and *methods* from the _block's context_ **or** the target _object's context_, interchangeably. This is "**the hard part**", where most folks making a DSL in Ruby throw up their hands.
86
85
 
87
86
  For example:
88
87
 
@@ -30,6 +30,7 @@ module Docile
30
30
  end
31
31
 
32
32
  block_context.instance_variables.each do |ivar|
33
+ next unless proxy_context.instance_variables.include?(ivar)
33
34
  value_from_dsl_proxy = proxy_context.instance_variable_get(ivar)
34
35
  block_context.instance_variable_set(ivar, value_from_dsl_proxy)
35
36
  end
@@ -1,4 +1,4 @@
1
1
  module Docile
2
2
  # The current version of this library
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Siegel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake