yourkarma 0.0.1

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.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +28 -0
  7. data/Rakefile +2 -0
  8. data/bin/yourkarma +8 -0
  9. data/lib/yourkarma.rb +5 -0
  10. data/lib/yourkarma/benchmarker.rb +36 -0
  11. data/lib/yourkarma/cli.rb +195 -0
  12. data/lib/yourkarma/client.rb +61 -0
  13. data/lib/yourkarma/device.rb +35 -0
  14. data/lib/yourkarma/version.rb +3 -0
  15. data/spec/cassettes/.keep +0 -0
  16. data/spec/cassettes/CLI/output/connected_to_a_hotspot/.yml +86 -0
  17. data/spec/cassettes/CLI/output/connected_to_a_hotspot_without_an_assigned_WAN_IP_address/.yml +45 -0
  18. data/spec/cassettes/CLI/output/connected_to_the_internet/.yml +86 -0
  19. data/spec/cassettes/CLI/output/connected_to_the_internet_with_a_slow_connection/.yml +45 -0
  20. data/spec/cassettes/CLI/status_code/connected_to_a_hotspot/.yml +86 -0
  21. data/spec/cassettes/CLI/status_code/connected_to_a_hotspot_without_an_assigned_WAN_IP_address/.yml +45 -0
  22. data/spec/cassettes/CLI/status_code/connected_to_the_internet/.yml +86 -0
  23. data/spec/cassettes/CLI/status_code/connected_to_the_internet_with_a_slow_connection/.yml +45 -0
  24. data/spec/features/cli_spec.rb +77 -0
  25. data/spec/spec_helper.rb +22 -0
  26. data/spec/support/have_line_matching_matcher.rb +5 -0
  27. data/spec/support/vcr.rb +12 -0
  28. data/spec/units/benchmarker_spec.rb +50 -0
  29. data/spec/units/cli_argument_parser_spec.rb +26 -0
  30. data/spec/units/cli_reporter_spec.rb +61 -0
  31. data/spec/units/cli_spec.rb +41 -0
  32. data/spec/units/client_spec.rb +54 -0
  33. data/spec/units/device_spec.rb +21 -0
  34. data/what_karma.gemspec +30 -0
  35. metadata +167 -0
@@ -0,0 +1,3 @@
1
+ module YourKarma
2
+ VERSION = "0.0.1"
3
+ end
File without changes
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 22:02:23 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H4M36S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"74.60.178.162\",\"bsid\":\"00:00:02:07:44:E9\",\"rssi\":-75,\"cinr\":20,\"connectionduration\":\"P0Y0M0DT0H0M17S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:49:45 GMT
45
+ - request:
46
+ method: get
47
+ uri: http://yourkarma.com/dashboard
48
+ body:
49
+ encoding: US-ASCII
50
+ string: ''
51
+ headers:
52
+ Accept-Encoding:
53
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
+ Accept:
55
+ - "*/*"
56
+ User-Agent:
57
+ - Ruby
58
+ Host:
59
+ - yourkarma.com
60
+ response:
61
+ status:
62
+ code: 301
63
+ message: Moved Permanently
64
+ headers:
65
+ Content-Type:
66
+ - text/html
67
+ Date:
68
+ - Thu, 01 May 2014 12:49:45 GMT
69
+ Location:
70
+ - https://yourkarma.com/dashboard
71
+ Server:
72
+ - nginx
73
+ Status:
74
+ - 301 Moved Permanently
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ Content-Length:
78
+ - '0'
79
+ Connection:
80
+ - keep-alive
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ http_version:
85
+ recorded_at: Thu, 01 May 2014 12:49:46 GMT
86
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 21:59:03 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H25M15S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"N/A\",\"bsid\":\"N/A\",\"rssi\":\"N/A\",\"cinr\":\"N/A\",\"connectionduration\":\"P0Y0M0DT0H0M0S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:46:25 GMT
45
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 22:02:24 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H4M37S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"74.60.178.162\",\"bsid\":\"00:00:02:07:44:E9\",\"rssi\":-75,\"cinr\":21,\"connectionduration\":\"P0Y0M0DT0H0M18S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:49:46 GMT
45
+ - request:
46
+ method: get
47
+ uri: http://yourkarma.com/dashboard
48
+ body:
49
+ encoding: US-ASCII
50
+ string: ''
51
+ headers:
52
+ Accept-Encoding:
53
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
+ Accept:
55
+ - "*/*"
56
+ User-Agent:
57
+ - Ruby
58
+ Host:
59
+ - yourkarma.com
60
+ response:
61
+ status:
62
+ code: 301
63
+ message: Moved Permanently
64
+ headers:
65
+ Content-Type:
66
+ - text/html
67
+ Date:
68
+ - Thu, 01 May 2014 12:49:46 GMT
69
+ Location:
70
+ - https://yourkarma.com/dashboard
71
+ Server:
72
+ - nginx
73
+ Status:
74
+ - 301 Moved Permanently
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ Content-Length:
78
+ - '0'
79
+ Connection:
80
+ - keep-alive
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ http_version:
85
+ recorded_at: Thu, 01 May 2014 12:49:47 GMT
86
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 21:49:57 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H4M37S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"74.60.178.162\",\"bsid\":\"00:00:02:07:44:E9\",\"rssi\":-75,\"cinr\":21,\"connectionduration\":\"P0Y0M0DT0H0M18S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Wed, 30 Apr 2014 21:49:58 GMT
45
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 22:02:23 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H4M36S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"74.60.178.162\",\"bsid\":\"00:00:02:07:44:E9\",\"rssi\":-75,\"cinr\":20,\"connectionduration\":\"P0Y0M0DT0H0M17S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:49:45 GMT
45
+ - request:
46
+ method: get
47
+ uri: http://yourkarma.com/dashboard
48
+ body:
49
+ encoding: US-ASCII
50
+ string: ''
51
+ headers:
52
+ Accept-Encoding:
53
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
+ Accept:
55
+ - "*/*"
56
+ User-Agent:
57
+ - Ruby
58
+ Host:
59
+ - yourkarma.com
60
+ response:
61
+ status:
62
+ code: 301
63
+ message: Moved Permanently
64
+ headers:
65
+ Content-Type:
66
+ - text/html
67
+ Date:
68
+ - Thu, 01 May 2014 12:49:45 GMT
69
+ Location:
70
+ - https://yourkarma.com/dashboard
71
+ Server:
72
+ - nginx
73
+ Status:
74
+ - 301 Moved Permanently
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ Content-Length:
78
+ - '0'
79
+ Connection:
80
+ - keep-alive
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ http_version:
85
+ recorded_at: Thu, 01 May 2014 12:49:46 GMT
86
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 21:59:03 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H25M15S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"N/A\",\"bsid\":\"N/A\",\"rssi\":\"N/A\",\"cinr\":\"N/A\",\"connectionduration\":\"P0Y0M0DT0H0M0S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:46:25 GMT
45
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://hotspot.yourkarma.com/api/status.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - hotspot.yourkarma.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
26
+ Expires:
27
+ - "-1"
28
+ - "-1"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Date:
36
+ - Wed, 30 Apr 2014 22:02:24 GMT
37
+ Server:
38
+ - lighttpd/1.4.30-devel-4855
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\"device\":{\"name\":\"IMW-C918W\",\"swversion\":\"R4855\",\"hwversion\":\"R06\",\"uptime\":\"P0Y0M0DT0H4M37S\",\"batterypower\":100,\"charging\":false,\"waninterface\":{\"macaddress\":\"001E312C42D0\",\"ipaddress\":\"74.60.178.162\",\"bsid\":\"00:00:02:07:44:E9\",\"rssi\":-75,\"cinr\":21,\"connectionduration\":\"P0Y0M0DT0H0M18S\"},\"wifiinterface\":{\"ssid\":\"Karma
42
+ Wi-Fi\",\"users\":1}}}\r\n"
43
+ http_version:
44
+ recorded_at: Thu, 01 May 2014 12:49:46 GMT
45
+ - request:
46
+ method: get
47
+ uri: http://yourkarma.com/dashboard
48
+ body:
49
+ encoding: US-ASCII
50
+ string: ''
51
+ headers:
52
+ Accept-Encoding:
53
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
+ Accept:
55
+ - "*/*"
56
+ User-Agent:
57
+ - Ruby
58
+ Host:
59
+ - yourkarma.com
60
+ response:
61
+ status:
62
+ code: 301
63
+ message: Moved Permanently
64
+ headers:
65
+ Content-Type:
66
+ - text/html
67
+ Date:
68
+ - Thu, 01 May 2014 12:49:46 GMT
69
+ Location:
70
+ - https://yourkarma.com/dashboard
71
+ Server:
72
+ - nginx
73
+ Status:
74
+ - 301 Moved Permanently
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ Content-Length:
78
+ - '0'
79
+ Connection:
80
+ - keep-alive
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ http_version:
85
+ recorded_at: Thu, 01 May 2014 12:49:47 GMT
86
+ recorded_with: VCR 2.9.0