atomutil 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 2.4.0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.5.2"
12
+ gem "rcov", ">= 0"
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,28 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.2)
5
+ git (1.2.5)
6
+ jeweler (1.5.2)
7
+ bundler (~> 1.0.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rake (0.8.7)
11
+ rcov (0.9.9)
12
+ rspec (2.4.0)
13
+ rspec-core (~> 2.4.0)
14
+ rspec-expectations (~> 2.4.0)
15
+ rspec-mocks (~> 2.4.0)
16
+ rspec-core (2.4.0)
17
+ rspec-expectations (2.4.0)
18
+ diff-lcs (~> 1.1.2)
19
+ rspec-mocks (2.4.0)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ bundler (~> 1.0.0)
26
+ jeweler (~> 1.5.2)
27
+ rcov
28
+ rspec (~> 2.4.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 lyokato
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:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
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.
data/License.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007 Lyo Kato
1
+ Copyright (c) 2011 lyokato
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = atomutil
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to atomutil
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 lyokato. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile CHANGED
@@ -1,4 +1,50 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
3
-
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "atomutil"
16
+ gem.homepage = "http://github.com/lyokato/ruby-atomutil"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Ruby AtomPub Client}
19
+ gem.description = %Q{This library allows your to handle AtomPub and Atom Feed easily}
20
+ gem.email = "lyo.kato@gmail.com"
21
+ gem.authors = ["lyokato"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rspec/core'
30
+ require 'rspec/core/rake_task'
31
+ RSpec::Core::RakeTask.new(:spec) do |spec|
32
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
+ end
34
+
35
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
+ spec.pattern = 'spec/**/*_spec.rb'
37
+ spec.rcov = true
38
+ end
39
+
40
+ task :default => :spec
41
+
42
+ require 'rake/rdoctask'
43
+ Rake::RDocTask.new do |rdoc|
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
+
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "atomutil #{version}"
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
50
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/atomutil.gemspec ADDED
@@ -0,0 +1,84 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{atomutil}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["lyokato"]
12
+ s.date = %q{2011-01-07}
13
+ s.description = %q{This library allows your to handle AtomPub and Atom Feed easily}
14
+ s.email = %q{lyo.kato@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "License.txt",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "atomutil.gemspec",
29
+ "lib/atomutil.rb",
30
+ "spec/categories_spec.rb",
31
+ "spec/category_spec.rb",
32
+ "spec/content_spec.rb",
33
+ "spec/customfeed_spec.rb",
34
+ "spec/feed_spec.rb",
35
+ "spec/link_spec.rb",
36
+ "spec/namespace_spec.rb",
37
+ "spec/opensearch_spec.rb",
38
+ "spec/person_spec.rb",
39
+ "spec/samples/feed.atom",
40
+ "spec/spec.opts",
41
+ "spec/spec_helper.rb",
42
+ "spec/threading_spec.rb"
43
+ ]
44
+ s.homepage = %q{http://github.com/lyokato/ruby-atomutil}
45
+ s.licenses = ["MIT"]
46
+ s.require_paths = ["lib"]
47
+ s.rubygems_version = %q{1.4.2}
48
+ s.summary = %q{Ruby AtomPub Client}
49
+ s.test_files = [
50
+ "spec/categories_spec.rb",
51
+ "spec/category_spec.rb",
52
+ "spec/content_spec.rb",
53
+ "spec/customfeed_spec.rb",
54
+ "spec/feed_spec.rb",
55
+ "spec/link_spec.rb",
56
+ "spec/namespace_spec.rb",
57
+ "spec/opensearch_spec.rb",
58
+ "spec/person_spec.rb",
59
+ "spec/spec_helper.rb",
60
+ "spec/threading_spec.rb"
61
+ ]
62
+
63
+ if s.respond_to? :specification_version then
64
+ s.specification_version = 3
65
+
66
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
67
+ s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
68
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
69
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
70
+ s.add_development_dependency(%q<rcov>, [">= 0"])
71
+ else
72
+ s.add_dependency(%q<rspec>, ["~> 2.4.0"])
73
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
74
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
75
+ s.add_dependency(%q<rcov>, [">= 0"])
76
+ end
77
+ else
78
+ s.add_dependency(%q<rspec>, ["~> 2.4.0"])
79
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
80
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
81
+ s.add_dependency(%q<rcov>, [">= 0"])
82
+ end
83
+ end
84
+
data/lib/atomutil.rb CHANGED
@@ -29,7 +29,7 @@
29
29
  # http://search.cpan.org/perldoc?XML%3A%3AAtom%3A%3AExt%3A%3AThreading
30
30
  # http://search.cpan.org/perldoc?Atompub
31
31
  #
32
- # This package supports however only version 1.0 of Atom(original Perl libraries support also version 0.3),
32
+ # This package however supports only version 1.0 of Atom(original Perl libraries support also version 0.3),
33
33
  # and is not stable yet.
34
34
  # We need more document, more tutorials, and more tests by RSpec.
35
35
  #++
@@ -54,8 +54,8 @@ require 'rexml/document'
54
54
  module AtomUtil
55
55
  module VERSION#:nodoc:
56
56
  MAJOR = 0
57
- MINOR = 0
58
- TINY = 9
57
+ MINOR = 1
58
+ TINY = 0
59
59
  STRING = [MAJOR, MINOR, TINY].join('.')
60
60
  end
61
61
  end
@@ -760,7 +760,7 @@ module Atom
760
760
  |[\xf0-\xf7][\x80-\xbf]{3}
761
761
  |[\xf8-\xfb][\x80-\xbf]{4}
762
762
  |[\xfc-\xfd][\x80-\xbf]{5}
763
- )*$/xs
763
+ )*$/x
764
764
  copy = "<div xmlns=\"http://www.w3.org/1999/xhtml\">#{value}</div>"
765
765
  is_valid = true
766
766
  begin
@@ -1305,6 +1305,9 @@ module Atompub
1305
1305
  # * cache
1306
1306
  #
1307
1307
  def initialize(params={})
1308
+ unless params.has_key?(:auth)
1309
+ throw ArgumentError.new("Atompub::Client needs :auth as argument for constructor.")
1310
+ end
1308
1311
  @auth = params.has_key?(:auth) && params[:auth].kind_of?(Auth::Abstract) ? params[:auth] : Auth::Abstract.new
1309
1312
  @cache = params.has_key?(:cache) && params[:cache].kind_of?(AbstractCache) ? params[:cache] : AbstractCache.instance
1310
1313
  @service_info = params.has_key?(:info) && params[:info].kind_of?(ServiceInfoStorage) ? params[:info] : ServiceInfoStorage.instance
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,12 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems'
5
- gem 'rspec'
6
- require 'spec'
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'atomutil'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
7
12
  end
8
- require File.dirname(__FILE__) + "/../lib/atomutil"
metadata CHANGED
@@ -1,53 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
5
11
  platform: ruby
6
12
  authors:
7
- - Lyo Kato
13
+ - lyokato
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2008-08-29 00:00:00 +09:00
18
+ date: 2011-01-07 00:00:00 +09:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
- name: hoe
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ hash: 31
28
+ segments:
29
+ - 2
30
+ - 4
31
+ - 0
32
+ version: 2.4.0
33
+ requirement: *id001
34
+ prerelease: false
35
+ name: rspec
17
36
  type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
37
+ - !ruby/object:Gem::Dependency
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 23
44
+ segments:
45
+ - 1
46
+ - 0
47
+ - 0
48
+ version: 1.0.0
49
+ requirement: *id002
50
+ prerelease: false
51
+ name: bundler
52
+ type: :development
53
+ - !ruby/object:Gem::Dependency
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 7
60
+ segments:
61
+ - 1
62
+ - 5
63
+ - 2
64
+ version: 1.5.2
65
+ requirement: *id003
66
+ prerelease: false
67
+ name: jeweler
68
+ type: :development
69
+ - !ruby/object:Gem::Dependency
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
+ none: false
20
72
  requirements:
21
73
  - - ">="
22
74
  - !ruby/object:Gem::Version
23
- version: 1.7.0
24
- version:
25
- description: Utilities for AtomPub / Atom Syndication Format
26
- email: lyo.kato atmark gmail.com
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ requirement: *id004
80
+ prerelease: false
81
+ name: rcov
82
+ type: :development
83
+ description: This library allows your to handle AtomPub and Atom Feed easily
84
+ email: lyo.kato@gmail.com
27
85
  executables: []
28
86
 
29
87
  extensions: []
30
88
 
31
89
  extra_rdoc_files:
32
- - History.txt
33
- - License.txt
34
- - Manifest.txt
35
- - README.txt
36
- - website/index.txt
90
+ - LICENSE.txt
91
+ - README.rdoc
37
92
  files:
38
- - History.txt
93
+ - .document
94
+ - .rspec
95
+ - Gemfile
96
+ - Gemfile.lock
39
97
  - License.txt
40
- - Manifest.txt
41
- - README.txt
98
+ - README.rdoc
42
99
  - Rakefile
43
- - config/hoe.rb
44
- - config/requirements.rb
100
+ - VERSION
101
+ - atomutil.gemspec
45
102
  - lib/atomutil.rb
46
- - log/debug.log
47
- - script/destroy
48
- - script/generate
49
- - script/txt2html
50
- - setup.rb
51
103
  - spec/categories_spec.rb
52
104
  - spec/category_spec.rb
53
105
  - spec/content_spec.rb
@@ -61,41 +113,50 @@ files:
61
113
  - spec/spec.opts
62
114
  - spec/spec_helper.rb
63
115
  - spec/threading_spec.rb
64
- - tasks/deployment.rake
65
- - tasks/environment.rake
66
- - tasks/rspec.rake
67
- - tasks/website.rake
68
- - website/index.html
69
- - website/index.txt
70
- - website/javascripts/rounded_corners_lite.inc.js
71
- - website/stylesheets/screen.css
72
- - website/template.rhtml
116
+ - LICENSE.txt
73
117
  has_rdoc: true
74
- homepage: http://atomutil.rubyforge.org
118
+ homepage: http://github.com/lyokato/ruby-atomutil
119
+ licenses:
120
+ - MIT
75
121
  post_install_message:
76
- rdoc_options:
77
- - --main
78
- - README.txt
122
+ rdoc_options: []
123
+
79
124
  require_paths:
80
125
  - lib
81
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
+ none: false
82
128
  requirements:
83
129
  - - ">="
84
130
  - !ruby/object:Gem::Version
131
+ hash: 3
132
+ segments:
133
+ - 0
85
134
  version: "0"
86
- version:
87
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
+ none: false
88
137
  requirements:
89
138
  - - ">="
90
139
  - !ruby/object:Gem::Version
140
+ hash: 3
141
+ segments:
142
+ - 0
91
143
  version: "0"
92
- version:
93
144
  requirements: []
94
145
 
95
- rubyforge_project: atomutil
96
- rubygems_version: 1.2.0
146
+ rubyforge_project:
147
+ rubygems_version: 1.4.2
97
148
  signing_key:
98
- specification_version: 2
99
- summary: Utilities for AtomPub / Atom Syndication Format
100
- test_files: []
101
-
149
+ specification_version: 3
150
+ summary: Ruby AtomPub Client
151
+ test_files:
152
+ - spec/categories_spec.rb
153
+ - spec/category_spec.rb
154
+ - spec/content_spec.rb
155
+ - spec/customfeed_spec.rb
156
+ - spec/feed_spec.rb
157
+ - spec/link_spec.rb
158
+ - spec/namespace_spec.rb
159
+ - spec/opensearch_spec.rb
160
+ - spec/person_spec.rb
161
+ - spec/spec_helper.rb
162
+ - spec/threading_spec.rb
data/History.txt DELETED
@@ -1,48 +0,0 @@
1
- == 0.0.9 2008-08-29
2
-
3
- Now Client's constructor doesn't need :auth param if not needed.
4
-
5
- == 0.0.7 2008-08-29
6
-
7
- * bugfix: fix where it checks the response code is OK or No Content when updating resource.
8
- fix Element::to_s because last version of REXML::Document::to_s doesn't accept any param.
9
-
10
- == 0.0.6 2008-05-01
11
-
12
- Removed dependency on REXML::Formatters::Pretty,
13
- because REXML::Formatters::Pretty inserts linebreaks into each tags...
14
- But this isn't best solution.
15
-
16
- == 0.0.5 2008-04-30
17
-
18
- * bugfix: Atom::Content didn't work as expected with multibyte UTF-8 string.
19
- Atom::Element::to_s didn't work well on ruby 1.8.6 or above, because
20
- REXML::Document::to_s is deprecated and has a bug on 1.8.6 or 1.9 patched release.
21
- require 'sha1' -> require 'digest/sha1'
22
-
23
- Thanks to walf443, Elton Okada.
24
-
25
- == 0.0.4 2008-02-12
26
-
27
- * bugfix: SimpleCache - fixed typo
28
- CacheResource - fixed type
29
- ServiceInfoStorage#clone_collection now returns new collections correctly.
30
- ServiceInfo#accepts_media_type? works as expected now.
31
- added credential control on Atompub::Client#delete_resource
32
- approved error messages.
33
-
34
- == 0.0.3 2008-02-12
35
-
36
- * bugfix: now this handle URL which has query correctly.
37
- approved error messages.
38
-
39
- Thanks to cho45.
40
-
41
- == 0.0.2 2007-12-05
42
-
43
- * documentation improvement:
44
-
45
- == 0.0.1 2007-12-05
46
-
47
- * 1 major enhancement:
48
- * Initial release
data/Manifest.txt DELETED
@@ -1,35 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- README.txt
5
- Rakefile
6
- config/hoe.rb
7
- config/requirements.rb
8
- lib/atomutil.rb
9
- log/debug.log
10
- script/destroy
11
- script/generate
12
- script/txt2html
13
- setup.rb
14
- spec/categories_spec.rb
15
- spec/category_spec.rb
16
- spec/content_spec.rb
17
- spec/customfeed_spec.rb
18
- spec/feed_spec.rb
19
- spec/link_spec.rb
20
- spec/namespace_spec.rb
21
- spec/opensearch_spec.rb
22
- spec/person_spec.rb
23
- spec/samples/feed.atom
24
- spec/spec.opts
25
- spec/spec_helper.rb
26
- spec/threading_spec.rb
27
- tasks/deployment.rake
28
- tasks/environment.rake
29
- tasks/rspec.rake
30
- tasks/website.rake
31
- website/index.html
32
- website/index.txt
33
- website/javascripts/rounded_corners_lite.inc.js
34
- website/stylesheets/screen.css
35
- website/template.rhtml