rss 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +25 -5
- data/NEWS.md +17 -0
- data/README.md +2 -2
- data/Rakefile +3 -5
- data/lib/rss.rb +2 -0
- data/lib/rss/itunes.rb +24 -12
- data/lib/rss/maker/0.9.rb +1 -1
- data/lib/rss/rss.rb +0 -4
- data/lib/rss/version.rb +4 -0
- data/rss.gemspec +56 -14
- metadata +4 -4
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0661103c506f9158deefa370289f1f197422d06b500b92319e63d953d8243842
|
4
|
+
data.tar.gz: f855b9669a566ac469b85820a5bbe2ff6d60be14e72040096d997057c653e596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd38d5deb4396141f6e8a7e384cea8c3af86d7a54c42dc1e8f20d8447129c2e1f12a5fcb169d836353687ab16b6838999618f760b09f8d46246b17442977889e
|
7
|
+
data.tar.gz: 4cfaf4d6c6794344edee289fe73a0cc810e8a9ffe95c47f845f47a883c14dcb7ae64cdf6d4ce0a3e89bd1aa96ba8440958a4cb8294a78c648886d3e91e41a857
|
data/.travis.yml
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
-
|
1
|
+
notifications:
|
2
|
+
webhooks:
|
3
|
+
- https://webhook.commit-email.info/
|
4
|
+
|
2
5
|
language: ruby
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
matrix:
|
7
|
+
include:
|
8
|
+
- name: "2.3"
|
9
|
+
rvm: 2.3
|
10
|
+
- name: "2.4"
|
11
|
+
rvm: 2.4.5
|
12
|
+
- name: "2.5"
|
13
|
+
rvm: 2.5.3
|
14
|
+
- name: "2.6"
|
15
|
+
rvm: 2.6
|
16
|
+
- name: "trunk"
|
17
|
+
rvm: ruby-head
|
18
|
+
- name: "gem"
|
19
|
+
rvm: 2.6
|
20
|
+
install:
|
21
|
+
- rake install
|
22
|
+
script:
|
23
|
+
- mkdir -p tmp
|
24
|
+
- cd tmp
|
25
|
+
- cp -a ../test/ ./
|
26
|
+
- ../run-test.rb
|
data/NEWS.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# News
|
2
|
+
|
3
|
+
## 0.2.8 - 2019-01-24
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Stopped passing needless blocks.
|
8
|
+
|
9
|
+
* Added support for seconds only `<itunes:duration>`.
|
10
|
+
[GitHub#4][Reported by Jarvis Johnson]
|
11
|
+
[GitHub#5][Patch by Aitor García Rey]
|
12
|
+
|
13
|
+
### Thanks
|
14
|
+
|
15
|
+
* Jarvis Johnson
|
16
|
+
|
17
|
+
* Aitor García Rey
|
data/README.md
CHANGED
@@ -75,9 +75,9 @@ As you can see, this is a very Builder-like DSL. This code will spit out an Atom
|
|
75
75
|
|
76
76
|
## Development
|
77
77
|
|
78
|
-
After checking out the repo, run `
|
78
|
+
After checking out the repo, run `rake test` to run the tests.
|
79
79
|
|
80
|
-
To install this gem onto your local machine, run `
|
80
|
+
To install this gem onto your local machine, run `rake install`. To release a new version, update the version number in `lib/rss/version.rb`, and then run `rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
81
81
|
|
82
82
|
## Contributing
|
83
83
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
require "rake/testtask"
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
t.test_files = FileList["test/**/test_*.rb"]
|
3
|
+
desc "Run test"
|
4
|
+
task :test do
|
5
|
+
ruby("run-test.rb")
|
8
6
|
end
|
9
7
|
|
10
8
|
task :default => :test
|
data/lib/rss.rb
CHANGED
data/lib/rss/itunes.rb
CHANGED
@@ -277,34 +277,46 @@ module RSS
|
|
277
277
|
def parse(duration, do_validate=true)
|
278
278
|
if do_validate and /\A(?:
|
279
279
|
\d?\d:[0-5]\d:[0-5]\d|
|
280
|
-
[0-5]?\d:[0-5]\d
|
280
|
+
[0-5]?\d:[0-5]\d|
|
281
|
+
\d+
|
281
282
|
)\z/x !~ duration
|
282
283
|
raise ArgumentError,
|
283
|
-
"must be one of HH:MM:SS, H:MM:SS, MM
|
284
|
+
"must be one of HH:MM:SS, H:MM:SS, MM:SS, M:SS, S+: " +
|
284
285
|
duration.inspect
|
285
286
|
end
|
286
287
|
|
287
|
-
|
288
|
-
|
288
|
+
if duration.include?(':')
|
289
|
+
components = duration.split(':')
|
290
|
+
components[3..-1] = nil if components.size > 3
|
289
291
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
292
|
+
components.unshift("00") until components.size == 3
|
293
|
+
components.collect do |component|
|
294
|
+
component.to_i
|
295
|
+
end
|
296
|
+
else
|
297
|
+
seconds_to_components(duration.to_i)
|
294
298
|
end
|
295
299
|
end
|
296
300
|
|
297
|
-
def construct(
|
298
|
-
components = [
|
301
|
+
def construct(hours, minutes, seconds)
|
302
|
+
components = [minutes, seconds]
|
299
303
|
if components.include?(nil)
|
300
304
|
nil
|
301
305
|
else
|
302
|
-
components.unshift(
|
306
|
+
components.unshift(hours) if hours and hours > 0
|
303
307
|
components.collect do |component|
|
304
308
|
"%02d" % component
|
305
|
-
end.join(
|
309
|
+
end.join(':')
|
306
310
|
end
|
307
311
|
end
|
312
|
+
|
313
|
+
private
|
314
|
+
def seconds_to_components(total_seconds)
|
315
|
+
hours = total_seconds / (60 * 60)
|
316
|
+
minutes = (total_seconds / 60) % 60
|
317
|
+
seconds = total_seconds % 60
|
318
|
+
[hours, minutes, seconds]
|
319
|
+
end
|
308
320
|
end
|
309
321
|
|
310
322
|
content_setup
|
data/lib/rss/maker/0.9.rb
CHANGED
data/lib/rss/rss.rb
CHANGED
data/lib/rss/version.rb
ADDED
data/rss.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
begin
|
2
|
-
require_relative "lib/rss"
|
2
|
+
require_relative "lib/rss/version"
|
3
3
|
rescue LoadError
|
4
4
|
# for Ruby core repository
|
5
|
-
require_relative "
|
5
|
+
require_relative "version"
|
6
6
|
end
|
7
7
|
|
8
8
|
Gem::Specification.new do |spec|
|
@@ -16,18 +16,60 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.homepage = "https://github.com/ruby/rss"
|
17
17
|
spec.license = "BSD-2-Clause"
|
18
18
|
|
19
|
-
spec.files = [
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
spec.files = [
|
20
|
+
".gitignore",
|
21
|
+
".travis.yml",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"NEWS.md",
|
25
|
+
"README.md",
|
26
|
+
"Rakefile",
|
27
|
+
"lib/rss.rb",
|
28
|
+
"lib/rss/0.9.rb",
|
29
|
+
"lib/rss/1.0.rb",
|
30
|
+
"lib/rss/2.0.rb",
|
31
|
+
"lib/rss/atom.rb",
|
32
|
+
"lib/rss/content.rb",
|
33
|
+
"lib/rss/content/1.0.rb",
|
34
|
+
"lib/rss/content/2.0.rb",
|
35
|
+
"lib/rss/converter.rb",
|
36
|
+
"lib/rss/dublincore.rb",
|
37
|
+
"lib/rss/dublincore/1.0.rb",
|
38
|
+
"lib/rss/dublincore/2.0.rb",
|
39
|
+
"lib/rss/dublincore/atom.rb",
|
40
|
+
"lib/rss/image.rb",
|
41
|
+
"lib/rss/itunes.rb",
|
42
|
+
"lib/rss/maker.rb",
|
43
|
+
"lib/rss/maker/0.9.rb",
|
44
|
+
"lib/rss/maker/1.0.rb",
|
45
|
+
"lib/rss/maker/2.0.rb",
|
46
|
+
"lib/rss/maker/atom.rb",
|
47
|
+
"lib/rss/maker/base.rb",
|
48
|
+
"lib/rss/maker/content.rb",
|
49
|
+
"lib/rss/maker/dublincore.rb",
|
50
|
+
"lib/rss/maker/entry.rb",
|
51
|
+
"lib/rss/maker/feed.rb",
|
52
|
+
"lib/rss/maker/image.rb",
|
53
|
+
"lib/rss/maker/itunes.rb",
|
54
|
+
"lib/rss/maker/slash.rb",
|
55
|
+
"lib/rss/maker/syndication.rb",
|
56
|
+
"lib/rss/maker/taxonomy.rb",
|
57
|
+
"lib/rss/maker/trackback.rb",
|
58
|
+
"lib/rss/parser.rb",
|
59
|
+
"lib/rss/rexmlparser.rb",
|
60
|
+
"lib/rss/rss.rb",
|
61
|
+
"lib/rss/slash.rb",
|
62
|
+
"lib/rss/syndication.rb",
|
63
|
+
"lib/rss/taxonomy.rb",
|
64
|
+
"lib/rss/trackback.rb",
|
65
|
+
"lib/rss/utils.rb",
|
66
|
+
"lib/rss/version.rb",
|
67
|
+
"lib/rss/xml-stylesheet.rb",
|
68
|
+
"lib/rss/xml.rb",
|
69
|
+
"lib/rss/xmlparser.rb",
|
70
|
+
"lib/rss/xmlscanner.rb",
|
71
|
+
"rss.gemspec",
|
72
|
+
]
|
31
73
|
spec.bindir = "exe"
|
32
74
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
75
|
spec.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,10 +63,9 @@ files:
|
|
63
63
|
- ".travis.yml"
|
64
64
|
- Gemfile
|
65
65
|
- LICENSE.txt
|
66
|
+
- NEWS.md
|
66
67
|
- README.md
|
67
68
|
- Rakefile
|
68
|
-
- bin/console
|
69
|
-
- bin/setup
|
70
69
|
- lib/rss.rb
|
71
70
|
- lib/rss/0.9.rb
|
72
71
|
- lib/rss/1.0.rb
|
@@ -106,6 +105,7 @@ files:
|
|
106
105
|
- lib/rss/taxonomy.rb
|
107
106
|
- lib/rss/trackback.rb
|
108
107
|
- lib/rss/utils.rb
|
108
|
+
- lib/rss/version.rb
|
109
109
|
- lib/rss/xml-stylesheet.rb
|
110
110
|
- lib/rss/xml.rb
|
111
111
|
- lib/rss/xmlparser.rb
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "rss"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|