datapimp 1.0.11 → 1.0.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47197614b0c4d6c1516dc06bc52effb6a1925dfb
4
- data.tar.gz: 29ac24ff99fa81657cf073209d38cf8152368153
3
+ metadata.gz: 04d4793efcb122a4aa130ae1e979303970defb83
4
+ data.tar.gz: 27044a2f923a7e155ca65d0173db0689f5c45119
5
5
  SHA512:
6
- metadata.gz: fffa9d02fdd46d56a9ab41673bf943c097f50729902f0274aabb67de126f1ea09ef4a4acff4dae0b47bdf69c7f3653efd75fe5009bd92865d74bb57bd900adc0
7
- data.tar.gz: f82e0a60066538e96fedfb58e5060e910447fe9fc60e9f6b7e39c9c78c953142512973291b9d8eb144e5f408d4fe3a18d936d42b47c5af96796c8fa90f6a67ad
6
+ metadata.gz: 3d9b7739a5f9988355b4e71b9d0dec7e031d9f1d2f2c36d63d1c0d8e3adc94a5eda99393da65f8c54db5b469c865856d7544be70c4d43cb405571869bc064e28
7
+ data.tar.gz: 4563f49579ceff3abb34559fc754158e1cf8c4211f949f26a6a0c063f2c992f4d35f92a3771d164281599f4d2b1297b4821897792829d54dc438d29513ced6d8
@@ -30,7 +30,7 @@ command 'create cache invalidations' do |c|
30
30
 
31
31
  if options.previous_deploy
32
32
  items = bucket.deploy_manifest["uploaded"]
33
- binding.pry
33
+ items
34
34
  end
35
35
 
36
36
  if paths.length > 0
@@ -76,18 +76,21 @@ command 'create cloudfront distribution' do |c|
76
76
  },
77
77
  comment: options.bucket,
78
78
  caller_reference: Time.now.to_i.to_s,
79
- cname: Array(options.domains).join(","),
79
+ cname: Array(options.domains),
80
80
  default_root_object: 'index.html'
81
81
  }
82
82
 
83
83
  distributions = Datapimp::Sync.amazon.cdn.distributions
84
84
 
85
- distribution = distributions.find {|d| d.comment == options.bucket }
85
+ distribution_id = distributions.find {|d| d.comment == options.bucket }.id
86
86
 
87
- if !distribution
87
+ if !distribution_id
88
88
  distribution = Datapimp::Sync.amazon.cdn.distributions.create(cdn_options)
89
+ elsif distribution_id
90
+ distribution = distributions.get(distribution_id)
91
+ distribution.etag = distribution.etag
92
+ distribution.cname = Array(options.domains)
93
+ distribution.save
89
94
  end
90
-
91
- log "Cloudfront distribution created: #{ distribution.domain } status: #{ distribution.status }"
92
95
  end
93
96
  end
@@ -14,6 +14,8 @@ command 'view amazon setup' do |c|
14
14
  rows << ["Website Hostname", bucket.website_hostname]
15
15
  rows << ["Website URL", bucket.website_url]
16
16
  rows << ["Cloudfront Hostname", cloudfront.domain]
17
+ rows << ["Cloudfront ID", cloudfront.id]
18
+ rows << ["Cloudfront Domains", cloudfront.cname && cloudfront.cname.join(",")]
17
19
 
18
20
  table = Terminal::Table.new :rows => rows, :headings => %w(Setting Value)
19
21
 
@@ -1,3 +1,3 @@
1
1
  module Datapimp
2
- VERSION = "1.0.11"
2
+ VERSION = "1.0.12"
3
3
  end
data/lib/datapimp.rb CHANGED
@@ -3,7 +3,7 @@ require 'set'
3
3
  require 'pathname'
4
4
  require 'hashie'
5
5
  require 'datapimp/core_ext'
6
- require 'active_support'
6
+ require 'active_support/core_ext/string'
7
7
 
8
8
  module Datapimp
9
9
  def self.config
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datapimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry