thinkific 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6904cfb832971f742efae07c62ed4ba7b6ce9b8d
4
- data.tar.gz: c00ccad77d971c9b61c6f1ba90970e300d4e2021
3
+ metadata.gz: e9e7098e5eda6ed52d75fdd9ab071ed237dd5be5
4
+ data.tar.gz: 11787388042e396aff89b5040cc94d368685ccba
5
5
  SHA512:
6
- metadata.gz: 1d4165308d163a906711ef23b14c1e871a1e0b842db9e631d25573899b6da3cf8712cb84fb10a2c72da2c965cf4689c9ac288b1f3602496cdc9a754cf521cef8
7
- data.tar.gz: abf0c3bb55e676027131c674b985c9e4f343012fbe0bdbcddb3b8abf0a29c50eea93f970a88f080d1344ccfb9b95fe515785b4eb49f3e13454856415afced04b
6
+ metadata.gz: 37725de0a9a50a3846e63c4937625e91ba81a6a02f0c2a2b2c15a83c967a4c0b6ace04c21c7ab2cf8eedb59c25d798d45df317d3d27abf18c8c403927fa75394
7
+ data.tar.gz: 29b37220335d6d1e5da5d030ae524f09ad03924bd03354682a7a592281597be160112a7a468948f3c14e618079264a2275ccba74ec7337b18f685b7b08aa3e79
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem 'httparty'
3
4
 
4
5
  group :development do
5
6
  gem "shoulda", ">= 0"
data/Gemfile.lock CHANGED
@@ -24,6 +24,8 @@ GEM
24
24
  oauth2 (~> 1.0)
25
25
  hashie (3.5.7)
26
26
  highline (1.7.10)
27
+ httparty (0.16.2)
28
+ multi_xml (>= 0.5.2)
27
29
  i18n (1.0.1)
28
30
  concurrent-ruby (~> 1.0)
29
31
  jeweler (2.3.9)
@@ -79,6 +81,7 @@ PLATFORMS
79
81
 
80
82
  DEPENDENCIES
81
83
  bundler
84
+ httparty
82
85
  jeweler (~> 2.3.9)
83
86
  rdoc (~> 3.12)
84
87
  shoulda
data/README.md CHANGED
@@ -1,19 +1,18 @@
1
- = thinkific
2
1
 
3
- Description goes here.
2
+ # Thinkific gem
4
3
 
5
- == Contributing to thinkific
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
4
+ Thin wraper around thinkific.com API.
14
5
 
15
- == Copyright
6
+ # Develop
7
+ Set these in an initializer:
8
+ THINKIFIC_SUBDOMAIN = "<your-subdomain>"
9
+ THINKIFIC_KEY = "<your-key>"
16
10
 
17
- Copyright (c) 2018 v p. See LICENSE.txt for
18
- further details.
11
+ # Test
12
+ bundle exec rspec spec
13
+
14
+ ### Copyright
15
+
16
+ Copyright (c) 2018 Wasya Co
17
+ MIT license
19
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.2
data/lib/thinkific.rb CHANGED
@@ -30,5 +30,17 @@ new_user.update :last_name => 'Jackson'
30
30
  new_user.delete
31
31
  =end
32
32
 
33
+ module Thinkific
34
+ DOMAIN = 'https://api.thinkific.com'
35
+
36
+ HEADERS = {
37
+ 'Content-Type' => 'application/json',
38
+ 'X-Auth-Subdomain' => THINKIFIC_SUBDOMAIN,
39
+ 'X-Auth-API-Key' => THINKIFIC_KEY
40
+ }
41
+
42
+ end
43
+
44
+ require 'thinkific/course'
33
45
  require 'thinkific/user'
34
46
 
@@ -0,0 +1,17 @@
1
+ require 'httparty'
2
+
3
+ class Thinkific::Course
4
+
5
+ def self.all
6
+ result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/courses",
7
+ :headers => Thinkific::HEADERS,
8
+ :query => { :limit => 10000 }
9
+ rs = JSON.parse result.body
10
+ return rs['items']
11
+ end
12
+
13
+
14
+
15
+ end
16
+
17
+
@@ -1,8 +1,15 @@
1
+ require 'httparty'
2
+
3
+ class Thinkific::User
1
4
 
2
- class Thinkific::User do
3
5
  def self.get id
4
6
  puts "+++ get one user"
5
7
  end
8
+
9
+ def self.all
10
+ puts "+++ all users"
11
+ end
12
+
6
13
  end
7
14
 
8
15
 
data/thinkific.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: thinkific 0.0.0 ruby lib
5
+ # stub: thinkific 0.0.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "thinkific"
9
- s.version = "0.0.0"
9
+ s.version = "0.0.2"
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 = ["v p"]
14
- s.date = "2018-05-20"
14
+ s.date = "2018-05-22"
15
15
  s.description = "Thinkific is an online education / course management system. It has a public API. This gem wraps the API and gives you equivalent ruby objects to work with."
16
16
  s.email = "piousbox@vs-MacBook-Pro.local"
17
17
  s.extra_rdoc_files = [
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  "Rakefile",
28
28
  "VERSION",
29
29
  "lib/thinkific.rb",
30
+ "lib/thinkific/course.rb",
30
31
  "lib/thinkific/user.rb",
31
32
  "test/helper.rb",
32
33
  "test/test_thinkific.rb",
@@ -41,12 +42,14 @@ Gem::Specification.new do |s|
41
42
  s.specification_version = 4
42
43
 
43
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
+ s.add_runtime_dependency(%q<httparty>, [">= 0"])
44
46
  s.add_development_dependency(%q<shoulda>, [">= 0"])
45
47
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
46
48
  s.add_development_dependency(%q<bundler>, [">= 0"])
47
49
  s.add_development_dependency(%q<jeweler>, ["~> 2.3.9"])
48
50
  s.add_development_dependency(%q<simplecov>, [">= 0"])
49
51
  else
52
+ s.add_dependency(%q<httparty>, [">= 0"])
50
53
  s.add_dependency(%q<shoulda>, [">= 0"])
51
54
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
52
55
  s.add_dependency(%q<bundler>, [">= 0"])
@@ -54,6 +57,7 @@ Gem::Specification.new do |s|
54
57
  s.add_dependency(%q<simplecov>, [">= 0"])
55
58
  end
56
59
  else
60
+ s.add_dependency(%q<httparty>, [">= 0"])
57
61
  s.add_dependency(%q<shoulda>, [">= 0"])
58
62
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
59
63
  s.add_dependency(%q<bundler>, [">= 0"])
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinkific
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - v p
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-20 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: shoulda
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +112,7 @@ files:
98
112
  - Rakefile
99
113
  - VERSION
100
114
  - lib/thinkific.rb
115
+ - lib/thinkific/course.rb
101
116
  - lib/thinkific/user.rb
102
117
  - test/helper.rb
103
118
  - test/test_thinkific.rb