strongmind-schoology-client 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 271745541c3bb94e1ef9eded32dd55cf25bc3d78913b02214244f33ac2fb1456
4
- data.tar.gz: d2b1548b934b5cd2779864d22ce82417b6438eae8d6081b8e45f96f5eaf1a8ce
3
+ metadata.gz: ae95f00744a8364f799342056301ff99f387a757117fce80f3d0819530fc20c0
4
+ data.tar.gz: a5a88caa7e2dbbb42f4d54662e38ff42b75b22a665d8ad2ba110a4c5135dbd21
5
5
  SHA512:
6
- metadata.gz: fc5cebfd760eb646c78e27693524e651dd90b63516f77d58df9c1f0bce382bf27028948504fdb63aa7e4d5d7ca572507efd3abd6f8134f816696d181e5cd4a97
7
- data.tar.gz: 78bd3b4d61b96a38338ee5af1a554ac0cd1e199634d589eaf63963a2462893d975cdec52eb2773e1803bfeaf91783d1b7b2544a32ef97f3bc518fb38946dd93f
6
+ metadata.gz: 33a8aa9d22200d827dc09189f705b2ff1c9f721e3733de1b9283e8264bc664a48697a5ae428e5d9f64f0c09b2ce82f11aaf7a13bcf94d3af27c1f72f025f21e6
7
+ data.tar.gz: 7b3a45d2eb4531ef612056ff3bfa433df05e114c5580444a371d280e52dfbb63950e852311ffa02f4918cd4ff63f047252c313b33f068a8704fcb1b0404d949e
data/Gemfile.lock CHANGED
@@ -4,9 +4,9 @@ PATH
4
4
  strongmind-schoology-client (0.1.2)
5
5
  faraday (~> 1.1)
6
6
  faraday_middleware (~> 1.2)
7
- oauth (~> 1.1)
8
7
  rails (~> 7.0)
9
8
  railties (~> 7.0)
9
+ simple_oauth (~> 0.3.1)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
@@ -209,6 +209,7 @@ GEM
209
209
  parser (>= 3.2.1.0)
210
210
  ruby-progressbar (1.13.0)
211
211
  ruby2_keywords (0.0.5)
212
+ simple_oauth (0.3.1)
212
213
  snaky_hash (2.0.1)
213
214
  hashie
214
215
  version_gem (~> 1.1, >= 1.1.1)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require 'faraday'
3
3
  require 'faraday_middleware'
4
- require 'oauth'
4
+ require 'simple_oauth'
5
5
 
6
6
  module SchoologyClient
7
7
  class Client
@@ -22,33 +22,18 @@ module SchoologyClient
22
22
  end
23
23
 
24
24
  def connection
25
-
26
- # Set up the OAuth 1.0 consumer
27
- consumer = OAuth::Consumer.new(
28
- @oauth_consumer_key,
29
- @oauth_consumer_secret,
30
- site: @url,
31
- scheme: :header,
32
- signature_method: 'PLAINTEXT',
33
- realm: 'Schoology API'
34
- )
35
-
36
- # Set up the Faraday connection
37
- connection = Faraday.new("#{@url}") do |conn|
38
- conn.request :url_encoded
39
- conn.request :json
40
-
41
- conn.response :dates
42
- conn.response :json, content_type: "application/json"
43
-
44
- if @stubs
45
- conn.adapter adapter, @stubs
46
- else
47
- conn.adapter adapter
48
- end
25
+ # setup faraday connection using 2-legged oauth 1.0
26
+ connection = Faraday.new(url: @url) do |faraday|
27
+ faraday.request :json
28
+ faraday.request :oauth, {
29
+ consumer_key: @oauth_consumer_key,
30
+ consumer_secret: @oauth_consumer_secret
31
+ }
32
+
33
+ faraday.response :json
34
+ faraday.adapter @adapter, @stubs
49
35
  end
50
-
51
- return connection
36
+ connection
52
37
  end
53
38
 
54
39
  end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generatorsi'
4
- require 'schoology_client'
3
+ require 'rails/generators/base'
5
4
 
6
- module SchoologyApi
5
+ module SchoologyClient
7
6
  module Generators
7
+
8
8
  class InstallGenerator < Rails::Generators::Base
9
9
  source_root File.expand_path("../../templates", __FILE__)
10
10
 
11
- desc "Generate SchoologyClient initializer file for Rails applications"
11
+ desc "Generate Strongmind Schoology Client initializer file for Rails applications"
12
12
 
13
13
  def copy_initializer
14
14
  template "schoology_api.rb", "config/initializers/schoology_api.rb"
@@ -4,8 +4,7 @@ require 'json'
4
4
  module SchoologyClient
5
5
  class GroupResource < Resource
6
6
  def create(**attributes)
7
- response_body = post_request("groups", body: attributes.to_json).body
8
- return GroupResource.new(response_body)
7
+ GroupResource.new post_request("groups", body: attributes.to_json).body
9
8
  end
10
9
  end
11
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SchoologyClient
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -2,10 +2,9 @@
2
2
 
3
3
  require "faraday"
4
4
  require "faraday_middleware"
5
- require "rails/all"
5
+ require "rails"
6
6
  require_relative "schoology_client/version"
7
7
 
8
-
9
8
  module SchoologyClient
10
9
 
11
10
  class << self
@@ -17,7 +16,6 @@ module SchoologyClient
17
16
  autoload :Object, "schoology_client/object"
18
17
  autoload :Resource, "schoology_client/resource"
19
18
  autoload :Error, "schoology_client/error"
20
- autoload :Railtie, "schoology_client/railtie"
21
19
 
22
20
  # High-level categories of Schoology API calls
23
21
  autoload :GroupResource, "schoology_client/resources/group"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-schoology-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Strongmind
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: oauth
42
+ name: simple_oauth
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.1'
47
+ version: 0.3.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.1'
54
+ version: 0.3.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,13 @@ files:
100
100
  - lib/schoology_client/client.rb
101
101
  - lib/schoology_client/configuration.rb
102
102
  - lib/schoology_client/error.rb
103
- - lib/schoology_client/generators/schoology_api/install_generator.rb
103
+ - lib/schoology_client/generators/schoology_client/install_generator.rb
104
+ - lib/schoology_client/generators/templates/schoology_client_initializer.rb
104
105
  - lib/schoology_client/object.rb
105
106
  - lib/schoology_client/objects/group.rb
106
107
  - lib/schoology_client/resource.rb
107
108
  - lib/schoology_client/resources/group.rb
108
109
  - lib/schoology_client/version.rb
109
- - lib/templates/rails/initializer/schoology-client.rb.tt
110
- - lib/templates/schoology_client_initializer.rb
111
110
  - sig/schoology.rbs
112
111
  homepage: https://github.com/Strongmind/schoology-client
113
112
  licenses: []