object-template 0.2 → 0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +35 -11
- data/lib/object-template.rb +3 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ea40dd81c9a57d0aa33469adf8d6408bb3682f
|
4
|
+
data.tar.gz: 683ee591d159652402b2f213751193accbde5bca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 931b827d49c540ff50ad42d562a5bc2ac29e54bd17a83eb49faefa8f1e65fbd5e7caa55347d02ee66fd21927d66087d383dce8e09682c038457a90f5ecdeb07a
|
7
|
+
data.tar.gz: e62e883bc92e2d0740791fc27b416283ff0345851c15d61605ee8da4049e5ec297061c3a019eb08540c8c9d7f7983a0db8f396af24ffed4e3aec58d0fc718050
|
data/Rakefile
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
3
|
|
4
|
+
PRJ = "object-template"
|
5
|
+
|
4
6
|
def version
|
5
|
-
|
6
|
-
|
7
|
+
@version ||= begin
|
8
|
+
require 'object-template'
|
9
|
+
v = ObjectTemplate::VERSION
|
10
|
+
warn "ObjectTemplate::VERSION not a string" unless v.kind_of? String
|
11
|
+
v
|
12
|
+
end
|
7
13
|
end
|
8
14
|
|
9
|
-
|
15
|
+
def tag
|
16
|
+
@tag ||= "#{PRJ}-#{version}"
|
17
|
+
end
|
10
18
|
|
11
19
|
desc "Run tests"
|
12
20
|
Rake::TestTask.new :test do |t|
|
@@ -22,27 +30,43 @@ Rake::TestTask.new :bench do |t|
|
|
22
30
|
t.test_files = FileList["bench/*.rb"]
|
23
31
|
end
|
24
32
|
|
25
|
-
desc "
|
26
|
-
task :release do
|
33
|
+
desc "Commit, tag, and push repo; build and push gem"
|
34
|
+
task :release => "release:is_new_version" do
|
27
35
|
require 'tempfile'
|
28
36
|
|
29
|
-
|
30
|
-
|
31
|
-
sh "gem build #{prj}.gemspec"
|
37
|
+
sh "gem build #{PRJ}.gemspec"
|
32
38
|
|
33
39
|
file = Tempfile.new "template"
|
34
40
|
begin
|
35
41
|
file.puts "release #{version}"
|
36
42
|
file.close
|
37
|
-
sh "git commit -a -v -t #{file.path}"
|
43
|
+
sh "git commit --allow-empty -a -v -t #{file.path}"
|
38
44
|
ensure
|
39
45
|
file.close unless file.closed?
|
40
46
|
file.unlink
|
41
47
|
end
|
42
48
|
|
43
|
-
sh "git tag #{
|
49
|
+
sh "git tag #{tag}"
|
44
50
|
sh "git push"
|
45
51
|
sh "git push --tags"
|
46
52
|
|
47
|
-
sh "gem push #{
|
53
|
+
sh "gem push #{tag}.gem"
|
54
|
+
end
|
55
|
+
|
56
|
+
namespace :release do
|
57
|
+
desc "Diff to latest release"
|
58
|
+
task :diff do
|
59
|
+
latest = `git describe --abbrev=0 --tags --match '#{PRJ}-*'`.chomp
|
60
|
+
sh "git diff #{latest}"
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Log to latest release"
|
64
|
+
task :log do
|
65
|
+
latest = `git describe --abbrev=0 --tags --match '#{PRJ}-*'`.chomp
|
66
|
+
sh "git log #{latest}.."
|
67
|
+
end
|
68
|
+
|
69
|
+
task :is_new_version do
|
70
|
+
abort "#{tag} exists; update version!" unless `git tag -l #{tag}`.empty?
|
71
|
+
end
|
48
72
|
end
|
data/lib/object-template.rb
CHANGED
@@ -2,7 +2,9 @@ require 'set'
|
|
2
2
|
|
3
3
|
# Base class for classes of templates used to match somewhat arbitrary objects.
|
4
4
|
class ObjectTemplate
|
5
|
-
VERSION = "0.
|
5
|
+
VERSION = "0.3"
|
6
|
+
|
7
|
+
attr_reader :spec
|
6
8
|
|
7
9
|
# A set implementation that treats the matching operator (===) as membership.
|
8
10
|
# Used internally by PortableObjectTemplate, but can also be used in
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: object-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel VanderWerf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Templates for matching objects.
|
14
14
|
email: vjoel@users.sourceforge.net
|
@@ -22,47 +22,47 @@ files:
|
|
22
22
|
- COPYING
|
23
23
|
- Rakefile
|
24
24
|
- lib/object-template.rb
|
25
|
-
- bench/lib/bench.rb
|
26
25
|
- bench/bench-match.rb
|
27
|
-
-
|
28
|
-
- test/lib/eq3.rb
|
29
|
-
- test/test-match.rb
|
26
|
+
- bench/lib/bench.rb
|
30
27
|
- test/test-key-conv.rb
|
28
|
+
- test/test-match.rb
|
31
29
|
- test/test-errors.rb
|
30
|
+
- test/lib/assert-threequal.rb
|
31
|
+
- test/lib/eq3.rb
|
32
32
|
homepage: https://github.com/vjoel/object-template
|
33
33
|
licenses:
|
34
34
|
- BSD
|
35
35
|
metadata: {}
|
36
36
|
post_install_message:
|
37
37
|
rdoc_options:
|
38
|
-
- --quiet
|
39
|
-
- --line-numbers
|
40
|
-
- --inline-source
|
41
|
-
- --title
|
38
|
+
- "--quiet"
|
39
|
+
- "--line-numbers"
|
40
|
+
- "--inline-source"
|
41
|
+
- "--title"
|
42
42
|
- object-template
|
43
|
-
- --main
|
43
|
+
- "--main"
|
44
44
|
- README.md
|
45
45
|
require_paths:
|
46
46
|
- lib
|
47
47
|
- ext
|
48
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
|
-
- -
|
50
|
+
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '0'
|
53
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- -
|
55
|
+
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
59
|
rubyforge_project:
|
60
|
-
rubygems_version: 2.
|
60
|
+
rubygems_version: 2.1.11
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Templates for matching objects
|
64
64
|
test_files:
|
65
|
-
- test/test-match.rb
|
66
65
|
- test/test-key-conv.rb
|
66
|
+
- test/test-match.rb
|
67
67
|
- test/test-errors.rb
|
68
68
|
has_rdoc:
|