paperclip-env_aware 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile ADDED
@@ -0,0 +1,32 @@
1
+ h1. Paperclip Environment Aware
2
+
3
+ This gem allows you to easily configure different stores in the different Rails environments for "paperclip":https://github.com/thoughtbot/paperclip attachments. This is useful, for example, when you want to use S3 in production but not in development mode. You should be able to configure paperclip to use the file system storage in development and S3 in production. Also it's usefull to have different buckets or paths for each environment.
4
+
5
+ h2. Quick Start
6
+
7
+ Create @config/paperclip_env.yml@ with your configurations (similar to database.yml)
8
+ Ej.
9
+
10
+ <pre>
11
+ # config/paperclip_env.yml
12
+ ---
13
+ production:
14
+ storage: :s3
15
+ s3_credentials:
16
+ access_key_id: ASI3p24809we8409
17
+ secret_access_key: V3Cxnx23yKuViGEzQPqrVVRwhUzSmTpD+wN/M0WL
18
+ path: ":attachment/:id/:style/:basename.:extension"
19
+ bucket: some_bucket
20
+ </pre>
21
+
22
+ <pre>
23
+ class SomeModel < ActiveRecord::Base
24
+ has_attached_file :main_photo
25
+ end
26
+ </pre>
27
+ With this configuration your non-production environments will store in your file system and your production environment will store in S3
28
+
29
+ h2. TODO
30
+
31
+ Currently it's not very flexible, but I'll work to allow different configurations for differents models.
32
+
@@ -4,7 +4,6 @@ module Paperclip::EnvAware
4
4
  def has_attached_file(*args)
5
5
  opts = ConfigReader.read('paperclip_env.yml').reverse_merge(args.extract_options!)
6
6
  args.push(opts.symbolize_keys)
7
- puts args.inspect
8
7
  super(*args)
9
8
  end
10
9
  end
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module EnvAware
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-env_aware
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Juan Manuel Barreneche
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-19 00:00:00 -03:00
18
+ date: 2011-02-04 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -60,6 +60,7 @@ files:
60
60
  - .gitignore
61
61
  - Gemfile
62
62
  - MIT-LICENSE
63
+ - README.textile
63
64
  - Rakefile
64
65
  - lib/paperclip-env_aware.rb
65
66
  - lib/paperclip/env_aware/active_record/class_methods.rb