thrifty 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,12 @@ class Thrifty::ThriftFile
53
53
 
54
54
  def compile_once
55
55
  with_cache do
56
- FileUtils.mkdir_p(build_directory)
56
+ begin
57
+ FileUtils.mkdir_p(build_directory)
58
+ rescue Errno::EACCES => e
59
+ e.message << ' (HINT: this probably means you forgot to precompile your Thrift file, or the relative path has changed between your build and deploy machines)'
60
+ raise e
61
+ end
57
62
  Rubysh('thrift', '--gen', 'rb', '-out', build_directory, path).check_call
58
63
  end
59
64
  end
@@ -63,10 +68,13 @@ class Thrifty::ThriftFile
63
68
  end
64
69
 
65
70
  def build_directory
66
- # Use the basename for informational purposes, and the SHA1 for
67
- # avoid collisions.
71
+ # Use the basename for informational purposes, and the SHA1 to avoid
72
+ # collisions.
73
+ #
74
+ # Use relative_path since that should be invariant across machines
75
+ # (i.e. once you've deployed the service).
68
76
  base = File.basename(path)
69
- sha1 = Digest::SHA1.hexdigest(path)
77
+ sha1 = Digest::SHA1.hexdigest(relative_path)
70
78
  File.join(build_root, "#{base}-#{sha1}")
71
79
  end
72
80
 
@@ -1,3 +1,3 @@
1
1
  module Thrifty
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrifty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  segments:
202
202
  - 0
203
- hash: 287513174984063520
203
+ hash: 904017040795247836
204
204
  required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  segments:
211
211
  - 0
212
- hash: 287513174984063520
212
+ hash: 904017040795247836
213
213
  requirements: []
214
214
  rubyforge_project:
215
215
  rubygems_version: 1.8.23