creamerscript-sweeteners 0.0.1 → 0.0.2
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,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2M0NWUwYjBhMjE5Mjc1MWMwNGViYjFmNjY1YWNlMjI0MDE2NjQxMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGQ0ZmVjZjIzODVkODRhNDA1OTc5N2E5NDNmMjhmN2IxMWY1MDg3MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmZjZWMyYTM4NzMzMTZhMjA3N2I1ZmY3NTY2Mzg2MDAzMzVjODJhMjNlOGM2
|
10
|
+
ZDhjMTc1NWQ3YTFhMmNlOWY0NzU2ZDE2NmQzMjI0NWQwYTkyOTQ4NzhmOWRm
|
11
|
+
MmIyMjExNWI0NzVkNDRjZGViM2Q2ODMzMjIzMjJjOWMyNDRhZDg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTZmYmZlZTkyMGUxNzc1OGY0NTNlZGQwYTBjNjk1YWQyZDFjNGY4MTY2Y2Ji
|
14
|
+
NTg2YmJiNTk3OGI5NWUwYTAzM2ZmZDg1Y2UzYjFlMWU2YTk4YTI4OTlmOTg3
|
15
|
+
ODExZDRmYWEwNjZhZDllN2U3Y2UzZjY0MWFjNGM0YmEyMDFiN2Q=
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Creamerscript
|
2
2
|
module Sweeteners
|
3
3
|
class JSArgumentList < Base
|
4
|
-
def
|
5
|
-
|
4
|
+
def pattern
|
5
|
+
/:(#{SYMBOL},\s*[#{SYMBOL},\s]*)\)/
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def substitute(source)
|
9
|
+
source.gsub!(pattern) { |match| match.gsub($1, tokenize($1)) }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -10,4 +10,9 @@ describe Creamerscript::Sweeteners::JSArgumentList do
|
|
10
10
|
it "substitutes a normal comma seperated list of arguments" do
|
11
11
|
substitution("(this foo:arg1, arg2, arg3)").should == "(this foo:_____CREAMER_JS_ARGUMENT_LIST_0_____)"
|
12
12
|
end
|
13
|
+
|
14
|
+
it "substitutes a list of arguments who's subject is an invocation" do
|
15
|
+
substitution("((player find:_____CREAMER_STRING_0_____) attr:_____CREAMER_STRING_1_____, _____CREAMER_PROPERTY_INVOCATION_0_____)")
|
16
|
+
.should == "((player find:_____CREAMER_STRING_0_____) attr:_____CREAMER_JS_ARGUMENT_LIST_0_____)"
|
17
|
+
end
|
13
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creamerscript-sweeteners
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matte Noble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_support
|