webloc 0.0.1 → 0.1.0
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.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/README.md +4 -6
- data/lib/webloc/version.rb +1 -1
- data/lib/webloc.rb +1 -1
- data/test/webloc_test.rb +12 -1
- metadata +36 -55
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d9a56c2bca20e777c569936514d7ee8bc96fb683a7a2bd2f22b4cd5b031b6aaf
|
4
|
+
data.tar.gz: 3021c05bc2d572d30e7733ba046564be363631d563be0308aa07ee109ee0eaa7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f559ba319ffe258097182613651c7b700d828635ef70dab3bb38f0d0fba29892425e42af10a90bd955d21ca18744e9498dc9146f63bf59d7ef09b233ccc22b29
|
7
|
+
data.tar.gz: 8a5f22e11f55d1f80875bb471a095bbcd8348baeecc0c50ae8f5dad3e115cc04f22270b1055bf247e43698d4fae120001dc3dcb58eb6ae1d359c13d968bdf8b2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# webloc
|
2
2
|
|
3
|
-
*webloc* is a Ruby library that can read from and write to <tt>.webloc</tt> files as used on
|
3
|
+
*webloc* is a Ruby library that can read from and write to <tt>.webloc</tt> files as used on macOS.
|
4
4
|
|
5
|
-
It works on
|
5
|
+
It works on Ruby 1.8.7 and up, including Ruby 3.x. It appears to still work on macOS Monterey too, so I have made a quick tidy up and release for 2022!
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -10,18 +10,16 @@ It works on both Ruby 1.9.2 and 1.8.7 (though development is focused on 1.9.2).
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
It's pretty simple.
|
14
|
-
|
15
13
|
Reading a .webloc file:
|
16
14
|
|
17
15
|
Webloc.load(ARGV.first).url
|
18
16
|
|
19
17
|
Writing to a .webloc file:
|
20
18
|
|
21
|
-
Webloc.new('
|
19
|
+
Webloc.new('https://rubyweekly.com/').save('rubyweekly.webloc')
|
22
20
|
|
23
21
|
## License
|
24
22
|
|
25
|
-
Copyright (C) 2011 Peter Cooper
|
23
|
+
Copyright (C) 2011-2022 Peter Cooper
|
26
24
|
|
27
25
|
webloc is licensed under the terms of the MIT License
|
data/lib/webloc/version.rb
CHANGED
data/lib/webloc.rb
CHANGED
data/test/webloc_test.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'webloc'
|
3
|
+
require 'tempfile'
|
3
4
|
|
4
5
|
class WeblocTest < Test::Unit::TestCase
|
5
6
|
def test_webloc_object_requires_url
|
@@ -20,7 +21,17 @@ class WeblocTest < Test::Unit::TestCase
|
|
20
21
|
|
21
22
|
def test_webloc_generates_valid_data
|
22
23
|
data = File.read(File.dirname(__FILE__) + '/oldstyle.webloc')
|
23
|
-
data = data.force_encoding('binary') rescue data
|
24
24
|
assert_equal data, Webloc.new('https://github.com/peterc/webloc').data
|
25
25
|
end
|
26
|
+
|
27
|
+
def test_webloc_can_write_file
|
28
|
+
file = Tempfile.new('test-webloc')
|
29
|
+
begin
|
30
|
+
Webloc.new('https://github.com/peterc/webloc').save(file.path)
|
31
|
+
assert_equal Webloc.new('https://github.com/peterc/webloc').data, File.read(file.path)
|
32
|
+
ensure
|
33
|
+
file.close
|
34
|
+
file.unlink
|
35
|
+
end
|
36
|
+
end
|
26
37
|
end
|
metadata
CHANGED
@@ -1,46 +1,37 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: webloc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Peter Cooper
|
13
|
-
autorequire:
|
8
|
+
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: plist
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
31
20
|
type: :runtime
|
32
|
-
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
33
27
|
description: Webloc reads and writes .webloc files on OS X
|
34
|
-
email:
|
28
|
+
email:
|
35
29
|
- peter@petercooper.co.uk
|
36
30
|
executables: []
|
37
|
-
|
38
31
|
extensions: []
|
39
|
-
|
40
32
|
extra_rdoc_files: []
|
41
|
-
|
42
|
-
|
43
|
-
- .gitignore
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
44
35
|
- Gemfile
|
45
36
|
- README.md
|
46
37
|
- Rakefile
|
@@ -50,39 +41,29 @@ files:
|
|
50
41
|
- test/pliststyle.webloc
|
51
42
|
- test/webloc_test.rb
|
52
43
|
- webloc.gemspec
|
53
|
-
has_rdoc: true
|
54
44
|
homepage: http://github.com/peterc/webloc
|
55
45
|
licenses: []
|
56
|
-
|
57
|
-
post_install_message:
|
46
|
+
metadata: {}
|
47
|
+
post_install_message:
|
58
48
|
rdoc_options: []
|
59
|
-
|
60
|
-
require_paths:
|
49
|
+
require_paths:
|
61
50
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
-
|
64
|
-
requirements:
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
65
53
|
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
|
-
requirements:
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
73
58
|
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
- 0
|
77
|
-
version: "0"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
78
61
|
requirements: []
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
signing_key:
|
83
|
-
specification_version: 3
|
62
|
+
rubygems_version: 3.2.22
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
84
65
|
summary: Reads and writes .webloc files on OS X
|
85
|
-
test_files:
|
66
|
+
test_files:
|
86
67
|
- test/oldstyle.webloc
|
87
68
|
- test/pliststyle.webloc
|
88
69
|
- test/webloc_test.rb
|