assetable 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWJhOTkyOTFjOWJlMGU4YzNkMWY5MjNhMTJkY2RhNzc5YjFmZDA1Mg==
4
+ YzI1MmU4NTY3MGVhOWIxNDJiNTllMGE0NDQ3Mzc3YTNkM2QwMmQ0Yw==
5
5
  data.tar.gz: !binary |-
6
- NzhiNzUyMmZiODdkM2ZhMTYwM2IzN2M3Nzg2Mzk4YWMyYmVlZWRhYw==
6
+ MDZjZTliMGY5NDdjMjUyZjdjYTY3ZmQ4NjMxNzQzYTIzMjBkODdlMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDQ1YTA4NDY4NjlkYjJlOWQ3MGY5ZjJiMGFmNDBhM2U3N2Q2YjQ2NGRkYTEz
10
- YzNkNzA0ZDU4NzM2ZGRhNTFiODgwN2Y5OWZkY2NmZDZmZThhYTZjNTdmOWUw
11
- NTMwZGNiMTA4NGM4NzAwYmZiNjU3YzQyMjQ5ZGFmOTRmM2EwOTM=
9
+ NjIwMmU1NWQzNTExM2RiMjUzZjg0Mjc4N2FkN2QwMDJiY2NhNjE5ZjE1ZTY3
10
+ ZTc0OTc3YjhhMjE5ZjY4ZmU2NzVlYzUwYmVkZmU1MjY3YmIxMWJkN2I5ZWVi
11
+ N2Q0MjEzNmJhYWZkNDIwYmUzNDQyZTdkMGYxYmM3OTg3Y2EyM2U=
12
12
  data.tar.gz: !binary |-
13
- MTI0Yzg3MTA2N2RhODBlYTk5NjQ2ODUzZTU4MDkwYWE1YjIyZTNiYmE1MTkz
14
- ZDNiMDY2N2ZkNGQyNGJlMmQ4MjdmNDNmZDE0YjhlMTdkMWViNmVkYjIwYzI4
15
- MWVjZTBmOTUyY2NlOTMzOGFjNGUwZTQ4Y2Y0Mzg4NmUyOTA4OWY=
13
+ ZjQwNWVmOTQ2MjkxZmEzZTZjYzkzZGYxNzc3MGMzZjAyN2QwYWIwYzU2NDRl
14
+ MmI1MjQ4MmZjODQxNjgyZjRjMzIzNTUwZjYxMTYxNTRmYWIwMzJkMjFjODZk
15
+ YzkxMzc0YmQwZjc4ZjExZmUxNTEzMTgxYjU1ZGY1MDM3ZDhkYzk=
data/app/models/asset.rb CHANGED
@@ -62,6 +62,7 @@ class Asset < ActiveRecord::Base
62
62
  self.content_type = self.filename.file.content_type
63
63
  self.file_size = self.filename.file.size
64
64
  self.width, self.height = `identify -format "%wx%h" #{self.filename.file.path}`.split(/x/) unless self.document? or self.width? or self.height?
65
+ self.ratio = self.width.to_f / self.height.to_f if self.width.present? and self.height.present?
65
66
  end
66
67
  end
67
68
 
@@ -0,0 +1,5 @@
1
+ class AddRatioToAssets < ActiveRecord::Migration
2
+ def change
3
+ add_column :assets, :ratio, :float, precision: 5, scale: 4
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Assetable
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assetable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Koht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-20 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec-rails
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -323,6 +337,7 @@ files:
323
337
  - db/migrate/20131122232735_create_assets.rb
324
338
  - db/migrate/20131123172825_create_asset_attachments.rb
325
339
  - db/migrate/20131125200943_create_galleries.rb
340
+ - db/migrate/20140121173312_add_ratio_to_assets.rb
326
341
  - lib/assetable/config.rb
327
342
  - lib/assetable/core.rb
328
343
  - lib/assetable/engine.rb