dropbox-deployment 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dropbox-deployment.rb +11 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e854d07fdfbef742970d84a597081f57a6daf96d
4
- data.tar.gz: ad97a78e8aef9a80df09cea2a7c8ccb5cdaf7821
3
+ metadata.gz: 53966b92c5af10d6d5c3033c13cee7a0120187ce
4
+ data.tar.gz: dcf6ad8fea3fd0a4193a17c0edcce593be27df73
5
5
  SHA512:
6
- metadata.gz: d668c7d0639c25dac492b58c2450922a368601bb040dafa1cee67a2ea04d589f109ed2d20dfaefd5b2463ff025c224e682d296e4afc63a2c9d90b942a0a6a146
7
- data.tar.gz: 3d9459036faa8d496f085967656e4e46727c007dcd07a03db0d03904cd4bd2cad9c8d367a11b4e52e3219787cf4cabe36c7a319e7f77eaf8342ecd3d3bc427da
6
+ metadata.gz: 11ac70d8088fb06506b2297b0645f0efd555c7236c4c0a1edfb32f2b95f3355eef702c813cb272e8e1f0fa6d0f20d9e56cb66e928c3703ce9fd70c72ef0e5f71
7
+ data.tar.gz: c31f9b75e10e23cb79bf3801d6d42d9efa1b10ba9ddde9310fcad4b8bdb02fc382c66a96e96e4b583f7dd20b37eb0af27b717d8c4de177e3dad6b649f542b9b7
@@ -6,8 +6,10 @@ require 'find'
6
6
  module DropboxDeployment
7
7
  class Deployer
8
8
 
9
- logger = Logger.new(STDOUT)
10
- logger.level = Logger::WARN
9
+ def initialize
10
+ @@logger = Logger.new(STDOUT)
11
+ @@logger.level = Logger::WARN
12
+ end
11
13
 
12
14
  def uploadFile(dropboxClient, file, dropboxPath)
13
15
  fileName = File.basename(file)
@@ -33,7 +35,7 @@ module DropboxDeployment
33
35
  end
34
36
  config = YAML.load_file("dropbox-deployment.yml")
35
37
  testing = false
36
- if !config["deploy"]
38
+ if !config.has_key?("deploy")
37
39
  puts "\nError in config file! Build file must contain a `deploy` object.\n\n"
38
40
  exit(1)
39
41
  end
@@ -53,24 +55,24 @@ module DropboxDeployment
53
55
  end
54
56
 
55
57
  if config["deploy"]["debug"]
56
- logger.level = Logger::DEBUG
57
- logger.debug("We are in debug mode")
58
+ @@logger.level = Logger::DEBUG
59
+ @@logger.debug("We are in debug mode")
58
60
  end
59
61
 
60
62
  dropboxClient = DropboxApi::Client.new
61
63
 
62
64
  # Upload all files
63
- logger.debug("Artifact Path: " + artifactPath)
64
- logger.debug("Dropbox Path: " + dropboxPath)
65
+ @@logger.debug("Artifact Path: " + artifactPath)
66
+ @@logger.debug("Dropbox Path: " + dropboxPath)
65
67
  isDirectory = File.directory?(artifactPath)
66
- logger.debug("Is directory: " + "#{isDirectory}")
68
+ @@logger.debug("Is directory: " + "#{isDirectory}")
67
69
  if isDirectory
68
70
  uploadDirectory(dropboxClient, artifactPath, dropboxPath)
69
71
  else
70
72
  artifactFile = File.open(artifactPath)
71
73
  uploadFile(dropboxClient, artifactFile, dropboxPath)
72
74
  end
73
- logger.debug("Uploading complete")
75
+ @@logger.debug("Uploading complete")
74
76
  end
75
77
  end
76
78
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropbox-deployment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Carlson