powncer 0.1.1 → 0.1.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/Rakefile +23 -0
- data/lib/powncer/authentication.rb +1 -1
- data/lib/powncer/version.rb +1 -1
- data/test/unit/authentication_test.rb +1 -1
- data/test/unit/note_test.rb +2 -2
- data/test/unit/scratch_test.rb +9 -0
- data/test/unit/user_test.rb +1 -1
- metadata +3 -2
data/Rakefile
CHANGED
@@ -17,6 +17,19 @@ Rake::TestTask.new('test') do |t|
|
|
17
17
|
t.pattern = 'test/*/*_test.rb'
|
18
18
|
end
|
19
19
|
|
20
|
+
Rake::RDocTask.new do |rdoc|
|
21
|
+
rdoc.rdoc_dir = 'doc'
|
22
|
+
rdoc.title = "Powncer -- A Ruby library to the Pownce REST API"
|
23
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
24
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
25
|
+
end
|
26
|
+
|
27
|
+
namespace :rdoc do
|
28
|
+
task :deploy => :rerdoc do
|
29
|
+
sh %(scp -r doc jaehess@rubyforge.org:/var/www/gforge-projects/powncer/)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
20
33
|
desc 'Check code to test ratio'
|
21
34
|
task :stats do
|
22
35
|
library_files = FileList["#{library_root}/lib/**/*.rb"]
|
@@ -99,3 +112,13 @@ namespace :dist do
|
|
99
112
|
end
|
100
113
|
|
101
114
|
end
|
115
|
+
|
116
|
+
desc 'Upload website files to rubyforge'
|
117
|
+
task :website do
|
118
|
+
host = "jaehess@rubyforge.org"
|
119
|
+
remote_dir = "/var/www/gforge-projects/powncer/"
|
120
|
+
local_dir = '~/Sites/powncer/site'
|
121
|
+
sh %{rsync -av #{local_dir}/ #{host}:#{remote_dir}}
|
122
|
+
end
|
123
|
+
|
124
|
+
task :cleanup => ['dist:clobber_package', 'clobber_rdoc']
|
@@ -34,7 +34,7 @@ module Powncer
|
|
34
34
|
form_params.merge!({'event_location' => params[:location]}) if params[:location]
|
35
35
|
form_params.merge!({'event_date' => params[:date]}) if params[:date]
|
36
36
|
form_params.merge!({'media_file' => params[:data]}) if params[:data]
|
37
|
-
req.set_content_type('multipart/form-data')
|
37
|
+
#req.set_content_type('multipart/form-data')
|
38
38
|
req.set_form_data({'app_key' => options[:application_key], 'note_to' => "#{params[:to]}"}.merge(form_params))
|
39
39
|
response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
|
40
40
|
response.body
|
data/lib/powncer/version.rb
CHANGED
@@ -11,7 +11,7 @@ class AuthenticationTest < Test::Unit::TestCase
|
|
11
11
|
connection = Authentication::Basic.connect!
|
12
12
|
assert_equal 1, Powncer.connections.length
|
13
13
|
"/users/jaehess.json".mock_auth_connection(example_profile_for)
|
14
|
-
"/note_lists/jaehess.json?filter=
|
14
|
+
"/note_lists/jaehess.json?filter=notes".mock_auth_connection(auth_example_notes_for)
|
15
15
|
j = User.find('jaehess')
|
16
16
|
assert_equal 20, j.notes.length
|
17
17
|
end
|
data/test/unit/note_test.rb
CHANGED
@@ -88,7 +88,7 @@ class NoteTest < Test::Unit::TestCase
|
|
88
88
|
|
89
89
|
def test_public_note_link_is_not_hash
|
90
90
|
"/users/jaehess.json".mock_connection(example_profile_for)
|
91
|
-
'/note_lists/jaehess.json?filter=
|
91
|
+
'/note_lists/jaehess.json?filter=notes'.mock_connection(example_public_links_for)
|
92
92
|
user = User.find('jaehess')
|
93
93
|
assert_not_nil user
|
94
94
|
assert_not_nil user.notes
|
@@ -97,7 +97,7 @@ class NoteTest < Test::Unit::TestCase
|
|
97
97
|
|
98
98
|
def test_chaining_notes_on_user_profile_find
|
99
99
|
"/users/jaehess.json".mock_connection(example_profile_for)
|
100
|
-
"/note_lists/jaehess.json?filter=
|
100
|
+
"/note_lists/jaehess.json?filter=notes".mock_connection(example_public_notes_for)
|
101
101
|
@notes = User.find('jaehess').notes
|
102
102
|
assert_not_nil @notes
|
103
103
|
assert_kind_of Array, @notes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
class ScratchTest < Test::Unit::TestCase
|
3
|
+
|
4
|
+
def test_holder
|
5
|
+
Powncer::Authentication::Basic.connect!
|
6
|
+
link = Powncer::Link.new({:body => "", :to => :public, :url =>"http://google.com"})
|
7
|
+
assert link.save
|
8
|
+
end
|
9
|
+
end
|
data/test/unit/user_test.rb
CHANGED
@@ -35,7 +35,7 @@ class UserTest < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_user_should_have_notes
|
38
|
-
'/note_lists/jaehess.json?filter=
|
38
|
+
'/note_lists/jaehess.json?filter=notes'.mock_connection(example_public_notes_for)
|
39
39
|
assert_kind_of Array, @user.notes
|
40
40
|
assert_kind_of Powncer::Note, @user.notes.first
|
41
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: powncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jae Hess
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-03-
|
12
|
+
date: 2008-03-24 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -82,4 +82,5 @@ test_files:
|
|
82
82
|
- test/unit/link_test.rb
|
83
83
|
- test/unit/media_test.rb
|
84
84
|
- test/unit/note_test.rb
|
85
|
+
- test/unit/scratch_test.rb
|
85
86
|
- test/unit/user_test.rb
|