picturama 1.0.0beta → 1.0.1
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +20 -15
- data/config/picturama.sample.yml +7 -0
- data/lib/picturama.rb +1 -1
- data/lib/picturama/album.rb +5 -6
- data/lib/picturama/version.rb +1 -1
- data/spec/album_spec.rb +2 -2
- data/spec/picture_spec.rb +3 -3
- metadata +5 -5
- data/config/config.sample.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce8ef1ddfecc75ce3d21e1a43b5d1374f05f2e4
|
4
|
+
data.tar.gz: 749b20d61a868023c2ad7db7fcc682b621d76c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e3319d7ba9b076b68fe42db525d6794711f78c530a375c979c659815c85d2f8673978d7d5ab3f7bbc0481f1482eef8d164e98eb51c51a88b938d1ce8136d673
|
7
|
+
data.tar.gz: d63a9857e182e1b5d453f97f5c072a1622ea5c0a1f80b1dfab2144474ae17654a9be9555cad1fc6a05e04b262cf9d93c43c650fb2234a4fb7b5241e8f4ec4dca
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
picturama (1.0.
|
5
|
-
mini_magick (~> 3.6
|
6
|
-
stringex (~> 2.0
|
4
|
+
picturama (1.0.1)
|
5
|
+
mini_magick (~> 3.6)
|
6
|
+
stringex (~> 2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -23,10 +23,10 @@ GEM
|
|
23
23
|
debugger-ruby_core_source (~> 1.3.5)
|
24
24
|
debugger-linecache (1.2.0)
|
25
25
|
debugger-ruby_core_source (1.3.8)
|
26
|
-
diff-lcs (1.2.
|
26
|
+
diff-lcs (1.2.5)
|
27
27
|
method_source (0.8.2)
|
28
28
|
mime-types (1.23)
|
29
|
-
mini_magick (3.
|
29
|
+
mini_magick (3.8.1)
|
30
30
|
subexec (~> 0.2.1)
|
31
31
|
multi_json (1.7.6)
|
32
32
|
pry (0.10.1)
|
@@ -39,20 +39,24 @@ GEM
|
|
39
39
|
rake (10.0.3)
|
40
40
|
rest-client (1.6.7)
|
41
41
|
mime-types (>= 1.16)
|
42
|
-
rspec (
|
43
|
-
rspec-core (~>
|
44
|
-
rspec-expectations (~>
|
45
|
-
rspec-mocks (~>
|
46
|
-
rspec-core (
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
rspec (3.0.0)
|
43
|
+
rspec-core (~> 3.0.0)
|
44
|
+
rspec-expectations (~> 3.0.0)
|
45
|
+
rspec-mocks (~> 3.0.0)
|
46
|
+
rspec-core (3.0.4)
|
47
|
+
rspec-support (~> 3.0.0)
|
48
|
+
rspec-expectations (3.0.4)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.0.0)
|
51
|
+
rspec-mocks (3.0.4)
|
52
|
+
rspec-support (~> 3.0.0)
|
53
|
+
rspec-support (3.0.4)
|
50
54
|
simplecov (0.7.1)
|
51
55
|
multi_json (~> 1.0)
|
52
56
|
simplecov-html (~> 0.7.1)
|
53
57
|
simplecov-html (0.7.1)
|
54
58
|
slop (3.6.0)
|
55
|
-
stringex (2.
|
59
|
+
stringex (2.5.2)
|
56
60
|
subexec (0.2.3)
|
57
61
|
thor (0.18.1)
|
58
62
|
|
@@ -61,7 +65,8 @@ PLATFORMS
|
|
61
65
|
|
62
66
|
DEPENDENCIES
|
63
67
|
coveralls
|
68
|
+
debugger
|
64
69
|
picturama!
|
65
70
|
pry-debugger
|
66
71
|
rake
|
67
|
-
rspec
|
72
|
+
rspec (= 3.0.0)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
picturama:
|
2
|
+
album_source: "%{album_path}"
|
3
|
+
allowed_formats: "%{album_format}" # array
|
4
|
+
thumbnail_prefix: "%{album_thumbnail_prefix}"
|
5
|
+
thumnail_default_size: "%{album_thumbnail_size}" #eg 200x200
|
6
|
+
resized_prefix: "%{album_resized_prefix}"
|
7
|
+
resized_default_size: "%{album_resized_size}" #eg 800x800
|
data/lib/picturama.rb
CHANGED
@@ -11,7 +11,7 @@ module Picturama
|
|
11
11
|
Dir["lib/picturama/*.rb"].each { |file| require "#{Dir.pwd}/#{file}" }
|
12
12
|
|
13
13
|
def self.config
|
14
|
-
YAML.load_file('config/
|
14
|
+
YAML.load_file('config/picturama.yml')['picturama']
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.albums(album_source)
|
data/lib/picturama/album.rb
CHANGED
@@ -2,12 +2,11 @@ require 'picturama'
|
|
2
2
|
|
3
3
|
module Picturama
|
4
4
|
class Album
|
5
|
-
|
5
|
+
|
6
6
|
def initialize(args)
|
7
|
-
@folder
|
8
|
-
@thumbnails = "#{
|
9
|
-
@resized
|
10
|
-
@info = "#{args[:folder]}/.info.yml"
|
7
|
+
@folder = args[:folder]
|
8
|
+
@thumbnails = "#{@folder}/thumbnails"
|
9
|
+
@resized = "#{@folder}/resized"
|
11
10
|
end
|
12
11
|
|
13
12
|
def pictures(order = :basename)
|
@@ -61,7 +60,7 @@ module Picturama
|
|
61
60
|
end
|
62
61
|
|
63
62
|
def info
|
64
|
-
YAML.load_file(@info) if File.exists?(@info)
|
63
|
+
YAML.load_file("#{@folder}/.info.yml") if File.exists?("#{@folder}/.info.yml")
|
65
64
|
end
|
66
65
|
|
67
66
|
def valid?
|
data/lib/picturama/version.rb
CHANGED
data/spec/album_spec.rb
CHANGED
@@ -12,8 +12,8 @@ describe "For a given folder" do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "check thumnails for images" do
|
15
|
-
expect(album.pictures.first.has_thumbnail?).to
|
16
|
-
expect(album.pictures.first.has_resized?).to
|
15
|
+
expect(album.pictures.first.has_thumbnail?).to eq false
|
16
|
+
expect(album.pictures.first.has_resized?).to eq false
|
17
17
|
end
|
18
18
|
|
19
19
|
it "check info for files" do
|
data/spec/picture_spec.rb
CHANGED
@@ -11,14 +11,14 @@ describe "For a given picture in a given album" do
|
|
11
11
|
before { album.init_thumbnails }
|
12
12
|
|
13
13
|
it "generate thumbnail" do
|
14
|
-
expect(picture.has_thumbnail?).to
|
14
|
+
expect(picture.has_thumbnail?).to eq false
|
15
15
|
thumb = MiniMagick::Image.open(picture.path)
|
16
16
|
thumb.resize "100x100"
|
17
17
|
thumb.format "jpg"
|
18
18
|
thumb.write picture.thumbnail
|
19
|
-
expect(picture.has_thumbnail?).to
|
19
|
+
expect(picture.has_thumbnail?).to eq true
|
20
20
|
picture.remove_assoc
|
21
|
-
expect(picture.has_thumbnail?).to
|
21
|
+
expect(picture.has_thumbnail?).to eq false
|
22
22
|
end
|
23
23
|
|
24
24
|
it "checks the image basename" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picturama
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Silveira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
@@ -66,7 +66,7 @@ files:
|
|
66
66
|
- Gemfile.lock
|
67
67
|
- LICENCE
|
68
68
|
- README.md
|
69
|
-
- config/
|
69
|
+
- config/picturama.sample.yml
|
70
70
|
- i18n/en.yml
|
71
71
|
- i18n/es.yml
|
72
72
|
- lib/ext/string.rb
|
@@ -103,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - '
|
106
|
+
- - '>='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
111
|
rubygems_version: 2.2.2
|