guard-s3 0.1.0 → 0.1.1

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.
@@ -20,9 +20,9 @@ module ::Guard
20
20
  :secret_access_key => options[:secret_access_key]
21
21
  )
22
22
  @bucket = options[:bucket]
23
- @s3_permissions = :public_read
23
+ @s3_permissions = options[:s3_permissions]
24
24
  @debug = true
25
- @pwd = Dir.pwd
25
+ @pwd = watchdir || Dir.pwd
26
26
  end
27
27
 
28
28
  def run_on_change(paths)
@@ -32,9 +32,8 @@ module ::Guard
32
32
  if exists?(file)
33
33
  log "Nothing uploaded. #{file} already exists!"
34
34
  else
35
- log "Syncing #{path}"
36
- S3Object.store(path, open(file), @bucket)
37
- #S3Object.store(file, open(file), @bucket, {:content_type => file.content_type.to_s.strip, :access => @s3_permissions})
35
+ log "Uploading #{path}"
36
+ S3Object.store(path, open(file), @bucket, {:access => @s3_permissions})
38
37
  end
39
38
  rescue Exception => e
40
39
  log e.message
@@ -57,5 +56,9 @@ module ::Guard
57
56
  puts "[#{Time.now}] #{msg}"
58
57
  end
59
58
 
59
+ def watchdir
60
+ # TODO: Nicer way to detect Guard watching a directory explicitly?
61
+ ::Guard::Dsl.class_variable_get(:@@options).watchdir
62
+ end
60
63
  end
61
64
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module S3
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-24 00:00:00.000000000Z
12
+ date: 2011-11-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-s3
16
- requirement: &70196145999740 !ruby/object:Gem::Requirement
16
+ requirement: &70217174640680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70196145999740
24
+ version_requirements: *70217174640680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard
27
- requirement: &70196145999160 !ruby/object:Gem::Requirement
27
+ requirement: &70217174640220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70196145999160
35
+ version_requirements: *70217174640220
36
36
  description: A simple guard library for syncing files with s3
37
37
  email:
38
38
  - james at supermatter dot com
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: 1.3.6
69
69
  requirements: []
70
70
  rubyforge_project: guard-s3
71
- rubygems_version: 1.8.6
71
+ rubygems_version: 1.8.11
72
72
  signing_key:
73
73
  specification_version: 3
74
74
  summary: A simple guard library for syncing files with s3