fog-serverlove 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a3ac139dc1cdb32a8d4586bb8a84c4dabc5ec9
4
- data.tar.gz: b04cf3df5e6bc02ae7ae40a04ce4e8c37d30be4a
3
+ metadata.gz: 217fe23d90cf438d61bed021782cf37273e4d4e1
4
+ data.tar.gz: d50e8999d921909a726ceb59ee9e476a7c3c5738
5
5
  SHA512:
6
- metadata.gz: 26ca8f808552220ce6dbb88c6dbed1a88920eaae32eb1098add342a7bf9a034350bc6c817518bd0dff185e7b89d24b59c4dfd218202a4cd389c3811d65fca9c0
7
- data.tar.gz: 275a4755bc99213e1cb3bfd545133104320122a618e1f55103aa9046421d4c52aa8720ff0025f0ab9dd74d7f8e7c2ba42329e2bbb85185f57f58fc857d7f31b1
6
+ metadata.gz: 2316dae856cfe4ce0bf720f38c3c8e225422eb2aef003d7c58e79f9238614a4e66beaf0f707c406a49f5c5b3d1e41289cbb459f9a6e73274e7a16859e9ae38c2
7
+ data.tar.gz: a937c37d39c3661d7d7fac5cb09f7faf27358e6905af9d1b97239402f8954514fec28c967f9bce5d2663497631b739d69ba8217163540bab2241996ea6a2cac7
@@ -18,3 +18,6 @@ Style/SignalException:
18
18
 
19
19
  Style/StringLiterals:
20
20
  EnforcedStyle: double_quotes
21
+
22
+ Style/ExtraSpacing:
23
+ Enabled: false
@@ -14,7 +14,10 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = ""
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0")
17
+ files = `git ls-files -z`.split("\x0")
18
+ files.delete(".hound.yml")
19
+ spec.files = files
20
+
18
21
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
23
  spec.require_paths = ["lib"]
@@ -14,7 +14,7 @@ class Serverlove < Fog::Bin
14
14
  hash[key] = case key
15
15
  when :compute
16
16
  Fog::Logger.warning("Serverlove[:compute] is not recommended, use Compute[:serverlove] for portability")
17
- Fog::Compute.new(:provider => 'Serverlove')
17
+ Fog::Compute.new(:provider => "Serverlove")
18
18
  else
19
19
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
20
20
  end
@@ -1,24 +1,24 @@
1
1
  module Fog
2
2
  module Compute
3
3
  class Serverlove < Fog::Service
4
- autoload :Image, 'fog/compute/serverlove/models/image'
5
- autoload :Images, 'fog/compute/serverlove/models/images'
6
- autoload :Server, 'fog/compute/serverlove/models/server'
7
- autoload :Servers, 'fog/compute/serverlove/models/servers'
8
- autoload :PasswordGenerator, 'fog/compute/serverlove/password_generator'
4
+ autoload :Image, File.expand_path("../serverlove/models/image", __FILE__)
5
+ autoload :Images, File.expand_path("../serverlove/models/images", __FILE__)
6
+ autoload :Server, File.expand_path("../serverlove/models/server", __FILE__)
7
+ autoload :Servers, File.expand_path("../serverlove/models/servers", __FILE__)
8
+ autoload :PasswordGenerator, File.expand_path("../serverlove/password_generator", __FILE__)
9
9
 
10
10
  API_HOST = "api.z1-man.serverlove.com"
11
11
 
12
12
  requires :serverlove_uuid, :serverlove_api_key
13
13
  recognizes :serverlove_api_url
14
14
 
15
- model_path 'fog/compute/serverlove/models'
15
+ model_path "fog/compute/serverlove/models"
16
16
  model :image
17
17
  collection :images
18
18
  model :server
19
19
  collection :servers
20
20
 
21
- request_path 'fog/compute/serverlove/requests'
21
+ request_path "fog/compute/serverlove/requests"
22
22
  # Image
23
23
  request :get_image
24
24
  request :get_images
@@ -86,7 +86,7 @@ module Fog
86
86
  def raise_if_error!(response)
87
87
  case response.status
88
88
  when 400 then
89
- raise 'omg'
89
+ raise "omg"
90
90
  end
91
91
  end
92
92
  end
@@ -2,7 +2,7 @@ module Fog
2
2
  module Compute
3
3
  class Serverlove
4
4
  class Image < Fog::Model
5
- identity :id, :aliases => 'drive'
5
+ identity :id, :aliases => "drive"
6
6
 
7
7
  attribute :name
8
8
  attribute :user
@@ -10,7 +10,7 @@ module Fog
10
10
  attribute :claimed
11
11
  attribute :status
12
12
  attribute :imaging
13
- attribute :encryption_cipher, :aliases => 'encryption:cipher'
13
+ attribute :encryption_cipher, :aliases => "encryption:cipher"
14
14
 
15
15
  def save
16
16
  attributes = {}
@@ -33,7 +33,7 @@ module Fog
33
33
  end
34
34
 
35
35
  def ready?
36
- status.upcase == 'ACTIVE'
36
+ status.upcase == "ACTIVE"
37
37
  end
38
38
 
39
39
  def destroy
@@ -2,25 +2,25 @@ module Fog
2
2
  module Compute
3
3
  class Serverlove
4
4
  class Server < Fog::Model
5
- identity :id, :aliases => 'server'
5
+ identity :id, :aliases => "server"
6
6
 
7
7
  attribute :name
8
8
  attribute :cpu
9
9
  attribute :mem
10
10
  attribute :smp
11
- attribute :ide_0_0, :aliases => 'ide:0:0'
12
- attribute :ide_0_1, :aliases => 'ide:0:1'
13
- attribute :ide_1_0, :aliases => 'ide:1:0'
14
- attribute :ide_1_1, :aliases => 'ide:1:1'
11
+ attribute :ide_0_0, :aliases => "ide:0:0"
12
+ attribute :ide_0_1, :aliases => "ide:0:1"
13
+ attribute :ide_1_0, :aliases => "ide:1:0"
14
+ attribute :ide_1_1, :aliases => "ide:1:1"
15
15
  attribute :boot
16
16
  attribute :persistent
17
17
  attribute :vnc
18
- attribute :vnc_password, :aliases => 'vnc:password'
18
+ attribute :vnc_password, :aliases => "vnc:password"
19
19
  attribute :status
20
20
  attribute :user
21
21
  attribute :started
22
- attribute :nic_0_model, :aliases => 'nic:0:model'
23
- attribute :nic_0_dhcp, :aliases => 'nic:0:dhcp'
22
+ attribute :nic_0_model, :aliases => "nic:0:model"
23
+ attribute :nic_0_dhcp, :aliases => "nic:0:dhcp"
24
24
 
25
25
  def save
26
26
  attributes = {}
@@ -56,9 +56,9 @@ module Fog
56
56
  def self.defaults
57
57
  # TODO: Document default settings.
58
58
  # Note that VNC password standards are strict (need explaining)
59
- { 'nic:0:model' => 'e1000', 'nic:0:dhcp' => 'auto',
60
- 'smp' => 'auto', 'vnc' => 'auto',
61
- 'vnc:password' => Fog::Compute::Serverlove::PasswordGenerator.generate
59
+ { "nic:0:model" => "e1000", "nic:0:dhcp" => "auto",
60
+ "smp" => "auto", "vnc" => "auto",
61
+ "vnc:password" => Fog::Compute::Serverlove::PasswordGenerator.generate
62
62
  }
63
63
  end
64
64
  end
@@ -3,7 +3,7 @@ module Fog
3
3
  class Serverlove
4
4
  class PasswordGenerator
5
5
  def self.generate
6
- ('a'...'z').to_a.concat(('A'...'Z').to_a).shuffle[0,8].join
6
+ ("a"..."z").to_a.concat(("A"..."Z").to_a).shuffle[0, 8].join
7
7
  end
8
8
  end
9
9
  end
@@ -14,9 +14,9 @@ module Fog
14
14
  response.status = 200
15
15
 
16
16
  data = {
17
- 'drive' => Fog::Mock.random_numbers(1000000).to_s,
18
- 'name' => options['name'] || 'Test',
19
- 'size' => options['size'] || 12345
17
+ "drive" => Fog::Mock.random_numbers(1000000).to_s,
18
+ "name" => options["name"] || "Test",
19
+ "size" => options["size"] || 12345
20
20
  }
21
21
 
22
22
  response.body = data
@@ -14,11 +14,11 @@ module Fog
14
14
  response.status = 200
15
15
 
16
16
  data = {
17
- 'server' => Fog::Mock.random_numbers(1000000).to_s,
18
- 'name' => options['name'] || 'Test',
19
- 'cpu' => options['cpu'] || 1000,
20
- 'persistent' => options['persistent'] || false,
21
- 'vnc:password' => options['vnc:password'] || 'T35tServER!'
17
+ "server" => Fog::Mock.random_numbers(1000000).to_s,
18
+ "name" => options["name"] || "Test",
19
+ "cpu" => options["cpu"] || 1000,
20
+ "persistent" => options["persistent"] || false,
21
+ "vnc:password" => options["vnc:password"] || "T35tServER!"
22
22
  }
23
23
 
24
24
  response.body = data
@@ -1,15 +1,15 @@
1
- require 'fog/serverlove/version'
2
- require 'fog/core'
3
- require 'fog/json'
1
+ require "fog/core"
2
+ require "fog/json"
3
+ require File.expand_path("../serverlove/version", __FILE__)
4
4
 
5
5
  module Fog
6
6
  module Compute
7
- autoload :Serverlove, 'fog/compute/serverlove'
7
+ autoload :Serverlove, File.expand_path("../compute/serverlove", __FILE__)
8
8
  end
9
9
 
10
10
  module Serverlove
11
11
  extend Fog::Provider
12
12
 
13
- service(:compute, 'Compute')
13
+ service(:compute, "Compute")
14
14
  end
15
15
  end
@@ -0,0 +1 @@
1
+ # This file was intentionally left blank
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Serverlove
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-serverlove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Henrique Lopes Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-22 00:00:00.000000000 Z
11
+ date: 2015-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -146,7 +146,6 @@ extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
148
148
  - ".gitignore"
149
- - ".hound.yml"
150
149
  - ".rubocop.yml"
151
150
  - ".ruby-gemset"
152
151
  - ".ruby-version"
data/.hound.yml DELETED
@@ -1,20 +0,0 @@
1
- Metrics/LineLength:
2
- Enabled: false
3
-
4
- Style/EachWithObject:
5
- Enabled: false
6
-
7
- Style/Encoding:
8
- EnforcedStyle: when_needed
9
-
10
- Style/FormatString:
11
- Enabled: false
12
-
13
- Style/HashSyntax:
14
- EnforcedStyle: hash_rockets
15
-
16
- Style/SignalException:
17
- EnforcedStyle: only_raise
18
-
19
- Style/StringLiterals:
20
- EnforcedStyle: double_quotes