Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

switch to bundler for gemspec management

  • Loading branch information...
commit 30b5022e9c2901cbdb309b863390922bd95af12c 1 parent c0d49ca
@grosser authored
View
4 Gemfile
@@ -1,7 +1,7 @@
source :rubygems
+gemspec
-group :dev do
+group :development do
gem 'rake'
gem 'rspec', '~>2'
- gem 'jeweler'
end
View
12 Gemfile.lock
@@ -1,12 +1,12 @@
+PATH
+ remote: .
+ specs:
+ url_store (0.3.2)
+
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.2)
- git (1.2.5)
- jeweler (1.5.2)
- bundler (~> 1.0.0)
- git (>= 1.2.5)
- rake
rake (0.8.7)
rspec (2.5.0)
rspec-core (~> 2.5.0)
@@ -21,6 +21,6 @@ PLATFORMS
ruby
DEPENDENCIES
- jeweler
rake
rspec (~> 2)
+ url_store!
View
29 Rakefile
@@ -1,19 +1,22 @@
+require 'bundler/gem_tasks'
+
task :default do
sh "rspec spec/"
end
-begin
- require 'jeweler'
- project_name = 'url_store'
- Jeweler::Tasks.new do |gem|
- gem.name = project_name
- gem.description = gem.summary = "Data securely stored in urls."
- gem.email = "grosser.michael@gmail.com"
- gem.homepage = "http://github.com/grosser/#{project_name}"
- gem.authors = ["Michael Grosser"]
- end
+# extracted from https://github.com/grosser/project_template
+rule /^version:bump:.*/ do |t|
+ sh "git status | grep 'nothing to commit'" # ensure we are not dirty
+ index = ['major', 'minor','patch'].index(t.name.split(':').last)
+ file = 'lib/url_store/version.rb'
+
+ version_file = File.read(file)
+ old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
+ version_parts[index] = version_parts[index].to_i + 1
+ version_parts[2] = 0 if index < 2 # remove patch for minor
+ version_parts[1] = 0 if index < 1 # remove minor for major
+ new_version = version_parts * '.'
+ File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
+ sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
end
View
1  VERSION
@@ -1 +0,0 @@
-0.3.2
View
3  lib/url_store.rb
@@ -1,9 +1,8 @@
+require 'url_store/version'
require 'url_store/compact_encoder'
-
require 'url_store/railtie' if defined?(::Rails) && ::Rails::VERSION::MAJOR >= 3
class UrlStore
- VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
SECRET = 'asdkasjlwqjdqaccxnjkasdfh2313'
# (convert to base64url <-> RFC4648) and '|'
View
3  lib/url_store/version.rb
@@ -0,0 +1,3 @@
+class UrlStore
+ VERSION = Version = '0.3.2'
+end
View
56 url_store.gemspec
@@ -1,50 +1,12 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
-# -*- encoding: utf-8 -*-
+$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
+name = "url_store"
+require "#{name}/version"
-Gem::Specification.new do |s|
- s.name = %q{url_store}
- s.version = "0.3.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+Gem::Specification.new name, UrlStore::VERSION do |s|
+ s.summary = "Data securely stored in urls."
s.authors = ["Michael Grosser"]
- s.date = %q{2011-05-28}
- s.description = %q{Data securely stored in urls.}
- s.email = %q{grosser.michael@gmail.com}
- s.files = [
- "Gemfile",
- "Gemfile.lock",
- "Rakefile",
- "Readme.md",
- "VERSION",
- "lib/url_store.rb",
- "lib/url_store/compact_encoder.rb",
- "lib/url_store/generators/initializer.rb",
- "lib/url_store/generators/templates/initializer.erb",
- "lib/url_store/railtie.rb",
- "spec/spec_helper.rb",
- "spec/url_store/compact_encoder_spec.rb",
- "spec/url_store_spec.rb",
- "url_store.gemspec"
- ]
- s.homepage = %q{http://github.com/grosser/url_store}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{Data securely stored in urls.}
- s.test_files = [
- "spec/spec_helper.rb",
- "spec/url_store/compact_encoder_spec.rb",
- "spec/url_store_spec.rb"
- ]
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
+ s.email = "michael@grosser.it"
+ s.homepage = "http://github.com/grosser/#{name}"
+ s.files = `git ls-files`.split("\n")
+ s.license = "MIT"
end
-
Please sign in to comment.
Something went wrong with that request. Please try again.