launchcraft 0.0.1.1 → 0.0.1.2

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.
@@ -17,20 +17,19 @@
17
17
  # along with launchcraft. If not, see <http://www.gnu.org/licenses/>.
18
18
  #++
19
19
 
20
+ require 'os'
20
21
  require 'launchcraft'
21
22
 
22
- require 'rbconfig'
23
-
24
23
  class Dir
25
24
  def self.path
26
- (((ENV.key?('PATH') and ENV['PATH'] and !ENV['PATH'].empty?) ? ENV['PATH'] : nil) ||
27
- ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'].join(RbConfig::CONFIG['PATH_SEPARATOR'])
28
- ).split(RbConfig::CONFIG['PATH_SEPARATOR'])
25
+ ((ENV.key?('PATH') and ENV['PATH'] and !ENV['PATH'].empty?) ? ENV['PATH'] : '').split(File::PATH_SEPARATOR)
29
26
  end
30
27
  end
31
28
 
32
29
  module Kernel
33
30
  def self.which (bin, which=0)
31
+ bin << '.exe' if OS.windows? and bin !~ /\.exe$/
32
+
34
33
  res = Dir.path.map {|path|
35
34
  File.join(path, bin)
36
35
  }.select {|bin|
@@ -73,7 +72,7 @@ class LaunchCraft
73
72
  bindir = File.join(LaunchCraft.working_dir, 'bin')
74
73
  [BIN, '-Xmx1024M', '-Xms512M', '-cp', %w[jinput lwjgl lwjgl_util minecraft].map {|x|
75
74
  File.join(bindir, "#{x}.jar")
76
- }.join(':'), "-Djava.library.path=#{File.join(bindir, 'natives')}", "-Dminecraft.appname=#{LaunchCraft.appname}",
75
+ }.join(File::PATH_SEPARATOR), "-Djava.library.path=#{File.join(bindir, 'natives')}", "-Dminecraft.appname=#{LaunchCraft.appname}",
77
76
  'net.minecraft.client.Minecraft', user, sessid].compact
78
77
  end
79
78
  end
@@ -18,5 +18,5 @@
18
18
  #++
19
19
 
20
20
  class LaunchCraft
21
- VERSION = '0.0.1.1'.freeze
21
+ VERSION = '0.0.1.2'.freeze
22
22
  end
data/lib/os.rb CHANGED
@@ -37,7 +37,7 @@ class OS
37
37
  else
38
38
  def parse (what=RUBY_PLATFORM)
39
39
  case what
40
- when /(?<!dar)win/
40
+ when /(?<!dar)win|w32/
41
41
  :windows
42
42
  when /darwin/
43
43
  :macos
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.0.1.1
9
+ - 2
10
+ version: 0.0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - shura