one-eye-eater 0.1.14 → 0.1.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f36556a0b6201bf70b06ad3a3ec3836b26b3554e
4
- data.tar.gz: 6c844d8f7cf7de88044e592593c142d9598c01f1
3
+ metadata.gz: fc8db83ea6ac323877f490faa5a122b1175a3b0d
4
+ data.tar.gz: 4be8aa7691b17577db81a9f8844a05a3c819463a
5
5
  SHA512:
6
- metadata.gz: 64e86d23bbe205b0a56cb91ae0c52fdf07a62509494071993030607f88f2e5be0dd06f5aadff01b0dcddfc01071388271dfbe94e7f53de74e9a420ed59595091
7
- data.tar.gz: fc6342a518d07df65c2c703cbc2ba34036a1f15790c17b9ec83318a5a709097b557ad2cb55e50a6da6ffb80133ec45f7eda99adca27617716d1c9ae624a2cf1b
6
+ metadata.gz: 24a4ff387c034e3d1ff14916db9bb6fa39a7a5e13ba97db6f965465cc67183ae0fb78833f89f9369845f883df883fe2d0b2a86945e467d072474f8ef0aba8f38
7
+ data.tar.gz: 3ff92ef6ef53f2bc3bb66cc74df11f00cbea8080a7a1aef1aa7483b770b5e6424b445907ca8c522d8b7579bc698e892da002010bfc5de68d9c09b038c6a63408
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.14
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 = slash_name(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
@@ -87,7 +87,7 @@ module OneEye
87
87
 
88
88
  private
89
89
  def self.resources_url
90
- self.name.gsub(/\w+\:\:/) {}.downcase.pluralize
90
+ self.name.gsub(/\w+\:\:/) {}.underscore.downcase.pluralize
91
91
  end
92
92
 
93
93
  def method_missing(name, *args, &block)
@@ -0,0 +1,6 @@
1
+ require_relative "./base"
2
+
3
+ module OneEye
4
+ class Group < OneEye::Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require_relative "./base"
2
+
3
+ module OneEye
4
+ class GroupMembership < OneEye::Base
5
+ end
6
+ end
@@ -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.14 ruby lib
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.14"
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-02"
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",
@@ -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(34961739).admin_rights["institution"]).to eq "schools/334645"
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(21417).id).to eq(21417)
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 => 21417).id).to eq(21417)
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 => 21417)
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 => 21417, :query => "october")
31
- expect(@schools.first.name).to eq("October's Very Own School")
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 => true do
56
- @district = OneEye::District.new(:id => 21417)
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
- expect(StagingAPI.districts(21417).parsed_response["id"]).to eq(21417)
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.14
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-02 00:00:00.000000000 Z
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