jewel 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/jewel/gem.rb +8 -2
  2. metadata +3 -3
data/lib/jewel/gem.rb CHANGED
@@ -42,8 +42,14 @@ class << Jewel::Gem
42
42
  # @return [String] the gem root as an absolute path
43
43
  # @since 0.0.2
44
44
  def root(relative_to = nil)
45
+ # caller returns an array of strings that are like “file:line” or “file:line: in `method’”
46
+ file = caller.first.split(/:/).first
45
47
  arguments = []
46
- arguments << File.expand_path(relative_to.to_s, File.dirname(__FILE__)) unless relative_to.nil?
48
+ unless relative_to.nil?
49
+ relative_to = relative_to.to_s
50
+ file = File.dirname file
51
+ arguments << File.expand_path(relative_to, file)
52
+ end
47
53
  metadata.send :root, *arguments
48
54
  end
49
55
 
@@ -122,7 +128,7 @@ class Jewel::Gem
122
128
 
123
129
  name! :jewel
124
130
  summary 'Easy access to gem metadata'
125
- version '0.0.2'
131
+ version '0.0.3'
126
132
  homepage 'https://github.com/matheusmoreira/jewel'
127
133
  license 'Mozilla Public License, version 2.0'
128
134
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jewel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: 1007763749711895978
109
+ hash: 4515205193521416105
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: 1007763749711895978
118
+ hash: 4515205193521416105
119
119
  requirements: []
120
120
  rubyforge_project:
121
121
  rubygems_version: 1.8.24