one-eye-eater 0.1.17 → 0.1.19

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: 15904298bb77805501e8ccf2f94154afd16a69bc
4
- data.tar.gz: 5fb2cdc0832035c3637f6431c57b11fc32b20df0
3
+ metadata.gz: c1cbafab304a7fe6beecdb28c0e63c7370671cf4
4
+ data.tar.gz: a6e5007b600d0666fc7ee30655de8e538184df1f
5
5
  SHA512:
6
- metadata.gz: 77ec9c36c8ba744d19b9136017648e6008362f2a5a5c297dcd0162a4dbfef6fbad657ecd245e0e4f09c60355c1eb7c9bc2a474be0a543aa4e269ff3c1714b910
7
- data.tar.gz: cdeb5de9c77fa02d9b707858db8dd088529eb1f1606c637bf947a48a59b55cf81d3417f0e38a9929d5b52608b55cab4df14b72f247f93f542bb90eebd3579014
6
+ metadata.gz: c8914f5ee882484544264953542af3661571ea376eb4afbb05fe150b32879f88b47cf049cd8a35645109de6e92e4f7d96b1dbc950e955f3424e4661a9ea3d343
7
+ data.tar.gz: 3786ee3af10cce47079fa8aae30d00133fb67a8a5dd2de392aad74c24e9373a12cbaffde8a90a301dca8827f808781c6da6a8e60374390b7c4232984b7b189cf
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.17
1
+ 0.1.19
data/lib/api.rb CHANGED
@@ -51,6 +51,10 @@ module OneEye
51
51
  [name, options]
52
52
  end
53
53
 
54
+ def symbolize_keys(hash)
55
+ hash.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
56
+ end
57
+
54
58
  def standardize_options(options={})
55
59
  if options.class == Fixnum
56
60
  options = {id: options}
@@ -59,7 +63,7 @@ module OneEye
59
63
  @options[:query] = @options[:query].merge(options)
60
64
  @options[:body] = options.to_json
61
65
  @options[:headers] = {"Content-Type"=>"application/json"}
62
- @options
66
+ symbolize_keys(@options)
63
67
  end
64
68
  end
65
69
  end
data/lib/models/base.rb CHANGED
@@ -52,12 +52,12 @@ module OneEye
52
52
 
53
53
  def update(attributes={})
54
54
  self.attributes = attributes
55
- self.attributes = api.put(resources_url, non_nil_attributes)
55
+ self.attributes = api.put(resources_url, self.attributes)
56
56
  self
57
57
  end
58
58
 
59
59
  def destroy
60
- api.delete resources_url, non_nil_attributes
60
+ api.delete resources_url, attributes
61
61
  end
62
62
 
63
63
  def delete
@@ -81,13 +81,6 @@ module OneEye
81
81
  end
82
82
  end
83
83
 
84
- def non_nil_attributes
85
- instance_variables.inject Hash.new do |obj, key|
86
- obj[key.to_s[1..-1].to_sym] = instance_variable_get(key) unless instance_variable_get(key).nil?
87
- obj
88
- end
89
- end
90
-
91
84
  def api
92
85
  self.class.api
93
86
  end
@@ -2,7 +2,7 @@ require_relative "../base"
2
2
 
3
3
  module OneEye
4
4
  module Insights
5
- class SnapshotSuggestedGroups < OneEye::Base
5
+ class SnapshotSuggestedGroup < OneEye::Base
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@
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.17 ruby lib
5
+ # stub: one-eye-eater 0.1.19 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "one-eye-eater"
9
- s.version = "0.1.17"
9
+ s.version = "0.1.19"
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"]
@@ -35,16 +35,16 @@ Gem::Specification.new do |s|
35
35
  "lib/models/group_membership.rb",
36
36
  "lib/models/insights/insights.rb",
37
37
  "lib/models/insights/snapshot_performance.rb",
38
- "lib/models/insights/snapshot_suggested_groups.rb",
38
+ "lib/models/insights/snapshot_suggested_group.rb",
39
39
  "lib/models/insights/snapshot_usage.rb",
40
40
  "lib/models/school.rb",
41
41
  "lib/models/user.rb",
42
42
  "lib/one-eye-eater.rb",
43
43
  "one-eye-eater.gemspec",
44
- "spec/mock_urls.rb",
45
44
  "spec/models/base_spec.rb",
46
45
  "spec/one_eye_spec.rb",
47
- "spec/spec_helper.rb"
46
+ "spec/spec_helper.rb",
47
+ "spec/support/mock_urls.rb"
48
48
  ]
49
49
  s.homepage = "http://github.com/brettshollenberger/one-eye-eater"
50
50
  s.licenses = ["MIT"]
@@ -33,7 +33,7 @@ describe OneEye::Base do
33
33
  end
34
34
 
35
35
  it "replaces module names with URLs", :deep_module_nesting do
36
- expect(OneEye::Insights::SnapshotSuggestedGroups.find(55).school_id).to eq(406879)
36
+ expect(OneEye::Insights::SnapshotSuggestedGroup.find(55).school_id).to eq(406879)
37
37
  end
38
38
 
39
39
  it "dynamically dispatches custom finders", :finders do
@@ -53,7 +53,7 @@ describe OneEye::Base do
53
53
  @district = OneEye::District.create(:name => "YMCMB District")
54
54
  end
55
55
 
56
- it "creates instance via a backend post" do
56
+ it "creates instance via a backend post", :destroy do
57
57
  expect(@district.name).to eq("YMCMB District")
58
58
  @district.destroy
59
59
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "pry"
2
2
 
3
3
  Dir.glob("./lib/**/*.rb").each { |f| require f }
4
- Dir.glob("./spec/**/*.rb").each { |f| require f }
4
+ Dir.glob("./spec/support/**/*.rb").each { |f| require f }
5
5
 
6
6
  RSpec.configure do |config|
7
7
  include MockUrls
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: one-eye-eater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
@@ -202,16 +202,16 @@ files:
202
202
  - lib/models/group_membership.rb
203
203
  - lib/models/insights/insights.rb
204
204
  - lib/models/insights/snapshot_performance.rb
205
- - lib/models/insights/snapshot_suggested_groups.rb
205
+ - lib/models/insights/snapshot_suggested_group.rb
206
206
  - lib/models/insights/snapshot_usage.rb
207
207
  - lib/models/school.rb
208
208
  - lib/models/user.rb
209
209
  - lib/one-eye-eater.rb
210
210
  - one-eye-eater.gemspec
211
- - spec/mock_urls.rb
212
211
  - spec/models/base_spec.rb
213
212
  - spec/one_eye_spec.rb
214
213
  - spec/spec_helper.rb
214
+ - spec/support/mock_urls.rb
215
215
  homepage: http://github.com/brettshollenberger/one-eye-eater
216
216
  licenses:
217
217
  - MIT