Class: Microstatic::S3Deployer
- Inherits:
-
Object
- Object
- Microstatic::S3Deployer
- Defined in:
- lib/microstatic/s3_deployer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #exclude_files(*args) ⇒ Object
-
#initialize(local_dir, uploader) ⇒ S3Deployer
constructor
A new instance of S3Deployer.
- #upload ⇒ Object
Constructor Details
#initialize(local_dir, uploader) ⇒ S3Deployer
Returns a new instance of S3Deployer.
13 14 15 16 17 |
# File 'lib/microstatic/s3_deployer.rb', line 13 def initialize( local_dir, uploader ) @local_dir = Pathname.new(local_dir) @file_list = ::Rake::FileList.new( (@local_dir+"**/*").to_s ) @uploader = uploader end |
Class Method Details
Instance Method Details
#exclude_files(*args) ⇒ Object
19 20 21 |
# File 'lib/microstatic/s3_deployer.rb', line 19 def exclude_files(*args) @file_list.exclude(*args) end |
#upload ⇒ Object
23 24 25 26 27 28 |
# File 'lib/microstatic/s3_deployer.rb', line 23 def upload @file_list.each do |entry| entry = Pathname.new(entry) @uploader.upsert_filepath(entry) unless entry.directory? end end |