nulogy-fitter-happier 0.0.3 → 1.0.0

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: 816e9e6be2a7edad145c32cc8caf7656b7471e7a
4
- data.tar.gz: f396f3084dd49447d4f54a204f0c200cbc2a4a5a
3
+ metadata.gz: 721947ca24eba27cfde909dcfa9c958b138977ff
4
+ data.tar.gz: ea467bbf8c0095dc3c145ed4d1dd32056b5b9f34
5
5
  SHA512:
6
- metadata.gz: 832393d4e08b0a34d5ee22eec8f08ff2e248f3cc2f5f54cf2f420c11a6970503fc499ca571630786d4c82bf8c01a0b89f86322b5f9481056beda1b14d4d68148
7
- data.tar.gz: 526efad42a0c262857137b6869d95017b8d38b602974d3fc1d7e8732a46c9bde864be80c33e13d89fe581a93138c62c942f71f4baef464a120f5ce0e30a32e57
6
+ metadata.gz: a617c7d4c9bc6828278ba28e2d9abf9aa64203c2b5b5486c940e5a08b461671bc10f5370c78a27b885872568b14230ae78ea1020840181e915835da43b6480a5
7
+ data.tar.gz: 52e5e0ad975da04e6bc7d68295e60cc764e297e38ecd607d5cdae9cbd87786c53e67b78ad710e364c3df933a2f5f94bf4ba76da95709856120d53692189667e0
File without changes
@@ -0,0 +1,30 @@
1
+ module FitterHappier
2
+ class HeartbeatController < ActionController::Base
3
+ layout nil
4
+
5
+ around_action :process_with_silence
6
+
7
+ def index
8
+ render(:plain => "FitterHappier Site Check Passed\n")
9
+ end
10
+
11
+ def site_check
12
+ time = Time.now.to_formatted_s(:rfc822)
13
+ render(:plain => "FitterHappier Site Check Passed @ #{time}\n")
14
+ end
15
+
16
+ def site_and_database_check
17
+ version = DatabaseCheck.schema_version
18
+ time = Time.now.to_formatted_s(:rfc822)
19
+ render(:plain => "FitterHappier Site and Database Check Passed @ #{time}\nSchema Version: #{version}\n")
20
+ end
21
+
22
+ private
23
+
24
+ def process_with_silence(*args)
25
+ logger.silence do
26
+ yield *args
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,8 @@
1
+ module FitterHappier
2
+ module DatabaseCheck
3
+ def self.schema_version
4
+ query = "SELECT max(lpad(version, 20, '0')) FROM schema_migrations"
5
+ ActiveRecord::Base.connection.select_value(query).to_i
6
+ end
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
- Rails.application.routes.draw do
2
- get '/fitter_happier' => 'fitter_happier#index'
3
- get '/fitter_happier/site_check' => 'fitter_happier#site_check'
4
- get '/fitter_happier/site_and_database_check' => 'fitter_happier#site_and_database_check'
1
+ FitterHappier::Engine.routes.draw do
2
+ get '/fitter_happier' => 'heartbeat#index'
3
+ get '/fitter_happier/site_check' => 'heartbeat#site_check'
4
+ get '/fitter_happier/site_and_database_check' => 'heartbeat#site_and_database_check'
5
5
  end
@@ -0,0 +1,4 @@
1
+ require "fitter_happier/engine"
2
+
3
+ module FitterHappier
4
+ end
@@ -0,0 +1,11 @@
1
+ module FitterHappier
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace FitterHappier
4
+
5
+ config.generators do |g|
6
+ g.test_framework :rspec, :fixture => false
7
+ g.assets false
8
+ g.helper false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,15 @@
1
+ require_relative 'boot'
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "fitter_happier"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+ end
14
+ end
15
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,54 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
+
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => 'public, max-age=172800'
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
28
+
29
+ # Don't care if the mailer can't send.
30
+ config.action_mailer.raise_delivery_errors = false
31
+
32
+ config.action_mailer.perform_caching = false
33
+
34
+ # Print deprecation notices to the Rails logger.
35
+ config.active_support.deprecation = :log
36
+
37
+ # Raise an error on page load if there are pending migrations.
38
+ config.active_record.migration_error = :page_load
39
+
40
+ # Debug mode disables concatenation and preprocessing of assets.
41
+ # This option may cause significant delays in view rendering with a large
42
+ # number of complex assets.
43
+ config.assets.debug = true
44
+
45
+ # Suppress logger output for asset requests.
46
+ config.assets.quiet = true
47
+
48
+ # Raises error for missing translations
49
+ # config.action_view.raise_on_missing_translations = true
50
+
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
+ end
@@ -0,0 +1,86 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Disable serving static files from the `/public` folder by default since
18
+ # Apache or NGINX already handles this.
19
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
20
+
21
+ # Compress JavaScripts and CSS.
22
+ config.assets.js_compressor = :uglifier
23
+ # config.assets.css_compressor = :sass
24
+
25
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
26
+ config.assets.compile = false
27
+
28
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
29
+
30
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
31
+ # config.action_controller.asset_host = 'http://assets.example.com'
32
+
33
+ # Specifies the header that your server uses for sending files.
34
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
35
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
36
+
37
+ # Mount Action Cable outside main process or domain
38
+ # config.action_cable.mount_path = nil
39
+ # config.action_cable.url = 'wss://example.com/cable'
40
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
41
+
42
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
+ # config.force_ssl = true
44
+
45
+ # Use the lowest log level to ensure availability of diagnostic information
46
+ # when problems arise.
47
+ config.log_level = :debug
48
+
49
+ # Prepend all log lines with the following tags.
50
+ config.log_tags = [ :request_id ]
51
+
52
+ # Use a different cache store in production.
53
+ # config.cache_store = :mem_cache_store
54
+
55
+ # Use a real queuing backend for Active Job (and separate queues per environment)
56
+ # config.active_job.queue_adapter = :resque
57
+ # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
58
+ config.action_mailer.perform_caching = false
59
+
60
+ # Ignore bad email addresses and do not raise email delivery errors.
61
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
62
+ # config.action_mailer.raise_delivery_errors = false
63
+
64
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
65
+ # the I18n.default_locale when a translation cannot be found).
66
+ config.i18n.fallbacks = true
67
+
68
+ # Send deprecation notices to registered listeners.
69
+ config.active_support.deprecation = :notify
70
+
71
+ # Use default logging formatter so that PID and timestamp are not suppressed.
72
+ config.log_formatter = ::Logger::Formatter.new
73
+
74
+ # Use a different logger for distributed setups.
75
+ # require 'syslog/logger'
76
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
77
+
78
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
79
+ logger = ActiveSupport::Logger.new(STDOUT)
80
+ logger.formatter = config.log_formatter
81
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
82
+ end
83
+
84
+ # Do not dump schema after migrations.
85
+ config.active_record.dump_schema_after_migration = false
86
+ end
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => 'public, max-age=3600'
19
+ }
20
+
21
+ # Show full error reports and disable caching.
22
+ config.consider_all_requests_local = true
23
+ config.action_controller.perform_caching = false
24
+
25
+ # Raise exceptions instead of rendering exception templates.
26
+ config.action_dispatch.show_exceptions = false
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+ # config.action_mailer.perform_caching = false
31
+
32
+ # Tell Action Mailer not to deliver emails to the real world.
33
+ # The :test delivery method accumulates sent emails in the
34
+ # ActionMailer::Base.deliveries array.
35
+ # config.action_mailer.delivery_method = :test
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount FitterHappier::Engine => "/"
3
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: INSERT_SECRET_HERE
15
+
16
+ test:
17
+ secret_key_base: INSERT_SECRET_HERE
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,31 @@
1
+ require "spec_helper"
2
+
3
+ module FitterHappier
4
+ RSpec.describe "FitterHappierRequestSpec", type: :request do
5
+
6
+ it "can GET index" do
7
+ get "/fitter_happier"
8
+
9
+ expect(response.status).to eq(200)
10
+ expect(response.body).to match(/FitterHappier Site Check Passed/)
11
+ end
12
+
13
+ it "can GET site_check" do
14
+ get "/fitter_happier/site_check"
15
+
16
+ expect(response.status).to eq(200)
17
+ expected_body = %r{FitterHappier Site Check Passed @ [A-z]{3}, \d{2} [A-z]{3} \d{4} \d{2}:\d{2}:\d{2} [0-9\-]+}
18
+ expect(response.body).to match(expected_body)
19
+ end
20
+
21
+ it "can GET site_and_database_check" do
22
+ expect(DatabaseCheck).to receive(:schema_version).and_return(12345)
23
+
24
+ get "/fitter_happier/site_and_database_check"
25
+
26
+ expect(response.status).to eq(200)
27
+ expected_body = %r{FitterHappier Site and Database Check Passed @ [A-z]{3}, \d{2} [A-z]{3} \d{4} \d{2}:\d{2}:\d{2} [0-9\-]+\nSchema Version: \d+}
28
+ expect(response.body).to match(expected_body)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ # NOTE: May not be supported on Rails 3 and require Rails 4+
4
+ module FitterHappier
5
+ RSpec.describe "FitterHappierRoutingSpec", type: :routing do
6
+ routes { FitterHappier::Engine.routes }
7
+
8
+ it "tests routing" do
9
+ expect(get: "fitter_happier").to route_to(controller: "fitter_happier/heartbeat", action: "index")
10
+ expect(get: "fitter_happier/site_check").to route_to(controller: "fitter_happier/heartbeat", action: "site_check")
11
+ expect(get: "fitter_happier/site_and_database_check").to route_to(controller: "fitter_happier/heartbeat", action: "site_and_database_check")
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ ENV["RAILS_ENV"] ||= "test"
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ require "rspec/rails"
5
+
6
+ RSpec.configure do |config|
7
+ config.mock_with :rspec
8
+ config.use_transactional_fixtures = true
9
+ config.infer_base_class_for_anonymous_controllers = false
10
+ config.order = "random"
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nulogy-fitter-happier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Moses
@@ -10,8 +10,106 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-20 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2016-09-28 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: actionpack
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 3.1.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: activerecord
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 3.1.0
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.1.0
43
+ - !ruby/object:Gem::Dependency
44
+ name: railties
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.1.0
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.1.0
57
+ - !ruby/object:Gem::Dependency
58
+ name: rake
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 0.9.2
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.9.2
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 2.6.0
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 2.6.0
85
+ - !ruby/object:Gem::Dependency
86
+ name: rspec-rails
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 2.6.1
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 2.6.1
99
+ - !ruby/object:Gem::Dependency
100
+ name: sqlite3
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
15
113
  description: send bug reports to http://github.com/nulogy/fitter-happier/
16
114
  email:
17
115
  - engineering@nulogy.com
@@ -21,11 +119,27 @@ extra_rdoc_files: []
21
119
  files:
22
120
  - CHANGELOG
23
121
  - MIT-LICENSE
24
- - README.mdown
25
- - app/controllers/fitter_happier_controller.rb
122
+ - README.md
123
+ - app/controllers/fitter_happier/heartbeat_controller.rb
124
+ - app/helpers/fitter_happier/database_check.rb
26
125
  - config/routes.rb
27
- - lib/fitter-happier.rb
28
- - rails/init.rb
126
+ - lib/fitter_happier.rb
127
+ - lib/fitter_happier/engine.rb
128
+ - spec/dummy/Rakefile
129
+ - spec/dummy/app/controllers/application_controller.rb
130
+ - spec/dummy/config.ru
131
+ - spec/dummy/config/application.rb
132
+ - spec/dummy/config/boot.rb
133
+ - spec/dummy/config/database.yml
134
+ - spec/dummy/config/environment.rb
135
+ - spec/dummy/config/environments/development.rb
136
+ - spec/dummy/config/environments/production.rb
137
+ - spec/dummy/config/environments/test.rb
138
+ - spec/dummy/config/routes.rb
139
+ - spec/dummy/config/secrets.yml
140
+ - spec/fitter_happier_request_spec.rb
141
+ - spec/fitter_happier_routing_spec.rb
142
+ - spec/spec_helper.rb
29
143
  homepage: https://github.com/nulogy/fitter-happier
30
144
  licenses: []
31
145
  metadata: {}
@@ -45,9 +159,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
159
  version: '0'
46
160
  requirements: []
47
161
  rubyforge_project:
48
- rubygems_version: 2.4.8
162
+ rubygems_version: 2.6.6
49
163
  signing_key:
50
164
  specification_version: 4
51
165
  summary: FitterHappier is a plug-in that provides actions for monitoring site and/or
52
166
  database availability for rails apps.
53
- test_files: []
167
+ test_files:
168
+ - spec/dummy/app/controllers/application_controller.rb
169
+ - spec/dummy/config/application.rb
170
+ - spec/dummy/config/boot.rb
171
+ - spec/dummy/config/database.yml
172
+ - spec/dummy/config/environment.rb
173
+ - spec/dummy/config/environments/development.rb
174
+ - spec/dummy/config/environments/production.rb
175
+ - spec/dummy/config/environments/test.rb
176
+ - spec/dummy/config/routes.rb
177
+ - spec/dummy/config/secrets.yml
178
+ - spec/dummy/config.ru
179
+ - spec/dummy/Rakefile
180
+ - spec/fitter_happier_request_spec.rb
181
+ - spec/fitter_happier_routing_spec.rb
182
+ - spec/spec_helper.rb
@@ -1,30 +0,0 @@
1
- class FitterHappierController < ActionController::Base
2
- layout nil
3
-
4
- def index
5
- render(:text => "FitterHappier Site Check Passed\n")
6
- end
7
-
8
- def site_check
9
- time = Time.now.to_formatted_s(:rfc822)
10
- render(:text => "FitterHappier Site Check Passed @ #{time}\n")
11
- end
12
-
13
- def site_and_database_check
14
- table_name = (Rails::VERSION::STRING >= '2.1.0' ? 'schema_migrations' : 'schema_info')
15
- query = "SELECT max(lpad(version, 20, '0')) FROM #{table_name}"
16
- version = ActiveRecord::Base.connection.select_value(query).to_i
17
- time = Time.now.to_formatted_s(:rfc822)
18
- render(:text => "FitterHappier Site and Database Check Passed @ #{time}\nSchema Version: #{version}\n")
19
- end
20
-
21
- private
22
-
23
- def process_with_silence(*args)
24
- logger.silence do
25
- process_without_silence(*args)
26
- end
27
- end
28
-
29
- alias_method_chain :process, :silence
30
- end
@@ -1,5 +0,0 @@
1
- module FitterHappier
2
- class Engine < Rails::Engine
3
- engine_name :fitter_happier
4
- end
5
- end
@@ -1 +0,0 @@
1
- require 'fitter_happier'