mnky 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dc248b9fa03c3713992dbcd3e8ed6a159d80715
4
- data.tar.gz: ad5219227fb825d06e71a45a4f0b0e9c1e7faf84
3
+ metadata.gz: a4f952e25528755a6bd5b82e96c426f9a3723715
4
+ data.tar.gz: 55ab58bfbf1282d7ee8fed17d7a44a9ae6352210
5
5
  SHA512:
6
- metadata.gz: 1100f26fafcaba1eedaa1e5473bdcb8353ca4aeb038aaa9d6c6d34e974e1ccc43c662552a5c104f52f31861c9fd705d2493923c2da1fa27311538e996aa9ed9c
7
- data.tar.gz: 96113594de413f3767ea0989c5d363b6ababd4b902bd49a993075cd0919a9b4704f0851e109e80720a9d1a000ed7671733599f61862c07df083b3e613bf68520
6
+ metadata.gz: dcda50273f4f7146ce93e92a992880947d1d50339d1b841c173aa7680a536e44e953180821a6cd2dee39aa950560461d64b1b91a1c2ec9a572a903d4eb4ca52f
7
+ data.tar.gz: 5c7fa815019e5d4d79a9a6eab216e46d75391734c89c19145cb20745f872e0a461d420b6e7404d5b79d8b2ca7bedf5e4032c6c015f052be7364299c77c9727ca
@@ -57,6 +57,26 @@ module Monkey
57
57
  ensure
58
58
  Socket.do_not_reverse_lookup = orig
59
59
  end
60
+
61
+ def self.architecture
62
+ if windows?
63
+ os_arch = ENV['PROCESSOR_ARCHITECTURE']
64
+ return :bit64 if os_arch.include? '64'
65
+ return :bit32 if os_arch.include? '86'
66
+ elsif mac?
67
+ os_arch = `uname -a`
68
+ return :bit64 if os_arch.include? '64'
69
+ return :bit32 if os_arch.include? 'i386'
70
+ end
71
+ end
72
+
73
+ def self.bit64?
74
+ (self.architecture == :bit64)
75
+ end
76
+
77
+ def self.bit32?
78
+ (self.architecture == :bit32)
79
+ end
60
80
  end
61
81
 
62
82
  end
@@ -9,9 +9,29 @@ module Monkey
9
9
  end
10
10
  end
11
11
 
12
+ def self.global_bit64_apps
13
+ return nil if Computer.bit32?
14
+ return ENV['programfiles'].gsub(File::ALT_SEPARATOR, File::SEPARATOR) if Computer.windows?
15
+ return File.join(root, '/Applications') if Computer.mac?
16
+ end
17
+
18
+ def self.global_bit32_apps
19
+ if Computer.windows?
20
+ path = ENV['programfiles(x86)'] if Computer.bit64?
21
+ path = ENV['programfiles'] if Computer.bit32?
22
+ return path.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
23
+ elsif Computer.mac?
24
+ return File.join(root, '/Applications')
25
+ end
26
+ end
27
+
28
+ def self.global_apps
29
+ global_bit64_apps || global_bit32_apps
30
+ end
31
+
12
32
  def self.hosts_file
13
33
  return File.join(root, 'windows/system32/drivers/etc/hosts') if Computer.windows?
14
- return '/private/etc/hosts' if Computer.mac?
34
+ return File.join(root, '/private/etc/hosts') if Computer.mac?
15
35
  end
16
36
  end
17
37
 
@@ -25,6 +25,7 @@ module Monkey
25
25
  end
26
26
  end
27
27
 
28
+ require_relative 'version.rb'
28
29
  require_relative 'task.rb'
29
30
  require_relative 'triggers.rb'
30
31
  require_relative '../helpers/init.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mnky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Snyman