qwandry 0.1.2 → 0.1.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
@@ -23,7 +23,7 @@ module Qwandry
23
23
 
24
24
  # Returns true if binary `name` is present.
25
25
  def present? name
26
- system("which #{name}", STDOUT=>"/dev/null")
26
+ system("which #{name} > /dev/null")
27
27
  end
28
28
 
29
29
  # Sets the default configuration to launch, if no `configurations` are passed
@@ -144,4 +144,4 @@ module Qwandry
144
144
  end
145
145
 
146
146
  end
147
- end
147
+ end
@@ -1,20 +1,18 @@
1
-
2
1
  # Register the default ruby configuration:
3
2
  register :ruby do
4
- # Reject binary paths, and then find only the `/lib/ruby` sources:
5
- paths = ($:).reject{|path| path =~ /#{RUBY_PLATFORM}$/}.grep(/lib\/ruby/)
3
+ # Reject binary paths, and ruby gems. Gems will be loaded separately:
4
+ paths = ($:).reject{|path| path["/#{RUBY_PLATFORM}/"] || path["/gems/"] || path == '.' }
6
5
 
7
6
  # Add ruby standard libraries using the LibraryRepository:
8
- add paths, :class=>Qwandry::LibraryRepository
7
+ add paths, :class=>Qwandry::LibraryRepository, :reject=>/\.(o|a|s|inc|def|dylib|rbc)$/
9
8
  end
10
9
 
11
10
  # Register the default ruby gems configuration:
12
11
  register_if_present :gem do
13
- # Get the gem paths from the ruby load paths:
14
- paths = ($:).grep(/gems/).map{|p| p[/.+\/gems\//]}.uniq
12
+ require 'rubygems' unless defined? Gem
15
13
 
16
- # Add all the rubygems' paths:
17
- add paths
14
+ # Add rubygems path:
15
+ add File.join(Gem.dir, 'gems')
18
16
  end
19
17
 
20
18
  # Register a perl configuration:
@@ -52,21 +50,23 @@ register_if_present :node do
52
50
  add node_paths
53
51
  end
54
52
 
55
- # If this is mri ruby and we can figure out where the user's ruby source directory is, add it.
56
- # This might not be quite right...
57
- #
58
- # TODO figure out how to identify different ruby variants.
59
- if RUBY_ENGINE == 'ruby'
60
- register_if_present :mri, :rvm do
53
+ # If this is mri ruby or rubinus and we can figure out where the user's ruby source directory is, add it.
54
+ # TODO: Add support for macruby and jruby
55
+ if RUBY_DESCRIPTION =~ /^(ruby|rubinius) /
56
+ name = case $1
57
+ when 'ruby' then :mri
58
+ when 'rubinius' then :rbx
59
+ end
60
+ register_if_present name, :rvm do
61
61
  # If present, use the current rvm's ruby source.
62
62
  paths = []
63
63
  root = File.join(ENV['rvm_src_path'], ENV['rvm_ruby_string'])
64
64
  paths << root # core objects: String, etc
65
- paths << File.join(root, 'ext') # c extensions: Fiber, IO, etc.
65
+ paths << File.join(root, 'ext') # extensions: Fiber, IO, etc.
66
66
  paths << File.join(root, 'lib') # pure ruby libraries
67
67
 
68
68
  # Add the sources, use a LibraryRepository to bundle .h and .c files
69
- add paths, :reject=>/\.(o|a|s|inc|def|dylib)$/, :class=>Qwandry::LibraryRepository
69
+ add paths, :reject=>/\.(o|a|s|inc|def|dylib|rbc)$/, :class=>Qwandry::LibraryRepository
70
70
  end
71
71
  end
72
72
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qwandry
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Sanderson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-01 00:00:00 -07:00
18
+ date: 2011-01-06 00:00:00 -08:00
19
19
  default_executable: qw
20
20
  dependencies: []
21
21