xqcoretools 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. data/bin/xqcoretools +44 -15
  2. metadata +2 -2
data/bin/xqcoretools CHANGED
@@ -7,6 +7,7 @@ require 'zip/zip'
7
7
  require 'nokogiri'
8
8
  require 'net/http'
9
9
  require 'execjs'
10
+ require 'fileutils'
10
11
 
11
12
  class XQCoreTools < Thor
12
13
  desc "processcontent [PLATFORM] [OUTPUT] [PATHS]", "Process content packages"
@@ -122,27 +123,34 @@ class XQCoreTools < Thor
122
123
  isDirty = false
123
124
 
124
125
  for node in nodes do
125
- if node.has_attribute?('src')
126
- srcComponents = node.get_attribute('src').scan(/library\.xqcore.com\/(.*)\/xqcore\-web\-debug\.js/)
127
- if srcComponents.length > 0
128
- scriptVersion = srcComponents[0][0]
126
+ if node.has_attribute?('type') && node.get_attribute('type') == 'text/javascript'
127
+ if node.has_attribute?('src')
128
+ srcComponents = node.get_attribute('src').scan(/library\.xqcore.com\/(.*)\/xqcore\-web\-debug\.js/)
129
+ if srcComponents.length > 0
130
+ scriptVersion = srcComponents[0][0]
129
131
 
130
- includeFolder = 'inc'
132
+ includeFolder = 'inc'
131
133
 
132
- runtimeFile = "xqcore-web-#{platform.downcase}.js"
133
- runtimeFolder = "#{includeFolder}/#{runtimeFile}"
134
- runtimePath = "#{path}/#{runtimeFolder}"
134
+ runtimeFile = "xqcore-web-#{platform.downcase}.js"
135
+ runtimeFolder = "#{includeFolder}/#{runtimeFile}"
136
+ runtimePath = "#{path}/#{runtimeFolder}"
135
137
 
136
- downloadCache.saveFile("#{scriptVersion}/#{runtimeFile}", runtimePath)
138
+ downloadCache.saveFile("#{scriptVersion}/#{runtimeFile}", runtimePath)
137
139
 
138
- node.set_attribute('src', runtimeFolder)
140
+ node.set_attribute('src', runtimeFolder)
139
141
 
140
- XQCoreTools::compileTemplates(platform, subPath, document, scriptVersion, downloadCache, node)
142
+ XQCoreTools::compileTemplates(platform, subPath, document, scriptVersion, downloadCache, node)
141
143
 
142
- isDirty = true
143
- break;
144
- end
145
- end
144
+ isDirty = true
145
+ end
146
+ else
147
+ if platform != "Windows"
148
+ node.content = node.content.gsub(/\.click\(/, ".on('touchstart', ")
149
+
150
+ isDirty = true
151
+ end
152
+ end
153
+ end
146
154
  end
147
155
 
148
156
  if isDirty
@@ -262,6 +270,27 @@ class XQCoreTools < Thor
262
270
 
263
271
  return path
264
272
  end
273
+
274
+ desc "setup", "First time setup of projects"
275
+ def setup()
276
+ Dir.foreach(Dir.pwd) do |item|
277
+ if File.directory?(item)
278
+ if item != '.' || item != '..'
279
+ pathResources = "#{item}/Source/Resources"
280
+
281
+ if File.directory?("#{pathResources}")
282
+ pathRaw = "#{pathResources}/raw"
283
+
284
+ if !File.directory?("#{pathRaw}")
285
+ FileUtils.mkdir("#{pathRaw}")
286
+ end
287
+
288
+ FileUtils.touch "#{pathRaw}/content.zip"
289
+ end
290
+ end
291
+ end
292
+ end
293
+ end
265
294
  end
266
295
 
267
296
  class XQCoreToolsDownloadCache
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xqcoretools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-17 00:00:00.000000000 Z
12
+ date: 2013-04-18 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Tools for synchronizing multiple CSharp projects and deploying to several
15
15
  platform