pco-url 1.4.0 → 1.5.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 +4 -4
- data/lib/pco/url.rb +4 -2
- data/lib/pco/url/version.rb +1 -1
- data/spec/pco_url_spec.rb +6 -2
- 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: be3eb46f919cb623fbb6232e443ab60a6313c84a
|
4
|
+
data.tar.gz: 9b18a5461d22051ea2922280b96413b2419a79c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25db8d4fe497d0cabf40702822877b6528fdf9c9da48a49e004541077bdae1154fe2a2732caa98276ffcfe3855df63a54352e1b1e56dd0c4287405cb97a709e2
|
7
|
+
data.tar.gz: 073305bdf03bccc3d17ce0d6ed8ab83ff685a34ec3714fed009ee3f321de61db96742f3649f0b4dc2cefc7eebe0b66c07d0bf739788fe04469de263999142720
|
data/lib/pco/url.rb
CHANGED
@@ -48,8 +48,10 @@ module PCO
|
|
48
48
|
attr_reader :query
|
49
49
|
|
50
50
|
def initialize(app_name:, path: nil, query: nil, encrypt_query_params: false)
|
51
|
-
@app_name
|
52
|
-
@path
|
51
|
+
@app_name = app_name.to_s.gsub("_", "-")
|
52
|
+
@path = path
|
53
|
+
|
54
|
+
@path = @path[1..-1] if @path && @path[0] == "/"
|
53
55
|
|
54
56
|
if query
|
55
57
|
@query = encrypt_query_params ? "_e=#{URLcrypt.encrypt(query)}" : query
|
data/lib/pco/url/version.rb
CHANGED
data/spec/pco_url_spec.rb
CHANGED
@@ -177,7 +177,7 @@ describe PCO::URL do
|
|
177
177
|
|
178
178
|
it 'sets the app_name and path attrs' do
|
179
179
|
expect(subject.app_name).to eq('people')
|
180
|
-
expect(subject.path).to eq('
|
180
|
+
expect(subject.path).to eq('households/2.json')
|
181
181
|
end
|
182
182
|
end
|
183
183
|
|
@@ -188,7 +188,7 @@ describe PCO::URL do
|
|
188
188
|
|
189
189
|
it 'sets the app_name, path, and query attrs' do
|
190
190
|
expect(subject.app_name).to eq('people')
|
191
|
-
expect(subject.path).to eq('
|
191
|
+
expect(subject.path).to eq('households/2.html')
|
192
192
|
expect(subject.query).to eq('full_access=1&total_control=1')
|
193
193
|
end
|
194
194
|
|
@@ -207,6 +207,10 @@ describe PCO::URL do
|
|
207
207
|
it "decrypts the encrypted portion and appends the unencrypted portion" do
|
208
208
|
expect(subject.query).to eq('full_access=1&total_control=1&foo=bar')
|
209
209
|
end
|
210
|
+
|
211
|
+
it "returns the full url" do
|
212
|
+
expect(subject.to_s).to eq('https://people-staging.planningcenteronline.com/households/2.html?full_access=1&total_control=1&foo=bar')
|
213
|
+
end
|
210
214
|
end
|
211
215
|
end
|
212
216
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pco-url
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: urlcrypt
|