Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch a hard-coded gemspec to Jeweler #6

Merged
merged 2 commits into from
Mar 24, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pkg
pkg
Gemfile.lock
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ gem 'bundler'
gem 'i18n'
gem 'activesupport'

group :development do
gem 'bundler'
gem 'rake'
gem 'jeweler'
end

group :test do
gem 'rspec'
end

77 changes: 31 additions & 46 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
require 'rubygems'
require 'bundler'

require File.expand_path('../lib/numbers_and_words/version', __FILE__)

begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
Expand All @@ -8,57 +11,39 @@ rescue Bundler::BundlerError => e
exit e.status_code
end

require 'rake/gempackagetask'
require 'rubygems/specification'

GEM = "numbers_and_words"
GEM_VERSION = "0.2.3"
AUTHOR = "Kirill Lazarev"
EMAIL = "[email protected]"
HOMEPAGE = "http://github.com/kslazarev/numbers_and_words"
SUMMARY = "Simple convert number to russian words using I18N."
LICENSE = "MIT"

spec = Gem::Specification.new do |s|
s.name = GEM
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
#s.extra_rdoc_files = ["README.textile", "LICENSE", "CHANGELOG", "TODO"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.license = LICENSE
s.require_path = 'lib'
s.autorequire = GEM
s.files = Dir.glob("{lib,spec}/**/*")
require 'rake'

require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "numbers_and_words"
gem.homepage = "http://github.com/kslazarev/numbers_and_words"
gem.license = "MIT"
gem.summary = "Convert numbers to words using I18N."
gem.description = "Convert numbers to words using I18N."
gem.email = "[email protected]"
gem.version = NumbersAndWords::VERSION
gem.authors = [ "Kirill Lazarev" ]
gem.files = Dir.glob('lib/**/*')
end

Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
Jeweler::RubygemsDotOrgTasks.new

#task :default => :spec
require 'rspec/core'
require 'rspec/core/rake_task'

#require 'spec/rake/spectask'
#require 'date'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

#desc "Run specs"
#Spec::Rake::SpecTask.new do |t|
# t.spec_files = FileList['spec/**/*_spec.rb']
# t.spec_opts = %w(-fs --color)
#end
task :default => :spec

desc "install the gem locally"
task :install => [:package] do
sh %{gem install pkg/#{GEM}-#{GEM_VERSION}}
end
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

desc "create a gemspec file"
task :make_spec do
File.open("#{GEM}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "numbers_and_words #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('LICENSE*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 2 additions & 0 deletions lib/numbers_and_words.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require 'initializers/i18n'
require 'active_support/inflector'

require 'numbers_and_words/version'

require 'numbers_and_words/translations_helpers'
require 'numbers_and_words/strategies'
require 'numbers_and_words/array_additions'
Expand Down
3 changes: 3 additions & 0 deletions lib/numbers_and_words/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module NumbersAndWords
VERSION = '0.3.0'
end
56 changes: 50 additions & 6 deletions numbers_and_words.gemspec
Original file line number Diff line number Diff line change
@@ -1,28 +1,72 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = "numbers_and_words"
s.version = "0.2.3"
s.version = "0.3.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Kirill Lazarev"]
s.autorequire = "numbers_and_words"
s.date = "2011-12-15"
s.description = "Simple convert number to russian words using I18N."
s.date = "2012-03-22"
s.description = "Convert numbers to words using I18N."
s.email = "[email protected]"
s.files = ["lib/initializers", "lib/initializers/i18n.rb", "lib/locales", "lib/locales/numbers.en.yml", "lib/locales/numbers.ru.yml", "lib/locales/plurals.rb", "lib/numbers_and_words", "lib/numbers_and_words/array_additions", "lib/numbers_and_words/array_additions/helpers.rb", "lib/numbers_and_words/array_additions/validations.rb", "lib/numbers_and_words/array_additions.rb", "lib/numbers_and_words/core_ext", "lib/numbers_and_words/core_ext/array.rb", "lib/numbers_and_words/core_ext/integer.rb", "lib/numbers_and_words/figures_array.rb", "lib/numbers_and_words/pluralization.rb", "lib/numbers_and_words/strategies", "lib/numbers_and_words/strategies/base.rb", "lib/numbers_and_words/strategies/en.rb", "lib/numbers_and_words/strategies/ru.rb", "lib/numbers_and_words/strategies.rb", "lib/numbers_and_words/translations_helpers", "lib/numbers_and_words/translations_helpers/base.rb", "lib/numbers_and_words/translations_helpers/en.rb", "lib/numbers_and_words/translations_helpers/ru.rb", "lib/numbers_and_words/translations_helpers.rb", "lib/numbers_and_words.rb", "spec/numbers_and_words", "spec/numbers_and_words/array", "spec/numbers_and_words/array/ru_spec.rb", "spec/numbers_and_words/integer", "spec/numbers_and_words/integer/ru_spec.rb", "spec/spec_helper.rb"]
s.extra_rdoc_files = [
"LICENSE.txt",
"README.rdoc"
]
s.files = [
"lib/initializers/i18n.rb",
"lib/locales/numbers.en.yml",
"lib/locales/numbers.ru.yml",
"lib/locales/plurals.rb",
"lib/numbers_and_words.rb",
"lib/numbers_and_words/array_additions.rb",
"lib/numbers_and_words/array_additions/helpers.rb",
"lib/numbers_and_words/array_additions/validations.rb",
"lib/numbers_and_words/core_ext/array.rb",
"lib/numbers_and_words/core_ext/integer.rb",
"lib/numbers_and_words/figures_array.rb",
"lib/numbers_and_words/pluralization.rb",
"lib/numbers_and_words/strategies.rb",
"lib/numbers_and_words/strategies/base.rb",
"lib/numbers_and_words/strategies/en.rb",
"lib/numbers_and_words/strategies/ru.rb",
"lib/numbers_and_words/translations_helpers.rb",
"lib/numbers_and_words/translations_helpers/base.rb",
"lib/numbers_and_words/translations_helpers/en.rb",
"lib/numbers_and_words/translations_helpers/ru.rb",
"lib/numbers_and_words/version.rb"
]
s.homepage = "http://github.com/kslazarev/numbers_and_words"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = "1.8.10"
s.summary = "Simple convert number to russian words using I18N."
s.summary = "Convert numbers to words using I18N."

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<i18n>, [">= 0"])
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
s.add_development_dependency(%q<bundler>, [">= 0"])
s.add_development_dependency(%q<rake>, [">= 0"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
else
s.add_dependency(%q<i18n>, [">= 0"])
s.add_dependency(%q<activesupport>, [">= 0"])
s.add_dependency(%q<bundler>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
end
else
s.add_dependency(%q<i18n>, [">= 0"])
s.add_dependency(%q<activesupport>, [">= 0"])
s.add_dependency(%q<bundler>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
end
end

15 changes: 15 additions & 0 deletions spec/numbers_and_words/version_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require './spec/spec_helper'

describe NumbersAndWords do
context "version" do
it "exists" do
NumbersAndWords::VERSION.length.should > 0
end
it "has 3 parts" do
NumbersAndWords::VERSION.split(".").length.should == 3
end
it "is not zero" do
NumbersAndWords::VERSION.split(".").inject(0) { |sum, part| sum + part.to_i }.should > 0
end
end
end