RssMangler 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -14,4 +14,5 @@ group :development do
14
14
  gem "bundler", "~> 1.0.0"
15
15
  gem "jeweler", "~> 1.5.2"
16
16
  gem "rcov", ">= 0"
17
+ gem "pry"
17
18
  end
@@ -2,16 +2,23 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  ZenTest (4.4.2)
5
+ coderay (1.0.6)
5
6
  git (1.2.5)
6
7
  jeweler (1.5.2)
7
8
  bundler (~> 1.0.0)
8
9
  git (>= 1.2.5)
9
10
  rake
11
+ method_source (0.7.1)
10
12
  minitest (2.0.2)
11
13
  nokogiri (1.4.4)
14
+ pry (0.9.8.4)
15
+ coderay (~> 1.0.5)
16
+ method_source (~> 0.7.1)
17
+ slop (>= 2.4.4, < 3)
12
18
  rake (0.8.7)
13
19
  rcov (0.9.9)
14
20
  shoulda (2.11.3)
21
+ slop (2.4.4)
15
22
 
16
23
  PLATFORMS
17
24
  ruby
@@ -22,5 +29,6 @@ DEPENDENCIES
22
29
  jeweler (~> 1.5.2)
23
30
  minitest (~> 2.0.2)
24
31
  nokogiri (~> 1.4.4)
32
+ pry
25
33
  rcov
26
34
  shoulda
@@ -4,21 +4,20 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{RssMangler}
8
- s.version = "0.0.5"
7
+ s.name = "RssMangler"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jones"]
12
- s.date = %q{2011-03-04}
13
- s.description = %q{}
14
- s.email = %q{jones@encc.de}
12
+ s.date = "2012-05-11"
13
+ s.description = ""
14
+ s.email = "jones@encc.de"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".rvmrc",
22
21
  "Gemfile",
23
22
  "Gemfile.lock",
24
23
  "LICENSE.txt",
@@ -31,11 +30,11 @@ Gem::Specification.new do |s|
31
30
  "test/helper.rb",
32
31
  "test/test_RssMangler.rb"
33
32
  ]
34
- s.homepage = %q{http://github.com/enc/RssMangler}
33
+ s.homepage = "http://github.com/enc/RssMangler"
35
34
  s.licenses = ["MIT"]
36
35
  s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.5.2}
38
- s.summary = %q{Fetches everything form non conform rss stream}
36
+ s.rubygems_version = "1.8.11"
37
+ s.summary = "Fetches everything form non conform rss stream"
39
38
  s.test_files = [
40
39
  "test/helper.rb",
41
40
  "test/test_RssMangler.rb"
@@ -52,6 +51,7 @@ Gem::Specification.new do |s|
52
51
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
53
52
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
54
53
  s.add_development_dependency(%q<rcov>, [">= 0"])
54
+ s.add_development_dependency(%q<pry>, [">= 0"])
55
55
  s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.4"])
56
56
  else
57
57
  s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
@@ -61,6 +61,7 @@ Gem::Specification.new do |s|
61
61
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
62
62
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
63
63
  s.add_dependency(%q<rcov>, [">= 0"])
64
+ s.add_dependency(%q<pry>, [">= 0"])
64
65
  s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
65
66
  end
66
67
  else
@@ -71,6 +72,7 @@ Gem::Specification.new do |s|
71
72
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
72
73
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
73
74
  s.add_dependency(%q<rcov>, [">= 0"])
75
+ s.add_dependency(%q<pry>, [">= 0"])
74
76
  s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
75
77
  end
76
78
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.1.0
@@ -9,8 +9,13 @@ class RssMangler
9
9
 
10
10
  def initialize uri
11
11
  @doc = Nokogiri::Slop(open(uri))
12
- @items = @doc.html.body.rss.channel.item.collect do |element|
13
- ContentItem.new(element)
12
+ channel = @doc.html.body.rss.channel
13
+ unless channel.xpath("child::item").empty?
14
+ @items = channel.item.collect do |element|
15
+ ContentItem.new(element)
16
+ end
17
+ else
18
+ @items = []
14
19
  end
15
20
 
16
21
  end
@@ -15,6 +15,10 @@ class TestRssMangler < MiniTest::Unit::TestCase
15
15
  assert_respond_to stream, :each
16
16
  end
17
17
 
18
+ def test_empty
19
+ assert RssMangler.new("http://about.podpiska.de/rss-feed-promotions/").size, 0
20
+ end
21
+
18
22
  def test_wrong_url
19
23
  assert_raises Errno::ENOENT do
20
24
  stream = RssMangler.new("not even an url")
metadata CHANGED
@@ -1,159 +1,124 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: RssMangler
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 5
10
- version: 0.0.5
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jones
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-03-04 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: nokogiri
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70286702517660 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 15
29
- segments:
30
- - 1
31
- - 4
32
- - 4
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.4.4
34
- prerelease: false
35
22
  type: :runtime
36
- requirement: *id001
37
- - !ruby/object:Gem::Dependency
23
+ prerelease: false
24
+ version_requirements: *70286702517660
25
+ - !ruby/object:Gem::Dependency
38
26
  name: ZenTest
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &70286702515840 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 47
45
- segments:
46
- - 4
47
- - 4
48
- - 0
31
+ - !ruby/object:Gem::Version
49
32
  version: 4.4.0
50
- prerelease: false
51
33
  type: :development
52
- requirement: *id002
53
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *70286702515840
36
+ - !ruby/object:Gem::Dependency
54
37
  name: minitest
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &70286702514720 !ruby/object:Gem::Requirement
56
39
  none: false
57
- requirements:
40
+ requirements:
58
41
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 11
61
- segments:
62
- - 2
63
- - 0
64
- - 2
42
+ - !ruby/object:Gem::Version
65
43
  version: 2.0.2
66
- prerelease: false
67
44
  type: :development
68
- requirement: *id003
69
- - !ruby/object:Gem::Dependency
45
+ prerelease: false
46
+ version_requirements: *70286702514720
47
+ - !ruby/object:Gem::Dependency
70
48
  name: shoulda
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
49
+ requirement: &70286702513580 !ruby/object:Gem::Requirement
72
50
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
80
- prerelease: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
81
55
  type: :development
82
- requirement: *id004
83
- - !ruby/object:Gem::Dependency
56
+ prerelease: false
57
+ version_requirements: *70286702513580
58
+ - !ruby/object:Gem::Dependency
84
59
  name: bundler
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
60
+ requirement: &70286702512700 !ruby/object:Gem::Requirement
86
61
  none: false
87
- requirements:
62
+ requirements:
88
63
  - - ~>
89
- - !ruby/object:Gem::Version
90
- hash: 23
91
- segments:
92
- - 1
93
- - 0
94
- - 0
64
+ - !ruby/object:Gem::Version
95
65
  version: 1.0.0
96
- prerelease: false
97
66
  type: :development
98
- requirement: *id005
99
- - !ruby/object:Gem::Dependency
67
+ prerelease: false
68
+ version_requirements: *70286702512700
69
+ - !ruby/object:Gem::Dependency
100
70
  name: jeweler
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
71
+ requirement: &70286702511400 !ruby/object:Gem::Requirement
102
72
  none: false
103
- requirements:
73
+ requirements:
104
74
  - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 7
107
- segments:
108
- - 1
109
- - 5
110
- - 2
75
+ - !ruby/object:Gem::Version
111
76
  version: 1.5.2
112
- prerelease: false
113
77
  type: :development
114
- requirement: *id006
115
- - !ruby/object:Gem::Dependency
78
+ prerelease: false
79
+ version_requirements: *70286702511400
80
+ - !ruby/object:Gem::Dependency
116
81
  name: rcov
117
- version_requirements: &id007 !ruby/object:Gem::Requirement
82
+ requirement: &70286702535600 !ruby/object:Gem::Requirement
118
83
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
126
89
  prerelease: false
90
+ version_requirements: *70286702535600
91
+ - !ruby/object:Gem::Dependency
92
+ name: pry
93
+ requirement: &70286702534900 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
127
99
  type: :development
128
- requirement: *id007
129
- - !ruby/object:Gem::Dependency
100
+ prerelease: false
101
+ version_requirements: *70286702534900
102
+ - !ruby/object:Gem::Dependency
130
103
  name: nokogiri
131
- version_requirements: &id008 !ruby/object:Gem::Requirement
104
+ requirement: &70286702534380 !ruby/object:Gem::Requirement
132
105
  none: false
133
- requirements:
106
+ requirements:
134
107
  - - ~>
135
- - !ruby/object:Gem::Version
136
- hash: 15
137
- segments:
138
- - 1
139
- - 4
140
- - 4
108
+ - !ruby/object:Gem::Version
141
109
  version: 1.4.4
142
- prerelease: false
143
110
  type: :runtime
144
- requirement: *id008
145
- description: ""
111
+ prerelease: false
112
+ version_requirements: *70286702534380
113
+ description: ''
146
114
  email: jones@encc.de
147
115
  executables: []
148
-
149
116
  extensions: []
150
-
151
- extra_rdoc_files:
117
+ extra_rdoc_files:
152
118
  - LICENSE.txt
153
119
  - README.rdoc
154
- files:
120
+ files:
155
121
  - .document
156
- - .rvmrc
157
122
  - Gemfile
158
123
  - Gemfile.lock
159
124
  - LICENSE.txt
@@ -165,40 +130,34 @@ files:
165
130
  - lib/RssMangler.rb
166
131
  - test/helper.rb
167
132
  - test/test_RssMangler.rb
168
- has_rdoc: true
169
133
  homepage: http://github.com/enc/RssMangler
170
- licenses:
134
+ licenses:
171
135
  - MIT
172
136
  post_install_message:
173
137
  rdoc_options: []
174
-
175
- require_paths:
138
+ require_paths:
176
139
  - lib
177
- required_ruby_version: !ruby/object:Gem::Requirement
140
+ required_ruby_version: !ruby/object:Gem::Requirement
178
141
  none: false
179
- requirements:
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- hash: 3
183
- segments:
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ segments:
184
147
  - 0
185
- version: "0"
186
- required_rubygems_version: !ruby/object:Gem::Requirement
148
+ hash: 636951202025622201
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
187
150
  none: false
188
- requirements:
189
- - - ">="
190
- - !ruby/object:Gem::Version
191
- hash: 3
192
- segments:
193
- - 0
194
- version: "0"
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
195
155
  requirements: []
196
-
197
156
  rubyforge_project:
198
- rubygems_version: 1.5.2
157
+ rubygems_version: 1.8.11
199
158
  signing_key:
200
159
  specification_version: 3
201
160
  summary: Fetches everything form non conform rss stream
202
- test_files:
161
+ test_files:
203
162
  - test/helper.rb
204
163
  - test/test_RssMangler.rb
data/.rvmrc DELETED
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
- # development environment upon cd'ing into the directory
5
-
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
- environment_id="ree-1.8.7-2011.01@CS"
8
-
9
- #
10
- # First we attempt to load the desired environment directly from the environment
11
- # file. This is very fast and efficicent compared to running through the entire
12
- # CLI and selector. If you want feedback on which environment was used then
13
- # insert the word 'use' after --create as this triggers verbose mode.
14
- #
15
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
16
- && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then
17
- \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
18
- else
19
- # If the environment file has not yet been created, use the RVM CLI to select.
20
- rvm --create use "$environment_id"
21
- fi
22
-
23
- #
24
- # If you use an RVM gemset file to install a list of gems (*.gems), you can have
25
- # it be automatically loaded. Uncomment the following and adjust the filename if
26
- # necessary.
27
- #
28
- # filename=".gems"
29
- # if [[ -s "$filename" ]] ; then
30
- # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
31
- # fi
32
-
33
- #
34
- # If you use bundler and would like to run bundle each time you enter the
35
- # directory, you can uncomment the following code.
36
- #
37
- # # Ensure that Bundler is installed. Install it if it is not.
38
- # if ! command -v bundle >/dev/null; then
39
- # printf "The rubygem 'bundler' is not installed. Installing it now.\n"
40
- # gem install bundler
41
- # fi
42
- #
43
- # # Bundle while reducing excess noise.
44
- # printf "Bundling your gems. This may take a few minutes on a fresh clone.\n"
45
- # bundle | grep -v '^Using ' | grep -v ' is complete' | sed '/^$/d'
46
- #
47
-