rjiffy 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/Readme.md +12 -6
- data/lib/rjiffy/box.rb +4 -0
- data/lib/rjiffy/configuration.rb +1 -1
- data/lib/rjiffy/request.rb +2 -0
- data/lib/rjiffy/version.rb +1 -1
- data/spec/fixtures/backup_from_box.json +1 -1
- data/spec/fixtures/recurring_box_backup.json +7 -0
- data/spec/rjiffy/box_spec.rb +7 -0
- data/spec/rjiffy/configuration_spec.rb +5 -1
- metadata +47 -17
data/Readme.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Description
|
1
|
+
# Description
|
2
2
|
Ruby Wrapper for jiffybox.de API
|
3
3
|
|
4
4
|
## Configuration
|
@@ -15,12 +15,11 @@ Ruby Wrapper for jiffybox.de API
|
|
15
15
|
## Find one box
|
16
16
|
box = Rjiffy::Box.find(ID)
|
17
17
|
|
18
|
-
##
|
19
|
-
box.
|
18
|
+
## List Backups for the box
|
19
|
+
box.backups
|
20
20
|
|
21
|
-
##
|
22
|
-
box.
|
23
|
-
This triggers the delete process. On success the new status for the box is set to "DELETING"
|
21
|
+
## Create a recurring Backup for the box
|
22
|
+
box.create_recurring_backup({"dayid" => 1, "timeid" => 2})
|
24
23
|
|
25
24
|
## Create a box
|
26
25
|
Rjiffy::Box.create({:name => "Test", :planid => "1", :distribution => "centos_5_6_32bit"})
|
@@ -28,6 +27,13 @@ Ruby Wrapper for jiffybox.de API
|
|
28
27
|
## Start, shutdown, pullplug, freeze and thaw a box
|
29
28
|
`box.start`, `box.shutdown`, `box.pullplug`, `box.freeze`, `box.thaw(PLANID)`
|
30
29
|
|
30
|
+
## Reload a box
|
31
|
+
box.reload
|
32
|
+
|
33
|
+
## Delete a box
|
34
|
+
box.delete
|
35
|
+
This triggers the delete process. On success the new status for the box is set to "DELETING"
|
36
|
+
|
31
37
|
## List all plans
|
32
38
|
Rjiffy::Plan.all
|
33
39
|
|
data/lib/rjiffy/box.rb
CHANGED
@@ -28,6 +28,10 @@ module Rjiffy
|
|
28
28
|
Backup.new(Request.get_data("/backups/#{id}"))
|
29
29
|
end
|
30
30
|
|
31
|
+
def create_recurring_backup(date_time_id = {})
|
32
|
+
Backup.new(Request.post_data("/backups/#{id}", date_time_id))
|
33
|
+
end
|
34
|
+
|
31
35
|
def thaw(planid)
|
32
36
|
merge!(Request.put_data("/jiffyBoxes/#{id}", "status=THAW&planid=#{planid}"))
|
33
37
|
end
|
data/lib/rjiffy/configuration.rb
CHANGED
data/lib/rjiffy/request.rb
CHANGED
data/lib/rjiffy/version.rb
CHANGED
data/spec/rjiffy/box_spec.rb
CHANGED
@@ -70,5 +70,12 @@ describe Rjiffy::Box do
|
|
70
70
|
box.plan.id.should == 2
|
71
71
|
end
|
72
72
|
|
73
|
+
it "creates a recurring backup", :create_box_backup => true do
|
74
|
+
FakeWeb.register_uri(:post, Rjiffy::Configuration.base_uri["/backups/#{@id}"].to_s, :body => fixture_file("recurring_box_backup.json"), :content_type => "application/json")
|
75
|
+
backup = @box.create_recurring_backup({"dayid" => 1, "timeid" => 2})
|
76
|
+
backup.class.should == Rjiffy::Backup
|
77
|
+
backup.dayid.should == 1
|
78
|
+
backup.timeid.should == 2
|
79
|
+
end
|
73
80
|
|
74
81
|
end
|
@@ -4,9 +4,13 @@ describe Rjiffy::Configuration do
|
|
4
4
|
|
5
5
|
|
6
6
|
it "sets the config variables and build the base_url" do
|
7
|
-
Rjiffy::Configuration.configure
|
7
|
+
Rjiffy::Configuration.configure do |conf|
|
8
|
+
conf.token = "mytoken"
|
9
|
+
conf.loglevel = Logger::DEBUG
|
10
|
+
end
|
8
11
|
Rjiffy::Configuration.token.should == "mytoken"
|
9
12
|
Rjiffy::Configuration.base_uri.should == "https://api.jiffybox.de/mytoken/v1.0".to_uri
|
13
|
+
Rjiffy::Configuration.loglevel.should == Logger::DEBUG
|
10
14
|
end
|
11
15
|
|
12
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rjiffy
|
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,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: wrest
|
17
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ~>
|
@@ -22,10 +21,15 @@ dependencies:
|
|
22
21
|
version: 1.4.2
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.2
|
26
30
|
- !ruby/object:Gem::Dependency
|
27
31
|
name: hashie
|
28
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
29
33
|
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
@@ -33,10 +37,15 @@ dependencies:
|
|
33
37
|
version: 1.1.0
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.1.0
|
37
46
|
- !ruby/object:Gem::Dependency
|
38
47
|
name: i18n
|
39
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
40
49
|
none: false
|
41
50
|
requirements:
|
42
51
|
- - ! '>='
|
@@ -44,10 +53,15 @@ dependencies:
|
|
44
53
|
version: '0'
|
45
54
|
type: :runtime
|
46
55
|
prerelease: false
|
47
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
48
62
|
- !ruby/object:Gem::Dependency
|
49
63
|
name: rspec
|
50
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
51
65
|
none: false
|
52
66
|
requirements:
|
53
67
|
- - ~>
|
@@ -55,10 +69,15 @@ dependencies:
|
|
55
69
|
version: 2.6.0
|
56
70
|
type: :development
|
57
71
|
prerelease: false
|
58
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.6.0
|
59
78
|
- !ruby/object:Gem::Dependency
|
60
79
|
name: fakeweb
|
61
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
62
81
|
none: false
|
63
82
|
requirements:
|
64
83
|
- - ~>
|
@@ -66,10 +85,15 @@ dependencies:
|
|
66
85
|
version: 1.3.0
|
67
86
|
type: :development
|
68
87
|
prerelease: false
|
69
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.3.0
|
70
94
|
- !ruby/object:Gem::Dependency
|
71
95
|
name: simplecov
|
72
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
73
97
|
none: false
|
74
98
|
requirements:
|
75
99
|
- - ~>
|
@@ -77,7 +101,12 @@ dependencies:
|
|
77
101
|
version: 0.4.2
|
78
102
|
type: :development
|
79
103
|
prerelease: false
|
80
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.4.2
|
81
110
|
description: Ruby Wrapper for the jiffybox.de API
|
82
111
|
email:
|
83
112
|
- frank@heidjer.info
|
@@ -116,6 +145,7 @@ files:
|
|
116
145
|
- spec/fixtures/freezed_box.json
|
117
146
|
- spec/fixtures/plan.json
|
118
147
|
- spec/fixtures/plan_list.json
|
148
|
+
- spec/fixtures/recurring_box_backup.json
|
119
149
|
- spec/fixtures/updated_box.json
|
120
150
|
- spec/rjiffy/box_spec.rb
|
121
151
|
- spec/rjiffy/configuration_spec.rb
|
@@ -124,7 +154,6 @@ files:
|
|
124
154
|
- spec/rjiffy/result_spec.rb
|
125
155
|
- spec/rjiffy_spec.rb
|
126
156
|
- spec/spec_helper.rb
|
127
|
-
has_rdoc: true
|
128
157
|
homepage: ''
|
129
158
|
licenses: []
|
130
159
|
post_install_message:
|
@@ -145,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
174
|
version: '0'
|
146
175
|
requirements: []
|
147
176
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.
|
177
|
+
rubygems_version: 1.8.23
|
149
178
|
signing_key:
|
150
179
|
specification_version: 3
|
151
180
|
summary: Rjiffy
|
@@ -163,6 +192,7 @@ test_files:
|
|
163
192
|
- spec/fixtures/freezed_box.json
|
164
193
|
- spec/fixtures/plan.json
|
165
194
|
- spec/fixtures/plan_list.json
|
195
|
+
- spec/fixtures/recurring_box_backup.json
|
166
196
|
- spec/fixtures/updated_box.json
|
167
197
|
- spec/rjiffy/box_spec.rb
|
168
198
|
- spec/rjiffy/configuration_spec.rb
|