jnicklas-carrierwave 0.3.2 → 0.3.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,11 +1,18 @@
1
1
  = CarrierWave
2
2
 
3
+ http://carrierwave.rubyforge.org
4
+
5
+ == Summary
6
+
3
7
  This plugin for Merb and Rails provides a simple and extremely flexible way to
4
8
  upload files.
5
9
 
10
+ == Description
11
+
6
12
  * RDoc Documentation {available at Rubyforge}[http://carrierwave.rubyforge.org/].
7
13
  * Source code {hosted at GitHub}[http://github.com/jnicklas/carrierwave]
8
14
  * Please {report any issues}[http://github.com/jnicklas/carrierwave/issues] on GitHub
15
+ * Please direct any questions at the {mailing list}[http://groups.google.com/group/carrierwave]
9
16
 
10
17
  == Getting Started
11
18
 
data/Rakefile CHANGED
@@ -1,115 +1,29 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rake/rdoctask'
4
- gem 'rdoc', '>=2.4.0'
5
- require 'rdoc'
6
- begin
7
- require 'sdoc'
8
- rescue LoadError
9
- end
10
-
11
- require 'spec/rake/spectask'
12
- require 'spec/rake/verify_rcov'
13
- require 'cucumber/rake/task'
14
-
15
- NAME = "carrierwave"
16
- GEM_VERSION = "0.3.2"
17
- AUTHOR = "Jonas Nicklas"
18
- EMAIL = "jonas.nicklas@gmail.com"
19
- HOMEPAGE = "http://www.example.com"
20
- SUMMARY = "Simple and powerful uploads for Merb and Rails"
21
-
22
- spec = Gem::Specification.new do |s|
23
- s.rubyforge_project = 'carrierwave'
24
- s.name = NAME
25
- s.version = GEM_VERSION
26
- s.platform = Gem::Platform::RUBY
27
- s.has_rdoc = true
28
- s.extra_rdoc_files = ["README.rdoc", "LICENSE", 'TODO']
29
- s.summary = SUMMARY
30
- s.description = s.summary
31
- s.author = AUTHOR
32
- s.email = EMAIL
33
- s.homepage = HOMEPAGE
34
- s.require_path = 'lib'
35
- s.files = %w(LICENSE Generators README.rdoc Rakefile TODO) + Dir.glob("{lib,spec,rails_generators}/**/*")
36
-
37
- end
38
-
39
- # Try these:
40
- #
41
- # rake features
42
- # rake features PROFILE=html
43
- Cucumber::Rake::Task.new do |t|
44
- profile = ENV['PROFILE'] || 'default'
45
- t.cucumber_opts = "--profile #{profile}"
46
- end
47
-
48
- Rake::RDocTask.new do |rd|
49
- rd.main = "README.rdoc"
50
- rd.title = "CarrierWave"
51
- rd.template = 'direct'
52
- rd.options << "--diagram" if ENV["DIAGRAM"]
53
- rd.rdoc_dir = File.join(File.dirname(__FILE__), 'doc')
54
- rd.rdoc_files.include("README.rdoc", "LICENSE", "TODO", 'lib/carrierwave/**/*.rb')
55
- end
56
-
57
- Rake::GemPackageTask.new(spec) do |pkg|
58
- pkg.gem_spec = spec
59
- end
60
-
61
- desc "install the plugin locally"
62
- task :install => [:package] do
63
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-update-sources}
64
- end
65
-
66
- desc "create a gemspec file"
67
- task :make_spec do
68
- File.open("#{NAME}.gemspec", "w") do |file|
69
- file.puts spec.to_ruby
70
- end
71
- end
72
-
73
- namespace :jruby do
74
-
75
- desc "Run :package and install the resulting .gem with jruby"
76
- task :install => :package do
77
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
78
- end
79
-
80
- end
81
-
82
- file_list = FileList['spec/**/*_spec.rb']
83
-
84
- desc "Run all examples"
85
- Spec::Rake::SpecTask.new('spec') do |t|
86
- t.spec_files = file_list
87
- end
88
-
89
- RCov::VerifyTask.new(:verify_coverage => "spec:rcov") do |t|
90
- t.threshold = 95.64
91
- t.index_html = 'doc/coverage/index.html'
92
- end
93
-
94
- namespace :spec do
95
- desc "Run all examples with RCov"
96
- Spec::Rake::SpecTask.new('rcov') do |t|
97
- t.spec_files = file_list
98
- t.rcov = true
99
- t.rcov_dir = "doc/coverage"
100
- t.rcov_opts = ['--exclude', 'spec,features,lib/generators,gems/*']
101
- end
102
-
103
- desc "Generate an html report"
104
- Spec::Rake::SpecTask.new('report') do |t|
105
- t.spec_files = file_list
106
- t.spec_opts = ["--format", "html:doc/reports/specs.html"]
107
- t.fail_on_error = false
108
- end
109
-
110
- end
111
-
112
- task :superspec => [:spec, :features]
113
-
114
- desc 'Default: run unit tests and features.'
115
- task :default => 'superspec'
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require './lib/carrierwave'
6
+
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ Hoe.plugin :cucumberfeatures
10
+
11
+ $hoe = Hoe.spec 'carrierwave' do
12
+ self.developer 'Jonas Nicklas', 'jonas.nicklas@gmail.com'
13
+ self.rubyforge_name = self.name
14
+ self.readme_file = 'README.rdoc'
15
+ self.version = CarrierWave::VERSION
16
+ self.extra_dev_deps << ['rspec', '>=1.2.8']
17
+ self.extra_dev_deps << ['cucumber', '>=0.3.96']
18
+ self.extra_dev_deps << ['activerecord', '>=2.3.3']
19
+ self.extra_dev_deps << ['dm-core', '>=0.9.11']
20
+ self.extra_dev_deps << ['sequel', '>=3.2.0']
21
+ self.extra_dev_deps << ['rmagick', '>=2.10.0']
22
+ self.extra_rdoc_files << 'README.rdoc'
23
+ self.extra_rdoc_files << 'LICENSE'
24
+ end
25
+
26
+ require 'newgem/tasks'
27
+ Dir['tasks/**/*.rake'].each { |t| load t }
28
+
29
+ task :default => [:spec, :features]
data/lib/carrierwave.rb CHANGED
@@ -6,6 +6,9 @@ require 'carrierwave/core_ext/module_setup'
6
6
  require 'carrierwave/core_ext/inheritable_attributes'
7
7
 
8
8
  module CarrierWave
9
+
10
+ VERSION = "0.3.2"
11
+
9
12
  class << self
10
13
  attr_accessor :config, :logger
11
14
 
@@ -1,9 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
- begin
4
- require 'rmagick'
5
- rescue LoadError
6
- require 'RMagick'
3
+ unless Module.const_defined?('Magick')
4
+ begin
5
+ require 'rmagick'
6
+ rescue LoadError
7
+ require 'RMagick'
8
+ end
7
9
  end
8
10
 
9
11
  module CarrierWave
@@ -14,19 +14,19 @@ module CarrierWave
14
14
  def initialize(uploader)
15
15
  @uploader = uploader
16
16
  end
17
-
17
+
18
18
  def self.setup!; end
19
-
19
+
20
20
  def identifier
21
21
  uploader.filename
22
22
  end
23
-
23
+
24
24
  def store!(file)
25
25
  end
26
-
26
+
27
27
  def retrieve!(identifier)
28
28
  end
29
-
29
+
30
30
  end # Abstract
31
31
  end # Storage
32
32
  end # CarrierWave
@@ -29,6 +29,18 @@ module CarrierWave
29
29
  #
30
30
  # The default is :public_read, it should work in most cases.
31
31
  #
32
+ # You can change the generated url to a cnamed domain by setting the cnamed config:
33
+ #
34
+ # CarrierWave.config[:s3][:cnamed] = true
35
+ #
36
+ # No the resulting url will be
37
+ #
38
+ # http://bucket_name.domain.tld/path/to/file
39
+ #
40
+ # instead of
41
+ #
42
+ # http://s3.amazonaws.com/bucket_name.domain.tld/path/to/file
43
+ #
32
44
  class S3 < Abstract
33
45
 
34
46
  class File
@@ -86,7 +98,11 @@ module CarrierWave
86
98
  # [String] file's url
87
99
  #
88
100
  def url
89
- ["http://s3.amazonaws.com", bucket, @path].compact.join('/')
101
+ if CarrierWave::config[:s3][:cnamed]
102
+ ["http://", bucket, @path].compact.join('/')
103
+ else
104
+ ["http://s3.amazonaws.com", bucket, @path].compact.join('/')
105
+ end
90
106
  end
91
107
 
92
108
  def about
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jnicklas-carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -22,13 +22,11 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README.rdoc
24
24
  - LICENSE
25
- - TODO
26
25
  files:
27
26
  - LICENSE
28
27
  - Generators
29
28
  - README.rdoc
30
29
  - Rakefile
31
- - TODO
32
30
  - lib/carrierwave
33
31
  - lib/carrierwave/compatibility
34
32
  - lib/carrierwave/compatibility/paperclip.rb
@@ -100,6 +98,7 @@ files:
100
98
  - rails_generators/uploader/USAGE
101
99
  has_rdoc: true
102
100
  homepage: http://www.example.com
101
+ licenses:
103
102
  post_install_message:
104
103
  rdoc_options: []
105
104
 
@@ -120,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
119
  requirements: []
121
120
 
122
121
  rubyforge_project: carrierwave
123
- rubygems_version: 1.2.0
122
+ rubygems_version: 1.3.5
124
123
  signing_key:
125
124
  specification_version: 3
126
125
  summary: Simple and powerful uploads for Merb and Rails
data/TODO DELETED
File without changes