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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f298d59968aae3fa680652c0b045d6b4ab551f8
4
- data.tar.gz: f45e878403ad0e42eb66912836b47aa4974726e8
3
+ metadata.gz: b081cf7ee1ddef23b4df6d82955438f54e626e87
4
+ data.tar.gz: 1be99808e2b23f445cd0155cf4e9f0410df67a59
5
5
  SHA512:
6
- metadata.gz: ab8e3ae038146523137ac88a67d08a333ea45d8524960f09df423ef19dd19361eb5a4d14f4f42c67f0ef532ae480306b796ac0a496e8755740bd16d78fac320e
7
- data.tar.gz: 820e029335b40e2037c7168299aeb1debe0741107c8c3375afe2fd91c43833aacce3de6c36a9be3e05044bb56ddbf27e62d8127b532849b48c133ea2ee902da3
6
+ metadata.gz: 456c2e5b1d097dfe6f06e7751630792971c25b3c63c6a19a56e4a5a484eedf0fe52e0ed081cf067a296399e75b417d19ae93a7a31aa5455fb2734fbc6078ffae
7
+ data.tar.gz: 9481b2f9acb212c5cd39496f61c3a1dac2f8ff0985e6279dd169e2b458d4e075e01dce48e1baf632a503d34099043e4c4b8278372b585ab01ad0b536274beafc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove (1.0.5)
4
+ maglove (1.0.7)
5
5
  actionpack (>= 4.0)
6
6
  activesupport (>= 4.0)
7
7
  bundler (~> 1.10)
@@ -1,3 +1,3 @@
1
1
  module MagLove
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.7"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer