snippr 0.15.16 → 0.15.17
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a8c5202bb47c0c71055a5052cb4be7544026e58
|
4
|
+
data.tar.gz: 0533cb0bc06a2721170a79cd94d0692aa17520bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 821e137bcb4c7df4d3756dab8eff7d87aec08f4ebc3f536f3857126e464aef8e7b029f952700b6f0769b17a8f04502d1b80cca2fdb7adefb93f1924a0b423e09
|
7
|
+
data.tar.gz: 31bacedcc7177ac83a30a97404ed2919c7c01b405730638df3996baa11649575a7ecd2bbbc370510ec97fff5f63e1874893bae64f3136e6a8f75313bc061dff4
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="content">
|
12
12
|
<%= Snippr::Clock.now %>
|
13
13
|
<input class="interval" type="text" placeholder="<%= session[:snippr_tardis_interval] || "+1d" %>" />
|
14
|
-
<button class="warp">Warp</
|
15
|
-
<button class="reset">Reset</
|
14
|
+
<button class="warp">Warp</button>
|
15
|
+
<button class="reset">Reset</button>
|
16
16
|
</div>
|
17
17
|
</div>
|
@@ -29,17 +29,25 @@ module Snippr
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# home
|
32
|
-
#
|
33
|
-
#
|
32
|
+
# home,var=1
|
33
|
+
# home,var1="1"
|
34
|
+
# home,var1="1,2,3"
|
34
35
|
def hashify(func_options="")
|
35
36
|
options = {}
|
37
|
+
|
38
|
+
# replace comma temporarily
|
39
|
+
func_options.scan(/(["'])?(.*?)(\1){1}/).each do |delimiter, value, _|
|
40
|
+
func_options.gsub!("#{delimiter}#{value}#{delimiter}", "#{delimiter}#{value.gsub(",", "@@comma@@")}#{delimiter}")
|
41
|
+
end
|
42
|
+
|
43
|
+
# Split on comma which is secure now
|
36
44
|
func_options.split(",").each do |option|
|
37
45
|
opt_key, opt_value = option.split("=")
|
38
46
|
unless opt_value
|
39
47
|
opt_value = opt_key
|
40
48
|
opt_key = :default
|
41
49
|
end
|
42
|
-
options[opt_key.to_sym] = opt_value.match(/^["']?(.*?)["']?$/)[1]
|
50
|
+
options[opt_key.to_sym] = opt_value.match(/^["']?(.*?)["']?$/)[1].gsub("@@comma@@", ",")
|
43
51
|
end
|
44
52
|
options
|
45
53
|
end
|
data/snippr.gemspec
CHANGED
data/spec/snippr/path_spec.rb
CHANGED
@@ -82,6 +82,9 @@ describe Snippr::Processor::Functions do
|
|
82
82
|
subject.send(:hashify, 'key="quoted"').should == { :key => 'quoted' }
|
83
83
|
end
|
84
84
|
|
85
|
+
it "allows a comma inside quotes strings" do
|
86
|
+
subject.send(:hashify, 'key="with,comma"').should == { :key => 'with,comma' }
|
87
|
+
end
|
85
88
|
end
|
86
89
|
|
87
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snippr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-03-
|
13
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|