mite-backup 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Simple command-line tool for downloading a backup in XML of your [mite](http://m
9
9
  ## Usage
10
10
 
11
11
  mite-backup -a [ACCOUNT] -e [EMAIL] -p [PASSWORD]
12
-
12
+
13
13
  This will output the backup file in XML to the prompt. You propably want to pipe it into an file:
14
14
 
15
15
  mite-backup -a [ACCOUNT] -e [EMAIL] -p [PASSWORD] > my_backup_file.xml
@@ -17,7 +17,6 @@ This will output the backup file in XML to the prompt. You propably want to pipe
17
17
  For further instructions run
18
18
 
19
19
  mite-backup -h
20
-
21
20
 
22
21
  ## BlaBla
23
22
 
@@ -1,3 +1,3 @@
1
1
  class MiteBackup
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/mite-backup.rb CHANGED
@@ -14,7 +14,7 @@ class MiteBackup
14
14
  def initialize(options={})
15
15
  @options = options
16
16
  self.class.clear_config if options["clear_config"]
17
- @account = options["account"] || config["account"]
17
+ @account = correct_account(options["account"] || config["account"])
18
18
  @email = options["email"] || config["email"]
19
19
  @password = options["password"] || config["password"]
20
20
  end
@@ -106,4 +106,8 @@ class MiteBackup
106
106
  def config
107
107
  @config ||= File.exist?(CONFIG_FILE) && YAML::load( File.open( CONFIG_FILE ) ) || {}
108
108
  end
109
+
110
+ def correct_account(account)
111
+ account.split(/\/\//, 2)[-1].split(/\./, 2)[0] if account
112
+ end
109
113
  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.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
16
- requirement: &2170014760 !ruby/object:Gem::Requirement
16
+ requirement: &2169588760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2170014760
24
+ version_requirements: *2169588760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2170014340 !ruby/object:Gem::Requirement
27
+ requirement: &2169588340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2170014340
35
+ version_requirements: *2169588340
36
36
  description: Download a backup of your mite.account from the command-line.
37
37
  email:
38
38
  - sebastian@yo.lk
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  segments:
67
67
  - 0
68
- hash: 1027709733883102799
68
+ hash: 2595647812214086943
69
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  segments:
76
76
  - 0
77
- hash: 1027709733883102799
77
+ hash: 2595647812214086943
78
78
  requirements: []
79
79
  rubyforge_project: mite-backup
80
80
  rubygems_version: 1.8.10