maglove 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/maglove/version.rb +1 -1
- data/lib/powersnap.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b081cf7ee1ddef23b4df6d82955438f54e626e87
|
4
|
+
data.tar.gz: 1be99808e2b23f445cd0155cf4e9f0410df67a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 456c2e5b1d097dfe6f06e7751630792971c25b3c63c6a19a56e4a5a484eedf0fe52e0ed081cf067a296399e75b417d19ae93a7a31aa5455fb2734fbc6078ffae
|
7
|
+
data.tar.gz: 9481b2f9acb212c5cd39496f61c3a1dac2f8ff0985e6279dd169e2b458d4e075e01dce48e1baf632a503d34099043e4c4b8278372b585ab01ad0b536274beafc
|
data/Gemfile.lock
CHANGED
data/lib/maglove/version.rb
CHANGED
data/lib/powersnap.rb
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
class Powersnap
|
2
2
|
attr_accessor :urls, :prefix
|
3
3
|
|
4
|
+
class << self
|
5
|
+
def powersnap_config
|
6
|
+
@system_prefix ||= (File.exist?("powersnap.yml") ? YAML.load_file("powersnap.yml") : default_powersnap_config)
|
7
|
+
end
|
8
|
+
|
9
|
+
def default_powersnap_config
|
10
|
+
{ "prefix" => nil }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
4
14
|
def initialize(urls, prefix: nil)
|
15
|
+
prefix ||= self.class.powersnap_config["prefix"]
|
5
16
|
@urls = urls.map { |url| URI.encode(url) }
|
6
17
|
@prefix = prefix
|
7
18
|
end
|