drumherum 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.1.31 2012-10-17
2
+ * fixed bug in smart_init
3
+
1
4
  == 0.1.19 2012-10-17
2
5
  * hide_tasks
3
6
 
@@ -150,6 +150,9 @@ end
150
150
  #
151
151
  module SmartInit
152
152
 
153
+
154
+ # require 'perception'
155
+
153
156
  # @!group Included in Object
154
157
 
155
158
  def smart_init(__file__ = nil)
@@ -160,27 +163,53 @@ module SmartInit
160
163
 
161
164
  patharray = dir_caller.split('/')
162
165
  patharray = dir_caller.split("\\") if patharray.size == 1
163
- # libpath = File.join(patharray)
164
- patharray.size.times do |i|
165
- break if File.directory?( File.join(patharray, 'lib') )
166
- patharray << '..'
167
- end
166
+ projectname = 'ERROR'
167
+
168
+ (patharray.size-2).times do |i|
169
+
170
+ # found name/lib/name?
171
+ if (patharray[-2] == 'lib' && patharray[-1] == patharray[-3])
172
+ projectname = patharray[-1]
173
+ patharray.pop(2)
174
+ break
175
+
176
+ # found lib one level down?
177
+ elsif File.directory?( File.join(patharray, 'lib') )
178
+ projectname = patharray[-1]
179
+ break
180
+
181
+ else
182
+ patharray.pop
183
+
184
+ end
185
+
186
+ end # do
168
187
 
188
+
189
+ # see "projectname = #{projectname}"
190
+ # see patharray
191
+ # see
169
192
  Drumherum::directory_main = patharray.dup
193
+
194
+ # /projectname/lib/projectname
195
+ newpath = File.join(patharray,'lib', projectname)
196
+ unless $:.include?(newpath)
197
+ $:.unshift(newpath)
198
+ end
170
199
 
171
- # Lib-Pfad anfügen
200
+ # /projectname/lib
172
201
  newpath = File.join(patharray,'lib')
173
202
  unless $:.include?(newpath)
174
203
  $:.unshift(newpath)
175
204
  end
176
205
 
177
- # Hauptpfad anfügen
206
+ # /projectname
178
207
  newpath = File.join(patharray)
179
208
  unless $:.include?(newpath)
180
209
  $:.unshift(newpath)
181
210
  end
182
211
 
183
-
212
+ # see $LOAD_PATH
184
213
 
185
214
  end #def
186
215
 
data/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Drumherum
3
3
 
4
- VERSION = '0.1.31'
4
+ VERSION = '0.1.32'
5
5
 
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drumherum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.32
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-03 00:00:00.000000000 Z
12
+ date: 2012-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hoe