lentil 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 950c29559c42d35bd5bbb5a5e9807262ef09e864
4
- data.tar.gz: a8fada323c1428fead60b192cebd9d0b709dc1fd
3
+ metadata.gz: 1eedb412866c22824ea3454b1988e1e1ad5d7511
4
+ data.tar.gz: 7637990fc33cec6f64cad9150cda02b138e6f9ed
5
5
  SHA512:
6
- metadata.gz: 460e078efac5f732ccf3c8f3ddd87fa1178abcbe4b32939bbdcf17ec99c9cdf2b33fb024ccff166c2bb58c1cdd5fda2b77502bd930419006e554697e3de249a6
7
- data.tar.gz: 83a3d1f490f4402eb21b1710c3f17edadc2622dfca9e17a2cd311b8948aa85db2d6897b68d4af401dbf85060e3d6726ca02daf102cca27bbf2d71655d0e64f4e
6
+ metadata.gz: c565046bd60a22dc4712e0d9c7ad18892fb438ab5771647bfc469c3825558157091d009a638dd6c69e6f0280cfa36ee9d93ae3ae933b19f8a6ea90e88e9f5df2
7
+ data.tar.gz: a5a6463f9281ea17e9b85dc7f3f78b945171f6bb47a526cdc45228ed5f49bf07a9b0f8ececa91fd0852028a79566b6e7d18b578e8de86aab540b1a59dd18c80d
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  lentil is a Ruby on Rails Engine that supports the harvesting of images from Instagram and provides several browsing views, mechanisms for sharing, tools for users to select their favorite images, an administrative interface for moderating images, and a system for harvesting images and submitting donor agreements in preparation of ingest into external repositories. Built according to the principles of responsive design, lentil is designed for use on mobile devices, tablets, desktops, and larger screens.
4
4
 
5
5
  [![Build Status](https://travis-ci.org/NCSU-Libraries/lentil.png)](https://travis-ci.org/NCSU-Libraries/lentil)
6
+ [![Gem Version](https://badge.fury.io/rb/lentil.png)](http://badge.fury.io/rb/lentil)
6
7
 
7
8
  ## History
8
9
 
@@ -94,7 +94,7 @@ class Lentil::Image < ActiveRecord::Base
94
94
  def service_tags
95
95
  begin
96
96
  tag_ids = self.taggings.where(:staff_tag => false).pluck(:tag_id)
97
- tags = Tag.find(tag_ids).sort_by(&:name)
97
+ tags = Lentil::Tag.find(tag_ids).sort_by(&:name)
98
98
  rescue
99
99
  Rails.logger.error "Error retrieving service_tags"
100
100
  tags = []
@@ -104,7 +104,7 @@ class Lentil::Image < ActiveRecord::Base
104
104
  def staff_tags
105
105
  begin
106
106
  tag_ids = self.taggings.where(:staff_tag => true).pluck(:tag_id)
107
- tags = Tag.find(tag_ids).sort_by(&:name)
107
+ tags = Lentil::Tag.find(tag_ids).sort_by(&:name)
108
108
  rescue
109
109
  Rails.logger.error "Error retrieving staff_tags"
110
110
  tags = []
@@ -149,16 +149,21 @@ class Lentil::Image < ActiveRecord::Base
149
149
  large_url
150
150
  end
151
151
 
152
+ def protocol_relative_url
153
+ # instagr.am returns 301 to instagram.com and invalid SSL certificate
154
+ url.sub(/^http:/, '').sub(/\/\/instagr\.am/, '//instagram.com')
155
+ end
156
+
152
157
  def large_url
153
- url + 'media/?size=l'
158
+ protocol_relative_url + 'media/?size=l'
154
159
  end
155
160
 
156
161
  def medium_url
157
- url + 'media/?size=m'
162
+ protocol_relative_url + 'media/?size=m'
158
163
  end
159
164
 
160
165
  def thumbnail_url
161
- url + 'media/?size=t'
166
+ protocol_relative_url + 'media/?size=t'
162
167
  end
163
168
 
164
169
  States = {
@@ -15,7 +15,7 @@ module Lentil
15
15
 
16
16
  desc 'precompile additional assets'
17
17
  def precompile_assets
18
- insert_into_file "config/application.rb", " config.assets.precompile += %w( lentil/iframe.js lentil/iframe.css )\n", :after => "# Inserted by lentil\n"
18
+ insert_into_file "config/application.rb", " config.assets.precompile += %w( lentil/iframe.js lentil/iframe.css addanimatedimages.js animatedimages/css/style.css )\n", :after => "# Inserted by lentil\n"
19
19
  end
20
20
 
21
21
  desc 'do not enforce available locales'
@@ -1,3 +1,3 @@
1
1
  module Lentil
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -39,7 +39,7 @@ namespace :lentil do
39
39
  Lentil::Service.where(:name => args[:image_service]).first.images.where(:file_harvested_date => nil).
40
40
  order("file_harvest_failed ASC").limit(num_to_harvest).each do |image|
41
41
  begin
42
- raise "Desination directory does not exist or is not a directory: #{base_dir}" unless File.directory?(base_dir)
42
+ raise "Destination directory does not exist or is not a directory: #{base_dir}" unless File.directory?(base_dir)
43
43
 
44
44
  image_file_path = "#{base_dir}/#{image.service.name}"
45
45
 
@@ -15,15 +15,24 @@
15
15
  one:
16
16
  image: uno
17
17
  tag: uno
18
+ staff_tag: false
18
19
 
19
20
  two:
20
21
  image: dos
21
22
  tag: dos
23
+ staff_tag: false
22
24
 
23
25
  three:
24
26
  image: uno
25
27
  tag: dos
28
+ staff_tag: false
26
29
 
27
- number_one:
30
+ number_one:
28
31
  image: one
29
32
  tag: hunttesting
33
+ staff_tag: false
34
+
35
+ staff_number_one:
36
+ image: one
37
+ tag: hunttesting_staff
38
+ staff_tag: true
@@ -27,3 +27,6 @@ five:
27
27
 
28
28
  hunttesting:
29
29
  name: "hunttesting"
30
+
31
+ hunttesting_staff:
32
+ name: "hunttesting_staff"
@@ -36,11 +36,28 @@ require 'test_helper'
36
36
 
37
37
  class ImageTest < ActiveSupport::TestCase
38
38
 
39
- test "Image should have a tag" do
39
+ test "Image should have tags" do
40
+ image = lentil_images(:one)
41
+
42
+ assert image.tags.size > 0, "Expected at least one tag"
43
+ end
44
+
45
+ test "Image should have a service tag" do
40
46
  image = lentil_images(:one)
41
47
  tag = lentil_tags(:hunttesting)
48
+ service_tags = image.service_tags
49
+
50
+ assert service_tags.size > 0, "Expected at least one service tag"
51
+ assert_equal tag.name, service_tags.first.name
52
+ end
53
+
54
+ test "Image should have a staff tag" do
55
+ image = lentil_images(:one)
56
+ tag = lentil_tags(:hunttesting_staff)
57
+ staff_tags = image.staff_tags
42
58
 
43
- assert_equal tag.name, image.tags.first.name
59
+ assert staff_tags.size > 0, "Expected at least one staff tag"
60
+ assert_equal tag.name, staff_tags.first.name
44
61
  end
45
62
 
46
63
  test "Image should have a license" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lentil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Casden
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-03-19 00:00:00.000000000 Z
14
+ date: 2014-04-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -984,4 +984,3 @@ test_files:
984
984
  - test/vcr_cassettes/instagram_image_harvest.yml
985
985
  - test/vcr_cassettes/instagram_image_id.yml
986
986
  - test/vcr_cassettes/instagram_oembed.yml
987
- has_rdoc: