summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-01-12 09:48:16 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-01-12 09:48:16 +1300
commita8ed9ac5ba43ab18dfbd45039e40d76b66cece2a (patch)
treeac1d2f220c2c1948cefa1e584153ee1dfe74a594
parent6fef4abc8e0e18cdcf5c3ca6ad63d5c42deb0432 (diff)
downloadrack-improve-install.tar.gz
Improve install process.improve-install
-rw-r--r--Rakefile1
-rw-r--r--lib/rack.rb17
-rw-r--r--lib/rack/version.rb29
-rw-r--r--rack.gemspec4
4 files changed, 35 insertions, 16 deletions
diff --git a/Rakefile b/Rakefile
index a365ff54..3a232cc5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+require "bundler/gem_tasks"
require "rake/testtask"
desc "Run all the tests"
diff --git a/lib/rack.rb b/lib/rack.rb
index 751bb059..a40738fb 100644
--- a/lib/rack.rb
+++ b/lib/rack.rb
@@ -11,22 +11,9 @@
# All modules meant for use in your application are <tt>autoload</tt>ed here,
# so it should be enough just to <tt>require 'rack'</tt> in your code.
-module Rack
- # The Rack protocol version number implemented.
- VERSION = [1, 3]
-
- # Return the Rack protocol version as a dotted string.
- def self.version
- VERSION.join(".")
- end
-
- RELEASE = "2.2.0"
-
- # Return the Rack release as a dotted string.
- def self.release
- RELEASE
- end
+require_relative 'rack/version'
+module Rack
HTTP_HOST = 'HTTP_HOST'
HTTP_VERSION = 'HTTP_VERSION'
HTTPS = 'HTTPS'
diff --git a/lib/rack/version.rb b/lib/rack/version.rb
new file mode 100644
index 00000000..fa37d786
--- /dev/null
+++ b/lib/rack/version.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+# Copyright (C) 2007-2019 Leah Neukirchen <http://leahneukirchen.org/infopage.html>
+#
+# Rack is freely distributable under the terms of an MIT-style license.
+# See MIT-LICENSE or https://opensource.org/licenses/MIT.
+
+# The Rack main module, serving as a namespace for all core Rack
+# modules and classes.
+#
+# All modules meant for use in your application are <tt>autoload</tt>ed here,
+# so it should be enough just to <tt>require 'rack'</tt> in your code.
+
+module Rack
+ # The Rack protocol version number implemented.
+ VERSION = [1, 3]
+
+ # Return the Rack protocol version as a dotted string.
+ def self.version
+ VERSION.join(".")
+ end
+
+ RELEASE = "2.2.0"
+
+ # Return the Rack release as a dotted string.
+ def self.release
+ RELEASE
+ end
+end
diff --git a/rack.gemspec b/rack.gemspec
index 6ed57b29..1e17890f 100644
--- a/rack.gemspec
+++ b/rack.gemspec
@@ -1,8 +1,10 @@
# frozen_string_literal: true
+require_relative 'lib/rack/version'
+
Gem::Specification.new do |s|
s.name = "rack"
- s.version = File.read('lib/rack.rb')[/RELEASE += +([\"\'])([\d][\w\.]+)\1/, 2]
+ s.version = Rack::RELEASE
s.platform = Gem::Platform::RUBY
s.summary = "a modular Ruby webserver interface"
s.license = "MIT"