loco-liquid-filters 0.0.9 → 0.0.10
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.
- data/lib/loco/liquid/filters/version.rb +1 -1
- data/lib/loco/liquid/filters.rb +15 -0
- metadata +3 -9
data/lib/loco/liquid/filters.rb
CHANGED
@@ -3,6 +3,7 @@ require 'liquid'
|
|
3
3
|
require 'digest/md5'
|
4
4
|
require 'sanitize'
|
5
5
|
require 'uri'
|
6
|
+
require 'net/https'
|
6
7
|
|
7
8
|
module Loco
|
8
9
|
module Liquid
|
@@ -41,6 +42,20 @@ module Loco
|
|
41
42
|
def random(max, min = 1)
|
42
43
|
rand(min..max)
|
43
44
|
end
|
45
|
+
|
46
|
+
def httpsRestGet(domain,method, user, password)
|
47
|
+
http = Net::HTTP.new(domain, 443)
|
48
|
+
http.use_ssl = true
|
49
|
+
http.start do |http|
|
50
|
+
req = Net::HTTP::Get.new(method)
|
51
|
+
|
52
|
+
# we make an HTTP basic auth by passing the
|
53
|
+
# username and password
|
54
|
+
req.basic_auth user, password
|
55
|
+
|
56
|
+
resp = http.request(req)
|
57
|
+
resp.body
|
58
|
+
end
|
44
59
|
end
|
45
60
|
end
|
46
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loco-liquid-filters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -103,21 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- - ! '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
hash: -1868051506796147716
|
109
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
107
|
none: false
|
111
108
|
requirements:
|
112
109
|
- - ! '>='
|
113
110
|
- !ruby/object:Gem::Version
|
114
111
|
version: '0'
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
hash: -1868051506796147716
|
118
112
|
requirements: []
|
119
113
|
rubyforge_project:
|
120
|
-
rubygems_version: 1.8.
|
114
|
+
rubygems_version: 1.8.23
|
121
115
|
signing_key:
|
122
116
|
specification_version: 3
|
123
117
|
summary: Liquid filters for Citrrus' LocomotiveCMS site
|