monkeyhelper-muddyit_fu 0.2.1 → 0.2.2
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/README.rdoc +1 -48
- data/VERSION +1 -1
- data/lib/muddyit/sites/pages/page.rb +1 -1
- data/lib/muddyit/sites/pages.rb +1 -1
- data/muddyit_fu.gemspec +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -93,54 +93,7 @@ can be stored in a yml file, an example of which is provided below.
|
|
93
93
|
|
94
94
|
== Authorising clients using irb
|
95
95
|
|
96
|
-
|
97
|
-
irb(main):002:0> require 'rubygems'
|
98
|
-
=> true
|
99
|
-
irb(main):003:0> require 'oauth'
|
100
|
-
=> true
|
101
|
-
irb(main):004:0> require 'oauth/consumer'
|
102
|
-
=> false
|
103
|
-
irb(main):005:0> @consumer=OAuth::Consumer.new "yourtoken", "yoursecret", {:site => 'http://www.muddy.it' }
|
104
|
-
=> #<OAuth::Consumer:0xb7683b7c @key="yourtoken", @secret="yoursecret", @options={:oauth_version=>"1.0",
|
105
|
-
:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token",
|
106
|
-
:site=>"http://www.muddy.it", :scheme=>:header,
|
107
|
-
:authorize_path=>"/oauth/authorize", :access_token_path=>"/oauth/access_token",
|
108
|
-
:http_method=>:post}>
|
109
|
-
irb(main):006:0> @request_token=@consumer.get_request_token
|
110
|
-
=> #<OAuth::RequestToken:0xb76778e0 @consumer=#<OAuth::Consumer:0xb7683b7c @key="tokenkey",
|
111
|
-
@http=#<Net::HTTP www.muddy.it:80 open=false>, @http_method=:post,
|
112
|
-
@secret="tokensecret", @options={:oauth_version=>"1.0", :signature_method=>"HMAC-SHA1",
|
113
|
-
:request_token_path=>"/oauth/request_token", :site=>"http://www.muddy.it",
|
114
|
-
:scheme=>:header, :authorize_path=>"/oauth/authorize", :access_token_path=>"/oauth/access_token",
|
115
|
-
:http_method=>:post}>, @token="tokenkey", @secret="tokensecret">
|
116
|
-
irb(main):007:0> @request_token.authorize_url
|
117
|
-
=> "http://www.muddy.it/oauth/authorize?oauth_token=tokenkey"
|
118
|
-
|
119
|
-
To authorise the application, visit the URL, check the 'authorize access' box and
|
120
|
-
save. The request token can now be exchanged for an access token :
|
121
|
-
|
122
|
-
irb(main):008:0> @access_token=@request_token.get_access_token
|
123
|
-
=> #<OAuth::AccessToken:0xb7667c10 @consumer=#<OAuth::Consumer:0xb7683b7c @key="accesstoken_key",
|
124
|
-
@http=#<Net::HTTP www.muddy.it:80 open=false>, @http_method=:post,
|
125
|
-
@secret="accesstoken_secret", @options={:oauth_version=>"1.0",
|
126
|
-
:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token",
|
127
|
-
:site=>"http://www.muddy.it", :scheme=>:header, :authorize_path=>"/oauth/authorize",
|
128
|
-
:access_token_path=>"/oauth/access_token", :http_method=>:post}>, @token="accesstoken",
|
129
|
-
@secret="accesstoken_secret">
|
130
|
-
|
131
|
-
This token can also be used to access the service :
|
132
|
-
|
133
|
-
irb(main):016:0> res = @access_token.get "/sites.json"
|
134
|
-
=> #<Net::HTTPOK 200 OK readbody=true>
|
135
|
-
irb(main):017:0> res.body
|
136
|
-
....
|
137
|
-
|
138
|
-
The access token credentials to be used with muddyit_fu are :
|
139
|
-
|
140
|
-
irb(main):011:0> @access_token.token
|
141
|
-
=> "sometoken"
|
142
|
-
irb(main):012:0> @access_token.secret
|
143
|
-
=> "somesecret"
|
96
|
+
See http://gist.github.com/178993 for details on how to obtain access credentials.
|
144
97
|
|
145
98
|
== Contact
|
146
99
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -17,7 +17,7 @@ class Muddyit::Sites::Site::Pages::Page < Muddyit::Generic
|
|
17
17
|
# Ensure we get extracted_content as well
|
18
18
|
options[:include_content] = true
|
19
19
|
|
20
|
-
body = { :page => { :uri => self.uri
|
20
|
+
body = { :page => { :uri => self.uri, :options => options } }
|
21
21
|
|
22
22
|
api_url = "/sites/#{self.site.attributes[:token]}/pages/#{self.identifier}"
|
23
23
|
response = @muddyit.send_request(api_url, :put, {}, body.to_json)
|
data/lib/muddyit/sites/pages.rb
CHANGED
@@ -59,7 +59,7 @@ class Muddyit::Sites::Site::Pages < Muddyit::Generic
|
|
59
59
|
raise
|
60
60
|
end
|
61
61
|
|
62
|
-
body = { :page => doc
|
62
|
+
body = { :page => doc.merge!(:options => options) }
|
63
63
|
|
64
64
|
api_url = "/sites/#{self.site.attributes[:token]}/pages/"
|
65
65
|
response = @muddyit.send_request(api_url, :post, {}, body.to_json)
|
data/muddyit_fu.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{muddyit_fu}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["robl"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-09-10}
|
10
10
|
s.email = %q{robl[at]monkeyhelper.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monkeyhelper-muddyit_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- robl
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|