simple_form_fancy_uploads 0.1.1 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1b75cdcaf00dad60ac963223c4143085c9e97b9
4
- data.tar.gz: f53775548ca15b3884b0ece5441cd316085964f6
3
+ metadata.gz: 275c198cbd4275e72eae27ae2eb6cf4d0fe533b1
4
+ data.tar.gz: 6f1f4b8c51cd8434789e23b040445cce1d1ed92b
5
5
  SHA512:
6
- metadata.gz: ec40667d3511f4c1b9c2ec8c2b7a430aa43354317f406cd430a090debd8539905837fe89516d888e5eda2ec3fa8c9a81da0368f5d8b3f0bdd48863628368e403
7
- data.tar.gz: 124aa9f5404a5f32e541f308166c45e4881dde012b22d742567084f0a22c7a0e1e165c7dd3b5c961161103694d220278c7c88942f9303a3d01462a620159969d
6
+ metadata.gz: 3b6f3aa9cc3151083e54d15af9ad005c359554ad9d06a1e52cba2db02c73b6dc70c0a4a982a4d91e724ec603eac6993d7f03cdddd207e0f3a5bcae8ad949fc15
7
+ data.tar.gz: 084c3bb12ad36ab7a45fdf024ca254caab030ce50faaf7b62feed0cc5e9432f358d4e21aaf7534042b75bacdfff3457660084a86e08813e6a68db30bf739cb1a
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # SimpleForm fancy uploads
2
2
 
3
- A set of [simple_form](https://github.com/plataformatec/simple_form) (~> 3.0) custom inputs to get image previews or a link to
3
+ A set of [simple_form](https://github.com/plataformatec/simple_form) (~> 3.1) custom inputs to get image previews or a link to
4
4
  uploaded file.
5
5
 
6
- This gem uses the new simple_form 3.0 ability to write your own form tags (check the [simple_form-bootstrap](https://github.com/rafaelfranca/simple_form-bootstrap) example). In 90% of cases, you need some kind of preview when it comes to uploaded files (avatar, images, docs, etc..), why should I write the same markup each time?
6
+ This gem uses the new simple_form 3.1 ability to write your own form tags (check the [simple_form-bootstrap](https://github.com/rafaelfranca/simple_form-bootstrap) example). In 90% of cases, you need some kind of preview when it comes to uploaded files (avatar, images, docs, etc..), why should I write the same markup each time?
7
7
 
8
8
  ## What you get
9
9
 
@@ -40,7 +40,7 @@ If you need to fallback on Carrierwave's `#default_url` method to show a default
40
40
 
41
41
  To get it work, you need:
42
42
 
43
- * [simple_form](https://github.com/plataformatec/simple_form) ~> 3.0 (*repetita iuvant*)
43
+ * [simple_form](https://github.com/plataformatec/simple_form) ~> 3.1 (*repetita iuvant*)
44
44
  * [carrierwave](https://github.com/jnicklas/carrierwave) actually it's the most opinionated gem for uploads (thank you paperclip for the good times, but you know... life goes on)
45
45
  * ruby 1.9+ (it uses some 1.9's syntax)
46
46
 
@@ -56,4 +56,4 @@ To get it work, you need:
56
56
  * *the hard way:* repeat the above points, then show your power and send a pull request.
57
57
 
58
58
  ## License
59
- Copyright (c) 2012 Andrea Pavoni http://andreapavoni.com
59
+ Copyright (c) 2014 Andrea Pavoni http://andreapavoni.com
data/Rakefile CHANGED
@@ -1,24 +1,15 @@
1
1
  #!/usr/bin/env rake
2
+
2
3
  begin
3
4
  require 'bundler/setup'
4
5
  rescue LoadError
5
6
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
7
  end
7
- begin
8
- require 'rdoc/task'
9
- rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
12
- RDoc::Task = Rake::RDocTask
13
- end
14
8
 
15
- RDoc::Task.new(:rdoc) do |rdoc|
16
- rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'SimpleFormFancyUploads'
18
- rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
21
- end
9
+ require 'rspec/core'
10
+ require 'rspec/core/rake_task'
22
11
 
23
12
  Bundler::GemHelper.install_tasks
13
+ RSpec::Core::RakeTask.new(:spec)
24
14
 
15
+ task :default => :spec
@@ -1,6 +1,6 @@
1
1
  module SimpleFormFancyUploads
2
2
  class AttachmentPreviewInput < SimpleForm::Inputs::FileInput
3
- def input
3
+ def input(wrapper_options=nil)
4
4
  out = ''
5
5
  if object.send("#{attribute_name}?")
6
6
  out << template.link_to(object.send(attribute_name).filename, object.send(attribute_name).url)
@@ -1,6 +1,6 @@
1
1
  module SimpleFormFancyUploads
2
2
  class ImagePreviewInput < SimpleForm::Inputs::FileInput
3
- def input
3
+ def input(wrapper_options=nil)
4
4
  version = input_html_options.delete(:preview_version)
5
5
  use_default_url = options.delete(:use_default_url) || false
6
6
 
@@ -1,3 +1,3 @@
1
1
  module SimpleFormFancyUploads
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_fancy_uploads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Pavoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '3.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '3.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: carrierwave
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.2.2
90
+ rubygems_version: 2.4.5
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: simple_form custom inputs to get image/link previews with file uploads.