multi_sync 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.document +3 -0
  3. data/.gitignore +20 -0
  4. data/.rubocop.yml +26 -0
  5. data/.travis.yml +24 -0
  6. data/.yardopts +6 -0
  7. data/CHANGELOG.md +0 -0
  8. data/CONTRIBUTING.md +44 -0
  9. data/Gemfile +17 -0
  10. data/LICENSE.md +20 -0
  11. data/README.md +134 -0
  12. data/Rakefile +45 -0
  13. data/examples/custom.rb +34 -0
  14. data/examples/rails-3-2/.gitignore +15 -0
  15. data/examples/rails-3-2/Gemfile +43 -0
  16. data/examples/rails-3-2/README.rdoc +261 -0
  17. data/examples/rails-3-2/Rakefile +7 -0
  18. data/examples/rails-3-2/app/assets/images/rails.png +0 -0
  19. data/examples/rails-3-2/app/assets/javascripts/application.js +15 -0
  20. data/examples/rails-3-2/app/assets/stylesheets/application.css +13 -0
  21. data/examples/rails-3-2/app/controllers/application_controller.rb +3 -0
  22. data/examples/rails-3-2/app/helpers/application_helper.rb +2 -0
  23. data/examples/rails-3-2/app/mailers/.gitkeep +0 -0
  24. data/examples/rails-3-2/app/models/.gitkeep +0 -0
  25. data/examples/rails-3-2/app/views/layouts/application.html.erb +14 -0
  26. data/examples/rails-3-2/config.ru +4 -0
  27. data/examples/rails-3-2/config/application.rb +62 -0
  28. data/examples/rails-3-2/config/asset_sync.yml +21 -0
  29. data/examples/rails-3-2/config/boot.rb +6 -0
  30. data/examples/rails-3-2/config/database.yml +25 -0
  31. data/examples/rails-3-2/config/environment.rb +5 -0
  32. data/examples/rails-3-2/config/environments/development.rb +37 -0
  33. data/examples/rails-3-2/config/environments/production.rb +67 -0
  34. data/examples/rails-3-2/config/environments/test.rb +37 -0
  35. data/examples/rails-3-2/config/initializers/backtrace_silencers.rb +7 -0
  36. data/examples/rails-3-2/config/initializers/inflections.rb +15 -0
  37. data/examples/rails-3-2/config/initializers/mime_types.rb +5 -0
  38. data/examples/rails-3-2/config/initializers/multi_sync.rb +29 -0
  39. data/examples/rails-3-2/config/initializers/secret_token.rb +7 -0
  40. data/examples/rails-3-2/config/initializers/session_store.rb +8 -0
  41. data/examples/rails-3-2/config/initializers/wrap_parameters.rb +14 -0
  42. data/examples/rails-3-2/config/locales/en.yml +5 -0
  43. data/examples/rails-3-2/config/routes.rb +58 -0
  44. data/examples/rails-3-2/db/seeds.rb +7 -0
  45. data/examples/rails-3-2/lib/assets/.gitkeep +0 -0
  46. data/examples/rails-3-2/lib/tasks/.gitkeep +0 -0
  47. data/examples/rails-3-2/log/.gitkeep +0 -0
  48. data/examples/rails-3-2/public/404.html +26 -0
  49. data/examples/rails-3-2/public/422.html +26 -0
  50. data/examples/rails-3-2/public/500.html +25 -0
  51. data/examples/rails-3-2/public/favicon.ico +0 -0
  52. data/examples/rails-3-2/public/index.html +241 -0
  53. data/examples/rails-3-2/public/robots.txt +5 -0
  54. data/examples/rails-3-2/script/rails +6 -0
  55. data/examples/rails-3-2/test/fixtures/.gitkeep +0 -0
  56. data/examples/rails-3-2/test/functional/.gitkeep +0 -0
  57. data/examples/rails-3-2/test/integration/.gitkeep +0 -0
  58. data/examples/rails-3-2/test/performance/browsing_test.rb +12 -0
  59. data/examples/rails-3-2/test/test_helper.rb +13 -0
  60. data/examples/rails-3-2/test/unit/.gitkeep +0 -0
  61. data/examples/rails-4-0/.gitignore +16 -0
  62. data/examples/rails-4-0/Gemfile +50 -0
  63. data/examples/rails-4-0/README.rdoc +28 -0
  64. data/examples/rails-4-0/Rakefile +6 -0
  65. data/examples/rails-4-0/app/assets/images/.keep +0 -0
  66. data/examples/rails-4-0/app/assets/javascripts/application.js +16 -0
  67. data/examples/rails-4-0/app/assets/stylesheets/application.css +13 -0
  68. data/examples/rails-4-0/app/controllers/application_controller.rb +5 -0
  69. data/examples/rails-4-0/app/controllers/concerns/.keep +0 -0
  70. data/examples/rails-4-0/app/helpers/application_helper.rb +2 -0
  71. data/examples/rails-4-0/app/mailers/.keep +0 -0
  72. data/examples/rails-4-0/app/models/.keep +0 -0
  73. data/examples/rails-4-0/app/models/concerns/.keep +0 -0
  74. data/examples/rails-4-0/app/views/layouts/application.html.erb +14 -0
  75. data/examples/rails-4-0/config.ru +4 -0
  76. data/examples/rails-4-0/config/application.rb +24 -0
  77. data/examples/rails-4-0/config/asset_sync.yml +21 -0
  78. data/examples/rails-4-0/config/boot.rb +4 -0
  79. data/examples/rails-4-0/config/database.yml +25 -0
  80. data/examples/rails-4-0/config/environment.rb +5 -0
  81. data/examples/rails-4-0/config/environments/development.rb +29 -0
  82. data/examples/rails-4-0/config/environments/production.rb +80 -0
  83. data/examples/rails-4-0/config/environments/test.rb +36 -0
  84. data/examples/rails-4-0/config/initializers/backtrace_silencers.rb +7 -0
  85. data/examples/rails-4-0/config/initializers/filter_parameter_logging.rb +4 -0
  86. data/examples/rails-4-0/config/initializers/inflections.rb +16 -0
  87. data/examples/rails-4-0/config/initializers/mime_types.rb +5 -0
  88. data/examples/rails-4-0/config/initializers/multi_sync.rb +29 -0
  89. data/examples/rails-4-0/config/initializers/secret_token.rb +12 -0
  90. data/examples/rails-4-0/config/initializers/session_store.rb +3 -0
  91. data/examples/rails-4-0/config/initializers/wrap_parameters.rb +14 -0
  92. data/examples/rails-4-0/config/locales/en.yml +23 -0
  93. data/examples/rails-4-0/config/routes.rb +56 -0
  94. data/examples/rails-4-0/db/seeds.rb +7 -0
  95. data/examples/rails-4-0/lib/assets/.keep +0 -0
  96. data/examples/rails-4-0/lib/tasks/.keep +0 -0
  97. data/examples/rails-4-0/log/.keep +0 -0
  98. data/examples/rails-4-0/public/404.html +58 -0
  99. data/examples/rails-4-0/public/422.html +58 -0
  100. data/examples/rails-4-0/public/500.html +57 -0
  101. data/examples/rails-4-0/public/favicon.ico +0 -0
  102. data/examples/rails-4-0/public/robots.txt +5 -0
  103. data/examples/rails-4-0/test/controllers/.keep +0 -0
  104. data/examples/rails-4-0/test/fixtures/.keep +0 -0
  105. data/examples/rails-4-0/test/helpers/.keep +0 -0
  106. data/examples/rails-4-0/test/integration/.keep +0 -0
  107. data/examples/rails-4-0/test/mailers/.keep +0 -0
  108. data/examples/rails-4-0/test/models/.keep +0 -0
  109. data/examples/rails-4-0/test/test_helper.rb +15 -0
  110. data/gemfiles/middleman-3.1.x.gemfile +5 -0
  111. data/gemfiles/rails-3.2.x.gemfile +5 -0
  112. data/gemfiles/rails-4.0.x.gemfile +5 -0
  113. data/lib/multi_sync.rb +92 -0
  114. data/lib/multi_sync/client.rb +243 -0
  115. data/lib/multi_sync/configuration.rb +36 -0
  116. data/lib/multi_sync/environment.rb +37 -0
  117. data/lib/multi_sync/extensions/middleman.rb +22 -0
  118. data/lib/multi_sync/extensions/rails.rb +20 -0
  119. data/lib/multi_sync/extensions/rails/asset_sync.rb +44 -0
  120. data/lib/multi_sync/extensions/rails/railtie.rb +11 -0
  121. data/lib/multi_sync/logging.rb +60 -0
  122. data/lib/multi_sync/mixins/log_helper.rb +9 -0
  123. data/lib/multi_sync/mixins/pluralize_helper.rb +15 -0
  124. data/lib/multi_sync/resource.rb +84 -0
  125. data/lib/multi_sync/resources/local_resource.rb +30 -0
  126. data/lib/multi_sync/resources/remote_resource.rb +32 -0
  127. data/lib/multi_sync/source.rb +40 -0
  128. data/lib/multi_sync/sources/local_source.rb +17 -0
  129. data/lib/multi_sync/sources/manifest_source.rb +82 -0
  130. data/lib/multi_sync/target.rb +34 -0
  131. data/lib/multi_sync/targets/aws_target.rb +80 -0
  132. data/lib/multi_sync/targets/local_target.rb +58 -0
  133. data/lib/multi_sync/version.rb +3 -0
  134. data/lib/tasks/multi_sync_rails.rake +15 -0
  135. data/multi_sync.gemspec +35 -0
  136. data/spec/spec_helper.rb +22 -0
  137. data/spec/support/celluloid.rb +14 -0
  138. data/spec/support/fakefs.rb +7 -0
  139. data/spec/support/fog.rb +25 -0
  140. data/spec/support/pry.rb +6 -0
  141. data/spec/support/timecop.rb +2 -0
  142. data/spec/unit/multi_sync/client_spec.rb +301 -0
  143. data/spec/unit/multi_sync/configuration_spec.rb +92 -0
  144. data/spec/unit/multi_sync/resources/local_resource_spec.rb +55 -0
  145. data/spec/unit/multi_sync/sources/local_source_spec.rb +48 -0
  146. data/spec/unit/multi_sync/sources/manifest_source_spec.rb +57 -0
  147. data/spec/unit/multi_sync/targets/aws_target_spec.rb +60 -0
  148. data/spec/unit/multi_sync/targets/local_target_spec.rb +41 -0
  149. data/spec/unit/multi_sync_spec.rb +55 -0
  150. metadata +377 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 15f64f882b07eb32c2ab67b3a86aebfce1c41c06
4
+ data.tar.gz: f35664cd52f5bf38d99156140f0c56aa1aa09e91
5
+ SHA512:
6
+ metadata.gz: 40c4bfece43530dbc54002bb4b59787bfa59f28acca1085772de7f0a22c83be9577a2b30fe47943d5f25f269b865a1c6fdc3ce55ed327143d80b7414c48cea4e
7
+ data.tar.gz: 845d7cc8cd79ab528445f057c0957a4802d7dcf4296be83fe99b1697a2867018052cfc8c64f5b5d4d597f29aeb1ecb37bd71c905fa39d8b27c8018b10861884d
data/.document ADDED
@@ -0,0 +1,3 @@
1
+ LICENSE.md
2
+ README.md
3
+ lib/**/*.rb
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ bin
19
+ /examples/rails-4-0/public/assets/
20
+ /examples/rails-3-2/public/assets/
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ AllCops:
2
+ Includes:
3
+ - Rakefile
4
+ - Gemfile
5
+ Excludes:
6
+ - script/**
7
+ - vendor/**
8
+ - bin/**
9
+ - examples/**
10
+ - gemfiles/**
11
+ LineLength:
12
+ Enabled: false
13
+ MethodLength:
14
+ Enabled: false
15
+ ClassLength:
16
+ Enabled: false
17
+ Documentation:
18
+ Enabled: false
19
+ Encoding:
20
+ Enabled: false
21
+ Blocks:
22
+ Enabled: false
23
+ AlignParameters:
24
+ Enabled: false
25
+ HashSyntax:
26
+ EnforcedStyle: ruby19
data/.travis.yml ADDED
@@ -0,0 +1,24 @@
1
+ language: ruby
2
+ cache: bundler
3
+ bundler_args: --without development
4
+ rvm:
5
+ - ruby-head
6
+ - jruby-head
7
+ - 2.1.0
8
+ - 2.0.0
9
+ - 1.9.3
10
+ - rbx-19mode
11
+ - jruby-19mode
12
+ # gemfile:
13
+ # - gemfiles/Gemfile.middleman-3.1.x
14
+ # - gemfiles/Gemfile.rails-3.2.x
15
+ # - Gemfile
16
+ matrix:
17
+ fast_finish: true
18
+ allow_failures:
19
+ - rvm: ruby-head
20
+ - rvm: jruby-head
21
+ - rvm: rbx-19mode
22
+ - rvm: jruby-19mode
23
+ notifications:
24
+ email: false
data/.yardopts ADDED
@@ -0,0 +1,6 @@
1
+ --markup markdown
2
+ -
3
+ CHANGELOG.md
4
+ CONTRIBUTING.md
5
+ LICENSE.md
6
+ README.md
data/CHANGELOG.md ADDED
File without changes
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,44 @@
1
+ ## Contributing
2
+ In the spirit of [free software][free-sw], **everyone** is encouraged to help
3
+ improve this project.
4
+
5
+ [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
6
+
7
+ Here are some ways *you* can contribute:
8
+
9
+ * by using alpha, beta, and prerelease versions
10
+ * by reporting bugs
11
+ * by suggesting new features
12
+ * by writing or editing documentation
13
+ * by writing specifications
14
+ * by writing code (**no patch is too small**: fix typos, add comments, clean up
15
+ inconsistent whitespace)
16
+ * by refactoring code
17
+ * by closing [issues][]
18
+ * by reviewing patches
19
+
20
+ [issues]: https://github.com/karlfreeman/multi_sync/issues
21
+
22
+ ## Submitting an Issue
23
+ We use the [GitHub issue tracker][issues] to track bugs and features. Before
24
+ submitting a bug report or feature request, check to make sure it hasn't
25
+ already been submitted. When submitting a bug report, please include a [Gist][]
26
+ that includes a stack trace and any details that may be necessary to reproduce
27
+ the bug, including your gem version, Ruby version, and operating system.
28
+ Ideally, a bug report should include a pull request with failing specs.
29
+
30
+ [gist]: https://gist.github.com/
31
+
32
+ ## Submitting a Pull Request
33
+ 1. [Fork the repository.][fork]
34
+ 2. [Create a topic branch.][branch]
35
+ 3. Add specs for your unimplemented feature or bug fix.
36
+ 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
37
+ 5. Implement your feature or bug fix.
38
+ 6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
39
+ 7. Add, commit, and push your changes.
40
+ 8. [Submit a pull request.][pr]
41
+
42
+ [fork]: http://help.github.com/fork-a-repo/
43
+ [branch]: http://learn.github.com/p/branching.html
44
+ [pr]: http://help.github.com/send-pull-requests/
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'sprockets'
6
+ gem 'celluloid', github: 'celluloid/celluloid'
7
+
8
+ group :developement do
9
+ gem 'rubocop', github: 'bbatsov/rubocop'
10
+ end
11
+
12
+ group :test do
13
+ gem 'rake', '~> 10.0'
14
+ gem 'fakefs', '~> 0.4.3'
15
+ gem 'rspec'
16
+ gem 'timecop'
17
+ end
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013-2014 Karl Freeman
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # MultiSync
2
+
3
+ :heavy_exclamation_mark: **a WIP that is functioning but just a warning, not finished yet.** :heavy_exclamation_mark:
4
+
5
+ A flexible synchronisation library for your assets.
6
+
7
+ At MultiSync's core is [Celluloid](http://celluloid.io) allowing for the synchronisation of assets to be truly parallel. Each target you define creates a pool of resources which allows for parallel execution of uploads and deletes. Meaning that when your synchronising thousands of files, you get alot more :boom: for your :dollar:.
8
+
9
+ MultiSync tries to expose its asset synchronisation in a flexible way, allowing for it to be used in `Rails`, `Sinatra (WIP)`, `Rake (WIP)` and `Plain old ruby` as well as extensions for `Middleman (WIP)`, `Nanoc (WIP)` and others. Listed below are examples of how to get setup.
10
+
11
+ ## Installation
12
+
13
+ ```ruby
14
+ gem 'multi_sync', '~> 0.0.1'
15
+ ```
16
+
17
+ ```ruby
18
+ require 'multi_sync'
19
+
20
+ MultiSync.configuration do |config|
21
+ # config.verbose = false # turn on verbose logging (defaults to false)
22
+ # config.force = false # force syncing of outdated_files (defaults to false)
23
+ # config.run_on_build = true # when within a framework which `builds` assets, whether to sync afterwards (defaults to true)
24
+ # config.sync_outdated_files = true # when an outdated file is found whether to replace it (defaults to true)
25
+ # config.delete_abandoned_files = true # when an abondoned file is found whether to remove it (defaults to true)
26
+ # config.upload_missing_files = true # when a missing file is found whether to upload it (defaults to true)
27
+ # config.target_pool_size = 8 # how many threads you would like to open for each target (defaults to the amount of CPU core's your machine has)
28
+ # config.max_sync_attempts = 1 # how many times a file should be retried if there was an error during sync (defaults to 3)
29
+ end
30
+ ```
31
+
32
+ ### Fog credentials support
33
+
34
+ `MultiSync` supports utilising [Fog Credentials](http://fog.io/about/getting_started.html#credentials). Simply specify either a `FOG_RC` or `.fog` and we'll use it as the base for any credentials used in a target.
35
+
36
+ ## Features / Usage Examples
37
+
38
+ ### AssetSync compatibility
39
+
40
+ Many people use [AssetSync](https://github.com/rumblelabs/asset_sync) and for `MultiSync`'s first release compatibility with it has been built in. When within a `Rails` environment `MultiSync` will check for `asset_sync.yml` and read in its settings. You should be able to simply require `multi_sync` and try things out.
41
+
42
+ #### Unsupported features
43
+
44
+ - `AssetSync`'s environment variables
45
+ - `AssetSync`'s gzip_compression hack
46
+
47
+ ### Rails
48
+
49
+ `MultiSync` prefers ruby backed configuration instead of `YAML` so you'll need to create an initializer `/config/initializers/multi_sync` for `MultiSync`.
50
+
51
+ ```ruby
52
+ MultiSync.prepare do
53
+
54
+ source :public, {
55
+ type: :manifest, # load files from a Sprockets based manifest
56
+ source_dir: '/path_to_your_build_folder',
57
+ targets: [:assets] # an array of target names that this source should sync against
58
+ }
59
+
60
+ target :assets, {
61
+ type: :aws, # :aws is the target's type, current options are :aws
62
+ target_dir: 'your_aws_bucket',
63
+ destination_dir: 'an_optional_directory_inside_your_aws_bucket',
64
+ credentials: {
65
+ region: 'us-east-1',
66
+ aws_access_key_id: 'super_secret',
67
+ aws_secret_access_key: 'super_secret'
68
+ }
69
+ }
70
+
71
+ end
72
+ ```
73
+
74
+ `MultiSync.prepare` simply bootstraps `MultiSync` which is then ran during `rake assets:precompile`. By having `multi_sync` included in your `Gemfile`, the rake task `rake assets:sync` will be available.
75
+
76
+ ### Plain Old Ruby
77
+
78
+ ```ruby
79
+ MultiSync.run do
80
+
81
+ source :build, {
82
+ type: :local, # :local is the source's type, current options are :local, :manifest
83
+ source_dir: '/path_to_your_build_folder',
84
+ targets: [:assets] # an array of target names that this source should sync against
85
+ }
86
+
87
+ target :assets, {
88
+ type: :aws, # :aws is the target's type, current options are :aws
89
+ target_dir: 'your_aws_bucket',
90
+ destination_dir: 'an_optional_directory_inside_your_aws_bucket',
91
+ credentials: {
92
+ region: 'us-east-1',
93
+ aws_access_key_id: 'super_secret',
94
+ aws_secret_access_key: 'super_secret'
95
+ }
96
+ }
97
+
98
+ end
99
+ ```
100
+
101
+ ## Badges
102
+
103
+ [![Gem Version](http://img.shields.io/gem/v/multi_sync.svg)][gem]
104
+ [![Build Status](http://img.shields.io/travis/karlfreeman/multi_sync.svg)][travis]
105
+ [![Code Quality](http://img.shields.io/codeclimate/github/karlfreeman/multi_sync.svg)][codeclimate]
106
+ [![Gittip](http://img.shields.io/gittip/karlfreeman.svg)][gittip]
107
+
108
+ ## Supported Storage Services
109
+
110
+ Behind the scenes we're using [Fog::Storage](http://fog.io/storage) which allows us to support the most popular storage providers
111
+
112
+ - [Amazon S3](http://aws.amazon.com/s3)
113
+ - [Rackspace CloudFiles](http://www.rackspace.com/cloud/files)
114
+ - [Google Cloud Storage](https://developers.google.com/storage)
115
+
116
+ ## Supported Ruby Versions
117
+
118
+ This library aims to support and is [tested against][travis] the following Ruby
119
+ implementations:
120
+
121
+ - Ruby 2.1.0
122
+ - Ruby 2.0.0
123
+ - Ruby 1.9.3
124
+ - [JRuby][jruby]
125
+ - [Rubinius][rubinius]
126
+
127
+ # Credits
128
+
129
+ [gem]: https://rubygems.org/gems/multi_sync
130
+ [travis]: http://travis-ci.org/karlfreeman/multi_sync
131
+ [codeclimate]: https://codeclimate.com/github/karlfreeman/multi_sync
132
+ [gittip]: https://www.gittip.com/karlfreeman
133
+ [jruby]: http://www.jruby.org
134
+ [rubinius]: http://rubini.us
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ require 'bundler'
2
+ Bundler.setup
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ require 'rspec/core/rake_task'
6
+ desc 'Run all examples'
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ begin
10
+ require 'yard'
11
+ YARD::Rake::YardocTask.new
12
+ rescue LoadError
13
+ end
14
+
15
+ begin
16
+ require 'rubocop/rake_task'
17
+ desc 'Run rubocop'
18
+ Rubocop::RakeTask.new(:rubocop)
19
+ rescue LoadError
20
+ end
21
+
22
+ namespace :spec do
23
+
24
+ desc 'Run specs with middleman'
25
+ task :middleman do
26
+ ENV['BUNDLE_GEMFILE'] = 'gemfiles/middleman-3.1.x.gemfile'
27
+ Rake::Task['spec'].execute
28
+ end
29
+
30
+ desc 'Run specs with rails 3.2'
31
+ task :rails_3_2 do
32
+ ENV['BUNDLE_GEMFILE'] = 'gemfiles/rails-3.2.x.gemfile'
33
+ Rake::Task['spec'].execute
34
+ end
35
+
36
+ desc 'Run specs with rails 4.0'
37
+ task :rails_4_0 do
38
+ ENV['BUNDLE_GEMFILE'] = 'gemfiles/rails-4.0.x.gemfile'
39
+ Rake::Task['spec'].execute
40
+ end
41
+
42
+ end
43
+
44
+ task default: :spec
45
+ task test: :spec
@@ -0,0 +1,34 @@
1
+ require "multi_sync"
2
+
3
+ MultiSync.configuration do |config|
4
+ # config.verbose = false # turn on verbose logging (defaults to false)
5
+ # config.force = false # force syncing of outdated_files (defaults to false)
6
+ # config.run_on_build = true # when within a framework which `builds` assets, whether to sync afterwards (defaults to true)
7
+ # config.sync_outdated_files = true # when an outdated file is found whether to replace it (defaults to true)
8
+ # config.delete_abandoned_files = true # when an abondoned file is found whether to remove it (defaults to true)
9
+ # config.upload_missing_files = true # when a missing file is found whether to upload it (defaults to true)
10
+ # config.target_pool_size = 8 # how many threads you would like to open for each target (defaults to the amount of CPU core's your machine has)
11
+ # config.max_sync_attempts = 1 # how many times a file should be retried if there was an error during sync (defaults to 3)
12
+ end
13
+
14
+ MultiSync.run do
15
+
16
+ source :build {
17
+ :type => :local, # :local is the source's type, current options are :local, :manifest
18
+ :source_dir => "/path_to_your_build_folder",
19
+ :targets => [ :www ] # an array of target names that this source should sync against
20
+ # targets optional? default to all
21
+ }
22
+
23
+ target :www {
24
+ :type => :aws, # :aws is the target's type, current options are :aws
25
+ :target_dir => "your_aws_bucket",
26
+ :destination_dir => "an_optional_directory_inside_your_aws_bucket",
27
+ :credentials => {
28
+ :region => "us-east-1",
29
+ :aws_access_key_id => "super_secret",
30
+ :aws_secret_access_key => "super_secret"
31
+ }
32
+ }
33
+
34
+ end
@@ -0,0 +1,15 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore bundler config
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+
13
+ # Ignore all logfiles and tempfiles.
14
+ /log/*.log
15
+ /tmp
@@ -0,0 +1,43 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 3.2'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ gem 'sqlite3'
9
+
10
+
11
+ # Gems used only for assets and not required
12
+ # in production environments by default.
13
+ group :assets do
14
+ gem 'sass-rails', '~> 3.2.3'
15
+ gem 'coffee-rails', '~> 3.2.1'
16
+
17
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
18
+ # gem 'therubyracer', :platforms => :ruby
19
+
20
+ gem 'uglifier', '>= 1.0.3'
21
+ end
22
+
23
+ gem 'jquery-rails'
24
+
25
+ # To use ActiveModel has_secure_password
26
+ # gem 'bcrypt-ruby', '~> 3.0.0'
27
+
28
+ # To use Jbuilder templates for JSON
29
+ # gem 'jbuilder'
30
+
31
+ # Use unicorn as the app server
32
+ # gem 'unicorn'
33
+
34
+ # Deploy with Capistrano
35
+ # gem 'capistrano'
36
+
37
+ # To use debugger
38
+ # gem 'debugger'
39
+
40
+ gem 'awesome_print', :require => 'awesome_print'
41
+ gem 'celluloid', :github => 'celluloid/celluloid'
42
+ gem 'multi_mime', :github => 'karlfreeman/multi_mime'
43
+ gem 'multi_sync', :path => '../../'