nimbu 0.10.5 → 0.11

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
  SHA256:
3
- metadata.gz: 48bfa351bcd8da9f22cc3ae2ac186fede987627447bec43cd533697de6671e96
4
- data.tar.gz: 8e4633b3b0f8a1983c70ee068265e4ca3b98c68f8d2c716608ff36170a85ff49
3
+ metadata.gz: 8b83d487f125fd6e62172e87ffd73d35dfe239a3e28d89909628071a8f5146c2
4
+ data.tar.gz: f0cb95835bc63ede7c7788718865677fa041458492c0792016862775798467c3
5
5
  SHA512:
6
- metadata.gz: 102857f2d0c6d113f72bf36e9c1bc8c7063694eebf0c852ef20b4fd654a690f74263eb6bc8644f269696adfa4bb0646101195b602ec39f4352537eed3e7feead
7
- data.tar.gz: ae1724304345db6c2bd6d5aff0791afd4ec229981f846310fce6684a19eb567e8bd2d9f257e938c05473b12fb7e7c4013fde5587db7cd941f41a819b6342fc43
6
+ metadata.gz: 6c8b2996b73656dffd0f927d09cfb641ee1628a3c64c76dc1ab7b68e0297d782a94f005a5f2b11bc3ab77e194e519a490b890f3e4e25ab2835a269fbffc43456
7
+ data.tar.gz: '0197d07948ec81b9ce10b001db9428347c5c95b8a58507a192bf70feb93ffb648324273eff21305af7996cf85c4221e18f4c6cb5bee19039f989cbf94340364c'
@@ -138,6 +138,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
138
138
  nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "fonts/#{font}", :file => io})
139
139
  print " - fonts/#{font}"
140
140
  print " (ok)\n"
141
+ rescue Nimbu::Error::Conflict => error
142
+ handle_conflict(error, font) do
143
+ nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "fonts/#{font}", :file => io, force: "true"})
144
+ end
141
145
  end
142
146
  end
143
147
 
@@ -156,6 +160,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
156
160
  nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "images/#{image}", :file => io})
157
161
  print " - images/#{image}"
158
162
  print " (ok)\n"
163
+ rescue Nimbu::Error::Conflict => error
164
+ handle_conflict(error, image) do
165
+ nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "images/#{image}", :file => io, force: "true"})
166
+ end
159
167
  end
160
168
  end
161
169
 
@@ -174,6 +182,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
174
182
  nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "stylesheets/#{css}", :file => io})
175
183
  print " - stylesheets/#{css}"
176
184
  print " (ok)\n"
185
+ rescue Nimbu::Error::Conflict => error
186
+ handle_conflict(error, css) do
187
+ nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "stylesheets/#{css}", :file => io, force: "true"})
188
+ end
177
189
  end
178
190
  end
179
191
 
@@ -192,6 +204,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
192
204
  nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "javascripts/#{js}", :file => io})
193
205
  print " - javascripts/#{js}"
194
206
  print " (ok)\n"
207
+ rescue Nimbu::Error::Conflict => error
208
+ handle_conflict(error, js) do
209
+ nimbu.themes(:subdomain => Nimbu::Auth.site).assets(:theme_id => theme).create({:name => "javascripts/#{js}", :file => io, force: "true"})
210
+ end
195
211
  end
196
212
  end
197
213
 
@@ -213,6 +229,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
213
229
  print " - snippets/#{snippet}"
214
230
  nimbu.themes(:subdomain => Nimbu::Auth.site).snippets(:theme_id => theme).create({:name => snippet, :content => IO.read(file).force_encoding('UTF-8')})
215
231
  print " (ok)\n"
232
+ rescue Nimbu::Error::Conflict => error
233
+ handle_conflict(error, snippet) do
234
+ nimbu.themes(:subdomain => Nimbu::Auth.site).snippets(:theme_id => theme).create({:name => snippet, :content => IO.read(file).force_encoding('UTF-8'), force: "true"})
235
+ end
216
236
  end
217
237
 
218
238
  print "\nLayouts:\n"
@@ -222,6 +242,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
222
242
  print " - layouts/#{layout}"
223
243
  nimbu.themes(:subdomain => Nimbu::Auth.site).layouts(:theme_id => theme).create({:name => layout, :content => IO.read(file).force_encoding('UTF-8')})
224
244
  print " (ok)\n"
245
+ rescue Nimbu::Error::Conflict => error
246
+ handle_conflict(error, layout) do
247
+ nimbu.themes(:subdomain => Nimbu::Auth.site).layouts(:theme_id => theme).create({:name => layout, :content => IO.read(file).force_encoding('UTF-8'), force: "true"})
248
+ end
225
249
  end
226
250
 
227
251
  print "\nTemplates:\n"
@@ -231,6 +255,10 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
231
255
  print " - templates/#{template}"
232
256
  nimbu.themes(:subdomain => Nimbu::Auth.site).templates(:theme_id => theme).create({:name => template, :content => IO.read(file).force_encoding('UTF-8')})
233
257
  print " (ok)\n"
258
+ rescue Nimbu::Error::Conflict => error
259
+ handle_conflict(error, template) do
260
+ nimbu.themes(:subdomain => Nimbu::Auth.site).templates(:theme_id => theme).create({:name => template, :content => IO.read(file).force_encoding('UTF-8'), force: "true"})
261
+ end
234
262
  end
235
263
  end
236
264
  rescue ::Nimbu::Error::Forbidden
@@ -239,6 +267,21 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
239
267
 
240
268
  private
241
269
 
270
+ def handle_conflict(error, filename, &block)
271
+ if error.message =~ /Conflict \((.*)\)/
272
+ puts " => WARNING!! #{$1}".red
273
+ if confirm(" Do you want to overwrite these changes? (y/n)")
274
+ print " -> Forcing upload of #{filename}".green
275
+ yield
276
+ print ": (ok)\n"
277
+ else
278
+ puts " -> Ok, skipping upload of #{filename}".yellow
279
+ end
280
+ else
281
+ puts " could not be updated".red
282
+ end
283
+ end
284
+
242
285
  def check_differences(contents, theme, *types)
243
286
  types.each do |type|
244
287
  if contents[type].any?
data/lib/nimbu/helpers.rb CHANGED
@@ -35,16 +35,6 @@ module Nimbu
35
35
  display "WARNING: #{message}"
36
36
  end
37
37
 
38
- def confirm_billing
39
- display
40
- display "This action will cause your account to be billed at the end of the month"
41
- display "For more information, see https://devcenter.Nimbu.com/articles/usage-and-billing"
42
- if confirm
43
- Nimbu::Auth.client.confirm_billing
44
- true
45
- end
46
- end
47
-
48
38
  def confirm(message="Are you sure you wish to continue? (y/n)")
49
39
  display("#{message} ", false)
50
40
  ['y', 'yes'].include?(ask.downcase)
data/lib/nimbu/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Nimbu
3
- VERSION = "0.10.5"
3
+ VERSION = "0.11"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nimbu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zenjoy BVBA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-30 00:00:00.000000000 Z
11
+ date: 2018-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.4'
33
+ version: 0.4.1
34
34
  type: :runtime
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.4'
40
+ version: 0.4.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement