quickdraw 0.0.4 → 0.0.5

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: 58a82ffc2216e932bdba3e67e015de64707d4fc1
4
- data.tar.gz: e1c97b28041a34d4d76e908280210a84014a15fa
3
+ metadata.gz: 51f90e243e29a4b80d81e1d21012cae4fa8e02dc
4
+ data.tar.gz: 970effdf3f87cfe12b67618bac1b9d5dd02fcc03
5
5
  SHA512:
6
- metadata.gz: a1e342512ec19ddaad5a6294fcb640e958d0f70680c14c99aed6b4e75abb5e60d0b97207be5a931d8745b376038ffbaf518701ca89b7e362360c27121e637494
7
- data.tar.gz: 385cdb7184de9c48211987d8476e8bc89a358517fd3859cdef9fd79869532c6bfbe281e22580ce19b9826268eebcda5c9c1bbfe9ca085e2cf741f02f2d39d2b5
6
+ metadata.gz: 9fc8e5530408ad1cc5d7bde5933b64309d26afb6b9c8097574f33a206d7a3a6a10db8da3dbe6f5acff293095e0b6bfcecd533c9be6eab4f4a4b29181ffb1d6bd
7
+ data.tar.gz: 410c09bb7122a33a7ee99be3146bafac7b561143a03b0b26d2663e6172a3b2d7107231e33f2415439caaa31fe0709dd27c534ba1098e3996e9d7fbde031581bf
@@ -1 +1 @@
1
- ruby-2.0
1
+ ruby-2.1
data/README.md CHANGED
@@ -4,6 +4,7 @@ The idea for Quickdraw comes from the 'shopify_theme' gem. I use a lot of code f
4
4
 
5
5
  ### Features
6
6
 
7
+ - Compatible with Ruby 2.0 and 2.1
7
8
  - MUCH faster downloads and uploads. Unfortunately, Shopify API call limits will slow you down. But in short bursts (10-20 files), Quickdraw is as much as 10x faster or more!
8
9
  - Quickdraw supports using ERB templates which are compiled then uploaded to shopify. This can save you time when making templates with redundant code.
9
10
 
@@ -28,6 +29,18 @@ Or install it yourself as:
28
29
  3. run ````quickdraw download````
29
30
  4. run ````quickdraw watch````
30
31
 
32
+ ### Workflow
33
+
34
+ Quickdraw creates two folders in your project, ````theme```` and ````src````.
35
+ When ````quickdraw watch```` is running, files added/changed/deleted in the ````theme```` folder will be mirrored to Shopify automatically.
36
+ To use ERB create a copy of the ````.liquid```` file you want to use, add an ````.erb```` extension to the end, and move it to the ````src```` folder.
37
+
38
+ #####Example
39
+ project/theme/templates/index.liquid
40
+ project/src/templates/index.liquid.erb
41
+
42
+ When the ````project/src/templates/index.liquid.erb```` is modified, Quickdraw will render it, overwriting ````project/theme/templates/index.liquid````, and uploading the result to Shopify.
43
+
31
44
  ## Contributing
32
45
 
33
46
  1. Fork it
@@ -1,11 +1,11 @@
1
1
  require 'thor'
2
- #require 'yaml'
2
+ require 'yaml'
3
3
  #YAML::ENGINE.yamler = 'syck' if defined? Syck
4
4
  #require 'abbrev'
5
5
  #require 'base64'
6
6
  #require 'fileutils'
7
7
  #require 'json'
8
- require 'listen'
8
+ require 'filewatcher'
9
9
  #require 'launchy'
10
10
  require 'benchmark'
11
11
  require 'pathname'
@@ -30,7 +30,17 @@ module Quickdraw
30
30
  }
31
31
  create_file('config.yml', config.to_yaml)
32
32
  empty_directory('src')
33
+ empty_directory('src/assets')
34
+ empty_directory('src/config')
35
+ empty_directory('src/layout')
36
+ empty_directory('src/snippets')
37
+ empty_directory('src/templates')
33
38
  empty_directory('theme')
39
+ empty_directory('theme/assets')
40
+ empty_directory('theme/config')
41
+ empty_directory('theme/layout')
42
+ empty_directory('theme/snippets')
43
+ empty_directory('theme/templates')
34
44
  end
35
45
 
36
46
  desc "upload FILES", "upload all theme assets to shop"
@@ -161,34 +171,32 @@ module Quickdraw
161
171
 
162
172
  futures = []
163
173
 
164
- listener = Listen.to((Quickdraw.getwd/'theme').to_s, (Quickdraw.getwd/'src').to_s, :force_polling => true, :latency => 0.2 ) do |modified, added, removed|
165
- modified.each do |asset|
166
- asset = asset.as_path
167
- say("MODIFIED: #{asset.relative_to(Quickdraw.getwd)}", :green)
174
+ FileWatcher.new([(Quickdraw.getwd/'theme').to_s, (Quickdraw.getwd/'src').to_s]).watch(0.5) do |asset, event|
175
+ asset = asset.as_path
176
+ if(event == :changed)
168
177
  if theme_file?(asset)
178
+ say("UPLOADING: #{asset.relative_to(Quickdraw.getwd)}", :green)
169
179
  futures << Celluloid::Actor[:shopify_connector].future.upload_asset(asset)
170
180
  elsif src_file?(asset)
181
+ say("COMPILING: #{asset.relative_to(Quickdraw.getwd)}", :green)
171
182
  futures << Celluloid::Actor[:shopify_connector].future.compile_asset(asset)
172
183
  end
173
184
  end
174
- added.each do |asset|
175
- asset = asset.as_path
176
- say("ADDED: #{asset}", :green)
185
+ if(event == :delete)
177
186
  if theme_file?(asset)
178
- futures << Celluloid::Actor[:shopify_connector].future.upload_asset(asset)
187
+ say("REMOVING: #{asset}", :green)
188
+ futures << Celluloid::Actor[:shopify_connector].future.remove_asset(asset)
179
189
  else
180
190
  end
181
191
  end
182
- removed.each do |asset|
183
- asset = asset.as_path
184
- say("REMOVED: #{asset}", :green)
192
+ if(event == :new)
185
193
  if theme_file?(asset)
186
- futures << Celluloid::Actor[:shopify_connector].future.remove_asset(asset)
194
+ say("ADDING: #{asset}", :green)
195
+ futures << Celluloid::Actor[:shopify_connector].future.upload_asset(asset)
187
196
  else
188
197
  end
189
198
  end
190
199
  end
191
- listener.start
192
200
 
193
201
  loop do
194
202
 
@@ -207,7 +215,10 @@ module Quickdraw
207
215
  sleep 0.2
208
216
  end
209
217
 
210
- rescue
218
+ rescue => e
219
+ puts e.message
220
+ puts e.backtrace
221
+ retry
211
222
  puts "exiting...."
212
223
  end
213
224
 
@@ -1,3 +1,3 @@
1
1
  module Quickdraw
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["bryan@internalfx.com"]
11
11
  spec.description = %q{Quickly develop Shopify themes}
12
12
  spec.summary = %q{Allows the use of ERB templates to develop and "compile" a theme and then automatically deploy to Shopify}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/internalfx/quickdraw"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "rake", "~> 10"
23
23
 
24
- spec.add_runtime_dependency "thor"
25
- spec.add_runtime_dependency "listen"
26
- spec.add_runtime_dependency "celluloid"
27
- spec.add_runtime_dependency "httparty"
28
- spec.add_runtime_dependency "filepath"
24
+ spec.add_runtime_dependency "thor", "~> 0.18"
25
+ spec.add_runtime_dependency "filewatcher", "~> 0.3"
26
+ spec.add_runtime_dependency "celluloid", "~> 0.15"
27
+ spec.add_runtime_dependency "httparty", "~> 0.12"
28
+ spec.add_runtime_dependency "filepath", "~> 0.6"
29
29
  end
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickdraw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Morris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.18'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.18'
55
55
  - !ruby/object:Gem::Dependency
56
- name: listen
56
+ name: filewatcher
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '0.3'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: celluloid
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '0.15'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '0.15'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: httparty
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '0.12'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '0.12'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: filepath
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.6'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.6'
111
111
  description: Quickly develop Shopify themes
112
112
  email:
113
113
  - bryan@internalfx.com
@@ -116,8 +116,8 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - .gitignore
120
- - .ruby-version
119
+ - ".gitignore"
120
+ - ".ruby-version"
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - README.md
@@ -129,7 +129,7 @@ files:
129
129
  - lib/quickdraw/shopify_connector_pool.rb
130
130
  - lib/quickdraw/version.rb
131
131
  - quickdraw.gemspec
132
- homepage: ''
132
+ homepage: https://github.com/internalfx/quickdraw
133
133
  licenses:
134
134
  - MIT
135
135
  metadata: {}
@@ -139,17 +139,17 @@ require_paths:
139
139
  - lib
140
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - '>='
147
+ - - ">="
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.1.11
152
+ rubygems_version: 2.2.0
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Allows the use of ERB templates to develop and "compile" a theme and then