base_indexer 0.2 → 0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a845f6565d0ab1da5a21c86ffa12cfd324e4de
|
4
|
+
data.tar.gz: c6f6f8214c8d68b5b7061acf51ab0dabf4d92ef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7c110bcda4514eb2a20006f7dc76ce1221efe6bab27e4aceb5bdb0ad74d6d66c7a8356d9c91e64a36b61f2e19c6f4e735530a3a5c3682d231c1d4a223c21aee
|
7
|
+
data.tar.gz: 2bba39fd14030d0dce955edbd1db1ffb975c7bdeeaf4544e94001b23e4dfcc07f1d974337d889bf66d9ad9ed8f76ebadc341a119a4bedb0e051cdac06b5edbee
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module BaseIndexer
|
2
|
+
class AboutController < ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
render :text=>'ok', :status=>200
|
6
|
+
end
|
7
|
+
|
8
|
+
def version
|
9
|
+
|
10
|
+
@result={:app_name=>Rails.configuration.app_name,:rails_env=>Rails.env,:version=>Rails.configuration.app_version,:last_restart=>(File.exists?('tmp/restart.txt') ? File.new('tmp/restart.txt').mtime : "n/a"),:last_deploy=>(File.exists?('REVISION') ? File.new('REVISION').mtime : "n/a")}
|
11
|
+
@result.update({:solr_cores=>BaseIndexer.solr_configuration_class_name.constantize.instance.get_configuration_hash})
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.json {render :json=>@result.to_json}
|
15
|
+
format.xml {render :json=>@result.to_xml(:root => 'status')}
|
16
|
+
format.html {render}
|
17
|
+
# add the solr core names
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1><%=@result[:app_name]%></h1>
|
2
|
+
<p>
|
3
|
+
<strong>Rails environment:</strong> <%=@result[:rails_env] %><br >
|
4
|
+
</p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong>Last deployed time:</strong> <%=@result[:last_deploy]%><br />
|
8
|
+
<strong>Current deployed version:</strong> <%=@result[:version]%><br />
|
9
|
+
<strong>Last restart time:</strong> <%=@result[:last_restart]%> <br />
|
10
|
+
<strong>Registered SOLR cores: </strong> <%=@result[:solr_cores]%> <br />
|
11
|
+
</p>
|
data/config/routes.rb
CHANGED
data/lib/base_indexer/engine.rb
CHANGED
@@ -15,6 +15,9 @@ module BaseIndexer
|
|
15
15
|
|
16
16
|
# Reads the SOLR configuration fiel
|
17
17
|
BaseIndexer.solr_configuration_class_name.constantize.instance.read(Rails.configuration.solr_config_file_path ||= 'test')
|
18
|
+
config.app_version = "0.0"
|
19
|
+
config.app_name = "[You have to override this name in your app]"
|
20
|
+
|
18
21
|
|
19
22
|
# Initializes the DiscoveryIndexer log with Rails logger, so all the messages will go to
|
20
23
|
# the same log file
|
data/lib/base_indexer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base_indexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmed Alsum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -194,10 +194,12 @@ files:
|
|
194
194
|
- MIT-LICENSE
|
195
195
|
- README.rdoc
|
196
196
|
- Rakefile
|
197
|
+
- app/controllers/base_indexer/about_controller.rb
|
197
198
|
- app/controllers/base_indexer/application_controller.rb
|
198
199
|
- app/controllers/base_indexer/items_controller.rb
|
199
200
|
- app/helpers/base_indexer/application_helper.rb
|
200
201
|
- app/helpers/base_indexer/items_helper.rb
|
202
|
+
- app/views/base_indexer/about/version.html.erb
|
201
203
|
- app/views/base_indexer/items/new.json.erb
|
202
204
|
- config/initializers/base_indexer.rb
|
203
205
|
- config/routes.rb
|