shopify_theme 0.0.17 → 0.0.18

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: 6157b9bdb277a5335fb30d287296a7d190678f6d
4
- data.tar.gz: 4d67641a71dbf5f44a3b96296fa749761fcedefa
3
+ metadata.gz: 8b849c05437407aeafa434479b6f2f198a3dc475
4
+ data.tar.gz: f33e3b4294a93ce747a650c3bc65e67f82bef9d6
5
5
  SHA512:
6
- metadata.gz: 88bae8b6b99275741f476858dedcadab0bb2216a791c1f7715dee1e1ad4dfb4992a07bee500ababbaecc21004a5abc89a1cdf7a0690f1dd634c33176d8eb6bce
7
- data.tar.gz: 357a5dd0f6875e1ba8d77f756022bdbcb6865158dca36a513a8991cee735bd84fc59ae7e1ccedfbe1f4b68274d665cee3e046dbe05570eb46adbd9f09a057590
6
+ metadata.gz: 21aa13d50791237942291edf030d96a624879809e53487b4251c40e1551f5e190b0703b6d2c1f4067e74e89ca94f18bfe876504ae9172e91deba84a2a9c47b95
7
+ data.tar.gz: 8e3a476aabbfce33e154c1d42014f54a63a285c027d96cedb04caa84bbe29ac0d3ae1a08714ae81d40d459ac531f2212f3778ffa07df1836ac35aead254958a7
checksums.yaml.gz.sig ADDED
@@ -0,0 +1 @@
1
+ 0Ϲ���cC��:\�H�%3�_R��L����o��r���4�X*�[�(.0�����L�p����ؑ`�������dah s�@#ն���^w�+�)zL��TP�� H��&Oy:S$ �NJ'�p�{F�P�+&h�� d�ī�Bȯ;��ψ�D��橦Е��&+RNǙ_���v :L��K�����<:��J|�E7hMVTL�L���K�4:��K��Q���ե[8޿w *�U�� q�yQ�V��:
data.tar.gz.sig ADDED
Binary file
data/README.md CHANGED
@@ -33,7 +33,7 @@ gem update shopify_theme
33
33
 
34
34
  # Usage
35
35
 
36
- Generate the config file. Go get a valid api_key and password for your store head to `https://[your store].myshopify.com/admin/apps/private` and generate a private application. Default it adds the main theme, if you want to edit one of your other themes, add the `theme_id`.
36
+ Generate the config file. Go get a valid api_key and password for your store head to `https://[your store].myshopify.com/admin/apps/private` and generate a private application. By default it adds the main theme, if you want to edit one of your other themes, add the `theme_id`.
37
37
 
38
38
  ```
39
39
  theme configure api_key password store_url
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'bundler'
2
+ require 'bundler/gem_tasks'
2
3
  require 'rake/testtask'
3
- Bundler::GemHelper.install_tasks
4
4
 
5
5
  task :default => [:spec]
6
6
 
data/bin/theme CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # This allows shopify_them to run easily from a git checkout without install.
3
+ # This allows shopify_theme to run easily from a git checkout without install.
4
4
  # Hat tip to chriseppstein of Compass fame for the code for this
5
5
  def fallback_load_path(path)
6
6
  retried = false
@@ -44,14 +44,14 @@ module ShopifyTheme
44
44
  theme_name ||= 'Timber'
45
45
  say("Registering #{theme_name} theme on #{store}", :green)
46
46
  theme = ShopifyTheme.upload_timber(theme_name, master || false)
47
-
47
+
48
48
  say("Creating directory named #{theme_name}", :green)
49
49
  empty_directory(theme_name)
50
-
50
+
51
51
  say("Saving configuration to #{theme_name}", :green)
52
52
  ShopifyTheme.config.merge!(theme_id: theme['id'])
53
53
  create_file("#{theme_name}/config.yml", ShopifyTheme.config.to_yaml)
54
-
54
+
55
55
  say("Downloading #{theme_name} assets from Shopify")
56
56
  Dir.chdir(theme_name)
57
57
  download()
@@ -126,14 +126,14 @@ module ShopifyTheme
126
126
  puts "Watching current folder: #{Dir.pwd}"
127
127
  watcher do |filename, event|
128
128
  filename = filename.gsub("#{Dir.pwd}/", '')
129
- if local_assets_list.include?(filename)
130
- action = case event
131
- when :changed, :new then :send_asset
132
- when :delete then :delete_asset
133
- else raise NotImplementedError, "Unknown event -- #{event}"
134
- end
135
- send(action, filename, options['quiet'])
136
- end
129
+ action = if local_assets_list.include?(filename) && [:changed, :new].include?(event)
130
+ :send_asset
131
+ elsif event == :delete
132
+ :delete_asset
133
+ else
134
+ raise NotImplementedError, "Unknown event -- #{event}"
135
+ end
136
+ send(action, filename, options['quiet'])
137
137
  end
138
138
  end
139
139
 
@@ -201,7 +201,6 @@ module ShopifyTheme
201
201
 
202
202
  def send_asset(asset, quiet=false)
203
203
  return unless valid?(asset)
204
- time = Time.now
205
204
  data = {:key => asset}
206
205
  content = File.read(asset)
207
206
  if BINARY_EXTENSIONS.include?(File.extname(asset).gsub('.','')) || ShopifyTheme.is_binary_data?(content)
@@ -211,21 +210,25 @@ module ShopifyTheme
211
210
  data.merge!(:value => content)
212
211
  end
213
212
 
214
- response = ShopifyTheme.send_asset(data)
213
+ response = show_during("[#{timestamp}] Uploading: #{asset}", quiet) do
214
+ ShopifyTheme.send_asset(data)
215
+ end
215
216
  if response.success?
216
- say("[" + time.strftime(TIMEFORMAT) + "] Uploaded: #{asset}", :green) unless quiet
217
+ say("[#{timestamp}] Uploaded: #{asset}", :green) unless quiet
217
218
  else
218
- report_error(time, "Could not upload #{asset}", response)
219
+ report_error(Time.now, "Could not upload #{asset}", response)
219
220
  end
220
221
  end
221
222
 
222
223
  def delete_asset(key, quiet=false)
223
224
  return unless valid?(key)
224
- time = Time.now
225
- if (response = ShopifyTheme.delete_asset(key)).success?
226
- say("[" + time.strftime(TIMEFORMAT) + "] Removed: #{key}", :green) unless quiet
225
+ response = show_during("[#{timestamp}] Removing: #{key}", quiet) do
226
+ ShopifyTheme.delete_asset(key)
227
+ end
228
+ if response.success?
229
+ say("[#{timestamp}] Removed: #{key}", :green) unless quiet
227
230
  else
228
- report_error(time, "Could not remove #{key}", response)
231
+ report_error(Time.now, "Could not remove #{key}", response)
229
232
  end
230
233
  end
231
234
 
@@ -242,7 +245,7 @@ module ShopifyTheme
242
245
  end
243
246
 
244
247
  def report_error(time, message, response)
245
- say("[#{time.strftime(TIMEFORMAT)}] Error: #{message}", :red)
248
+ say("[#{timestamp(time)}] Error: #{message}", :red)
246
249
  say("Error Details: #{errors_from_response(response)}", :yellow)
247
250
  end
248
251
 
@@ -252,15 +255,26 @@ module ShopifyTheme
252
255
  errors = response.parsed_response ? response.parsed_response["errors"] : response.body
253
256
 
254
257
  object[:errors] = case errors
255
- when NilClass
256
- ''
257
- when String
258
- errors.strip
259
- else
260
- errors.values.join(", ")
261
- end
258
+ when NilClass
259
+ ''
260
+ when String
261
+ errors.strip
262
+ else
263
+ errors.values.join(", ")
264
+ end
262
265
  object.delete(:errors) if object[:errors].length <= 0
263
266
  object
264
267
  end
268
+
269
+ def show_during(message = '', quiet = false, &block)
270
+ print(message) unless quiet
271
+ result = yield
272
+ print("\r#{' ' * message.length}\r") unless quiet
273
+ result
274
+ end
275
+
276
+ def timestamp(time = Time.now)
277
+ time.strftime(TIMEFORMAT)
278
+ end
265
279
  end
266
280
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyTheme
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -0,0 +1 @@
1
+ # using the default shipit config
@@ -14,11 +14,11 @@ Gem::Specification.new do |s|
14
14
  s.license = 'MIT'
15
15
 
16
16
  s.rubyforge_project = "shopify_theme"
17
- s.add_dependency("thor", [">= 0.14.4"])
18
- s.add_dependency("httparty", "~> 0.10.0")
19
- s.add_dependency("json", "~> 1.5.4")
20
- s.add_dependency("filewatcher")
21
- s.add_dependency("launchy")
17
+ s.add_dependency('thor', '>= 0.14.4')
18
+ s.add_dependency('httparty', '~> 0.13.0')
19
+ s.add_dependency('json', '~> 1.8.0')
20
+ s.add_dependency('filewatcher')
21
+ s.add_dependency('launchy')
22
22
 
23
23
  s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'minitest', '>= 5.0.0'
@@ -28,5 +28,5 @@ Gem::Specification.new do |s|
28
28
  s.files = `git ls-files`.split("\n")
29
29
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
30
30
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
31
- s.require_paths = ["lib"]
31
+ s.require_paths = ['lib']
32
32
  end
metadata CHANGED
@@ -1,139 +1,161 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Duff
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZhZG1p
14
+ bnMxFzAVBgoJkiaJk/IsZAEZFgdzaG9waWZ5MRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MB4XDTE0MDUxNTIwMzM0OFoXDTE1MDUxNTIwMzM0OFowPzEPMA0GA1UEAwwGYWRt
16
+ aW5zMRcwFQYKCZImiZPyLGQBGRYHc2hvcGlmeTETMBEGCgmSJomT8ixkARkWA2Nv
17
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0/81O3e1vh5smcwp2G
18
+ MpLQ6q0kejQLa65bPYPxdzWA1SYOKyGfw+yR9LdFzsuKpwWzKq6zX35lj1IckWS4
19
+ bNBEQzxmufUxU0XPM02haFB8fOfDJzdXsWte9Ge4IFwahwn68gpMqN+BvxL+KMYz
20
+ Iut9YmN44d4LZdsENEIO5vmybuG2vYDz7R56qB0PA+Q2P2CdhymsBad2DQs69FBo
21
+ uico9V6VMYYctL9lCYdzu9IXrOYNTt88suKIVzzAlHOKeN0Ng5qdztFoTR8sfxDr
22
+ Ydg3KHl5n47wlpgd8R0f/4b5gGxW+v9pyJCgQnLlRu7DedVSvv7+GMtj3g9r3nhJ
23
+ KqECAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/o
24
+ maf34HXbUOQsdoLHacEKQgunMB0GA1UdEQQWMBSBEmFkbWluc0BzaG9waWZ5LmNv
25
+ bTAdBgNVHRIEFjAUgRJhZG1pbnNAc2hvcGlmeS5jb20wDQYJKoZIhvcNAQEFBQAD
26
+ ggEBADkK9aj5T0HPExsov4EoMWFnO+G7RQ28C30VAfKxnL2UxG6i4XMHVs6Xi94h
27
+ qXFw1ec9Y2eDUqaolT3bviOk9BB197+A8Vz/k7MC6ci2NE+yDDB7HAC8zU6LAx8Y
28
+ Iqvw7B/PSZ/pz4bUVFlTATif4mi1vO3lidRkdHRtM7UePSn2rUpOi0gtXBP3bLu5
29
+ YjHJN7wx5cugMEyroKITG5gL0Nxtu21qtOlHX4Hc4KdE2JqzCPOsS4zsZGhgwhPs
30
+ fl3hbtVFTqbOlwL9vy1fudXcolIE/ZTcxQ+er07ZFZdKCXayR9PPs64heamfn0fp
31
+ TConQSX2BnZdhIEYW+cKzEC/bLc=
32
+ -----END CERTIFICATE-----
33
+ date: 2014-05-27 00:00:00.000000000 Z
12
34
  dependencies:
13
35
  - !ruby/object:Gem::Dependency
14
36
  name: thor
15
37
  requirement: !ruby/object:Gem::Requirement
16
38
  requirements:
17
- - - '>='
39
+ - - ">="
18
40
  - !ruby/object:Gem::Version
19
41
  version: 0.14.4
20
42
  type: :runtime
21
43
  prerelease: false
22
44
  version_requirements: !ruby/object:Gem::Requirement
23
45
  requirements:
24
- - - '>='
46
+ - - ">="
25
47
  - !ruby/object:Gem::Version
26
48
  version: 0.14.4
27
49
  - !ruby/object:Gem::Dependency
28
50
  name: httparty
29
51
  requirement: !ruby/object:Gem::Requirement
30
52
  requirements:
31
- - - ~>
53
+ - - "~>"
32
54
  - !ruby/object:Gem::Version
33
- version: 0.10.0
55
+ version: 0.13.0
34
56
  type: :runtime
35
57
  prerelease: false
36
58
  version_requirements: !ruby/object:Gem::Requirement
37
59
  requirements:
38
- - - ~>
60
+ - - "~>"
39
61
  - !ruby/object:Gem::Version
40
- version: 0.10.0
62
+ version: 0.13.0
41
63
  - !ruby/object:Gem::Dependency
42
64
  name: json
43
65
  requirement: !ruby/object:Gem::Requirement
44
66
  requirements:
45
- - - ~>
67
+ - - "~>"
46
68
  - !ruby/object:Gem::Version
47
- version: 1.5.4
69
+ version: 1.8.0
48
70
  type: :runtime
49
71
  prerelease: false
50
72
  version_requirements: !ruby/object:Gem::Requirement
51
73
  requirements:
52
- - - ~>
74
+ - - "~>"
53
75
  - !ruby/object:Gem::Version
54
- version: 1.5.4
76
+ version: 1.8.0
55
77
  - !ruby/object:Gem::Dependency
56
78
  name: filewatcher
57
79
  requirement: !ruby/object:Gem::Requirement
58
80
  requirements:
59
- - - '>='
81
+ - - ">="
60
82
  - !ruby/object:Gem::Version
61
83
  version: '0'
62
84
  type: :runtime
63
85
  prerelease: false
64
86
  version_requirements: !ruby/object:Gem::Requirement
65
87
  requirements:
66
- - - '>='
88
+ - - ">="
67
89
  - !ruby/object:Gem::Version
68
90
  version: '0'
69
91
  - !ruby/object:Gem::Dependency
70
92
  name: launchy
71
93
  requirement: !ruby/object:Gem::Requirement
72
94
  requirements:
73
- - - '>='
95
+ - - ">="
74
96
  - !ruby/object:Gem::Version
75
97
  version: '0'
76
98
  type: :runtime
77
99
  prerelease: false
78
100
  version_requirements: !ruby/object:Gem::Requirement
79
101
  requirements:
80
- - - '>='
102
+ - - ">="
81
103
  - !ruby/object:Gem::Version
82
104
  version: '0'
83
105
  - !ruby/object:Gem::Dependency
84
106
  name: rake
85
107
  requirement: !ruby/object:Gem::Requirement
86
108
  requirements:
87
- - - '>='
109
+ - - ">="
88
110
  - !ruby/object:Gem::Version
89
111
  version: '0'
90
112
  type: :development
91
113
  prerelease: false
92
114
  version_requirements: !ruby/object:Gem::Requirement
93
115
  requirements:
94
- - - '>='
116
+ - - ">="
95
117
  - !ruby/object:Gem::Version
96
118
  version: '0'
97
119
  - !ruby/object:Gem::Dependency
98
120
  name: minitest
99
121
  requirement: !ruby/object:Gem::Requirement
100
122
  requirements:
101
- - - '>='
123
+ - - ">="
102
124
  - !ruby/object:Gem::Version
103
125
  version: 5.0.0
104
126
  type: :development
105
127
  prerelease: false
106
128
  version_requirements: !ruby/object:Gem::Requirement
107
129
  requirements:
108
- - - '>='
130
+ - - ">="
109
131
  - !ruby/object:Gem::Version
110
132
  version: 5.0.0
111
133
  - !ruby/object:Gem::Dependency
112
134
  name: pry
113
135
  requirement: !ruby/object:Gem::Requirement
114
136
  requirements:
115
- - - '>='
137
+ - - ">="
116
138
  - !ruby/object:Gem::Version
117
139
  version: '0'
118
140
  type: :development
119
141
  prerelease: false
120
142
  version_requirements: !ruby/object:Gem::Requirement
121
143
  requirements:
122
- - - '>='
144
+ - - ">="
123
145
  - !ruby/object:Gem::Version
124
146
  version: '0'
125
147
  - !ruby/object:Gem::Dependency
126
148
  name: pry-debugger
127
149
  requirement: !ruby/object:Gem::Requirement
128
150
  requirements:
129
- - - '>='
151
+ - - ">="
130
152
  - !ruby/object:Gem::Version
131
153
  version: '0'
132
154
  type: :development
133
155
  prerelease: false
134
156
  version_requirements: !ruby/object:Gem::Requirement
135
157
  requirements:
136
- - - '>='
158
+ - - ">="
137
159
  - !ruby/object:Gem::Version
138
160
  version: '0'
139
161
  description: Command line tool to help with developing Shopify themes. Provides simple
@@ -146,8 +168,8 @@ executables:
146
168
  extensions: []
147
169
  extra_rdoc_files: []
148
170
  files:
149
- - .gitignore
150
- - .travis.yml
171
+ - ".gitignore"
172
+ - ".travis.yml"
151
173
  - CHANGELOG.md
152
174
  - Gemfile
153
175
  - MIT-LICENSE
@@ -158,6 +180,7 @@ files:
158
180
  - lib/shopify_theme.rb
159
181
  - lib/shopify_theme/cli.rb
160
182
  - lib/shopify_theme/version.rb
183
+ - shipit.rubygems.yml
161
184
  - shopify_theme.gemspec
162
185
  - spec/spec_helper.rb
163
186
  - spec/unit/cli_spec.rb
@@ -171,20 +194,18 @@ require_paths:
171
194
  - lib
172
195
  required_ruby_version: !ruby/object:Gem::Requirement
173
196
  requirements:
174
- - - '>='
197
+ - - ">="
175
198
  - !ruby/object:Gem::Version
176
199
  version: '0'
177
200
  required_rubygems_version: !ruby/object:Gem::Requirement
178
201
  requirements:
179
- - - '>='
202
+ - - ">="
180
203
  - !ruby/object:Gem::Version
181
204
  version: '0'
182
205
  requirements: []
183
206
  rubyforge_project: shopify_theme
184
- rubygems_version: 2.0.3
207
+ rubygems_version: 2.2.0
185
208
  signing_key:
186
209
  specification_version: 4
187
210
  summary: Command line tool for developing themes
188
- test_files:
189
- - spec/spec_helper.rb
190
- - spec/unit/cli_spec.rb
211
+ test_files: []
metadata.gz.sig ADDED
Binary file