From 7edc974bced1909af473c529d7b82733632c4473 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Tue, 3 May 2011 22:31:31 -0400
Subject: [PATCH] Add VERSION constant (rm VERSION file).

Was causing problems when installing with bundler from Git URL.
---
 VERSION                 | 1 -
 geocoder.gemspec        | 9 +++------
 lib/geocoder.rb         | 4 ----
 lib/geocoder/cli.rb     | 3 ++-
 lib/geocoder/version.rb | 3 +++
 5 files changed, 8 insertions(+), 12 deletions(-)
 delete mode 100644 VERSION
 create mode 100644 lib/geocoder/version.rb

diff --git a/VERSION b/VERSION
deleted file mode 100644
index 62ea2590..00000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.9.13
diff --git a/geocoder.gemspec b/geocoder.gemspec
index 5b4e38bb..704d9908 100644
--- a/geocoder.gemspec
+++ b/geocoder.gemspec
@@ -1,13 +1,10 @@
 # -*- encoding: utf-8 -*-
-
-lib = File.expand_path('../lib/', __FILE__)
-$:.unshift lib unless $:.include?(lib)
-
-require 'geocoder'
+$:.push File.expand_path("../lib", __FILE__)
+require "geocoder/version"
 
 Gem::Specification.new do |s|
   s.name        = "geocoder"
-  s.version     = Geocoder.version
+  s.version     = Geocoder::VERSION
   s.platform    = Gem::Platform::RUBY
   s.authors     = ["Alex Reisner"]
   s.email       = ["alex@alexreisner.com"]
diff --git a/lib/geocoder.rb b/lib/geocoder.rb
index e61ceabc..d98b76b5 100644
--- a/lib/geocoder.rb
+++ b/lib/geocoder.rb
@@ -93,10 +93,6 @@ module Geocoder
     [:freegeoip]
   end
 
-  def version
-    File.read(File.join(File.dirname(__FILE__), "..", "VERSION")).chomp
-  end
-
 
   # exception classes
   class Error < StandardError; end
diff --git a/lib/geocoder/cli.rb b/lib/geocoder/cli.rb
index 7bddd963..127b8d3f 100644
--- a/lib/geocoder/cli.rb
+++ b/lib/geocoder/cli.rb
@@ -46,7 +46,8 @@ module Geocoder
         end
 
         opts.on_tail("-v", "--version", "Print version number") do
-          out << "Geocoder #{Geocoder.version}\n"
+          require "geocoder/version"
+          out << "Geocoder #{Geocoder::VERSION}\n"
           exit
         end
 
diff --git a/lib/geocoder/version.rb b/lib/geocoder/version.rb
new file mode 100644
index 00000000..785b75ff
--- /dev/null
+++ b/lib/geocoder/version.rb
@@ -0,0 +1,3 @@
+module Geocoder
+  VERSION = "0.9.13"
+end
-- 
GitLab