Skip to content

Commit 5d15ebd

Browse files
committed
move version out of VERSION.yml and into version.rb (to remove yaml dependency and some messy code)
1 parent 6d7bfc0 commit 5d15ebd

File tree

7 files changed

+14
-86
lines changed

7 files changed

+14
-86
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gem "rake"
55
group :development do
66
gem 'mg'
77
gem 'rspec'
8-
gem 'wrong'
8+
gem 'wrong', '>=0.6.2'
99
gem 'rdoc'
1010
end
1111

Gemfile.lock

Lines changed: 0 additions & 64 deletions
This file was deleted.

Rakefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
here = File.dirname __FILE__
22

3-
require 'rubygems'
4-
require 'bundler'
3+
# Note : this causes annoying psych warnings under Ruby 1.9.2-p180; to fix, upgrade to 1.9.3
54
begin
5+
require 'bundler'
66
Bundler.setup(:default, :development)
77
rescue Bundler::BundlerError => e
88
$stderr.puts e.message
99
$stderr.puts "Run `bundle install` to install missing gems"
1010
exit e.status_code
1111
end
12+
1213
require 'rake/dsl_definition'
1314
require 'rake'
15+
include Rake::DSL
1416

1517
require "#{here}/lib/annotate"
1618

VERSION.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

annotate.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
require './lib/annotate'
1+
here = File.dirname __FILE__
2+
require "#{here}/lib/annotate"
23

34
Gem::Specification.new do |s|
45
s.name = %q{annotate}

lib/annotate.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
2-
require 'yaml'
1+
here = File.dirname __FILE__
2+
require "#{here}/annotate/version"
33

44
module Annotate
5-
def self.version
6-
version_file = File.dirname(__FILE__) + "/../VERSION.yml"
7-
if File.exist?(version_file)
8-
config = YAML.load(File.read(version_file))
9-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
10-
else
11-
version = "0.0.0"
12-
end
13-
end
14-
155
def self.load_tasks
166
if File.exists?('Rakefile')
177
require 'rake'

lib/annotate/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Annotate
2+
def self.version
3+
"2.5.0.beta1"
4+
end
5+
end

0 commit comments

Comments
 (0)