From ba2aced6741af1914140d2d4fb8d173dd78bb153 Mon Sep 17 00:00:00 2001 From: ajb Date: Thu, 25 Dec 2014 10:39:32 +0000 Subject: [PATCH 1/2] use a constant for versioning --- lib/sync.rb | 1 + lib/sync/version.rb | 3 +++ sync.gemspec | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 lib/sync/version.rb diff --git a/lib/sync.rb b/lib/sync.rb index 26baa30..c722674 100644 --- a/lib/sync.rb +++ b/lib/sync.rb @@ -29,6 +29,7 @@ require 'sync/clients/pusher' require 'sync/clients/dummy' require 'sync/reactor' +require 'sync/version' if defined? Rails require 'sync/erb_tracker' require 'sync/engine' diff --git a/lib/sync/version.rb b/lib/sync/version.rb new file mode 100644 index 0000000..dbf807c --- /dev/null +++ b/lib/sync/version.rb @@ -0,0 +1,3 @@ +module Sync + VERSION = '0.3.2' +end diff --git a/sync.gemspec b/sync.gemspec index 0acc845..152b827 100644 --- a/sync.gemspec +++ b/sync.gemspec @@ -1,6 +1,10 @@ +$:.push File.expand_path("../lib", __FILE__) + +require 'sync/version' + Gem::Specification.new do |s| s.name = "sync" - s.version = "0.3.1" + s.version = Sync::VERSION s.author = "Chris McCord" s.email = "chris@chrismccord.com" s.homepage = "http://github.com/chrismccord/sync" From 93c8217ce4879c92d1673096fdcf187f81b988ec Mon Sep 17 00:00:00 2001 From: ajb Date: Thu, 25 Dec 2014 10:39:44 +0000 Subject: [PATCH 2/2] more gemspec best-practices --- sync.gemspec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sync.gemspec b/sync.gemspec index 152b827..672c780 100644 --- a/sync.gemspec +++ b/sync.gemspec @@ -3,6 +3,8 @@ $:.push File.expand_path("../lib", __FILE__) require 'sync/version' Gem::Specification.new do |s| + s.required_ruby_version = Gem::Requirement.new('>= 1.9.3') + s.name = "sync" s.version = Sync::VERSION s.author = "Chris McCord" @@ -10,7 +12,8 @@ Gem::Specification.new do |s| s.homepage = "http://github.com/chrismccord/sync" s.summary = "Realtime Rails Partials" s.description = "Sync turns your Rails partials realtime with automatic updates through Faye" - s.files = Dir["{app,config,lib,test}/**/*", "[A-Z]*", "init.rb"] - ["Gemfile.lock"] + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {gemfiles,test}/*`.split("\n") s.require_path = "lib" s.licenses = ['MIT'] @@ -26,6 +29,4 @@ Gem::Specification.new do |s| s.add_development_dependency 'sqlite3' s.add_development_dependency 'pry' s.add_development_dependency 'minitest', '< 5.0.0' - - s.required_rubygems_version = ">= 1.3.4" end