hyper_api 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +10 -0
- data/lib/hyper_api.rb +4 -3
- data/lib/hyper_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74fbf0a0e8dab4021c83ef58451f0dd4f0e0fad0
|
|
4
|
+
data.tar.gz: c37be3b50fb447e62ef35539c9315153753c2f5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73a1e0fd328481860f68a399609064897e1449740114f59ee9906ba67c46fb3173ca4169a4ab906e95994d4f93abc72a40a965e06d95e06dcd788b36c66fbfdd
|
|
7
|
+
data.tar.gz: de21596453cd07e4ca4266ce0d823db314d80fbbb0cfa7046e5c27b85b6663cf92294ef3d69d075cd475005c5ec82c6fc37500a6c6396c5b1d6820ca965f77d0
|
data/README.md
CHANGED
|
@@ -71,6 +71,16 @@ fringe.some_calculated_method
|
|
|
71
71
|
|
|
72
72
|
If you've found a bug or have a question, please open an issue on the [issue tracker](https://github.com/jassa/hyper_api/issues). Or, clone the HyperAPI repository, write a failing test case, fix the bug, and submit a pull request.
|
|
73
73
|
|
|
74
|
+
## Version History
|
|
75
|
+
|
|
76
|
+
**0.1.1** (Feb 17, 2014)
|
|
77
|
+
|
|
78
|
+
* Allow empty values for attributes when not found in HTML source.
|
|
79
|
+
|
|
80
|
+
**0.1.0** (Feb 16, 2014)
|
|
81
|
+
|
|
82
|
+
* Initial public release.
|
|
83
|
+
|
|
74
84
|
## License
|
|
75
85
|
|
|
76
86
|
Copyright © 2014 Javier Saldana
|
data/lib/hyper_api.rb
CHANGED
|
@@ -39,9 +39,10 @@ module HyperAPI
|
|
|
39
39
|
known_attributes.each do |attr, options|
|
|
40
40
|
type, path, block = options
|
|
41
41
|
|
|
42
|
-
value = html.css(path)
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
unless (value = html.css(path)).empty?
|
|
43
|
+
value = block ? value.instance_eval(&block) : value.text
|
|
44
|
+
value = value.send("to_#{type[0]}")
|
|
45
|
+
end
|
|
45
46
|
|
|
46
47
|
instance_variable_set("@#{attr}", value)
|
|
47
48
|
|
data/lib/hyper_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hyper_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Javier Saldana
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-02-
|
|
11
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|