npo_assets 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ begin
11
11
  gem.homepage = "http://github.com/bartzon/npo_assets"
12
12
  gem.authors = ["Bart Zonneveld"]
13
13
  gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ gem.add_development_dependency "httparty", ">= 0"
14
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
16
  end
16
17
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.5
@@ -1,2 +1,2 @@
1
- NPO::Assets.base_url = 'http://media.omroep.nl'
1
+ NPO::Assets.base_url = 'http://mediadb.omroep.nl'
2
2
  NPO::Assets.account_name = ''
@@ -7,6 +7,6 @@ class CreateAssets < ActiveRecord::Migration
7
7
  end
8
8
 
9
9
  def self.down
10
- drop_table :blacklists
10
+ drop_table :assets
11
11
  end
12
12
  end
@@ -16,7 +16,7 @@ module NPO
16
16
 
17
17
  if res && res['assets']
18
18
  res['assets']['asset'].map do |vars|
19
- create(:url => vars['url'], :remote_id => vars['id'])
19
+ find_or_create_by_url_and_remote_id(vars['url'], vars['id'])
20
20
  end
21
21
  else
22
22
  []
data/npo_assets.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{npo_assets}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bart Zonneveld"]
12
- s.date = %q{2010-03-03}
12
+ s.date = %q{2010-03-29}
13
13
  s.description = %q{Wrapper for media db}
14
14
  s.email = %q{loop@superinfinite.com}
15
15
  s.extra_rdoc_files = [
@@ -51,11 +51,14 @@ Gem::Specification.new do |s|
51
51
 
52
52
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
53
53
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
54
+ s.add_development_dependency(%q<httparty>, [">= 0"])
54
55
  else
55
56
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
57
+ s.add_dependency(%q<httparty>, [">= 0"])
56
58
  end
57
59
  else
58
60
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
61
+ s.add_dependency(%q<httparty>, [">= 0"])
59
62
  end
60
63
  end
61
64
 
@@ -222,8 +222,8 @@ describe NPO::Assets::Asset do
222
222
 
223
223
  @object1 = mock("Asset")
224
224
  @object2 = mock("Asset")
225
- NPO::Assets::Asset.stub!(:create).with(:url => "000/000/001.jpg", :remote_id => "1").and_return @object1
226
- NPO::Assets::Asset.stub!(:create).with(:url => "000/000/002.jpg", :remote_id => "2").and_return @object2
225
+ NPO::Assets::Asset.stub!(:find_or_create_by_url_and_remote_id).with("000/000/001.jpg", "1").and_return @object1
226
+ NPO::Assets::Asset.stub!(:find_or_create_by_url_and_remote_id).with("000/000/002.jpg", "2").and_return @object2
227
227
 
228
228
  NPO::Assets::Asset.stub!(:get).and_return @response
229
229
  end
@@ -238,8 +238,8 @@ describe NPO::Assets::Asset do
238
238
  end
239
239
 
240
240
  it "should generate new assets for each returned asset" do
241
- NPO::Assets::Asset.should_receive(:create).with(:url => "000/000/001.jpg", :remote_id => "1").once
242
- NPO::Assets::Asset.should_receive(:create).with(:url => "000/000/002.jpg", :remote_id => "2").once
241
+ NPO::Assets::Asset.should_receive(:find_or_create_by_url_and_remote_id).with("000/000/001.jpg", "1").once
242
+ NPO::Assets::Asset.should_receive(:find_or_create_by_url_and_remote_id).with("000/000/002.jpg", "2").once
243
243
  do_list
244
244
  end
245
245
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bart Zonneveld
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-03 00:00:00 +01:00
17
+ date: 2010-03-29 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -31,6 +31,18 @@ dependencies:
31
31
  version: 1.2.9
32
32
  type: :development
33
33
  version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: httparty
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :development
45
+ version_requirements: *id002
34
46
  description: Wrapper for media db
35
47
  email: loop@superinfinite.com
36
48
  executables: []