tms 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDJlNTY4YTZhNmM4Y2ZiZDI5MmMyMzQxYzZiZjhiN2VlM2I3YjZhOA==
4
+ MDU4NzJhYTc0ZjYzM2ZmNjM4Zjg0Njg1OWVlYTM2ODkzOGQwMDU3OA==
5
5
  data.tar.gz: !binary |-
6
- ZGViM2QzMjFiYWY4OTExNDk0MTI5NjMxZjA4YjFhZTU3MjE5NDI1ZQ==
6
+ MTEwMzIwYjc5NDY2ODkyZWMxNGYwYzdiOGM3ZTEwM2ExMGViYWU1YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWU2ZmE4MTQxYzZjZDZmYTM3ODU1OTFhYjRhODg1NWMzMjllYTE1NmQwYzUy
10
- OGI5OTFjNzZiMjg0MDVmNGNkN2FmYWJhNmFlNjA4NTFkMjc3NGYxMDc0OWJk
11
- OGIwNmQyZjAzNjk3ZjMwNDJjOTFhMTk2MmZkODU5YWZiMjNmOTA=
9
+ OGVmMDM4ODY4NTE4NzJhZDJmOWU4NTA5ZGYxMGYwMzNiZmIxMzQzZTlmMWVk
10
+ Y2Q3MTA3NDdhZDU2ZTA2Y2RhYjNjMzU0YjM3Njk3ZjVlZTA4NjVmNTgxYWY2
11
+ ODYyMWRiZWQ3YzYyOWJjYzkxNzE5MjVkODQxZTQyOTQ4ZDZjYmQ=
12
12
  data.tar.gz: !binary |-
13
- NjIwY2U3YzVmODFlYjRlMGU0ODI1ZTdiMTQ4Zjg4ZDczZWEzMTllNzc0Nzdk
14
- YjZiYmFhYTE5YjhmMTQ0ZWQxNjBkYWFkMzc4ZmRhZDNkOGI2ZGM0Njg1YmZj
15
- NTNhOGQ2NThiNmEzOTZlYjY3NzRlZjRhYTE4YWZhOWVkMDEwZGM=
13
+ ZGU5OTk0NGFlZDRlZDYyNjAxZDQzMzBlNTUwN2RiNzZjYWJiNWMzOWNmMWQw
14
+ ODA4M2FjM2QzNTMyOTM1M2M1NjkwODBmZGYxYzMzMDZmN2FjMTZhYjYwNGNj
15
+ NWE3MjY1NmY4NDhmNmY2MTk2MTc2NDdjZmMyNGU3MWZmYzc2YWI=
@@ -2,6 +2,12 @@
2
2
  #include <CoreServices/CoreServices.h>
3
3
  #include <SystemConfiguration/SystemConfiguration.h>
4
4
 
5
+ #ifdef HAVE_RUBY_ENCODING_H
6
+ #define UTF8_STR_NEW2(str) rb_enc_associate_index(rb_str_new2(str), rb_enc_find_index("UTF-8"))
7
+ #else
8
+ #define UTF8_STR_NEW2(str) rb_str_new2(str)
9
+ #endif
10
+
5
11
  static VALUE backup_volume(VALUE self){
6
12
  OSStatus status = pathTooLongErr;
7
13
  char *path;
@@ -30,7 +36,7 @@ static VALUE backup_volume(VALUE self){
30
36
  }
31
37
 
32
38
  if (noErr == status) {
33
- return rb_str_new2(path);
39
+ return UTF8_STR_NEW2(path);
34
40
  } else {
35
41
  return Qnil;
36
42
  }
@@ -40,19 +46,18 @@ static VALUE computer_name(VALUE self){
40
46
  char *name;
41
47
  size_t nameLength;
42
48
 
43
- CFStringEncoding encoding;
44
49
  CFStringRef cfName;
45
50
 
46
- if (cfName = SCDynamicStoreCopyComputerName(NULL, &encoding)) {
51
+ if (cfName = SCDynamicStoreCopyComputerName(NULL, NULL)) {
47
52
  name = malloc(nameLength = 256);
48
- while (!CFStringGetCString(cfName, name, nameLength, encoding)) {
53
+ while (!CFStringGetCString(cfName, name, nameLength, kCFStringEncodingUTF8)) {
49
54
  nameLength += 256;
50
55
  name = reallocf(name, nameLength);
51
56
  }
52
57
 
53
58
  CFRelease(cfName);
54
59
 
55
- return rb_str_new2(name);
60
+ return UTF8_STR_NEW2(name);
56
61
  } else {
57
62
  return Qnil;
58
63
  }
@@ -11,7 +11,7 @@ module Tms
11
11
  extend BetterAttrAccessor
12
12
 
13
13
  def backup_volume
14
- Tms.backup_volume or abort('backup volume not avaliable')
14
+ Tms.backup_volume or abort('backup volume not available')
15
15
  end
16
16
 
17
17
  def computer_name
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'tms'
5
- s.version = '1.7.1'
5
+ s.version = '1.7.2'
6
6
  s.summary = %q{Time Machine Status}
7
7
  s.description = %Q{View avaliable Time Machine backups and show their diff}
8
8
  s.homepage = "http://github.com/toy/#{s.name}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-11 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project: tms
83
- rubygems_version: 2.4.5
83
+ rubygems_version: 2.4.7
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Time Machine Status