the-city-admin 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/city_keys.rb +2 -2
- data/examples/measurements.rb +33 -0
- data/lib/api/metric_measurement_list.rb +1 -1
- data/thecity_admin_api.gemspec +1 -1
- metadata +10 -5
- checksums.yaml +0 -7
data/examples/city_keys.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# *******************************************
|
2
|
+
# This is a demo file to show usage.
|
3
|
+
#
|
4
|
+
# @package TheCity::Admin
|
5
|
+
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
|
6
|
+
# *******************************************
|
7
|
+
|
8
|
+
require 'ruby-debug'
|
9
|
+
require File.dirname(__FILE__) + '/../lib/the_city_admin.rb'
|
10
|
+
|
11
|
+
require File.dirname(__FILE__) + '/city_keys.rb'
|
12
|
+
include CityKeys
|
13
|
+
|
14
|
+
TheCity::AdminApi.connect(KEY, TOKEN)
|
15
|
+
|
16
|
+
|
17
|
+
puts "------------------------------------"
|
18
|
+
|
19
|
+
metric_list = TheCity::MetricList.new
|
20
|
+
if metric_list.empty?
|
21
|
+
puts "No metrics in list"
|
22
|
+
else
|
23
|
+
puts "Metrices: #{metric_list.count}"
|
24
|
+
end
|
25
|
+
|
26
|
+
measurement_list = TheCity::MetricMeasurementList.new({:metric_id => metric_list[0].id})
|
27
|
+
if metric_list.empty?
|
28
|
+
puts "No measurements in list"
|
29
|
+
else
|
30
|
+
puts "Measurements: #{measurement_list.count}"
|
31
|
+
end
|
32
|
+
|
33
|
+
puts "####################################"
|
@@ -43,7 +43,7 @@ module TheCity
|
|
43
43
|
|
44
44
|
# This method is needed for Enumerable.
|
45
45
|
def each &block
|
46
|
-
@json_data['measurements'].each{ |measurement| yield(
|
46
|
+
@json_data['measurements'].each{ |measurement| yield( MetricMeasurement.new(measurement) )}
|
47
47
|
end
|
48
48
|
|
49
49
|
# Alias the count method
|
data/thecity_admin_api.gemspec
CHANGED
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the-city-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Wes Hays
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: typhoeus
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - '='
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - '='
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -50,6 +53,7 @@ files:
|
|
50
53
|
- examples/donations.rb
|
51
54
|
- examples/familes.rb
|
52
55
|
- examples/groups.rb
|
56
|
+
- examples/measurements.rb
|
53
57
|
- examples/metrics.rb
|
54
58
|
- examples/roles.rb
|
55
59
|
- examples/skills.rb
|
@@ -322,26 +326,27 @@ files:
|
|
322
326
|
- thecity_admin_api.gemspec
|
323
327
|
homepage: https://github.com/thecity/thecity-admin-ruby
|
324
328
|
licenses: []
|
325
|
-
metadata: {}
|
326
329
|
post_install_message:
|
327
330
|
rdoc_options: []
|
328
331
|
require_paths:
|
329
332
|
- lib
|
330
333
|
required_ruby_version: !ruby/object:Gem::Requirement
|
334
|
+
none: false
|
331
335
|
requirements:
|
332
336
|
- - ! '>='
|
333
337
|
- !ruby/object:Gem::Version
|
334
338
|
version: '0'
|
335
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
|
+
none: false
|
336
341
|
requirements:
|
337
342
|
- - ! '>='
|
338
343
|
- !ruby/object:Gem::Version
|
339
344
|
version: '0'
|
340
345
|
requirements: []
|
341
346
|
rubyforge_project: Project on www.github.com
|
342
|
-
rubygems_version:
|
347
|
+
rubygems_version: 1.8.25
|
343
348
|
signing_key:
|
344
|
-
specification_version:
|
349
|
+
specification_version: 3
|
345
350
|
summary: Ruby gem/plugin to interact with The City Admin API (https://api.OnTheCity.org).
|
346
351
|
test_files:
|
347
352
|
- spec/api/address_list_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6d147ed640f51572cb74a790fd699ba743ad40d0
|
4
|
-
data.tar.gz: 08b7ddb497057590bb606dd0183701c5fc9a17c0
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 57a74ac69aa8676286d744f4ac16f5d097eb7242b9ff839db4a228eb781a1d060418c8b9a11965eef5fec40f63f931af34e6202fc2f589d6d4a303a1fe6fb5bc
|
7
|
-
data.tar.gz: d6b612e463248773b7ede579a2a2147f2f0aed82c8e7ed537eb8e6694038e9ac3e5b1b2454e3dd0836ab8b45f8e8680d8a2f3131a483ff58c420a88262427bde
|