euston-eventstore 1.0.2-java → 1.0.3-java

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.
data/Rakefile CHANGED
@@ -32,12 +32,31 @@ def gem_file
32
32
  "#{name}-#{version}.gem"
33
33
  end
34
34
 
35
- def replace_header(head, header_name)
36
- head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
35
+ def replace_header(head, header_name, provider = nil)
36
+ if provider
37
+ value = send(provider)
38
+ else
39
+ value = "'#{send(header_name)}'"
40
+ end
41
+
42
+ provider ||= header_name
43
+ head.sub!(/(\.#{header_name}\s*= ).*/) { "#{$1}#{value}"}
37
44
  end
38
45
 
39
46
  def platform
40
- RUBY_PLATFORM.to_s == 'java' ? '-java' : ''
47
+ jruby? ? '-java' : ''
48
+ end
49
+
50
+ def platform_dependant_gem_file
51
+ "#{name}#{platform}-#{version}.gem"
52
+ end
53
+
54
+ def platform_dependent_version
55
+ "'#{version}#{platform}'"
56
+ end
57
+
58
+ def jruby?
59
+ RUBY_PLATFORM.to_s == 'java'
41
60
  end
42
61
 
43
62
  #############################################################################
@@ -60,23 +79,33 @@ end
60
79
  #############################################################################
61
80
 
62
81
  def built_gem
63
- Dir["#{name}*.gem"].first
82
+ @built_gem ||= Dir["#{name}*.gem"].first
64
83
  end
65
84
 
66
- desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
85
+ desc "Create tag v#{platform_dependent_version} and build and push #{platform_dependant_gem_file} to Rubygems"
67
86
  task :release => :build do
68
87
  unless `git branch` =~ /^\* master$/
69
88
  puts "You must be on the master branch to release!"
70
89
  exit!
71
90
  end
72
- sh "git commit --allow-empty -a -m 'Release #{version}'"
73
- sh "git tag v#{version}"
91
+
92
+ sh "git commit --allow-empty -a -m 'Release #{platform_dependent_version}'"
93
+ sh "git tag v#{platform_dependent_version}"
74
94
  sh "git push origin master"
75
- sh "git push origin v#{version}"
76
- sh "gem push pkg/#{built_gem}"
95
+ sh "git push origin v#{platform_dependent_version}"
96
+
97
+ command = "gem push pkg/#{platform_dependant_gem_file}"
98
+
99
+ if jruby?
100
+ puts "--------------------------------------------------------------------------------------"
101
+ puts "can't push to rubygems using jruby at the moment, so switch to mri and run: #{command}"
102
+ puts "--------------------------------------------------------------------------------------"
103
+ else
104
+ sh command
105
+ end
77
106
  end
78
107
 
79
- desc "Build #{gem_file} into the pkg directory"
108
+ desc "Build #{platform_dependant_gem_file} into the pkg directory"
80
109
  task :build => :gemspec do
81
110
  sh "mkdir -p pkg"
82
111
  sh "gem build #{gemspec_file}"
@@ -1,8 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'euston-eventstore'
3
- s.version = '1.0.2'
3
+ s.version = '1.0.3'
4
4
  s.date = '2011-09-15'
5
- # s.platform = Gem::Platform::CURRENT
6
5
  s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
7
6
  s.authors = ['Lee Henson', 'Guy Boertje']
8
7
  s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
@@ -1,5 +1,5 @@
1
1
  module Euston
2
2
  module EventStore
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: euston-eventstore
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: java
7
7
  authors:
8
8
  - Lee Henson