mirrored 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.5
2
+ * tweaked destroy and save to be a little less brittle
3
+
4
+ 0.1.4
5
+ * screwed up 0.1.3, this correctly fixes hpricot issue
6
+
1
7
  0.1.3
2
8
  * removed specific hpricot version requirement, instead now requiring anything over 0.5
3
9
 
data/License.txt CHANGED
@@ -1,20 +1,19 @@
1
1
  Copyright (c) 2007 John Nunemaker
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
10
9
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
13
12
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/Manifest.txt CHANGED
@@ -20,12 +20,6 @@ setup.rb
20
20
  tasks/deployment.rake
21
21
  tasks/environment.rake
22
22
  tasks/website.rake
23
- test/test_base.rb
24
- test/test_date.rb
25
- test/test_helper.rb
26
- test/test_post.rb
27
- test/test_tag.rb
28
- test/test_update.rb
29
23
  test/fixtures/xml/add_post_done.xml
30
24
  test/fixtures/xml/all_posts.xml
31
25
  test/fixtures/xml/all_posts_by_tag.xml
@@ -42,6 +36,11 @@ test/fixtures/xml/recent_posts_by_tag.xml
42
36
  test/fixtures/xml/recent_posts_by_tag_and_count.xml
43
37
  test/fixtures/xml/tag_rename.xml
44
38
  test/fixtures/xml/tags.xml
39
+ test/test_base.rb
40
+ test/test_date.rb
41
+ test/test_helper.rb
42
+ test/test_post.rb
43
+ test/test_tag.rb
44
+ test/test_update.rb
45
45
  website/css/common.css
46
- website/images
47
- website/index.html
46
+ website/index.html
data/config/hoe.rb CHANGED
@@ -60,7 +60,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
60
60
 
61
61
  # == Optional
62
62
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
63
- p.extra_deps = [['hpricot', '0.5']] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
+ p.extra_deps = [['hpricot', '>= 0.5']] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
64
64
 
65
65
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
66
66
 
data/lib/mirrored/post.rb CHANGED
@@ -65,8 +65,12 @@ module Mirrored
65
65
  # Mirrored::Post.delete('http://microsoft.com') # => aliased version
66
66
  def destroy(url)
67
67
  doc = Hpricot::XML(connection.get('posts/delete', :url => url))
68
- code = doc.at('result')['code']
69
- code == 'done' ? true : false
68
+ if doc && doc.at('result')
69
+ code = doc.at('result')['code']
70
+ code == 'done' ? true : false
71
+ else
72
+ false
73
+ end
70
74
  end
71
75
  alias :delete :destroy
72
76
  end
@@ -85,8 +89,12 @@ module Mirrored
85
89
  attrs = to_h.merge((replace) ? {:replace => 'yes'} : {:replace => 'no'})
86
90
  puts attrs.inspect
87
91
  doc = Hpricot::XML(self.class.connection.get('posts/add', attrs))
88
- @code = doc.at('result')['code']
89
- (@code == 'done') ? true : false
92
+ if doc && doc.at('result')
93
+ @code = doc.at('result')['code']
94
+ (@code == 'done') ? true : false
95
+ else
96
+ false
97
+ end
90
98
  end
91
99
 
92
100
  def to_h #:nodoc:
@@ -2,7 +2,7 @@ module Mirrored #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 3
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -27,6 +27,15 @@
27
27
 
28
28
  <h2>Usage</h2>
29
29
 
30
+ <h3>Establish A Connection</h3>
31
+ <pre><code class="ruby"># to magnolia
32
+ Mirrored::Base.establish_connection(:magnolia, 'jnunemaker', 'password')
33
+
34
+ # or to delicious
35
+ Mirrored::Base.establish_connection(:delicious, 'jnunemaker', 'password')
36
+
37
+ # then use any of the examples below</code></pre>
38
+
30
39
  <h3>Last Update</h3>
31
40
  <pre><code class="ruby">Mirrored::Update.last # => ruby time object equal to last update</code></pre>
32
41
 
metadata CHANGED
@@ -1,33 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: mirrored
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
7
- date: 2007-10-28 00:00:00 -04:00
8
- summary: Wrapper for delicious and magnolia mirrored apis
9
- require_paths:
10
- - lib
11
- email: nunemaker@gmail.com
12
- homepage: http://mirrored.rubyforge.org
13
- rubyforge_project: mirrored
14
- description: Wrapper for delicious and magnolia mirrored apis
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
25
- platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
4
+ version: 0.1.5
5
+ platform: ""
29
6
  authors:
30
7
  - John Nunemaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-02-07 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0.5"
23
+ version:
24
+ description: Wrapper for delicious and magnolia mirrored apis
25
+ email: nunemaker@gmail.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - History.txt
32
+ - License.txt
33
+ - Manifest.txt
34
+ - README.txt
31
35
  files:
32
36
  - History.txt
33
37
  - License.txt
@@ -51,12 +55,6 @@ files:
51
55
  - tasks/deployment.rake
52
56
  - tasks/environment.rake
53
57
  - tasks/website.rake
54
- - test/test_base.rb
55
- - test/test_date.rb
56
- - test/test_helper.rb
57
- - test/test_post.rb
58
- - test/test_tag.rb
59
- - test/test_update.rb
60
58
  - test/fixtures/xml/add_post_done.xml
61
59
  - test/fixtures/xml/all_posts.xml
62
60
  - test/fixtures/xml/all_posts_by_tag.xml
@@ -73,37 +71,45 @@ files:
73
71
  - test/fixtures/xml/recent_posts_by_tag_and_count.xml
74
72
  - test/fixtures/xml/tag_rename.xml
75
73
  - test/fixtures/xml/tags.xml
76
- - website/css/common.css
77
- - website/images
78
- - website/index.html
79
- test_files:
80
74
  - test/test_base.rb
81
75
  - test/test_date.rb
82
76
  - test/test_helper.rb
83
77
  - test/test_post.rb
84
78
  - test/test_tag.rb
85
79
  - test/test_update.rb
80
+ - website/css/common.css
81
+ - website/index.html
82
+ has_rdoc: true
83
+ homepage: http://mirrored.rubyforge.org
84
+ post_install_message:
86
85
  rdoc_options:
87
86
  - --main
88
87
  - README.txt
89
- extra_rdoc_files:
90
- - History.txt
91
- - License.txt
92
- - Manifest.txt
93
- - README.txt
94
- executables: []
95
-
96
- extensions: []
97
-
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: "0"
95
+ version:
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ version:
98
102
  requirements: []
99
103
 
100
- dependencies:
101
- - !ruby/object:Gem::Dependency
102
- name: hpricot
103
- version_requirement:
104
- version_requirements: !ruby/object:Gem::Version::Requirement
105
- requirements:
106
- - - "="
107
- - !ruby/object:Gem::Version
108
- version: "0.5"
109
- version:
104
+ rubyforge_project: mirrored
105
+ rubygems_version: 0.9.5
106
+ signing_key:
107
+ specification_version: 2
108
+ summary: Wrapper for delicious and magnolia mirrored apis
109
+ test_files:
110
+ - test/test_base.rb
111
+ - test/test_date.rb
112
+ - test/test_helper.rb
113
+ - test/test_post.rb
114
+ - test/test_tag.rb
115
+ - test/test_update.rb