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 +4 -4
- data/lib/nimbu/auth.rb +5 -1
- data/lib/nimbu/command/auth.rb +11 -1
- data/lib/nimbu/command/server.rb +24 -15
- data/lib/nimbu/version.rb +3 -2
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea744b90abeb08a41b2b3e1b9e5dbf71e2cc608bcf245cafbf528b351676fcd8
|
4
|
+
data.tar.gz: e12d6a2a32d6b64c28a713accdcbbd5d9d077286bb09daf68b2a772689ba85a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f3aafe810fd60838c04a0ddb60138ee4ed3d864fce6db48fdbeb8aed6ad1bb2c06ee4443812636d1f7f7ffe6cb76a14365bc15442ed783c7d3df34a06a8a15
|
7
|
+
data.tar.gz: 328c8393b654b1539578a45f3cb52ab6eb1d938fe1beb557a696053a42891617eeda0a1ac7ecf6545ff92eace5c1eaa6e834d40f7242b3cec49113c71302d20f
|
data/lib/nimbu/auth.rb
CHANGED
@@ -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
|
data/lib/nimbu/command/auth.rb
CHANGED
@@ -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
|
-
|
data/lib/nimbu/command/server.rb
CHANGED
@@ -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
|
27
|
-
print red(bold("ERROR")), ": this directory does not seem to contain any Nimbu theme
|
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 '
|
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
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
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
|
data/lib/nimbu/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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:
|
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
|
-
|
329
|
-
|
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: []
|