diff --git a/Rakefile b/Rakefile index 1b13e74..8ee2e8d 100644 --- a/Rakefile +++ b/Rakefile @@ -3,41 +3,23 @@ require 'rake' require 'rake/testtask' require 'rake/rdoctask' -spec = Gem::Specification.new do |s| - s.name = 'encrypted_strings' - s.version = '0.3.3' - s.platform = Gem::Platform::RUBY - s.summary = 'Dead-simple string encryption/decryption syntax' - s.description = s.summary - - s.files = FileList['{lib,test}/**/*'] + %w(CHANGELOG.rdoc init.rb LICENSE Rakefile README.rdoc) - s.require_path = 'lib' - s.has_rdoc = true - s.test_files = Dir['test/**/*_test.rb'] - - s.author = 'Aaron Pfeifer' - s.email = 'aaron@pluginaweek.org' - s.homepage = 'http://www.pluginaweek.org' - s.rubyforge_project = 'pluginaweek' -end - desc 'Default: run all tests.' task :default => :test -desc "Test the #{spec.name} plugin." +desc "Test encrypted_strings." Rake::TestTask.new(:test) do |t| t.libs << 'lib' - t.test_files = spec.test_files + t.test_files = Dir['test/**/*_test.rb'] t.verbose = true end begin require 'rcov/rcovtask' namespace :test do - desc "Test the #{spec.name} plugin with Rcov." + desc "Test encrypted_strings with Rcov." Rcov::RcovTask.new(:rcov) do |t| t.libs << 'lib' - t.test_files = spec.test_files + t.test_files = Dir['test/**/*_test.rb'] t.rcov_opts << '--exclude="^(?!lib/)"' t.verbose = true end @@ -45,18 +27,10 @@ begin rescue LoadError end -desc "Generate documentation for the #{spec.name} plugin." +desc "Generate documentation for encrypted_strings." Rake::RDocTask.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' - rdoc.title = spec.name - rdoc.template = '../rdoc_template.rb' + rdoc.title = 'encrypted_strings' rdoc.options << '--line-numbers' << '--inline-source' << '--main=README.rdoc' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG.rdoc', 'LICENSE', 'lib/**/*.rb') end - -desc 'Generate a gemspec file.' -task :gemspec do - File.open("#{spec.name}.gemspec", 'w') do |f| - f.write spec.to_ruby - end -end diff --git a/encrypted_strings.gemspec b/encrypted_strings.gemspec index 5dcfc00..db084f1 100644 --- a/encrypted_strings.gemspec +++ b/encrypted_strings.gemspec @@ -1,29 +1,17 @@ -# -*- encoding: utf-8 -*- +$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) +require 'encrypted_strings/version' Gem::Specification.new do |s| - s.name = %q{encrypted_strings} - s.version = "0.3.3" - - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Aaron Pfeifer"] - s.date = %q{2010-03-07} - s.description = %q{Dead-simple string encryption/decryption syntax} - s.email = %q{aaron@pluginaweek.org} - s.files = ["lib/encrypted_strings.rb", "lib/encrypted_strings", "lib/encrypted_strings/sha_cipher.rb", "lib/encrypted_strings/asymmetric_cipher.rb", "lib/encrypted_strings/symmetric_cipher.rb", "lib/encrypted_strings/cipher.rb", "lib/encrypted_strings/extensions", "lib/encrypted_strings/extensions/string.rb", "test/test_helper.rb", "test/keys", "test/keys/encrypted_private", "test/keys/public", "test/keys/private", "test/cipher_test.rb", "test/string_test.rb", "test/sha_cipher_test.rb", "test/symmetric_cipher_test.rb", "test/asymmetric_cipher_test.rb", "CHANGELOG.rdoc", "init.rb", "LICENSE", "Rakefile", "README.rdoc"] - s.homepage = %q{http://www.pluginaweek.org} - s.require_paths = ["lib"] - s.rubyforge_project = %q{pluginaweek} - s.rubygems_version = %q{1.3.5} - s.summary = %q{Dead-simple string encryption/decryption syntax} - s.test_files = ["test/cipher_test.rb", "test/string_test.rb", "test/sha_cipher_test.rb", "test/symmetric_cipher_test.rb", "test/asymmetric_cipher_test.rb"] - - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 - - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - else - end - else - end + s.name = "encrypted_strings" + s.version = EncryptedStrings::VERSION + s.authors = ["Aaron Pfeifer"] + s.email = "aaron@pluginaweek.org" + s.homepage = "http://www.pluginaweek.org" + s.description = "Dead-simple string encryption/decryption syntax" + s.summary = "Encrypts strings" + s.require_paths = ["lib"] + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- test/*`.split("\n") + s.rdoc_options = %w(--line-numbers --inline-source --title encrypted_strings --main README.rdoc) + s.extra_rdoc_files = %w(README.rdoc CHANGELOG.rdoc LICENSE) end diff --git a/lib/encrypted_strings/version.rb b/lib/encrypted_strings/version.rb new file mode 100644 index 0000000..0af9557 --- /dev/null +++ b/lib/encrypted_strings/version.rb @@ -0,0 +1,3 @@ +module EncryptedStrings + VERSION = '0.3.3' +end