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: 1220e752bf2216ae1aaff3753ec171f099ae45eb
4
- data.tar.gz: 045aedb65c90aef594d1fdfc93157d770a09d068
3
+ metadata.gz: 23a845f6565d0ab1da5a21c86ffa12cfd324e4de
4
+ data.tar.gz: c6f6f8214c8d68b5b7061acf51ab0dabf4d92ef3
5
5
  SHA512:
6
- metadata.gz: 40898053ee492e35d690f5bbbd31b2337cdbf3301a2dfc9a3b517b089afa7fb3b13563fc2b7c69b8bf9e5800ba640244ff8974bb640a960e517420fb8a41a66a
7
- data.tar.gz: b772fde1333708f8321d97c2a8e8d2fec83e54071ac41cda08a051a29a66c360597caa90ed3e97d49c88c5dfe52406e4cd4201eb5215948ea645f043263f7071
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>
@@ -1,4 +1,7 @@
1
1
  BaseIndexer::Engine.routes.draw do
2
- get '/items/:druid', to: 'items#new'
2
+ root 'about#index'
3
+ get 'about/version' => 'about#version'
4
+
5
+ post '/items/:druid', to: 'items#new'
3
6
  delete '/items/:druid', to: 'items#destroy'
4
7
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BaseIndexer
2
- VERSION = "0.2"
2
+ VERSION = "0.3"
3
3
  end
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.2'
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-01 00:00:00.000000000 Z
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