diff --git a/README.md b/README.md index 872f06c..210f728 100644 --- a/README.md +++ b/README.md @@ -184,15 +184,6 @@ $ curl -s https://rubies.io/api/last_update | jq } ``` -[`/version`](https://rubies.io/api/version) - returns the version of the API. It's the same value of the latest tag of the GitHub repo. - -```bash -$ curl -s https://rubies.io/api/version | jq -{ - "version": "2.2.1" -} -``` - ### Errors Invalid requests return a `404` status with no body. diff --git a/app.rb b/app.rb index ef6ead8..cb94271 100644 --- a/app.rb +++ b/app.rb @@ -24,10 +24,6 @@ class Rubies < Sinatra::Base set :root, File.dirname(settings.app_file) set :public_folder, File.join(settings.root, 'public') - before do - @version = REDIS.get('__version') - end - get '/' do @normal = REDIS.lrange('__normal', 0, -1) @security = REDIS.lrange('__security', 0, -1) diff --git a/lib/version.rb b/lib/version.rb deleted file mode 100644 index 7dfc1ac..0000000 --- a/lib/version.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -VERSION_MAJOR = 2 -VERSION_MINOR = 2 -VERSION_PATCH = 1 -VERSION_FULL = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}".freeze diff --git a/spec/app_spec.rb b/spec/app_spec.rb index 436049d..905c03e 100644 --- a/spec/app_spec.rb +++ b/spec/app_spec.rb @@ -106,18 +106,6 @@ end end - describe 'version endpoint' do - let(:endpoint) { '/api/version' } - - it 'returns the API version' do - get endpoint - - expect(json).to eq({ - 'version' => '2.2.1' - }) - end - end - describe 'last update endpoint' do let(:endpoint) { '/api/last_update' } diff --git a/spec/fixtures/redis.json b/spec/fixtures/redis.json index 3037ff6..3a69f0a 100644 --- a/spec/fixtures/redis.json +++ b/spec/fixtures/redis.json @@ -1343,9 +1343,6 @@ "latest": false, "prerelease": false }, - "version": { - "version": "2.2.1" - }, "last_update": { "last_update": "2020-10-24 07:30:00 +0000" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4757f28..0bda8ac 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,6 @@ require_relative '../lib/remote' require_relative '../lib/branch' require_relative '../lib/release' -require_relative '../lib/version' require_relative '../app' ENV['RACK_ENV'] = 'test' diff --git a/tasks/redis.rake b/tasks/redis.rake index a67a7ef..fadaeca 100644 --- a/tasks/redis.rake +++ b/tasks/redis.rake @@ -5,7 +5,6 @@ require 'redis' require_relative '../lib/remote' require_relative '../lib/branch' require_relative '../lib/release' -require_relative '../lib/version' REDIS ||= Redis.new(url: ENV['REDIS_URL']) @@ -32,7 +31,6 @@ namespace :redis do REDIS.set('__branches_sha', Branch.sha) REDIS.set('__releases_sha', Release.sha) - REDIS.set('__version', VERSION_FULL) REDIS.set('__last_update', last_update) # API endpoints @@ -40,8 +38,7 @@ namespace :redis do Branch.hashmap_branches.each { |key, attr| REDIS.set(key, attr.to_json) } Release.hashmap_releases.each { |key, attr| REDIS.set(key, attr.to_json) } - REDIS.set('version', { version: VERSION_FULL }.to_json) - REDIS.set('last_update', { last_update: last_update }.to_json) + REDIS.set('last_update', { last_update: last_update }.to_json) puts "#{last_update}: Redis OK (#{REDIS.dbsize})" end diff --git a/views/layout.erb b/views/layout.erb index 202a6de..bd762ce 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -46,11 +46,9 @@