pagespeedhelper 0.4.8 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pagespeedhelper.rb +5 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ff8226c6907c48de4b523d7ad267202347a6771
4
- data.tar.gz: 324067c982c5c41a33e09ee581b179d68cf09951
3
+ metadata.gz: 9bd2578f41e15a526e01f90c5125972d5f5c66ef
4
+ data.tar.gz: faaf54c499fa8c6188e6030e2dacea41f4f0cfba
5
5
  SHA512:
6
- metadata.gz: 6b66596a9436abd102ba13839af9fedd173c3625df9abb4285ac823271394371648a916ad2b1e1f1b59c0af9421b3121f0e51368eff9f23245bb51ede9c6edcf
7
- data.tar.gz: 665d0c0d6738fa0ee1621e20e5a3f88d2a42235c193d00df421f2945e38dd5eccfe9049a6909195ef95e30b79195bf791fd464478f8a13039837c9a1a55e8c37
6
+ metadata.gz: cd1c7de5993418030eb666402bc9b94d5e5f765c7af185e4f3de280493638da5cbf4639fde6dc88e21af16fe162ec55684f1614d8ba59dc962206cc161d22fe4
7
+ data.tar.gz: 137fbdcd7cb2ebe4121c9914ab8072d97e9ef2aa14d1ced59984cd76814c0a8f521e7b13658eb22942daeab588eda97d9f2abc6426bfd98978d8a0dc78ac9ed0
@@ -1,6 +1,7 @@
1
1
  require 'google/apis/pagespeedonline_v2'
2
2
  require 'google/apis'
3
3
  require 'logger'
4
+ require 'pry'
4
5
 
5
6
  class PagespeedHelper
6
7
 
@@ -17,7 +18,7 @@ class PagespeedHelper
17
18
  end
18
19
  end
19
20
 
20
- def query(urls, strategy="desktop", secure=false, conserve=false)
21
+ def query(urls, strategy="desktop", secure=false)
21
22
  @wait_time = 1
22
23
  data = Array.new
23
24
 
@@ -31,14 +32,14 @@ class PagespeedHelper
31
32
  results = send_request(url_list, strategy)
32
33
  end while rate_error?(results)
33
34
 
34
- conserve ? data.concat(PagespeedHelper.parse(results)) : data.concat(results)
35
+ block_given? ? yield(results) : data.concat(results)
36
+
35
37
  sleep(3)
36
38
  end
37
39
 
38
- data
40
+ data if !block_given?
39
41
  end
40
42
 
41
-
42
43
  def self.parse(data)
43
44
  results = Array.new
44
45
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagespeedhelper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirk Stennett
@@ -38,8 +38,8 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Utilizes Google's Api for ruby to batch query 20 websites at a time,
42
- and format the results.
41
+ description: Utilizes Google's Api for ruby to batch query 20 websites, accessible
42
+ immediately, and formattable.
43
43
  email: kirk.stennett@getg5.com
44
44
  executables: []
45
45
  extensions: []