nimbu 0.11.5 → 0.11.9

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
  SHA256:
3
- metadata.gz: b3ed668ba5555b406e463acca34c685068e0bffcd3ced2e9c7d664bbe033f389
4
- data.tar.gz: aeec3bf728680aabc02728e260a496f8023f2400098e5239983edba6eafaddcb
3
+ metadata.gz: ea744b90abeb08a41b2b3e1b9e5dbf71e2cc608bcf245cafbf528b351676fcd8
4
+ data.tar.gz: e12d6a2a32d6b64c28a713accdcbbd5d9d077286bb09daf68b2a772689ba85a0
5
5
  SHA512:
6
- metadata.gz: 1c069a1df54eec572537f2ea040476c68204bd8f82dde1a4ae4175f33b4a750996fb1919a62aa5fb502a6cda093d746261ed2502fd7a664e6414260150d869c6
7
- data.tar.gz: 88f0fb8c99bdefc20994dae6ba28a7f23d25c0feb6d0eb3fe7f9620e90bc0145eae6eb98310f57d38746982369b5d98cc6e9e5caeab7747f17c5aec3f89703a4
6
+ metadata.gz: 98f3aafe810fd60838c04a0ddb60138ee4ed3d864fce6db48fdbeb8aed6ad1bb2c06ee4443812636d1f7f7ffe6cb76a14365bc15442ed783c7d3df34a06a8a15
7
+ data.tar.gz: 328c8393b654b1539578a45f3cb52ab6eb1d938fe1beb557a696053a42891617eeda0a1ac7ecf6545ff92eace5c1eaa6e834d40f7242b3cec49113c71302d20f
@@ -37,6 +37,10 @@ class Nimbu::Auth
37
37
  delete_credentials
38
38
  end
39
39
 
40
+ def whoami
41
+ client.users.me
42
+ end
43
+
40
44
  # just a stub; will raise if not authenticated
41
45
  def check
42
46
  client.sites.list
@@ -172,7 +176,7 @@ class Nimbu::Auth
172
176
  end
173
177
 
174
178
  def token # :nodoc:
175
- get_credentials
179
+ ENV['NIMBU_API_KEY'] || get_credentials
176
180
  end
177
181
 
178
182
  def credentials_file
@@ -45,6 +45,17 @@ class Nimbu::Command::Auth < Nimbu::Command::Base
45
45
 
46
46
  alias_command "logout", "auth:logout"
47
47
 
48
+ # auth:whoami
49
+ #
50
+ # check the identity linked to your token
51
+ #
52
+ def whoami
53
+ results = Nimbu::Auth.whoami
54
+ display " => Logged in as: #{results[:name]} (#{results[:email]})"
55
+ end
56
+ alias_command "whoami", "auth:whoami"
57
+
58
+
48
59
  # auth:token
49
60
  #
50
61
  # display your api token
@@ -54,4 +65,3 @@ class Nimbu::Command::Auth < Nimbu::Command::Base
54
65
  end
55
66
 
56
67
  end
57
-
@@ -23,8 +23,10 @@ class Nimbu::Command::Server < Nimbu::Command::Base
23
23
  #
24
24
  def index
25
25
  # Check if config file is present?
26
- if !Nimbu::Auth.read_configuration || !Nimbu::Auth.read_credentials
27
- print red(bold("ERROR")), ": this directory does not seem to contain any Nimbu theme or your credentials are not set. \n ==> Run \"", bold { "nimbu init"}, "\" to initialize this directory."
26
+ if !Nimbu::Auth.read_configuration
27
+ print red(bold("ERROR")), ": this directory does not seem to contain any Nimbu theme configuration. \n ==> Run \"", bold { "nimbu init"}, "\" to initialize this directory."
28
+ elsif Nimbu::Auth.token.nil?
29
+ print red(bold("ERROR")), ": it seems you are not authenticated. \n ==> Run \"", bold { "nimbu login"}, "\" to initialize a session."
28
30
  else
29
31
  @with_haml = options[:haml]
30
32
  @with_compass = options[:compass] || options[:c]
@@ -242,7 +244,8 @@ class Nimbu::Command::Server < Nimbu::Command::Base
242
244
  end
243
245
 
244
246
  require 'rubygems'
245
- require 'fssm'
247
+ require 'filewatcher'
248
+ require 'pathname'
246
249
 
247
250
  class HamlWatcher
248
251
  class << self
@@ -250,19 +253,25 @@ class HamlWatcher
250
253
 
251
254
  def watch
252
255
  refresh
256
+ current_dir = File.join(Dir.pwd, 'haml/')
253
257
  puts ">>> Haml is polling for changes. Press Ctrl-C to Stop."
254
- FSSM.monitor('haml', '**/*.haml') do
255
- update do |base, relative|
256
- puts ">>> Change detected to: #{relative}"
257
- HamlWatcher.compile(relative)
258
- end
259
- delete do |base, relative|
260
- puts ">>> File deleted: #{relative}"
261
- HamlWatcher.remove(relative)
262
- end
263
- create do |base, relative|
264
- puts ">>> File created: #{relative}"
265
- HamlWatcher.compile(relative)
258
+ Filewatcher.new('haml/**/*.haml', every: true).watch do |filename, event|
259
+ begin
260
+ relative = filename.to_s.gsub(current_dir, '')
261
+
262
+ case event.to_s
263
+ when 'updated'
264
+ puts ">>> Change detected to: #{relative}"
265
+ HamlWatcher.compile(relative)
266
+ when 'deleted'
267
+ puts ">>> File deleted: #{relative}"
268
+ HamlWatcher.remove(relative)
269
+ when 'created'
270
+ puts ">>> File created: #{relative}"
271
+ HamlWatcher.compile(relative)
272
+ end
273
+ rescue => e
274
+ puts "#{e.inspect}"
266
275
  end
267
276
  end
268
277
  end
@@ -1,4 +1,5 @@
1
- # -*- encoding : utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  module Nimbu
3
- VERSION = "0.11.5"
4
+ VERSION = '0.11.9'
4
5
  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.11.5
4
+ version: 0.11.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zenjoy BVBA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-11 00:00:00.000000000 Z
11
+ date: 2020-11-05 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.1
33
+ version: 0.4.4
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.1
40
+ version: 0.4.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: rack
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.0.3
131
+ version: 2.1.4
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 2.0.3
138
+ version: 2.1.4
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: json
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: fssm
182
+ name: filewatcher
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="
@@ -310,7 +310,7 @@ files:
310
310
  homepage: https://www.nimbu.io
311
311
  licenses: []
312
312
  metadata: {}
313
- post_install_message:
313
+ post_install_message:
314
314
  rdoc_options: []
315
315
  require_paths:
316
316
  - lib
@@ -325,8 +325,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
325
  - !ruby/object:Gem::Version
326
326
  version: '0'
327
327
  requirements: []
328
- rubygems_version: 3.0.3
329
- signing_key:
328
+ rubyforge_project:
329
+ rubygems_version: 2.7.6.2
330
+ signing_key:
330
331
  specification_version: 4
331
332
  summary: Client library and CLI to design websites on the Nimbu platform.
332
333
  test_files: []