drumherum 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,7 @@
1
1
 
2
+ == 0.1.2 2012-10-15
3
+ * smart_load_path integrated
4
+
2
5
  == 0.1.0 2012-10-15
3
6
  * Initial public release
4
7
 
data/Manifest.txt CHANGED
@@ -7,6 +7,7 @@ Rakefile.rb
7
7
  README.txt
8
8
  lib/drumherum.rb
9
9
  lib/drumherum/call_tracker.rb
10
+ lib/drumherum/kernel.rb
10
11
  lib/drumherum/rake.rb
11
12
  lib/drumherum/regexp.rb
12
13
  lib/drumherum/unit_test.rb
data/Rakefile.rb CHANGED
@@ -1,12 +1,18 @@
1
1
  # ruby encoding: utf-8
2
+ if $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+ #puts 'Path schon aktuell'
4
+ else
5
+ $:.unshift(File.dirname(__FILE__))
6
+ end
2
7
 
3
8
  require 'kyanite/smart_load_path'
4
9
  smart_load_path
10
+ require 'drumherum'
5
11
 
6
12
 
7
- require 'drumherum'
8
13
  Drumherum.project_name = File.dirname(__FILE__).split("/")[-1].strip # Name des Projekt-Stammverzeichnisses
9
14
  Drumherum.github_username = 'bklippstein'
15
+
10
16
  require 'rdoc/task'
11
17
  require 'drumherum/rake'
12
18
 
@@ -0,0 +1,69 @@
1
+ # ruby encoding: utf-8
2
+ # ü
3
+
4
+
5
+ module DrumherumKernel
6
+
7
+ # Vereinfacht die require-Statements in den Tests bei der Entwicklung von Libraries.
8
+ # Beim lokalen Aufruf eines einzelnen Tests wird die lokale Version der Library verwendet, nicht die installierte gem.
9
+ # Verwendung:
10
+ # if $0 == __FILE__
11
+ # require 'drumherum'
12
+ # smart_load_path
13
+ # end
14
+ # require 'mygemproject'
15
+ #
16
+ def smart_load_path(__file__ = nil)
17
+ __file__ = caller[0] unless __file__
18
+ dir_caller =File.dirname(__file__)
19
+
20
+ #puts "smart_load_path " + dir_caller
21
+
22
+ patharray = dir_caller.split('/')
23
+ patharray = dir_caller.split("\\") if patharray.size == 1
24
+ # libpath = File.join(patharray)
25
+ patharray.size.times do |i|
26
+ break if File.directory?( File.join(patharray, 'lib') )
27
+ patharray << '..'
28
+ end
29
+ newpath = File.join(patharray,'lib')
30
+ if $:.include?(newpath)
31
+ return false
32
+ else
33
+ $:.unshift(newpath)
34
+ return true
35
+ end
36
+
37
+ end #def
38
+
39
+
40
+ end # module
41
+
42
+ class Object
43
+ include DrumherumKernel
44
+ end
45
+
46
+
47
+ # ---------------------------------------------------------
48
+ # Ausprobieren
49
+ #
50
+ if $0 == __FILE__
51
+
52
+ # pp RUBYDIR
53
+
54
+ smart_load_path
55
+ $LOAD_PATH.each do |path|
56
+ puts path
57
+ end
58
+
59
+ end
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
data/lib/drumherum.rb CHANGED
@@ -1,18 +1,34 @@
1
1
  # ruby encoding: utf-8
2
2
  # ü
3
+
3
4
  if $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
4
5
  #puts 'Path schon aktuell'
5
6
  else
6
7
  $:.unshift(File.dirname(__FILE__))
7
8
  end
8
9
 
10
+
9
11
  require 'hoe'
12
+ require 'rbconfig'
13
+ require 'drumherum/kernel' unless defined? DrumherumKernel
14
+
15
+ unless defined? WINDOWS
16
+ WINDOWS = /djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM ? RUBY_PLATFORM : false
17
+ end
18
+
19
+ unless defined? RUBYDIR
20
+ RUBYDIR = RbConfig::CONFIG['prefix']
21
+ # puts "rubydir=" + RUBYDIR
22
+ end
23
+
24
+
10
25
 
11
- module Drumherum
12
26
 
13
- VERSION = '0.1.0' # Drumherum
27
+ module Drumherum
14
28
 
15
29
 
30
+ VERSION = '0.1.2' # Drumherum
31
+
16
32
 
17
33
  class << self
18
34
 
@@ -70,8 +86,12 @@ end
70
86
  if $0 == __FILE__
71
87
 
72
88
 
73
- #Drumherum.project_name='kyanite'
74
89
  puts Drumherum.project_version
90
+
91
+ smart_load_path(__FILE__)
92
+ $LOAD_PATH.each do |path|
93
+ puts path
94
+ end
75
95
 
76
96
  end
77
97
 
data/test/_start_all.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
 
7
7
  if $0 == __FILE__
8
- require 'kyanite/smart_load_path.rb'
8
+ require 'drumherum'
9
9
  smart_load_path
10
10
  end
11
11
 
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.0
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -63,6 +63,7 @@ files:
63
63
  - README.txt
64
64
  - lib/drumherum.rb
65
65
  - lib/drumherum/call_tracker.rb
66
+ - lib/drumherum/kernel.rb
66
67
  - lib/drumherum/rake.rb
67
68
  - lib/drumherum/regexp.rb
68
69
  - lib/drumherum/unit_test.rb