lessonly 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1ff429ef85e9a98a1543fbc40d6b42c48d96bf49
4
+ data.tar.gz: e2aa88b795df509bc573775f6ce1d314ed8af751
5
+ SHA512:
6
+ metadata.gz: d1eb532602d1e19a14a5fed4751cad77563e60001ab88ec9242dc0650ebb57ac0d6799212a96d488d825b5836b34a41da76095457fe02e563e9961b89fa9823a
7
+ data.tar.gz: 453a025eb5a12c0e6e12d9fbbb6b10d8aefc7f0a5f10a42db553f5b0d4f7ae9d717f0cb8340e77cc25e7edb7c8a2e38979c8d85c12939525de56434f3c616480
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /spec/fixtures/vcr_cassettes
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in lessonly.gemspec
4
+ gemspec
@@ -0,0 +1,53 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features)
6
+
7
+ ## Uncomment to clear the screen before every task
8
+ # clearing :on
9
+
10
+ ## Guard internally checks for changes in the Guardfile and exits.
11
+ ## If you want Guard to automatically start up again, run guard in a
12
+ ## shell loop, e.g.:
13
+ ##
14
+ ## $ while bundle exec guard; do echo "Restarting Guard..."; done
15
+ ##
16
+ ## Note: if you are using the `directories` clause above and you are not
17
+ ## watching the project directory ('.'), then you will want to move
18
+ ## the Guardfile to a watched dir and symlink it back, e.g.
19
+ #
20
+ # $ mkdir config
21
+ # $ mv Guardfile config/
22
+ # $ ln -s config/Guardfile .
23
+ #
24
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
25
+
26
+ # Note: The cmd option is now required due to the increasing number of ways
27
+ # rspec may be run, below are examples of the most common uses.
28
+ # * bundler: 'bundle exec rspec'
29
+ # * bundler binstubs: 'bin/rspec'
30
+ # * spring: 'bin/rspec' (This will use spring if running and you have
31
+ # installed the spring binstubs per the docs)
32
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
33
+ # * 'just' rspec: 'rspec'
34
+
35
+ guard :rspec, cmd: "bundle exec rspec" do
36
+ require "guard/rspec/dsl"
37
+ dsl = Guard::RSpec::Dsl.new(self)
38
+
39
+ # Feel free to open issues for suggestions and improvements
40
+
41
+ # RSpec files
42
+ rspec = dsl.rspec
43
+ watch(rspec.spec_helper) { rspec.spec_dir }
44
+ watch(rspec.spec_support) { rspec.spec_dir }
45
+ watch(rspec.spec_files)
46
+
47
+ # Ruby files
48
+ ruby = dsl.ruby
49
+ dsl.watch_spec_files_for(ruby.lib_files)
50
+
51
+ # lib/lessonly files
52
+ watch(%r{^lib/.+/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
53
+ end
@@ -0,0 +1,41 @@
1
+ # Lessonly
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lessonly`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'lessonly'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install lessonly
22
+
23
+ ## Usage
24
+
25
+ Configuration:
26
+
27
+ ```ruby
28
+ ENV["LESSONLY_SUBDOMAIN"] = "my_subdomain"
29
+ ENV["LESSONLY_API_KEY"] = "my_api_key"
30
+ ```
31
+
32
+ ## Development
33
+
34
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+
36
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+
38
+ ## Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lessonly.
41
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "lessonly"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'lessonly/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "lessonly"
8
+ spec.version = Lessonly::VERSION
9
+ spec.authors = ["Lesson.ly"]
10
+ spec.email = ["support@lesson.ly"]
11
+
12
+ spec.summary = %q{A ruby wrapper for the Lesson.ly API.}
13
+ spec.description = %q{A ruby wrapper for the Lesson.ly API.}
14
+ spec.homepage = "https://github.com/lessonly/lessonly-ruby"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.10"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec", "~> 3.0"
24
+ spec.add_development_dependency "guard-rspec", "~> 4.0"
25
+ spec.add_development_dependency "webmock", "~> 1.0"
26
+ spec.add_development_dependency "vcr", "~> 2.0"
27
+
28
+ spec.add_dependency "httparty", "~> 0.13.5"
29
+ end
@@ -0,0 +1,5 @@
1
+ require "lessonly/version"
2
+ require "httparty"
3
+ require "lessonly/user"
4
+ require "lessonly/group"
5
+ require "lessonly/lesson"
@@ -0,0 +1,26 @@
1
+ module Lessonly
2
+ class Group
3
+ include HTTParty
4
+ base_uri "https://api.lesson.ly/api/v1"
5
+ basic_auth ENV.fetch("LESSONLY_SUBDOMAIN"), ENV.fetch("LESSONLY_API_KEY")
6
+
7
+ def self.find(id)
8
+ user_data = get("/groups/#{id}").parsed_response
9
+ new(user_data)
10
+ end
11
+
12
+ def self.all
13
+ users_data = get("/groups").parsed_response
14
+ users_data["groups"].map { |data| new(data) }
15
+ end
16
+
17
+ attr_reader :id, :name, :members, :managers
18
+
19
+ def initialize(response)
20
+ @id = response["id"]
21
+ @name = response["name"]
22
+ @members = response["members"]
23
+ @managers = response["managers"]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Lessonly
2
+ class Lesson
3
+ include HTTParty
4
+ base_uri "https://api.lesson.ly/api/v1"
5
+ basic_auth ENV.fetch("LESSONLY_SUBDOMAIN"), ENV.fetch("LESSONLY_API_KEY")
6
+
7
+ def self.find(id)
8
+ lesson_data = get("/lessons/#{id}").parsed_response
9
+ new(lesson_data)
10
+ end
11
+
12
+ def self.all
13
+ lessons_data = get("/lessons").parsed_response
14
+ lessons_data["lessons"].map { |data| new(data) }
15
+ end
16
+
17
+ attr_reader :id, :title, :assignees_count, :completed_count
18
+
19
+ def initialize(response)
20
+ @id = response["id"]
21
+ @title = response["title"]
22
+ @assignees_count = response["assignees_count"]
23
+ @completed_count = response["completed_count"]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ module Lessonly
2
+ class User
3
+ include HTTParty
4
+ base_uri "https://api.lesson.ly/api/v1"
5
+ basic_auth ENV.fetch("LESSONLY_SUBDOMAIN"), ENV.fetch("LESSONLY_API_KEY")
6
+
7
+ def self.find(id)
8
+ user_data = get("/users/#{id}").parsed_response
9
+ new(user_data)
10
+ end
11
+
12
+ def self.all
13
+ users_data = get("/users").parsed_response
14
+ users_data["users"].map { |data| new(data) }
15
+ end
16
+
17
+ attr_reader :id, :email, :name, :role, :custom_user_field_data
18
+
19
+ def initialize(response)
20
+ @id = response["id"]
21
+ @email = response["email"]
22
+ @name = response["name"]
23
+ @role = response["role"]
24
+ @custom_user_field_data = response["custom_user_field_data"]
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,3 @@
1
+ module Lessonly
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lessonly
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Lesson.ly
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: httparty
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.13.5
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.13.5
111
+ description: A ruby wrapper for the Lesson.ly API.
112
+ email:
113
+ - support@lesson.ly
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
+ - Gemfile
122
+ - Guardfile
123
+ - README.md
124
+ - Rakefile
125
+ - bin/console
126
+ - bin/setup
127
+ - lessonly.gemspec
128
+ - lib/lessonly.rb
129
+ - lib/lessonly/group.rb
130
+ - lib/lessonly/lesson.rb
131
+ - lib/lessonly/user.rb
132
+ - lib/lessonly/version.rb
133
+ homepage: https://github.com/lessonly/lessonly-ruby
134
+ licenses: []
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options: []
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 2.4.5
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: A ruby wrapper for the Lesson.ly API.
156
+ test_files: []