smartcrop-rails 0.1.10 → 0.1.11

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: 3feef6e3d9d7400965c579b8266b55ad14efb079
4
- data.tar.gz: 81ee2c32312e8c2468e6c6c554aacc6b7d18c33b
3
+ metadata.gz: 72c6953a42f746f47b706e0419ec0a60e5995734
4
+ data.tar.gz: c4217daef9449c42cf7abb49c3412246ec87bb68
5
5
  SHA512:
6
- metadata.gz: 9764f127d6b297037a3e691c8182ee75912c8548549951fd428d2fe48dc4886936d024f095abb25086d458e47a3be20e078c78d42fc5a1f5d8e799dd23ff2067
7
- data.tar.gz: f8ed1bee62a2d85943d875dde41baa46e9acc46f840249bf3b4ce9b8a408542759ed576de6b9eed148b11bf385d639377f1cb914c0e9acb74587a29d8fa720e6
6
+ metadata.gz: 399f734760c67fa53006b24f77ac8ec1573de9f6bfe68912953fd998cbe88293c10bd3e9a4dbb7b1571b90a810d31b6a07cd52c752cf99d5adc5b9422a4a4d08
7
+ data.tar.gz: fcb116c065571d193c07553d282aeac1fbd2739fe03da2310a2733cfaaa2a6190002d5ccdeee37c9ac67167d4e467ec5b02d27676e0a3f097e5aafba1fb5d51a
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
- # Smartcrop::Rails
1
+ # smartcrop-rails
2
+ [![Gem Version](https://badge.fury.io/rb/smartcrop-rails.svg)](http://badge.fury.io/rb/smartcrop-rails)
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/smartcrop/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+ smartcrop-rails gem is the integration of smartcrop.js javascript library for your Rails 4 application.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ Smartcrop.js implements an algorithm to find good crops for images.
7
+ Demo: For content aware image cropping http://29a.ch/2014/04/03/smartcrop-content-aware-image-cropping
8
+
9
+ source: https://github.com/jwagner/smartcrop.js/
6
10
 
7
11
  ## Installation
8
12
 
@@ -20,19 +24,41 @@ Or install it yourself as:
20
24
 
21
25
  $ gem install smartcrop-rails
22
26
 
27
+ Now you need to edit your `app/assets/javascripts/application.js` file and add the following line:
28
+ ``` javascript
29
+ //= require smartcrop
30
+ ```
31
+
23
32
  ## Usage
24
33
 
25
- TODO: Write usage instructions here
34
+ Here is the example working code to test with your Rails application.
35
+
36
+ Add this sample code to your `app/assets/javascripts/application.js` file
37
+
38
+ ``` javascript
39
+ $(document).ready(function(){
40
+
41
+ SmartCrop.crop(image, {width: 100, height: 100}, function(result){console.log(result);});
42
+
43
+ });
44
+ ```
45
+
46
+ *Note:* Here i am using `gem 'jquery-turbolinks'` for using the jquery $(document).ready function
47
+
48
+
49
+ ## Full documentation
50
+
51
+ Read the smartcrop.js documentation here https://github.com/jwagner/smartcrop.js/
26
52
 
27
53
  ## Development
28
54
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
56
 
31
57
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
58
 
33
59
  ## Contributing
34
60
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/smartcrop-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
61
+ Bug reports and pull requests are welcome on GitHub at https://github.com/sadiqmmm/smartcrop-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
62
 
37
63
 
38
64
  ## License
@@ -1,5 +1,5 @@
1
1
  module Smartcrop
2
2
  module Rails
3
- VERSION = "0.1.10"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcrop-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohammed Sadiq