sensor 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDBiYmRkOWNkYzAzZTkwZGI3MzAyZjNiYjQxMDQ4YWE1ZjU1ZDA1Zg==
4
+ OWI2YWIwYWFiMTE5Njg3OGYyYTY0YmVkN2YxNTA1MWFmMTQzZmQxMA==
5
5
  data.tar.gz: !binary |-
6
- NWY0NGQyOGQ3NTVhYzk1YWU2MjJiYTJhNDNjZWQwZTZlNWE3NzhiYQ==
7
- !binary "U0hBNTEy":
6
+ ZjMyODZlY2ViYTMxMzAxZGUyZGJmMDJjMDNjY2FjNjRlYjI4Y2U4MA==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- MDhjMTJhMzkwM2QwOTZmNTVjZTFhMjA3ZjMxODBhYTY5MWI3ZDI1ODY5NDMx
10
- ODFhOGViMDhjOWE2YjMwYTVhZjVjYjk3ZjdiZjhkZjdjMzI3Nzg3ODZkY2I4
11
- MjM0ZDg1MDk1YjZjNjE4NjhhMzVmODkyY2IxZjJiMGVmZTZiZmE=
9
+ OGQxYWZlYzFjZDAwYjNhODg2NDQ0OWZhMTViNDlkMTAwNTEzMDRkYjU4ZWI2
10
+ ZmEyNWJlZWVlY2I3YTlmNjQ1Zjk5YjRhYTM5MzQ1NzI4MWJlOTIxYTUwNjFk
11
+ MzViZDVkZTQxYjlmOWUzY2NlZTFmN2ExNTQxNmM4ZTYwOGM2MzA=
12
12
  data.tar.gz: !binary |-
13
- MDhjMTlhZTg2NWRhOGQ2ODZiNTkxZDFhZmQ5ZTk1NWYxNWZjNDZiNDM4Zjhl
14
- NWYwYzJlNTIxZmIxMTZlZTUyMjVmMzhlZWYyZTQwY2I3MDliMmUzNDI2YzJl
15
- NzFjZTQ5OWQyMjk1ZDExYWVkODk2MDY4MGNhNWFmOWJkNTUyYWY=
13
+ YmNhMmM5NzlhOTFmNDE4ZTY1ZWE2N2RhZjgxMThiYmFjZThmYTAwMzVhMjM1
14
+ MTE5MjE5YzlmM2E0MDE0OTk5M2Q4NmQzYjZkYjkyNDJmOWQ0NjFhZDQ3Zjdk
15
+ OWM1ZjI2ZWRlOTk1MDQzZmE1YWRlNjkwZGMwMWIyMjYyMzlkYTU=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Sensor
2
2
 
3
- TODO: Write a gem description
3
+ A utility that reports metrics from social media and analytics providers.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,20 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ **This is in draft mode and is not yet stable for use**
22
+
23
+ Desired configuration:
24
+
25
+ ```ruby
26
+ Sensor.add_source :twitter, {
27
+ account: 'launchacademy_',
28
+ consumer_key: ENV['TWITTER_CONSUMER_KEY'],
29
+ consumer_secret: ENV['TWITTER_CONSUMER_SECRET'],
30
+ access_token: ENV['TWITTER_ACCESS_TOKEN'],
31
+ access_token_secret: ENV['TWITTER_ACCESS_TOKEN_SECRET']
32
+ },
33
+ metrics: [:followers, :tweets, :mentions]
34
+ ```
22
35
 
23
36
  ## Contributing
24
37
 
@@ -1,11 +1,11 @@
1
1
  require 'garb'
2
2
 
3
- CA_CERT_FILE = File.join(File.dirname(__FILE__),
4
- '../../../certs/cacert.pem')
5
-
6
3
  module Sensor
7
4
  module Actuator
8
5
  class AnalyticsRetrieval
6
+ CA_CERT_FILE = File.join(File.dirname(__FILE__),
7
+ '../../../certs/cacert.pem')
8
+
9
9
  extend Garb::Model
10
10
 
11
11
  metrics :visitors,
@@ -34,10 +34,16 @@ module Sensor
34
34
  end
35
35
  end
36
36
 
37
+ class << self
38
+ def enable_garb_ssl!
39
+ Garb.ca_cert_file = CA_CERT_FILE
40
+ end
41
+ end
42
+
37
43
  protected
38
44
  def client
39
45
  if !@client
40
- session = Garb::Session.login(analytics_user, analytics_password)
46
+ session = Garb::Session.login(analytics_user, analytics_password, secure: true)
41
47
  end
42
48
 
43
49
  end
@@ -66,3 +72,5 @@ module Sensor
66
72
  end
67
73
  end
68
74
  end
75
+
76
+ Sensor::Actuator::AnalyticsRetrieval.enable_garb_ssl!
@@ -7,9 +7,7 @@ Sensor.require("flow_dock")
7
7
 
8
8
  module Sensor
9
9
  class Payload
10
- attr_reader :data, :time_range
11
- delegate :start_date, to: :time_range
12
- delegate :end_date, to: :time_range
10
+ attr_reader :time_range, :data
13
11
 
14
12
  def initialize(time_range)
15
13
  @time_range = time_range
@@ -28,6 +26,14 @@ module Sensor
28
26
  Sensor::OutputDistribution::FlowDock.new(self).distribute
29
27
  end
30
28
 
29
+ def start_date
30
+ @time_range.start_date
31
+ end
32
+
33
+ def end_date
34
+ @time_range.end_date
35
+ end
36
+
31
37
  protected
32
38
  def actuator_classes
33
39
  Sensor.configuration.actuators
@@ -1,3 +1,3 @@
1
1
  module Sensor
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Pickett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-30 00:00:00.000000000 Z
11
+ date: 2014-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  requirements: []
250
250
  rubyforge_project:
251
- rubygems_version: 2.0.6
251
+ rubygems_version: 2.1.11
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: Marketing Metrics Acquisition Tool