kibana-sinatra 3.1.0.0 → 3.1.0.1

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
  SHA1:
3
- metadata.gz: 8e814d7c44de07824618a49d1ef6f7fd1f65b9da
4
- data.tar.gz: cd129e565427adc2443cdc2b7678f134f580d6f4
3
+ metadata.gz: a1e05bf726539ac6f753a4f87fcfac3437365c8c
4
+ data.tar.gz: b13d42d8c9a2bc96f3724b6146ec8aa446d96684
5
5
  SHA512:
6
- metadata.gz: 5ebf59a58f1b18902b23f4066da73eb7fcb3b134053e28e0bf17d6b728c9f165b34d91b1bf24197c21470d63eb062d692e418401dfb2103ef06db00f7735306f
7
- data.tar.gz: 428d2994e538ed095cf9f0babe236e68bb096e87669b2fa427e534712daa784a96da670d578f23797943de3a29df29d547b15b450a32194ce760a0090108510f
6
+ metadata.gz: 2b6cb7c1cc7db01d55c8b7b3c84a73d699c3ca9726ed42532fd5c8be566fd486536623b2dde6295ef9a7efffeda664972363b02a4fccdad741a447a4fb28b6f1
7
+ data.tar.gz: 0d74a6de030ef1386d4e9d3622a08aa4ff00f0acb94632a2bc17f8b752570e646bd58da842cddb562382ed3766148dc77c2127cfb9b0d602132c267295dbe462
data/README.md CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  First you will need to configure Kibana's config.js file so that a web browser can find your [elasticsearch](http://www.elasticsearch.org/) cluster.
28
28
 
29
- Create a new file in `config/initializers` and include the following code. Replace the strings with the location of your elasticsearch cluster and the kibana index. Note that both of these are optional.
29
+ Create a new file in `config/initializers` and include the following code. Replace the strings with the location of your elasticsearch cluster and the kibana index. You may also set the default_route. Note that all of these are optional. Please refer to the [Kibana config file](https://github.com/elasticsearch/kibana/blob/master/src/config.js) for explanations of what these settings do.
30
30
 
31
31
  ```ruby
32
32
  module Kibana::Sinatra
@@ -38,6 +38,10 @@ module Kibana::Sinatra
38
38
  def kibana_index
39
39
  "kibana-int"
40
40
  end
41
+
42
+ def default_route
43
+ "/dashboard/elasticsearch/asdf"
44
+ end
41
45
  end
42
46
  end
43
47
  ```
@@ -1,5 +1,5 @@
1
1
  module Kibana
2
2
  module Sinatra
3
- VERSION = "3.1.0.0"
3
+ VERSION = "3.1.0.1"
4
4
  end
5
5
  end
@@ -22,6 +22,10 @@ module Kibana
22
22
  def kibana_index
23
23
  "kibana-int"
24
24
  end
25
+
26
+ def default_route
27
+ "/dashboard/file/default.json"
28
+ end
25
29
  end
26
30
 
27
31
  end
@@ -41,7 +41,7 @@ function (Settings) {
41
41
  *
42
42
  * default_route: '/dashboard/elasticsearch/WebLogs',
43
43
  */
44
- default_route : '/dashboard/file/default.json',
44
+ default_route : '<%= default_route %>',
45
45
 
46
46
  /** @scratch /configuration/config.js/5
47
47
  *
@@ -39,6 +39,7 @@ task :update do
39
39
  text = File.read(config_file)
40
40
  text.gsub!('http://"+window.location.hostname+":9200', '<%= elasticsearch_url %>')
41
41
  text.gsub!('"kibana-int"', '"<%= kibana_index %>"')
42
+ text.gsub!('\'/dashboard/file/default.json\'', '\'<%= default_route %>\'')
42
43
  File.open(config_file, "w") {|file| file.write(text) }
43
44
  end
44
45
 
@@ -23,6 +23,12 @@ class SinatraTest < Minitest::Unit::TestCase
23
23
  assert last_response.body.include?('elasticsearch: "http://"+window.location.hostname+":9200"')
24
24
  end
25
25
 
26
+ def test_it_renders_config_with_default_default_route
27
+ get '/config.js'
28
+ assert last_response.ok?
29
+ assert last_response.body.include?('default_route : \'/dashboard/file/default.json\'')
30
+ end
31
+
26
32
  def test_it_renders_config_with_custom_elasticsearch_url
27
33
  elasticsearch_url = Proc.new { "http://asdf.com:9200" }
28
34
 
@@ -49,6 +55,16 @@ class SinatraTest < Minitest::Unit::TestCase
49
55
  end
50
56
  end
51
57
 
58
+ def test_it_renders_config_with_custom_default_route
59
+ default_route = Proc.new { "asdf" }
60
+
61
+ monkey_patch "default_route", default_route do
62
+ get '/config.js'
63
+ assert last_response.ok?
64
+ assert last_response.body.include?('default_route : \'asdf\'')
65
+ end
66
+ end
67
+
52
68
  def monkey_patch(method_name, method_replacement)
53
69
  Kibana::Sinatra::Web.class_eval do
54
70
  alias_method "old_#{method_name}", method_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kibana-sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.0
4
+ version: 3.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Neubert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-28 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler