mite-backup 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .rvmrc
6
+ .rbenv-*
data/README.md CHANGED
@@ -5,7 +5,7 @@ Simple command-line tool for downloading a backup in XML of your [mite](http://m
5
5
  ## Installation
6
6
 
7
7
  gem install mite-backup
8
-
8
+
9
9
  ## Usage
10
10
 
11
11
  mite-backup -a [ACCOUNT] -e [EMAIL] -p [PASSWORD]
@@ -1,3 +1,3 @@
1
1
  class MiteBackup
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/mite-backup.rb CHANGED
@@ -30,7 +30,7 @@ class MiteBackup
30
30
  (config["account"] = @account) || config.delete("account")
31
31
  (config["email"] = @email) || config.delete("email")
32
32
  (config["password"] = @password) || config.delete("password")
33
-
33
+
34
34
  if config.size == 0
35
35
  self.class.clear_config
36
36
  else
@@ -67,7 +67,12 @@ class MiteBackup
67
67
  def download
68
68
  if @ready
69
69
  content = perform_request(Net::HTTP::Get.new("/account/backup/#{@id}/download.json"))
70
- gz = Zlib::GzipReader.new(StringIO.new(content), :external_encoding => content.encoding)
70
+ content_str = StringIO.new(content)
71
+ gz = if RUBY_VERSION =~ /\A1\.8\./
72
+ Zlib::GzipReader.new(content_str)
73
+ else
74
+ Zlib::GzipReader.new(content_str, :external_encoding => content.encoding)
75
+ end
71
76
  puts gz.read
72
77
  else
73
78
  failed "Backup was not ready for download after #{MAX_CHECKS*SLEEP_BEFORE_EACH_CHECK} seconds. Contact the mite support."
@@ -102,7 +107,7 @@ class MiteBackup
102
107
  $stderr.puts "Failed: #{reason}"
103
108
  exit(1)
104
109
  end
105
-
110
+
106
111
  def config
107
112
  @config ||= File.exist?(CONFIG_FILE) && YAML::load( File.open( CONFIG_FILE ) ) || {}
108
113
  end
data/mite-backup.gemspec CHANGED
@@ -19,5 +19,4 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_runtime_dependency "multi_json"
22
- s.add_development_dependency "rake"
23
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mite-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-18 00:00:00.000000000 Z
12
+ date: 2012-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
16
- requirement: &2169588760 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,18 +21,12 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2169588760
25
- - !ruby/object:Gem::Dependency
26
- name: rake
27
- requirement: &2169588340 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
28
25
  none: false
29
26
  requirements:
30
27
  - - ! '>='
31
28
  - !ruby/object:Gem::Version
32
29
  version: '0'
33
- type: :development
34
- prerelease: false
35
- version_requirements: *2169588340
36
30
  description: Download a backup of your mite.account from the command-line.
37
31
  email:
38
32
  - sebastian@yo.lk
@@ -42,7 +36,6 @@ extensions: []
42
36
  extra_rdoc_files: []
43
37
  files:
44
38
  - .gitignore
45
- - .rvmrc
46
39
  - Gemfile
47
40
  - MIT-LICENSE
48
41
  - README.md
@@ -63,21 +56,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
56
  - - ! '>='
64
57
  - !ruby/object:Gem::Version
65
58
  version: '0'
66
- segments:
67
- - 0
68
- hash: 2595647812214086943
69
59
  required_rubygems_version: !ruby/object:Gem::Requirement
70
60
  none: false
71
61
  requirements:
72
62
  - - ! '>='
73
63
  - !ruby/object:Gem::Version
74
64
  version: '0'
75
- segments:
76
- - 0
77
- hash: 2595647812214086943
78
65
  requirements: []
79
66
  rubyforge_project: mite-backup
80
- rubygems_version: 1.8.10
67
+ rubygems_version: 1.8.23
81
68
  signing_key:
82
69
  specification_version: 3
83
70
  summary: Download a backup of your mite.account from the command-line.
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use ruby-1.9.3@mite-backup --create