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 +4 -4
- data/HISTORY.md +6 -1
- data/README.md +1 -2
- data/lib/docile/execution.rb +1 -0
- data/lib/docile/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11815257ca44981c34b07c7f17fe1c2e6ca599783bc14aec836493812ebecd7b
|
4
|
+
data.tar.gz: f605e98ec83e48744601de31ea5809744b11227b89b3822c172c82c894498515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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#
|
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
|
|
data/lib/docile/execution.rb
CHANGED
@@ -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
|
data/lib/docile/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|