Commit Graph

11 Commits

Author SHA1 Message Date
Marc Siegel 25114d0c1d Add Rubocop and run checks in CI
This should finally allow us to adopt code style lints, as well
as others such as performance linting, and have them enforced by
the Github Actions continuous integration (CI) jobs.

For now, I'm choosing to depend on the 'panolint' gem from
Panorama Education, which is my current workplace, as I'd like
to adopt and stay consistent with the setting used there.

Changes
  * Move development and test dependencies from gemspec to Gemfile
  * Add dependency on 'panolint' gem
  * Add .rubocop.yml
  * Fix all existing issues
  * Run rubocop in github actions CI
2021-05-10 17:20:00 -04:00
Matt Schreiber 19c62d0d70
Call #instance_exec on DSL object instead of proxy (#39)
when the DSL object is the same object as the block context object.

This short-circuits prior to performing setup (like copying ivars
from the block context to the proxy) that is unnecessary when the block
context and DSL object "match".

Add test that runs non-mutative code on frozen DSL object to check that
no FrozenError is raised, as it would have been if a
FallbackContextProxy tried to dynamically add methods to the DSL object.
2021-01-13 10:57:05 -05:00
Jochen Seeber 5001479f54
Add ruby2_keywords to delegating methods (#62)
* Add ruby2_keywords to delegating methods
* Fix unit tests for Ruby 1.9
2021-01-11 17:03:24 -05:00
Taichi Ishitani fcbd6841ab Fix for when DSL object is also the block's context
* fix #29

* added RSpec example for issue #29

* fixed a typo on the descripton comment
2018-05-23 22:16:32 -04:00
Marc Siegel 745b317e12 Allow helper methods defined in the block's context to call DSL methods
Previously, it turns out that this wasn't possible, which made
refactoring code that used Docile to extract common helper methods,
and re-use them in different blocks, a painful experience.

This change should make it possible to extract methods from blocks
into the context around the block, and have those extracted helper
methods still able to call methods on the DSL object.
2018-02-07 17:06:53 -05:00
Marc Siegel 6e37fb8132 Standardize on double-quoted strings 2018-01-14 19:15:09 -05:00
Andrew Meyer 02efcb2e7c Don't nest proxy contexts in execution environment
Fixes #10
2014-01-09 21:46:26 -06:00
Marc Siegel 41b7721f4b (cosmetic: replace eligible double quoted strings with single quotes) 2013-11-26 15:53:45 -05:00
Marc Siegel 60f2489d4a (documentation: fix misspelling and replace @yield with @param block) 2013-08-02 15:45:12 -04:00
Marc Siegel 67756fa69e Improve documentation 2013-07-29 00:14:15 -04:00
Marc Siegel d36dfa8b21 Refactor #exec_in_proxy_context into private module Execution 2013-07-29 00:06:43 -04:00