zimt 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/zimt/pbxproj.rb CHANGED
@@ -157,9 +157,16 @@ module Zimt
157
157
  @position += 1
158
158
  end
159
159
 
160
+ # Escape filename
161
+ if not file.match /^[A-Za-z0-9.]+$/
162
+ escaped_file = "\"#{file}\""
163
+ else
164
+ escaped_file = file
165
+ end
166
+
160
167
  # Add Zimt Group
161
168
  self.content.insert(@position,
162
- "\t\t#{newgroup} /* #{file} */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = #{file_type}; path = #{file}; sourceTree = \"<group>\"; };\n")
169
+ "\t\t#{newgroup} /* #{file} */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = #{file_type}; path = #{escaped_file}; sourceTree = \"<group>\"; };\n")
163
170
 
164
171
  self.save!
165
172
  self.parse
data/lib/zimt/sprinkle.rb CHANGED
@@ -6,7 +6,7 @@ module Zimt
6
6
  if name.start_with?('http://') || name.start_with?('https://')
7
7
  url = name
8
8
  else
9
- url = "https://raw.github.com/zimt/sprinkles/stable/#{name.downcase}.sprinkle.yml"
9
+ url = "https://raw.github.com/zimt/sprinkles/stable/#{CGI.escape(name.downcase)}.sprinkle.yml"
10
10
  end
11
11
  spec = open(url) { |f| YAML::load(f) }
12
12
  self.new(spec)
data/lib/zimt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zimt
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4" # See http://semver.org/
3
3
  end
data/lib/zimt.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'cgi'
1
2
  require 'fileutils'
2
3
  require 'json'
3
4
  require 'open-uri'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Martin Schu\xCC\x88rrer"