lunfardo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -0
- data/Gemfile +2 -1
- data/README.md +10 -4
- data/lib/lunfardo/scope.rb +4 -6
- data/lib/lunfardo/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19d57fcb9a0317c6d825563cb21130211958aa1f
|
4
|
+
data.tar.gz: 1b3e61387dad26c0a72e5fdf6b9198ad32e7cac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a17eda51361b7c54c73a329fde4d0bcfb809d624ca7cab49102b0bbd353b5205390c31c879a9e45db6ca60e20e3344fbe6810605e9c0126588421369475d089
|
7
|
+
data.tar.gz: 6398e786cbd43af643a1f918a3a45ffe5350fdb58f9d600e6cab42d0a6c7078daf23a6d1902213bcc44dd8e6155c9360ba0c40db853b482646bf71bc81cf0bb0
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
Lunfardo is a framework to easily define simple (and not quite so simple) DSLs.
|
4
4
|
For example it can be used to define an object configuration DSL.
|
5
5
|
|
6
|
+
## Status
|
7
|
+
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/lunfardo.svg)](https://badge.fury.io/rb/lunfardo)
|
9
|
+
[![Build Status](https://travis-ci.org/cabeza-de-termo/lunfardo.svg?branch=master)](https://travis-ci.org/cabeza-de-termo/lunfardo)
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/github/cabeza-de-termo/lunfardo/badge.svg?branch=master)](https://coveralls.io/github/cabeza-de-termo/lunfardo?branch=master)
|
11
|
+
|
6
12
|
## Installation
|
7
13
|
|
8
14
|
Add this line to your application's Gemfile:
|
@@ -232,15 +238,15 @@ class BloatedJoinDSL
|
|
232
238
|
on :filenames do
|
233
239
|
attr_reader :files
|
234
240
|
|
235
|
-
define :extension do
|
236
|
-
'.txt'.freeze
|
237
|
-
end
|
238
|
-
|
239
241
|
before do
|
240
242
|
@files = []
|
241
243
|
end
|
242
244
|
|
243
245
|
on :filename do |name|
|
246
|
+
define :extension do
|
247
|
+
'.txt'.freeze
|
248
|
+
end
|
249
|
+
|
244
250
|
perform do |name|
|
245
251
|
outer.files << name + extension
|
246
252
|
end
|
data/lib/lunfardo/scope.rb
CHANGED
@@ -39,7 +39,7 @@ module CabezaDeTermo
|
|
39
39
|
define_method(method_name, &block)
|
40
40
|
end
|
41
41
|
|
42
|
-
def before(&block)
|
42
|
+
def before(*params, &block)
|
43
43
|
define(:before, &block)
|
44
44
|
end
|
45
45
|
|
@@ -47,15 +47,13 @@ module CabezaDeTermo
|
|
47
47
|
define(:perform, &block)
|
48
48
|
end
|
49
49
|
|
50
|
-
def on(method_name,
|
50
|
+
def on(method_name, &block)
|
51
51
|
scopes[method_name] = Scope.new_scope_class(name: method_name, &block)
|
52
52
|
|
53
53
|
scopes[method_name].instance_exec(&block)
|
54
54
|
end
|
55
55
|
|
56
|
-
def after(&block)
|
57
|
-
raise_error("#after method must receive a block argument") if block.nil?
|
58
|
-
|
56
|
+
def after(*params, &block)
|
59
57
|
define(:after, &block)
|
60
58
|
end
|
61
59
|
|
@@ -109,7 +107,7 @@ module CabezaDeTermo
|
|
109
107
|
|
110
108
|
def outer(n = 1)
|
111
109
|
(1..n-1).inject(@outer_scope) do |outer_scope, i|
|
112
|
-
|
110
|
+
outer_scope.outer
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
data/lib/lunfardo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lunfardo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rubi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
49
|
- ".rspec"
|
50
|
+
- ".travis.yml"
|
50
51
|
- Gemfile
|
51
52
|
- LICENSE.txt
|
52
53
|
- README.md
|
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
80
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.6
|
81
|
+
rubygems_version: 2.4.6
|
81
82
|
signing_key:
|
82
83
|
specification_version: 4
|
83
84
|
summary: A framework to easily define simple DSLs
|