snippr 0.15.16 → 0.15.17

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e25773d2d7ad82e84565b0b71c6e84148da25b7
4
- data.tar.gz: 5a2d3ee1f3f6cb03005a33a5723bd27c86f8b03f
3
+ metadata.gz: 9a8c5202bb47c0c71055a5052cb4be7544026e58
4
+ data.tar.gz: 0533cb0bc06a2721170a79cd94d0692aa17520bd
5
5
  SHA512:
6
- metadata.gz: cf7690affccd3f54b7a2f37094c7075e4f86ffb00db5cbab7430ffa7d324be7ebcd0a3117f88e748b1c3161d8d71b2a6ba3e4c111394935ed28d63f28bed39dc
7
- data.tar.gz: 6883b8fcae4c16d40a8d9febe9cdefe25c93fd65695ec70f615734cb541e962d7fcd2f119c2133c7a1accb21fe83737febd6ec1ad20b188099e9cce28ff910c8
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</botton>
15
- <button class="reset">Reset</botton>
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
- # snip=home
33
- # snip=home,var=1
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
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "snippr"
4
- s.version = "0.15.16"
4
+ s.version = "0.15.17"
5
5
  s.date = Time.now
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ["Daniel Harrington", "Thomas Jachmann", "Frank Schumacher"]
@@ -64,10 +64,6 @@ describe Snippr::Path do
64
64
  subject.list(:doesnotexist).should == []
65
65
  end
66
66
 
67
- it "can cope with umlauts in the name" do
68
- subject.list(:mixed_encoding).first.encoding.to_s.should == "UTF-8"
69
- end
70
-
71
67
  end
72
68
 
73
69
  context "with I18n" do
@@ -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.16
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-17 00:00:00.000000000 Z
13
+ date: 2014-03-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n