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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f94e6dbd92b5068221f701289dfa3d90ad57afcb
4
- data.tar.gz: d42d463a3063185db61a277aa9f5d231bbba9e5e
3
+ metadata.gz: 5ce8ef1ddfecc75ce3d21e1a43b5d1374f05f2e4
4
+ data.tar.gz: 749b20d61a868023c2ad7db7fcc682b621d76c24
5
5
  SHA512:
6
- metadata.gz: f7544e4744d0b6e01a5bf0caf96bf81c60ab08abba540a30536131d4a5e45f07a7e04097dc8e0fc7071fd3cb79ed6dc723a4282184796d25d6635b81a916d602
7
- data.tar.gz: ab38bc39afd97314648fa536a4972415d0f0fb917431bb2ffd932bab1198a4988b04e69de82a69882fedeeb834cfc87701d4c93e2ec206ef88b23fac8a016a54
6
+ metadata.gz: 9e3319d7ba9b076b68fe42db525d6794711f78c530a375c979c659815c85d2f8673978d7d5ab3f7bbc0481f1482eef8d164e98eb51c51a88b938d1ce8136d673
7
+ data.tar.gz: d63a9857e182e1b5d453f97f5c072a1622ea5c0a1f80b1dfab2144474ae17654a9be9555cad1fc6a05e04b262cf9d93c43c650fb2234a4fb7b5241e8f4ec4dca
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .rvmrc
2
2
  config/config.yml
3
3
  coverage/
4
+ config/picturama.yml
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
  gem 'coveralls', require: false
5
+ gem 'debugger'
5
6
  gem 'pry-debugger'
6
7
 
7
8
  gemspec
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- picturama (1.0.0beta)
5
- mini_magick (~> 3.6.0)
6
- stringex (~> 2.0.2)
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.4)
26
+ diff-lcs (1.2.5)
27
27
  method_source (0.8.2)
28
28
  mime-types (1.23)
29
- mini_magick (3.6.0)
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 (2.13.0)
43
- rspec-core (~> 2.13.0)
44
- rspec-expectations (~> 2.13.0)
45
- rspec-mocks (~> 2.13.0)
46
- rspec-core (2.13.1)
47
- rspec-expectations (2.13.0)
48
- diff-lcs (>= 1.1.3, < 2.0)
49
- rspec-mocks (2.13.1)
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.0.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
@@ -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/config.yml')['picturama']
14
+ YAML.load_file('config/picturama.yml')['picturama']
15
15
  end
16
16
 
17
17
  def self.albums(album_source)
@@ -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 = args[:folder]
8
- @thumbnails = "#{args[:folder]}/thumbnails"
9
- @resized = "#{args[:folder]}/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?
@@ -1,3 +1,3 @@
1
1
  module Picturama
2
- VERSION = '1.0.0beta'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -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 be_false
16
- expect(album.pictures.first.has_resized?).to be_false
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
@@ -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 be_false
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 be_true
19
+ expect(picture.has_thumbnail?).to eq true
20
20
  picture.remove_assoc
21
- expect(picture.has_thumbnail?).to be_false
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.0beta
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-12 00:00:00.000000000 Z
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/config.sample.yml
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: 1.3.1
108
+ version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 2.2.2
@@ -1,7 +0,0 @@
1
- picturama:
2
- album_source: '[your_path_here]'
3
- allowed_formats: ['jpg','png','jpeg','JPG']
4
- thumbnail_prefix: thumb_
5
- thumnail_default_size: "200x200"
6
- resized_prefix: resized_
7
- resized_default_size: "800x800"