jekyll-s3 0.0.2 → 0.0.3

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 ADDED
@@ -0,0 +1,39 @@
1
+ # jekyll-s3
2
+
3
+ Deploy your jekyll site to S3.
4
+
5
+ ## Install
6
+
7
+ gem install jekyll-s3
8
+
9
+ ## Setup
10
+
11
+ * Go to your jekyll site directory
12
+ * Run `jekyll-s3`. It generates a configuration file called `_jekyll_s3.yml` that looks like that:
13
+ <pre>
14
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
15
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
16
+ s3_bucket: your.blog.bucket.com
17
+ </pre>
18
+
19
+ * Edit it with your details.
20
+
21
+ ## Deploy!
22
+
23
+ * Run `jekyll-s3`. Done.
24
+
25
+ ## Want `http://www.my-awesome-blog.com/` to render `'index.html'`?
26
+
27
+ * Setup Cloudfront to distribute your s3 bucket files (you can do that
28
+ through the [AWS management console](https://console.aws.amazon.com/s3/home))
29
+ * Set the cloudfront root object to index.html (you can use the
30
+ [aws-cloudfront gem](https://github.com/iltempo/aws-cloudfront) to do so)
31
+
32
+ ## Todo
33
+
34
+ * Upload new / updated files *only*
35
+ * Setup Cloudfront distribution
36
+ * Invalidate updated files on Cloudfront
37
+
38
+
39
+
data/jekyll-s3.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Philippe Creux"]
10
10
  s.email = ["pcreux@gmail.com"]
11
- s.homepage = ""
11
+ s.homepage = "https://github.com/versapay/jekyll-s3"
12
12
  s.summary = %q{Push your jekyll blog to S3"}
13
13
  s.description = %q{Push your jekyll blog to AWS S3}
14
14
 
@@ -25,8 +25,9 @@ s3_bucket: your.blog.bucket.com
25
25
 
26
26
  include AWS::S3
27
27
 
28
+ # Please spec me!
28
29
  def upload_to_s3!
29
- puts "Uploading _site/* to #{@s3_bucket}"
30
+ puts "Deploying _site/* to #{@s3_bucket}"
30
31
 
31
32
  AWS::S3::Base.establish_connection!(
32
33
  :access_key_id => @s3_id,
@@ -52,17 +53,35 @@ s3_bucket: your.blog.bucket.com
52
53
  puts("Upload #{f}: Success!")
53
54
  else
54
55
  puts("Upload #{f}: FAILURE!")
55
- end
56
+ end
56
57
  end
57
58
 
58
59
  to_delete = remote_files - local_files
60
+
61
+ delete_all = false
62
+ keep_all = false
59
63
  to_delete.each do |f|
60
- if S3Object.delete(f, @s3_bucket)
61
- puts("Delete #{f}: Success!")
62
- else
63
- puts("Delete #{f}: FAILURE!")
64
- end
64
+ delete = false
65
+ keep = false
66
+ until delete || delete_all || keep || keep_all
67
+ puts "#{f} is on S3 but not in your _site directory anymore. Do you want to [d]elete, [D]elete all, [k]eep, [K]eep all?"
68
+ case STDIN.gets.chomp
69
+ when 'd' then delete = true
70
+ when 'D' then delete_all = true
71
+ when 'k' then keep = true
72
+ when 'K' then keep_all = true
73
+ end
74
+ end
75
+ if (delete_all || delete) && !(keep_all || keep)
76
+ if S3Object.delete(f, @s3_bucket)
77
+ puts("Delete #{f}: Success!")
78
+ else
79
+ puts("Delete #{f}: FAILURE!")
80
+ end
81
+ end
65
82
  end
83
+
84
+ puts "Done! Go visit: http://#{@s3_bucket}.s3.amazonaws.com/index.html"
66
85
  end
67
86
 
68
87
  def check_jekyll_project!
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module S3
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-s3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philippe Creux
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-01 00:00:00 -07:00
18
+ date: 2011-04-07 00:00:00 -07:00
19
19
  default_executable: jekyll-s3
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -86,6 +86,7 @@ extra_rdoc_files: []
86
86
  files:
87
87
  - .gitignore
88
88
  - Gemfile
89
+ - README.md
89
90
  - Rakefile
90
91
  - bin/jekyll-s3
91
92
  - features/jekyll-s3.feature
@@ -97,7 +98,7 @@ files:
97
98
  - lib/jekyll-s3/uploader.rb
98
99
  - lib/jekyll-s3/version.rb
99
100
  has_rdoc: true
100
- homepage: ""
101
+ homepage: https://github.com/versapay/jekyll-s3
101
102
  licenses: []
102
103
 
103
104
  post_install_message: