jcropper 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -14,7 +14,11 @@ Install plugin or gem
14
14
 
15
15
  gem install jcropper
16
16
  in environment.rb: config.gem 'jcropper'
17
- in config/preinitializer.rb or #{RAILS_ROOT}/Rakefile: require 'jcropper/tasks'
17
+ in config/preinitializer.rb or #{RAILS_ROOT}/Rakefile
18
+
19
+ begin
20
+ require 'jcropper/tasks'
21
+ rescue LoadError; end
18
22
 
19
23
  Include the jcropper processor in the paperclip style.
20
24
 
@@ -46,12 +50,11 @@ Add the helpers to your view:
46
50
  <%= croppable_image @user, :avatar, :thumb -%>
47
51
  <%= croppable_image_preview @user, :avatar, :thumb -%>
48
52
 
49
- Helper Options:
50
- :css_prefix => 'jcrop'
51
- :width => 100, :height => 100
52
- :js_object => 'croppedImage',
53
- :aspect_ratio => 2
54
- :aspect_ratio => false
53
+ Helper Options:
54
+ :css_prefix => 'jcrop',
55
+ :width => 100, :height => 100,
56
+ :js_object => 'croppedImage',
57
+ :aspect_ratio => false
55
58
 
56
59
  = Notes
57
60
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/jcropper.gemspec ADDED
@@ -0,0 +1,67 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{jcropper}
8
+ s.version = "0.3.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ryan Ziegler"]
12
+ s.date = %q{2010-06-11}
13
+ s.description = %q{}
14
+ s.email = %q{ryan@symbolforce.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc",
17
+ "TODO"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ "MIT-LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "TODO",
25
+ "VERSION",
26
+ "generators/jcropper/USAGE",
27
+ "generators/jcropper/jcropper_generator.rb",
28
+ "generators/jcropper/templates/jcropper_migration.rb.erb",
29
+ "install.rb",
30
+ "jcropper.gemspec",
31
+ "lib/jcropper.rb",
32
+ "lib/jcropper/cropped_image.rb",
33
+ "lib/jcropper/helpers.rb",
34
+ "lib/jcropper/jcropper.rb",
35
+ "lib/jcropper/tasks.rb",
36
+ "lib/paperclip_processors/jcropper.rb",
37
+ "public/images/Jcrop.gif",
38
+ "public/javascripts/jcropper.js",
39
+ "public/javascripts/jquery.Jcrop.min.js",
40
+ "public/stylesheets/jquery.Jcrop.css",
41
+ "rails/init.rb",
42
+ "tasks/jcropper.rake",
43
+ "test/jcropper_test.rb",
44
+ "test/test_helper.rb",
45
+ "uninstall.rb"
46
+ ]
47
+ s.homepage = %q{http://github.com/syfo/jcropper}
48
+ s.rdoc_options = ["--charset=UTF-8"]
49
+ s.require_paths = ["lib"]
50
+ s.rubygems_version = %q{1.3.7}
51
+ s.summary = %q{gem plugin wrapping jquery}
52
+ s.test_files = [
53
+ "test/jcropper_test.rb",
54
+ "test/test_helper.rb"
55
+ ]
56
+
57
+ if s.respond_to? :specification_version then
58
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
59
+ s.specification_version = 3
60
+
61
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
+ else
63
+ end
64
+ else
65
+ end
66
+ end
67
+
@@ -3,15 +3,15 @@ module JCropper
3
3
  def jcrop(attachment, style)
4
4
  raise "jcropper requires attachment to be of type Paperclip::Attachment" if self.attachment_definitions[attachment.to_sym].nil?
5
5
 
6
- class_exec(attachment, style) do |attachment, style|
7
- attr_reader :cropped_image
8
- write_inheritable_hash :jcropper_defs, {:attachment => attachment, :style => style}
9
- class_inheritable_reader :jcropper_defs
6
+ attr_reader :cropped_image
7
+ write_inheritable_hash :jcropper_defs, {:attachment => attachment, :style => style}
8
+ class_inheritable_reader :jcropper_defs
9
+ attr_accessor :jcropper_should_reprocess
10
+ before_save :jcropper_normalize_crop, :jcropper_check_for_reprocess
11
+ after_save :jcropper_reprocess
10
12
 
11
- attr_accessor :jcropper_should_reprocess
12
- before_save :jcropper_normalize_crop, :jcropper_check_for_reprocess
13
- after_save :jcropper_reprocess
14
-
13
+ x, y, w, h = [:x, :y, :w, :h].map{|coord| JCropper.jattr(attachment, style, coord) }
14
+ to_eval = <<-TO_EVAL
15
15
  ###CRZ - alias chain this
16
16
  def after_initialize
17
17
  @cropped_image = CroppedImage.new(self)
@@ -20,10 +20,7 @@ module JCropper
20
20
  def jcropper_reprocess
21
21
  cropped_image.attachment.reprocess! if @jcropper_should_reprocess
22
22
  end
23
- end
24
23
 
25
- x, y, w, h = [:x, :y, :w, :h].map{|coord| JCropper.jattr(attachment, style, coord) }
26
- to_eval = <<-TO_EVAL
27
24
  def jcropper_check_for_reprocess
28
25
  @jcropper_should_reprocess ||= !(changed & %w(#{x} #{y} #{w} #{h})).empty?
29
26
  true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcropper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Ziegler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-27 00:00:00 -04:00
18
+ date: 2010-06-11 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -39,6 +39,7 @@ files:
39
39
  - generators/jcropper/jcropper_generator.rb
40
40
  - generators/jcropper/templates/jcropper_migration.rb.erb
41
41
  - install.rb
42
+ - jcropper.gemspec
42
43
  - lib/jcropper.rb
43
44
  - lib/jcropper/cropped_image.rb
44
45
  - lib/jcropper/helpers.rb