fileclip 0.2.2 → 0.2.3

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: f40a90259ac27e876f6cf56f326ab18279b476f5
4
- data.tar.gz: decfde8e4d6ac8580cb2d86ec1c3394f37ca9333
3
+ metadata.gz: 3fa875e233d7b35eef0e879d87bfa59834b8c00d
4
+ data.tar.gz: ff60c7952f7a7e3647099d7afaf89cd7d9f32a3f
5
5
  SHA512:
6
- metadata.gz: 9b1f34aef2c3516b4db6e14ae09ab4c6d1a08ade820374c71b9e64d33224b7336028f8104d4aa435095a367f6660619a174d92df3c65cc967cd3bf1d431aee96
7
- data.tar.gz: 5b1c57b57955c4b3253dd8362d18b6c9b30ef0df73ef010cd3888ed9303ee59c5edb5d6996c108ef29d7fb4715bd4ef283f95caf843189788121b4b9c95d0b21
6
+ metadata.gz: e48638eb79dfcdfc0aec9cabb8ceb69994ce354426408f72d77389d3c813bf6318f76072d1f33f99b1eedfdbba522690d025884349e1e6bf68bd3c434b19e211
7
+ data.tar.gz: e2e0a1a28fd38252f03a15a5309900b19e337db40bbdbc7a2e906a59326607f9c0649df4cf1ca119f187c6200ffdf8dbfd2dc6e4f018136a455ec1ac4d3c2a17
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fileclip (0.2.1)
4
+ fileclip (0.2.2)
5
5
  paperclip
6
6
  paperclip (>= 3.5.1)
7
7
  railties (>= 3.0)
data/TODO.md CHANGED
@@ -5,24 +5,16 @@ Backend:
5
5
  * create generator for migration
6
6
  * create generator for intializer
7
7
  * Normalize filenames
8
- * Change keys as an option. defaults to filepicker_url
9
8
 
10
9
  Frontend:
11
- * Allow overriding of filepicker options
12
- * Fileclip link to automatically set fields and call it
13
- * link should act like a normal link helper
14
- * Minimal amount of JS
15
10
  * Loader for filepicker js only if needed
16
11
  * Eliminate need for jQuery
17
12
  * make it a form builder function that can accept a different url name
18
13
 
19
14
  Extra features:
20
- * Work with Delayed Paperclip
21
- * Work with Resque
22
15
  * Work with DelayedJob
23
16
  * Work with Sidekiq
24
17
  * Fallback to filepicker url if paperclip url doesn't exist
25
18
  * Filepicker converts to match paperclip styles
26
- * Configure Filepicker options
27
19
  * FilePicker droppane support
28
20
 
@@ -7,26 +7,25 @@ require 'fileclip/jobs/resque'
7
7
  require 'rest-client'
8
8
 
9
9
  module FileClip
10
-
11
10
  mattr_accessor :change_keys
12
11
 
13
- def self.change_keys
14
- @@change_keys ||= [:filepicker_url]
15
- end
12
+ class << self
16
13
 
17
- def self.delayed?
18
- defined?(DelayedPaperclip)
19
- # TODO: replace with checking for delayed options?
20
- end
14
+ def process(klass, instance_id)
15
+ klass.constantize.find(instance_id).process_from_filepicker
16
+ end
21
17
 
22
- class << self
18
+ # TODO: replace with checking for delayed options?
19
+ def delayed?
20
+ defined?(DelayedPaperclip)
21
+ end
23
22
 
24
23
  def resque_enabled?
25
24
  !!(defined? Resque)
26
25
  end
27
26
 
28
- def process(klass, instance_id)
29
- klass.constantize.find(instance_id).process_from_filepicker
27
+ def change_keys
28
+ @@change_keys ||= [:filepicker_url]
30
29
  end
31
30
 
32
31
  end
@@ -1,11 +1,7 @@
1
+ require 'rails'
2
+
3
+ # Necessary to load asset paths
1
4
  module FileClip
2
- module Rails
3
- class Engine < ::Rails::Engine
4
- initializer 'fileclip.insert_into_active_record' do
5
- ::ActiveSupport.on_load :active_record do
6
- FileClip::Railtie.insert
7
- end
8
- end
9
- end
5
+ class Engine < ::Rails::Engine
10
6
  end
11
7
  end
@@ -1,10 +1,15 @@
1
+ require 'rails'
2
+
3
+ # TODO: only include it in models that have paperclip attachments
4
+ # But will require restart of server for it to pick up the class on edit
1
5
  module FileClip
2
- class Railtie
3
- # Glue includes FileClip into ActiveRecord
4
- # TODO: only include it in models that have paperclip attachments
5
- # Will require restart of server for it to pick up the class on edit
6
- def self.insert
6
+ class Railtie < ::Rails::Railtie
7
+
8
+ initializer "fileclip.model_methods" do
7
9
  ::ActiveRecord::Base.send(:include, FileClip::Glue)
10
+ end
11
+
12
+ initializer "fileclip.view_helpers" do
8
13
  ::ActionView::Base.send(:include, FileClip::ActionView::Helpers)
9
14
  end
10
15
  end
@@ -1,3 +1,3 @@
1
1
  module FileClip
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -5,7 +5,7 @@ describe FileClip::Railtie do
5
5
  it "should include the glue" do
6
6
  ActiveRecord::Base.should_receive(:send).with(:include, FileClip::Glue)
7
7
  ActionView::Base.should_receive(:send).with(:include, FileClip::ActionView::Helpers)
8
- FileClip::Railtie.insert
8
+ FileClip::Railtie.run_initializers
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fileclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Carleton
@@ -151,7 +151,6 @@ files:
151
151
  - lib/fileclip/validators.rb
152
152
  - lib/fileclip/version.rb
153
153
  - spec/fileclip/configuration_spec.rb
154
- - spec/fileclip/engine_spec.rb
155
154
  - spec/fileclip/railtie_spec.rb
156
155
  - spec/fileclip/validators_spec.rb
157
156
  - spec/fileclip_spec.rb
@@ -184,7 +183,6 @@ specification_version: 4
184
183
  summary: A FilePicker / PaperClip mashup.
185
184
  test_files:
186
185
  - spec/fileclip/configuration_spec.rb
187
- - spec/fileclip/engine_spec.rb
188
186
  - spec/fileclip/railtie_spec.rb
189
187
  - spec/fileclip/validators_spec.rb
190
188
  - spec/fileclip_spec.rb
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
- require 'rails/initializable'
3
-
4
-
5
- describe FileClip::Rails::Engine do
6
-
7
- describe "include on initialzation" do
8
- it "should insert fileclip and include view helpers on rails initialzation" do
9
- pending
10
- FileClip::Railtie.should_receive(:insert)
11
- ::ActionView::Base.should_receive(:send).with(:include, FileClip::ActionView::Helpers)
12
- FileClip::Rails::Engine.run_initializers
13
- end
14
- end
15
-
16
- end