bresson 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  pkg/*
2
2
  *.gem
3
3
  .bundle
4
+ *.swp
5
+ *.swo
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
@@ -2,13 +2,28 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  bresson (0.0.1)
5
+ flickraw
5
6
 
6
7
  GEM
7
8
  remote: http://rubygems.org/
8
9
  specs:
10
+ diff-lcs (1.1.2)
11
+ flickraw (0.8.4)
12
+ json (>= 1.1.1)
13
+ json (1.5.1)
14
+ rspec (2.5.0)
15
+ rspec-core (~> 2.5.0)
16
+ rspec-expectations (~> 2.5.0)
17
+ rspec-mocks (~> 2.5.0)
18
+ rspec-core (2.5.1)
19
+ rspec-expectations (2.5.0)
20
+ diff-lcs (~> 1.1.2)
21
+ rspec-mocks (2.5.0)
9
22
 
10
23
  PLATFORMS
11
24
  ruby
12
25
 
13
26
  DEPENDENCIES
14
27
  bresson!
28
+ flickraw
29
+ rspec
data/Rakefile CHANGED
@@ -1,2 +1,5 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new('spec')
@@ -14,6 +14,9 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "bresson"
16
16
 
17
+ s.add_dependency "flickraw"
18
+ s.add_development_dependency "rspec"
19
+
17
20
  s.files = `git ls-files`.split("\n")
18
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -1,3 +1,8 @@
1
+ require File.expand_path('../bresson/image', __FILE__)
2
+ require File.expand_path('../bresson/image_reference', __FILE__)
3
+ require File.expand_path('../bresson/flickr', __FILE__)
4
+ require File.expand_path('../bresson/picasa', __FILE__)
5
+ require File.expand_path('../bresson/url_image', __FILE__)
6
+
1
7
  module Bresson
2
- # Your code goes here...
3
8
  end
@@ -0,0 +1,4 @@
1
+ module Bresson
2
+ class Bresson
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Bresson
2
+ class Flickr
3
+ def method_missing name, *args; nil; end
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Bresson
2
+ class Image
3
+ def initialize args
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,15 @@
1
+ module Bresson
2
+ class ImageReference
3
+ attr_accessor :item, :link
4
+
5
+ def initialize args
6
+ @item = eval "Bresson::#{args[:source]}.new"
7
+ @link = args[:link]
8
+ end
9
+
10
+ def method_missing name, *args
11
+ eval "@item.#{name}(args)"
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ module Bresson
2
+ class Picasa
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Bresson
2
+ class URLImage
3
+ def method_missing name, *args; nil; end
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Bresson
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ describe Bresson::ImageReference do
3
+
4
+ context "Flickr images" do
5
+ subject{Bresson::ImageReference.new :source => "Flickr"}
6
+ its(:item){should be_instance_of Bresson::Flickr}
7
+
8
+ it "should map methods to Flickr instance" do
9
+ Bresson::Flickr.stub(:smeagol).and_return("I works!")
10
+ subject.smeagol.should be_eql("I works!")
11
+ end
12
+ end
13
+
14
+ context "Picasa images" do
15
+ subject{Bresson::ImageReference.new :source => "Picasa"}
16
+ its(:item){should be_instance_of Bresson::Picasa}
17
+ end
18
+
19
+ context "URL images" do
20
+ subject{Bresson::ImageReference.new :source => "URLImage"}
21
+ its(:item){should be_instance_of Bresson::URLImage}
22
+ end
23
+
24
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'bresson'
5
+
6
+ RSpec.configure do |config|
7
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christian Mortaro
@@ -15,10 +15,35 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-18 00:00:00 -03:00
18
+ date: 2011-05-01 00:00:00 -03:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: flickraw
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: rspec
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ type: :development
46
+ version_requirements: *id002
22
47
  description: Abstracts the methods from different image services, like Flickr and Picasa
23
48
  email:
24
49
  - christian@quavio.com.br
@@ -31,13 +56,21 @@ extra_rdoc_files: []
31
56
 
32
57
  files:
33
58
  - .gitignore
59
+ - .rspec
34
60
  - Gemfile
35
61
  - Gemfile.lock
36
62
  - Rakefile
37
63
  - bresson.gemspec
38
64
  - lib/bresson.rb
39
- - lib/bresson/.version.rb.swp
65
+ - lib/bresson/bresson.rb
66
+ - lib/bresson/flickr.rb
67
+ - lib/bresson/image.rb
68
+ - lib/bresson/image_reference.rb
69
+ - lib/bresson/picasa.rb
70
+ - lib/bresson/url_image.rb
40
71
  - lib/bresson/version.rb
72
+ - spec/bresson/image_reference_spec.rb
73
+ - spec/spec_helper.rb
41
74
  has_rdoc: true
42
75
  homepage: https://github.com/quavio/bresson
43
76
  licenses: []
Binary file