one-eye-eater 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/api.rb +2 -1
- data/lib/models/base.rb +1 -1
- data/lib/models/group.rb +6 -0
- data/lib/models/group_membership.rb +6 -0
- data/one-eye-eater.gemspec +5 -3
- data/spec/models/base_spec.rb +14 -13
- data/spec/one_eye_spec.rb +3 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc8db83ea6ac323877f490faa5a122b1175a3b0d
|
4
|
+
data.tar.gz: 4be8aa7691b17577db81a9f8844a05a3c819463a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24a4ff387c034e3d1ff14916db9bb6fa39a7a5e13ba97db6f965465cc67183ae0fb78833f89f9369845f883df883fe2d0b2a86945e467d072474f8ef0aba8f38
|
7
|
+
data.tar.gz: 3ff92ef6ef53f2bc3bb66cc74df11f00cbea8080a7a1aef1aa7483b770b5e6424b445907ca8c522d8b7579bc698e892da002010bfc5de68d9c09b038c6a63408
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.15
|
data/lib/api.rb
CHANGED
@@ -45,7 +45,8 @@ module OneEye
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def standardize_request(http_method, name, options)
|
48
|
-
name =
|
48
|
+
name = "/#{name}"
|
49
|
+
# name = slash_name(name)
|
49
50
|
options = standardize_options(options)
|
50
51
|
name += "/#{options[:id]}" if options.keys.include? :id
|
51
52
|
[name, options]
|
data/lib/models/base.rb
CHANGED
data/lib/models/group.rb
ADDED
data/one-eye-eater.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: one-eye-eater 0.1.
|
5
|
+
# stub: one-eye-eater 0.1.15 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "one-eye-eater"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.15"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Brett Shollenberger"]
|
14
|
-
s.date = "2014-07-
|
14
|
+
s.date = "2014-07-10"
|
15
15
|
s.description = "Create, read, update, and destroy Edmodo data via the One Eye API."
|
16
16
|
s.email = "brett.shollenberger@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -31,6 +31,8 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/api.rb",
|
32
32
|
"lib/models/base.rb",
|
33
33
|
"lib/models/district.rb",
|
34
|
+
"lib/models/group.rb",
|
35
|
+
"lib/models/group_membership.rb",
|
34
36
|
"lib/models/school.rb",
|
35
37
|
"lib/models/user.rb",
|
36
38
|
"lib/one-eye-eater.rb",
|
data/spec/models/base_spec.rb
CHANGED
@@ -2,33 +2,34 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe OneEye::Base do
|
4
4
|
it "defines defaults", :defaults do
|
5
|
-
expect(OneEye::User.find(
|
5
|
+
expect(OneEye::User.find(41644529).admin_rights["institution"]).to eq "schools/404013"
|
6
6
|
expect(OneEye::User.new.admin_rights).to eq({})
|
7
7
|
end
|
8
8
|
|
9
9
|
it "finds by id", :find do
|
10
|
-
expect(OneEye::District.find(
|
10
|
+
expect(OneEye::District.find(22037).id).to eq(22037)
|
11
11
|
expect(OneEye::School.find(334517).id).to eq(334517)
|
12
12
|
expect(OneEye::User.find(34954995).id).to eq(34954995)
|
13
|
+
expect(OneEye::Group.find(110).id).to eq(110)
|
13
14
|
end
|
14
15
|
|
15
|
-
it "finds with a hash of options" do
|
16
|
-
expect(OneEye::District.find(:id =>
|
16
|
+
it "finds with a hash of options", :find do
|
17
|
+
expect(OneEye::District.find(:id => 22037).id).to eq(22037)
|
17
18
|
end
|
18
19
|
|
19
|
-
it "finds a collection of models using where" do
|
20
|
+
it "finds a collection of models using where", :where do
|
20
21
|
expect(OneEye::District.where.first.id).to eq(1)
|
21
22
|
expect(OneEye::School.where.first.id).to eq(1)
|
22
23
|
end
|
23
24
|
|
24
|
-
it "uses params to query with where" do
|
25
|
-
@schools = OneEye::School.where(:district_id =>
|
26
|
-
expect(@schools.first.abbreviated_name).to eq("OVOXO")
|
25
|
+
it "uses params to query with where", :where do
|
26
|
+
@schools = OneEye::School.where(:district_id => 22037)
|
27
|
+
expect(@schools.first.abbreviated_name).to eq("OVOXO Academy")
|
27
28
|
end
|
28
29
|
|
29
|
-
it "appropriately sets query key to where" do
|
30
|
-
@schools = OneEye::School.where(:district_id =>
|
31
|
-
expect(@schools.first.name).to eq("October's Very Own
|
30
|
+
it "appropriately sets query key to where", :where do
|
31
|
+
@schools = OneEye::School.where(:district_id => 22037, :query => "october")
|
32
|
+
expect(@schools.first.name).to eq("October's Very Own Academy")
|
32
33
|
end
|
33
34
|
|
34
35
|
it "sets attributes", :attributes do
|
@@ -52,8 +53,8 @@ describe OneEye::Base do
|
|
52
53
|
# end
|
53
54
|
# end
|
54
55
|
|
55
|
-
it "updates instances", :create
|
56
|
-
@district = OneEye::District.new(:id =>
|
56
|
+
it "updates instances", :create do
|
57
|
+
@district = OneEye::District.new(:id => 22037)
|
57
58
|
expect(@district.update(:motto => "Get Money Get Paid").motto).to eq("Get Money Get Paid")
|
58
59
|
|
59
60
|
@school = OneEye::School.new(:id => 334517)
|
data/spec/one_eye_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe OneEye do
|
|
4
4
|
|
5
5
|
StagingAPI = OneEye::API.new
|
6
6
|
|
7
|
-
it "translates method calls into urls" do
|
8
|
-
|
9
|
-
end
|
7
|
+
# it "translates method calls into urls" do
|
8
|
+
# expect(StagingAPI.districts(21417).parsed_response["id"]).to eq(21417)
|
9
|
+
# end
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: one-eye-eater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Shollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -198,6 +198,8 @@ files:
|
|
198
198
|
- lib/api.rb
|
199
199
|
- lib/models/base.rb
|
200
200
|
- lib/models/district.rb
|
201
|
+
- lib/models/group.rb
|
202
|
+
- lib/models/group_membership.rb
|
201
203
|
- lib/models/school.rb
|
202
204
|
- lib/models/user.rb
|
203
205
|
- lib/one-eye-eater.rb
|