mite-backup 0.1.1 → 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.
- data/.gitignore +2 -0
 - data/README.md +1 -1
 - data/lib/mite-backup/version.rb +1 -1
 - data/lib/mite-backup.rb +8 -3
 - data/mite-backup.gemspec +0 -1
 - metadata +5 -18
 - data/.rvmrc +0 -1
 
    
        data/.gitignore
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
    
        data/lib/mite-backup/version.rb
    CHANGED
    
    
    
        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 
     | 
    
         
            -
                     
     | 
| 
      
 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
    
    
    
        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. 
     | 
| 
      
 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:  
     | 
| 
      
 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:  
     | 
| 
      
 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:  
     | 
| 
       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. 
     | 
| 
      
 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
         
     |