nimbu 0.7.8 → 0.7.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
  SHA1:
3
- metadata.gz: 5d90952827746723728dda2218dd326a06ecf60d
4
- data.tar.gz: f22e1bb20f0e1596e43307997bc0d16b3a179eed
3
+ metadata.gz: 9d7d01bb99d406ca5718d7144a86ac847e1dd406
4
+ data.tar.gz: b20d6a92f23e1d3e35d2be2497f0ac4afaf05484
5
5
  SHA512:
6
- metadata.gz: 9c3970ee523e172609011573eae7fc53858835426a77635319db3a1ce8d08e548a47c1751ba825b7fa4c1e6a38b225ad6619f131d3b3d24cd61ce94eb77a88d0
7
- data.tar.gz: 89681997c94beb4c09fb9af551537812cc98d4a89d0aaa1cbba88f51c0d6dcac2101d1fa3ccac2a82bed6de509e0d0776b367dbf2294be078dcb4a7179514ab2
6
+ metadata.gz: ba5804f0fbf643a933a7c108f8957e0c5c9de0cd5254f31ac552adadcd6fe2790ef114df0421f82de6f72b88e91234805436cfe9c49bc64b5b9575c394075031
7
+ data.tar.gz: 0d4299b4d55489ce381b8dcc3ba0f997716e38a1b8af08580a186e79edb2ee72193df512dbb3890c76a37b3565090029cacea4e88108dfb4b3eed43eb8e0bc3b
@@ -12,11 +12,13 @@ class Nimbu::Command::Server < Nimbu::Command::Base
12
12
  #
13
13
  # starts a local development server, using the data from the Nimbu cloud in real time.
14
14
  #
15
- # -p PORT, --port PORT # set the port on which to start the http server
16
- # -h, --haml # start local HAML watcher
17
- # -c, --compass # start local Compass watcher
18
- # -d, --debug # enable debugging output
19
- # --nocookies # disable session refresh cookie check
15
+ # -p PORT, --port PORT # set the port on which to start the http server
16
+ # -h, --haml # start local HAML watcher
17
+ # -c, --compass # start local Compass watcher
18
+ # -d, --debug # enable debugging output
19
+ # --webpack RES # comma separated list of webpack resources (relative to /javascripts)
20
+ # --webpackurl URL # proxy requests for webpack resources to the given URL prefix (default: http://localhost:8080)
21
+ # --nocookies # disable session refresh cookie check
20
22
  #
21
23
  def index
22
24
  # Check if config file is present?
@@ -27,11 +29,22 @@ class Nimbu::Command::Server < Nimbu::Command::Base
27
29
  with_haml = options[:haml]
28
30
  with_compass = options[:compass] || options[:c]
29
31
  no_cookies = options[:nocookies]
32
+ webpack_resources = options[:webpack]
33
+ webpack_url = options[:webpackurl]
30
34
 
31
35
  if no_cookies
32
36
  Nimbu.cli_options[:nocookies] = true
33
37
  end
34
38
 
39
+ if webpack_resources
40
+ Nimbu.cli_options[:webpack_resources] = webpack_resources.split(",").map(&:strip)
41
+ if webpack_url
42
+ Nimbu.cli_options[:webpack_url] = webpack_url
43
+ else
44
+ Nimbu.cli_options[:webpack_url] = "http://localhost:8080"
45
+ end
46
+ end
47
+
35
48
  if with_compass
36
49
  require 'compass'
37
50
  require 'compass/exec'
@@ -47,6 +60,7 @@ class Nimbu::Command::Server < Nimbu::Command::Base
47
60
  title = "Starting up Nimbu Server"
48
61
  title << " (with local #{services.join(' and ')} watcher)" if with_compass || with_haml
49
62
  title << " (skipping cookies check)" if no_cookies
63
+ title << " (proxying webpack resources to #{Nimbu.cli_options[:webpack_url]})" if webpack_resources
50
64
  title << " ..."
51
65
  puts white("\n#{title}")
52
66
  puts green(nimbu_header)
@@ -29,6 +29,8 @@ module Nimbu
29
29
  use Rack::StreamingProxy::Proxy do |request|
30
30
  if request.path.start_with?('/favicon.ico')
31
31
  "http://#{Nimbu::Auth.site}.#{Nimbu::Auth.admin_host}/favicon.ico"
32
+ elsif Nimbu.cli_options[:webpack_url] && webpack_resource?(request.path)
33
+ "#{Nimbu.cli_options[:webpack_url]}#{request.path}"
32
34
  end
33
35
  end
34
36
 
@@ -189,6 +191,10 @@ module Nimbu
189
191
  end
190
192
  end
191
193
 
194
+ def self.webpack_resource?(path)
195
+ path =~ /\/javascripts\// && Nimbu.cli_options[:webpack_resources].include?(path.gsub("/javascripts/", ""))
196
+ end
197
+
192
198
  end
193
199
  end
194
200
  end
data/lib/nimbu/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Nimbu
3
- VERSION = "0.7.8"
3
+ VERSION = "0.7.9"
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.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zenjoy BVBA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-24 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  version: '0'
312
312
  requirements: []
313
313
  rubyforge_project:
314
- rubygems_version: 2.4.5
314
+ rubygems_version: 2.4.6
315
315
  signing_key:
316
316
  specification_version: 4
317
317
  summary: Client library and CLI to design websites on the Nimbu platform.