middleman-sync 3.0.3 → 3.0.4

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- middleman-sync (3.0.0)
4
+ middleman-sync (3.0.4)
5
5
  asset_sync (~> 0.5.0)
6
6
  middleman-core (>= 3.0.0)
7
7
 
data/README.md CHANGED
@@ -4,6 +4,8 @@ Synchronise your Middleman build to S3 and more
4
4
 
5
5
  Middleman-Sync is a Middleman extension that wraps the excellant [Asset Sync](https://raw.github.com/rumblelabs/asset_sync) to allow for both a CLI and after_build hook to your Middleman build's
6
6
 
7
+ The after_build hook is `false` by default, to allow for a more 'opt-in' extension.
8
+
7
9
  ## Installation
8
10
 
9
11
  If you already have a Middleman project:
@@ -20,8 +22,8 @@ activate :sync do |sync|
20
22
  sync.fog_region = 'bucket-region-name' # The region your storage bucket is in
21
23
  sync.aws_access_key_id = 'super' # Your Amazon S3 access key
22
24
  sync.aws_secret_access_key = 'secret' # Your Amazon S3 access secret
23
- sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
24
- # sync.after_build = true # Run sync after build
25
+ sync.existing_remote_files = 'keep' # What to do with your existing remote files? ( keep or delete )
26
+ # sync.after_build = true # Enable sync to run after Middleman build ( defaults to false )
25
27
  end
26
28
  ```
27
29
 
@@ -35,9 +37,9 @@ activate :sync do |sync|
35
37
  sync.fog_region = 'bucket-region-name' # The region your storage bucket is in
36
38
  sync.rackspace_username = 'karlfreeman' # Your Rackspace username
37
39
  sync.rackspace_api_key = 'secret' # Your Rackspace API Key
38
- sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
40
+ sync.existing_remote_files = 'keep' # What to do with your existing remote files? ( keep or delete )
39
41
  # sync.rackspace_auth_url = 'domain' # Your Rackspace auth URL
40
- # sync.after_build = true # Run sync after build
42
+ # sync.after_build = true # Enable sync to run after Middleman build ( defaults to false )
41
43
  end
42
44
  ```
43
45
 
@@ -51,8 +53,8 @@ activate :sync do |sync|
51
53
  sync.fog_region = 'bucket-region-name' # The region your storage bucket is in
52
54
  sync.google_storage_access_key_id = 'super' # Your Google Storage access key
53
55
  sync.google_storage_secret_access_key = 'secret' # Your Google Storage access secret
54
- sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
55
- # sync.after_build = true # Run sync after build
56
+ sync.existing_remote_files = 'keep' # What to do with your existing remote files? ( keep or delete )
57
+ # sync.after_build = true # Enable sync to run after Middleman build ( defaults to false )
56
58
  end
57
59
  ```
58
60
 
@@ -70,6 +72,25 @@ middleman sync
70
72
  middleman build
71
73
  ```
72
74
 
75
+ ## Sync to multiple targets
76
+
77
+ Middleman and Middleman-Sync are both environment agnostic. To be able to sync different versions of Middleman to different locations ( eg staging, production ) You might try running `middleman build` with environment varibles swapping out the sync credentials that need changing pre requirements.
78
+
79
+ Modifying the activate area to use an `ENV['FOG_DIRECTORY']` would allow you to run `FOG_DIRECTORY=example-staging middleman build` which then would sync to a different bucket on S3.
80
+
81
+ ``` ruby
82
+ # Activate sync extension
83
+ activate :sync do |sync|
84
+ sync.fog_provider = 'AWS' # Your storage provider
85
+ sync.fog_directory = ENV['FOG_DIRECTORY'] # Your bucket name
86
+ sync.fog_region = 'bucket-region-name' # The region your storage bucket is in
87
+ sync.aws_access_key_id = 'super' # Your Amazon S3 access key
88
+ sync.aws_secret_access_key = 'secret' # Your Amazon S3 access secret
89
+ sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
90
+ sync.after_build = true # Enable sync to run after Middleman build ( defaults to false )
91
+ end
92
+ ```
93
+
73
94
  ## Credits
74
95
 
75
96
  Using:
@@ -26,7 +26,7 @@ module Middleman
26
26
  app.after_configuration do
27
27
 
28
28
  options.after_build ||= false
29
- options.prefix = "*"
29
+ options.prefix = "**"
30
30
  options.public_path = build_dir
31
31
 
32
32
  AssetSync.configure do |config|
@@ -1,7 +1,7 @@
1
1
  module Middleman
2
2
 
3
3
  module Sync
4
- VERSION = "3.0.3"
4
+ VERSION = "3.0.4"
5
5
  end
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-09 00:00:00.000000000 Z
12
+ date: 2012-09-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
@@ -74,12 +74,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  - - ! '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
+ segments:
78
+ - 0
79
+ hash: 4555721958482037397
77
80
  required_rubygems_version: !ruby/object:Gem::Requirement
78
81
  none: false
79
82
  requirements:
80
83
  - - ! '>='
81
84
  - !ruby/object:Gem::Version
82
85
  version: '0'
86
+ segments:
87
+ - 0
88
+ hash: 4555721958482037397
83
89
  requirements: []
84
90
  rubyforge_project: middleman-sync
85
91
  rubygems_version: 1.8.23