tumblr_client 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4597029c0d9e24e9a0f7ebc7f3b79cf829ee287
4
+ data.tar.gz: cbe00d9e8edcae2fc2f22cef6a9979bedc945736
5
+ SHA512:
6
+ metadata.gz: 09c14d78f573c2370b50d85ab1221c8f97388108d8712f578d1efa2406149d30e7fb9a6bf7b173478507df7d7c31f4bfc9aad628ab548072fcf92dcd89ac36d9
7
+ data.tar.gz: 04ecbad123bc8274c1f8ec9d62b8597388f7f9e670409d755342131114e85e756bfc2bb35d3ce139a8889c77a53e564471639a79cebc273682c964a49d04b5bf
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ end
12
12
  task :release => :build do
13
13
  # tag and push
14
14
  system "git tag v#{Tumblr::VERSION}"
15
- #system "git push origin --tags"
15
+ system "git push origin --tags"
16
16
  # push the gem
17
17
  system "gem push tumblr_client-#{Tumblr::VERSION}.gem"
18
18
  end
data/bin/tumblr CHANGED
@@ -35,7 +35,7 @@ else
35
35
 
36
36
  site = "http://#{host}"
37
37
  consumer = OAuth::Consumer.new(config.consumer_key, config.consumer_secret, :site => site)
38
- request_token = consumer.get_request_token :oauth_callback => 'http://localhost/'
38
+ request_token = consumer.get_request_token :exclude_callback => true
39
39
 
40
40
  puts
41
41
 
@@ -4,6 +4,7 @@ module Tumblr
4
4
  STANDARD_POST_OPTIONS = [:state, :tags, :tweet, :date, :markdown, :slug, :format]
5
5
 
6
6
  def edit(blog_name, options = {})
7
+ convert_source_array :source, options
7
8
  post(blog_path(blog_name, 'post/edit'), options)
8
9
  end
9
10
 
@@ -19,14 +20,7 @@ module Tumblr
19
20
  valid_opts = STANDARD_POST_OPTIONS + [:caption, :link, :data, :data_raw, :source, :photoset_layout]
20
21
  validate_options(valid_opts, options)
21
22
  validate_no_collision options, [:data, :source]
22
-
23
- # Allow source to be passed as an Array
24
- if options.has_key?(:source) && options[:source].kind_of?(Array)
25
- options[:source].each.with_index do |src, idx|
26
- options["source[#{idx}]"] = src
27
- end
28
- options.delete(:source)
29
- end
23
+ convert_source_array :source, options
30
24
 
31
25
  options[:type] = 'photo'
32
26
  extract_data!(options)
@@ -91,6 +85,16 @@ module Tumblr
91
85
  blog_path(blog_name, 'post')
92
86
  end
93
87
 
88
+ # Allow source to be passed as an Array
89
+ def convert_source_array(key, options)
90
+ if options.has_key?(key) && options[key].kind_of?(Array)
91
+ options[key].each.with_index do |src, idx|
92
+ options["#{key.to_s}[#{idx}]"] = src
93
+ end
94
+ options.delete(key)
95
+ end
96
+ end
97
+
94
98
  # Look for the various ways that data can be passed, and normalize
95
99
  # the result in this hash
96
100
  def extract_data!(options)
@@ -1,5 +1,5 @@
1
1
  module Tumblr
2
2
 
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'
4
4
 
5
5
  end
@@ -159,6 +159,15 @@ describe Tumblr::Post do
159
159
  client.send type, blog_name, :source => [source, source]
160
160
  end
161
161
 
162
+ it 'should be able to be passed as an array on edit' do
163
+ client.should_receive(:post).once.with("v2/blog/#{blog_name}/post/edit", {
164
+ :id => post_id,
165
+ 'source[0]' => source,
166
+ 'source[1]' => source
167
+ })
168
+ client.edit blog_name, :id => post_id, :source => [source, source]
169
+ end
170
+
162
171
  end
163
172
 
164
173
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
5
- prerelease:
4
+ version: 0.7.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - John Bunting
@@ -10,134 +9,118 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-05-21 00:00:00.000000000 Z
12
+ date: 2013-05-29 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: faraday
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0.8'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0.8'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: faraday_middleware
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0.8'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0.8'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: json
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: oauth
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: rake
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - '>='
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - '>='
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: rspec
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: webmock
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - '>='
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - '>='
125
110
  - !ruby/object:Gem::Version
126
111
  version: '0'
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: simplecov
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
- - - ! '>='
116
+ - - '>='
133
117
  - !ruby/object:Gem::Version
134
118
  version: '0'
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
- - - ! '>='
123
+ - - '>='
141
124
  - !ruby/object:Gem::Version
142
125
  version: '0'
143
126
  description: A Ruby wrapper for the Tumblr v2 API
@@ -178,27 +161,26 @@ files:
178
161
  - tumblr_client.gemspec
179
162
  homepage: http://github.com/codingjester/tumblr_client
180
163
  licenses: []
164
+ metadata: {}
181
165
  post_install_message:
182
166
  rdoc_options: []
183
167
  require_paths:
184
168
  - lib
185
169
  required_ruby_version: !ruby/object:Gem::Requirement
186
- none: false
187
170
  requirements:
188
- - - ! '>='
171
+ - - '>='
189
172
  - !ruby/object:Gem::Version
190
173
  version: '0'
191
174
  required_rubygems_version: !ruby/object:Gem::Requirement
192
- none: false
193
175
  requirements:
194
- - - ! '>='
176
+ - - '>='
195
177
  - !ruby/object:Gem::Version
196
178
  version: 1.3.6
197
179
  requirements: []
198
180
  rubyforge_project:
199
- rubygems_version: 1.8.25
181
+ rubygems_version: 2.0.3
200
182
  signing_key:
201
- specification_version: 3
183
+ specification_version: 4
202
184
  summary: Tumblr API wrapper
203
185
  test_files:
204
186
  - spec/examples/blog_spec.rb