launchcraft 0.0.1 → 0.0.1.1

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/bin/minecraft CHANGED
@@ -77,6 +77,10 @@ OptionParser.new {|opts|
77
77
  $pass = pass
78
78
  }
79
79
 
80
+ opts.on('-n', '--appname APPNAME', 'Set application name (change directory)') {|appname|
81
+ LaunchCraft.appname = appname
82
+ }
83
+
80
84
  opts.on_tail('-v', '--version', 'Show version') {
81
85
  puts "launchcraft #{LaunchCraft::VERSION}"
82
86
  exit 0
@@ -22,6 +22,10 @@ require 'launchcraft'
22
22
  class LaunchCraft
23
23
  Config = Class.new(Hash) {
24
24
  def initialize
25
+ rehash
26
+ end
27
+
28
+ def rehash
25
29
  @path = File.join(LaunchCraft.working_dir, 'options.txt')
26
30
  set_default
27
31
  File.file?(@path) ? parse : save
@@ -73,7 +73,7 @@ class LaunchCraft
73
73
  bindir = File.join(LaunchCraft.working_dir, 'bin')
74
74
  [BIN, '-Xmx1024M', '-Xms512M', '-cp', %w[jinput lwjgl lwjgl_util minecraft].map {|x|
75
75
  File.join(bindir, "#{x}.jar")
76
- }.join(':'), "-Djava.library.path=#{File.join(bindir, 'natives')}",
76
+ }.join(':'), "-Djava.library.path=#{File.join(bindir, 'natives')}", "-Dminecraft.appname=#{LaunchCraft.appname}",
77
77
  'net.minecraft.client.Minecraft', user, sessid].compact
78
78
  end
79
79
  end
@@ -26,7 +26,12 @@ class LaunchCraft
26
26
  attr_accessor "#{OS.parse.to_s.gsub(/^macos$/, 'macosx')}_natives".to_sym
27
27
 
28
28
  def initialize
29
+ rehash
30
+ end
31
+
32
+ def rehash
29
33
  @path = File.join(LaunchCraft.working_dir, 'bin', 'md5s')
34
+ self.lwjgl = self.jinput = self.lwjgl_util = self.minecraft = self.natives = nil
30
35
  parse if File.file?(@path)
31
36
  end
32
37
 
@@ -18,10 +18,10 @@
18
18
  #++
19
19
 
20
20
  require 'os'
21
+ require 'lzma'
21
22
  require 'launchcraft'
22
23
  require 'launchcraft/md5_file'
23
24
  require 'launchcraft/config'
24
- require 'launchcraft/lzma'
25
25
  require 'launchcraft/zip'
26
26
  require 'launchcraft/uri'
27
27
 
@@ -18,5 +18,5 @@
18
18
  #++
19
19
 
20
20
  class LaunchCraft
21
- VERSION = '0.0.1'.freeze
21
+ VERSION = '0.0.1.1'.freeze
22
22
  end
data/lib/launchcraft.rb CHANGED
@@ -21,7 +21,18 @@ require 'os'
21
21
  require 'launchcraft/version'
22
22
 
23
23
  class LaunchCraft
24
- def self.working_dir (appname='minecraft')
24
+ def self.appname
25
+ @appname ||= 'minecraft'
26
+ end
27
+
28
+ def self.appname=(name)
29
+ @appname = name.to_s
30
+ Config.rehash
31
+ MD5File.rehash
32
+ @appname
33
+ end
34
+
35
+ def self.working_dir (appname=self.appname)
25
36
  res = case OS.parse
26
37
  when :linux, :solaris
27
38
  File.join(ENV['HOME'], ".#{appname}")
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 1
9
- version: 0.0.1
9
+ - 1
10
+ version: 0.0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - shura
@@ -14,11 +15,11 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-09-23 00:00:00 +02:00
18
+ date: 2011-09-28 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: ruby-lzma
22
+ name: lzma-ffi
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
@@ -27,7 +28,10 @@ dependencies:
27
28
  - !ruby/object:Gem::Version
28
29
  segments:
29
30
  - 0
30
- version: "0"
31
+ - 0
32
+ - 1
33
+ - 2
34
+ version: 0.0.1.2
31
35
  type: :runtime
32
36
  version_requirements: *id001
33
37
  - !ruby/object:Gem::Dependency
@@ -66,7 +70,6 @@ extra_rdoc_files: []
66
70
 
67
71
  files:
68
72
  - lib/launchcraft/md5_file.rb
69
- - lib/launchcraft/lzma.rb
70
73
  - lib/launchcraft/zip.rb
71
74
  - lib/launchcraft/version.rb
72
75
  - lib/launchcraft/java.rb
@@ -1,29 +0,0 @@
1
- #--
2
- # Copyleft shura. [ shura1991@gmail.com ]
3
- #
4
- # This file is part of launchcraft.
5
- #
6
- # launchcraft is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as published
8
- # by the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # launchcraft is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with launchcraft. If not, see <http://www.gnu.org/licenses/>.
18
- #++
19
-
20
- require 'lzma'
21
-
22
- class LZMA
23
- def self.extract (file, out=File.basename(file, '.lzma'))
24
- File.open(out, 'wb') {|f|
25
- f.write(decompress(File.read(file)))
26
- }
27
- out
28
- end
29
- end