dawanda_client 0.1.7 → 0.1.8
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.
- data/LICENSE +0 -0
- data/README.rdoc +1 -1
- data/Rakefile +7 -4
- data/VERSION +1 -1
- data/dawanda_client.gemspec +10 -10
- data/lib/dawanda/category.rb +0 -0
- data/lib/dawanda/channel.rb +0 -0
- data/lib/dawanda/color.rb +0 -0
- data/lib/dawanda/model.rb +15 -12
- data/lib/dawanda/product.rb +3 -3
- data/lib/dawanda/request.rb +0 -0
- data/lib/dawanda/response.rb +0 -0
- data/lib/dawanda/shop.rb +4 -4
- data/lib/dawanda/shop_category.rb +0 -0
- data/lib/dawanda/user.rb +0 -0
- data/lib/dawanda.rb +0 -0
- data/test/fixtures/getCategoryDetails.json +0 -0
- data/test/fixtures/getProductDetails.json +0 -0
- data/test/fixtures/getShopDetails.json +1 -1
- data/test/fixtures/getUserDetails.json +0 -0
- data/test/test_helper.rb +0 -0
- data/test/unit/dawanda/category_test.rb +0 -0
- data/test/unit/dawanda/color_test.rb +0 -0
- data/test/unit/dawanda/product_test.rb +0 -0
- data/test/unit/dawanda/shop_category_test.rb +0 -0
- data/test/unit/dawanda/shop_test.rb +1 -0
- data/test/unit/dawanda/user_test.rb +0 -0
- data/test/unit/dawanda_test.rb +0 -0
- metadata +15 -9
- data/.gitignore +0 -2
data/LICENSE
CHANGED
File without changes
|
data/README.rdoc
CHANGED
@@ -8,7 +8,7 @@ The Dawanda gem provides a friendly Ruby interface to the Dawanda API
|
|
8
8
|
|
9
9
|
Installing the latest stable version is simple:
|
10
10
|
|
11
|
-
sudo gem install
|
11
|
+
sudo gem install dawanda_client --source=http://gemcutter.org
|
12
12
|
|
13
13
|
== Usage
|
14
14
|
|
data/Rakefile
CHANGED
@@ -36,10 +36,13 @@ begin
|
|
36
36
|
gemspec.name = "dawanda_client"
|
37
37
|
gemspec.summary = "Provides a friendly ruby-like interface to the Dawanda API"
|
38
38
|
gemspec.description = "Provides a friendly ruby-like interface to the Dawanda API"
|
39
|
-
gemspec.email = '
|
40
|
-
gemspec.homepage = "http://github.com/dawanda/
|
41
|
-
gemspec.authors = ['
|
39
|
+
gemspec.email = 'api@dawanda.com'
|
40
|
+
gemspec.homepage = "http://github.com/dawanda/dawanda-api-client-ruby"
|
41
|
+
gemspec.authors = ['DaWanda GmbH']
|
42
|
+
|
43
|
+
gemspec.files.exclude 'examples/*'
|
44
|
+
gemspec.test_files.exclude 'examples/*'
|
42
45
|
end
|
43
46
|
rescue LoadError
|
44
|
-
puts "Jeweler not available. Install it with:
|
47
|
+
puts "Jeweler not available. Install it with: gem install jeweler"
|
45
48
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/dawanda_client.gemspec
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dawanda_client}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = %q{
|
11
|
+
s.authors = ["DaWanda GmbH"]
|
12
|
+
s.date = %q{2010-03-08}
|
13
13
|
s.description = %q{Provides a friendly ruby-like interface to the Dawanda API}
|
14
|
-
s.email = %q{
|
14
|
+
s.email = %q{api@dawanda.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
"LICENSE",
|
20
|
+
"LICENSE",
|
22
21
|
"README.rdoc",
|
23
22
|
"Rakefile",
|
24
23
|
"VERSION",
|
@@ -47,10 +46,10 @@ Gem::Specification.new do |s|
|
|
47
46
|
"test/unit/dawanda/user_test.rb",
|
48
47
|
"test/unit/dawanda_test.rb"
|
49
48
|
]
|
50
|
-
s.homepage = %q{http://github.com/dawanda/
|
49
|
+
s.homepage = %q{http://github.com/dawanda/dawanda-api-client-ruby}
|
51
50
|
s.rdoc_options = ["--charset=UTF-8"]
|
52
51
|
s.require_paths = ["lib"]
|
53
|
-
s.rubygems_version = %q{1.3.
|
52
|
+
s.rubygems_version = %q{1.3.6}
|
54
53
|
s.summary = %q{Provides a friendly ruby-like interface to the Dawanda API}
|
55
54
|
s.test_files = [
|
56
55
|
"test/test_helper.rb",
|
@@ -73,3 +72,4 @@ Gem::Specification.new do |s|
|
|
73
72
|
else
|
74
73
|
end
|
75
74
|
end
|
75
|
+
|
data/lib/dawanda/category.rb
CHANGED
File without changes
|
data/lib/dawanda/channel.rb
CHANGED
File without changes
|
data/lib/dawanda/color.rb
CHANGED
File without changes
|
data/lib/dawanda/model.rb
CHANGED
@@ -3,29 +3,32 @@ module Dawanda
|
|
3
3
|
|
4
4
|
module ClassMethods
|
5
5
|
|
6
|
-
def attribute(name, options
|
7
|
-
|
8
|
-
if
|
6
|
+
def attribute(name, options=nil)
|
7
|
+
options = name if options.nil?
|
8
|
+
if options.is_a? Array
|
9
9
|
class_eval <<-CODE
|
10
10
|
def #{name}
|
11
|
-
@result
|
11
|
+
@result#{to_result_string(options)}
|
12
12
|
end
|
13
13
|
CODE
|
14
14
|
else
|
15
15
|
class_eval <<-CODE
|
16
16
|
def #{name}
|
17
|
-
@result['#{
|
17
|
+
@result['#{options}']
|
18
18
|
end
|
19
19
|
CODE
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
def
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
|
23
|
+
def to_result_string options
|
24
|
+
options.map! do |o|
|
25
|
+
if o.is_a? Numeric
|
26
|
+
"[#{o}]"
|
27
|
+
else
|
28
|
+
"['#{o}']"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
options.join
|
29
32
|
end
|
30
33
|
|
31
34
|
def attributes(*names)
|
data/lib/dawanda/product.rb
CHANGED
@@ -30,9 +30,9 @@ module Dawanda
|
|
30
30
|
|
31
31
|
finder :one, '/products/:id'
|
32
32
|
|
33
|
-
attribute :created, :
|
34
|
-
attribute :category_id,
|
35
|
-
attribute :user_id,
|
33
|
+
attribute :created, :created_at
|
34
|
+
attribute :category_id, [ :category, :id ]
|
35
|
+
attribute :user_id, [ :user => :id ]
|
36
36
|
|
37
37
|
attributes :id, :name, :description, :created_at, :view_count, :tags,
|
38
38
|
:ending, :quantity, :materials, :price, :restful_path, :product_url, :images
|
data/lib/dawanda/request.rb
CHANGED
File without changes
|
data/lib/dawanda/response.rb
CHANGED
File without changes
|
data/lib/dawanda/shop.rb
CHANGED
@@ -19,10 +19,10 @@ module Dawanda
|
|
19
19
|
finder :one, '/shops/:user_id'
|
20
20
|
finder :all, '/shops/:method'
|
21
21
|
|
22
|
-
attribute :updated, :
|
23
|
-
attribute :created, :
|
24
|
-
attribute :user_id, :
|
25
|
-
attribute :banner_image_url, :
|
22
|
+
attribute :updated, :updated_at
|
23
|
+
attribute :created, :created_at
|
24
|
+
attribute :user_id, [:user, :id]
|
25
|
+
attribute :banner_image_url, [:images, 0, :shop_banner]
|
26
26
|
|
27
27
|
attributes :name
|
28
28
|
|
File without changes
|
data/lib/dawanda/user.rb
CHANGED
File without changes
|
data/lib/dawanda.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"name":"MEKO STORE",
|
20
20
|
"updated_at":"2009/09/29 09:58:46 +0000",
|
21
21
|
"images": [
|
22
|
-
{"
|
22
|
+
{"shop_banner":"http:\/\/img.dawanda.com.s3.amazonaws.com\/Shop\/1\/1592\/maxbanner\/1253807487-995.jpg"}
|
23
23
|
],
|
24
24
|
"restful_path":"\/shops\/13008",
|
25
25
|
"shop_categories": [
|
File without changes
|
data/test/test_helper.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -22,6 +22,7 @@ module Dawanda
|
|
22
22
|
value_for :name, :is => 'MEKO STORE'
|
23
23
|
value_for :updated, :is => "2009/09/29 09:58:46 +0000"
|
24
24
|
value_for :created, :is => "2007/05/18 10:44:17 +0000"
|
25
|
+
value_for :banner_image_url, :is => "http://img.dawanda.com.s3.amazonaws.com/Shop/1/1592/maxbanner/1253807487-995.jpg"
|
25
26
|
end
|
26
27
|
|
27
28
|
should "know the creation date" do
|
File without changes
|
data/test/unit/dawanda_test.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,20 +1,25 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dawanda_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 8
|
9
|
+
version: 0.1.8
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
|
-
-
|
12
|
+
- DaWanda GmbH
|
8
13
|
autorequire:
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-03-08 00:00:00 +01:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
16
21
|
description: Provides a friendly ruby-like interface to the Dawanda API
|
17
|
-
email:
|
22
|
+
email: api@dawanda.com
|
18
23
|
executables: []
|
19
24
|
|
20
25
|
extensions: []
|
@@ -23,7 +28,6 @@ extra_rdoc_files:
|
|
23
28
|
- LICENSE
|
24
29
|
- README.rdoc
|
25
30
|
files:
|
26
|
-
- .gitignore
|
27
31
|
- LICENSE
|
28
32
|
- README.rdoc
|
29
33
|
- Rakefile
|
@@ -53,7 +57,7 @@ files:
|
|
53
57
|
- test/unit/dawanda/user_test.rb
|
54
58
|
- test/unit/dawanda_test.rb
|
55
59
|
has_rdoc: true
|
56
|
-
homepage: http://github.com/dawanda/
|
60
|
+
homepage: http://github.com/dawanda/dawanda-api-client-ruby
|
57
61
|
licenses: []
|
58
62
|
|
59
63
|
post_install_message:
|
@@ -65,18 +69,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
69
|
requirements:
|
66
70
|
- - ">="
|
67
71
|
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
68
74
|
version: "0"
|
69
|
-
version:
|
70
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
76
|
requirements:
|
72
77
|
- - ">="
|
73
78
|
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
74
81
|
version: "0"
|
75
|
-
version:
|
76
82
|
requirements: []
|
77
83
|
|
78
84
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.3.
|
85
|
+
rubygems_version: 1.3.6
|
80
86
|
signing_key:
|
81
87
|
specification_version: 3
|
82
88
|
summary: Provides a friendly ruby-like interface to the Dawanda API
|
data/.gitignore
DELETED