moodle 0.1.0 → 0.1.1

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.
@@ -1,13 +1,21 @@
1
- Gem::Specification.new do |spec|
2
- spec.name = 'moodle'
3
- spec.version = '0.1.0'
4
- spec.date = '2014-03-01'
5
- spec.summary = "Moodle web services from ruby"
6
- spec.description = "Interact with Moodle from ruby"
7
- spec.authors = ["Robert Boloc"]
8
- spec.email = 'robertboloc@gmail.com'
9
- spec.files = `git ls-files`.split("\n")
10
- spec.homepage =
11
- 'http://robertboloc.github.com/moodle'
12
- spec.license = 'MIT'
13
- end
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'moodle'
3
+ spec.version = '0.1.1'
4
+ spec.date = Date.today.to_s
5
+ spec.summary = "Moodle web services from ruby"
6
+ spec.description = "Interact with Moodle from ruby"
7
+ spec.authors = ["Robert Boloc"]
8
+ spec.email = 'robertboloc@gmail.com'
9
+ spec.files = `git ls-files`.split("\n")
10
+ spec.homepage =
11
+ 'http://robertboloc.github.com/moodle'
12
+ spec.license = 'MIT'
13
+
14
+ spec.add_runtime_dependency 'rest-client', '~> 1.8'
15
+ spec.add_runtime_dependency 'hashie', '~> 3.4'
16
+ spec.add_runtime_dependency 'json', '~> 1.8'
17
+
18
+ spec.add_development_dependency 'rake', '~> 11.1'
19
+ spec.add_development_dependency 'simplecov', '~> 0.11'
20
+ spec.add_development_dependency 'mocha', '~> 1.1'
21
+ end
@@ -1,2 +1,2 @@
1
- username: 'test_username'
1
+ username: 'test_username'
2
2
  password: 'test_password'
@@ -1,34 +1,34 @@
1
- require 'test_helper'
2
- require 'moodle/client'
3
-
4
- class ClientTest < Test::Unit::TestCase
5
- # Test initialization with hash
6
- def test_initialize_with_hash
7
- client = Moodle::Client.new({
8
- :username => 'test_username',
9
- :password => 'test_password',
10
- :domain => 'test_domain',
11
- :protocol => 'test_protocol',
12
- :service => 'test_service',
13
- :format => 'test_format',
14
- :token => 'test_token'
15
- })
16
-
17
- assert_equal 'test_username', client.username
18
- assert_equal 'test_password', client.password
19
- assert_equal 'test_domain', client.domain
20
- assert_equal 'test_protocol', client.protocol
21
- assert_equal 'test_service', client.service
22
- assert_equal 'test_format', client.format
23
- assert_equal 'test_token', client.token
24
- end
25
-
26
- # Test obtaining a token
27
- def test_obtain_token
28
- client = Moodle::Protocol::Rest.new
29
- client.stubs(:request).returns('{"token" : "12345"}')
30
- moodle_client = Moodle::Client.new({:token => 'dummy', :domain => 'test'})
31
- moodle_client.stubs(:client).returns(client)
32
- assert_equal '12345', moodle_client.obtain_token()
33
- end
1
+ require 'test_helper'
2
+ require 'moodle/client'
3
+
4
+ class ClientTest < Test::Unit::TestCase
5
+ # Test initialization with hash
6
+ def test_initialize_with_hash
7
+ client = Moodle::Client.new({
8
+ :username => 'test_username',
9
+ :password => 'test_password',
10
+ :domain => 'test_domain',
11
+ :protocol => 'test_protocol',
12
+ :service => 'test_service',
13
+ :format => 'test_format',
14
+ :token => 'test_token'
15
+ })
16
+
17
+ assert_equal 'test_username', client.username
18
+ assert_equal 'test_password', client.password
19
+ assert_equal 'test_domain', client.domain
20
+ assert_equal 'test_protocol', client.protocol
21
+ assert_equal 'test_service', client.service
22
+ assert_equal 'test_format', client.format
23
+ assert_equal 'test_token', client.token
24
+ end
25
+
26
+ # Test obtaining a token
27
+ def test_obtain_token
28
+ client = Moodle::Protocol::Rest.new
29
+ client.stubs(:request).returns('{"token" : "12345"}')
30
+ moodle_client = Moodle::Client.new({:token => 'dummy', :domain => 'test'})
31
+ moodle_client.stubs(:client).returns(client)
32
+ assert_equal '12345', moodle_client.obtain_token()
33
+ end
34
34
  end
@@ -1,9 +1,9 @@
1
- require 'simplecov'
2
-
3
- SimpleCov.start do
4
- # Exclude test files from coverage
5
- add_filter "test_"
6
- end
7
-
8
- require 'test/unit'
9
- require 'mocha/setup'
1
+ require 'simplecov'
2
+
3
+ SimpleCov.start do
4
+ # Exclude test files from coverage
5
+ add_filter "test_"
6
+ end
7
+
8
+ require 'test/unit'
9
+ require 'mocha/setup'
@@ -1,29 +1,29 @@
1
- require 'test_helper'
2
- require 'moodle'
3
-
4
- class MoodleTest < Test::Unit::TestCase
5
- # Test creating new instance
6
- def test_new_with_token
7
- client = Moodle.new(:token => 'test')
8
- assert client.instance_of?(Moodle::Client)
9
- end
10
-
11
- # Test that global configuration can be set with hash
12
- def test_configure
13
- Moodle.configure({
14
- :username => 'test_username',
15
- :password => 'test_password'
16
- })
17
-
18
- assert_equal 'test_username', Moodle.config[:username]
19
- assert_equal 'test_password', Moodle.config[:password]
20
- end
21
-
22
- # Test that global configuration can be set with yaml
23
- def test_configure_with
24
- Moodle.configure_with('test/fixtures/config.yml')
25
-
26
- assert_equal 'test_username', Moodle.config[:username]
27
- assert_equal 'test_password', Moodle.config[:password]
28
- end
1
+ require 'test_helper'
2
+ require 'moodle'
3
+
4
+ class MoodleTest < Test::Unit::TestCase
5
+ # Test creating new instance
6
+ def test_new_with_token
7
+ client = Moodle.new(:token => 'test')
8
+ assert client.instance_of?(Moodle::Client)
9
+ end
10
+
11
+ # Test that global configuration can be set with hash
12
+ def test_configure
13
+ Moodle.configure({
14
+ :username => 'test_username',
15
+ :password => 'test_password'
16
+ })
17
+
18
+ assert_equal 'test_username', Moodle.config[:username]
19
+ assert_equal 'test_password', Moodle.config[:password]
20
+ end
21
+
22
+ # Test that global configuration can be set with yaml
23
+ def test_configure_with
24
+ Moodle.configure_with('test/fixtures/config.yml')
25
+
26
+ assert_equal 'test_username', Moodle.config[:username]
27
+ assert_equal 'test_password', Moodle.config[:password]
28
+ end
29
29
  end
metadata CHANGED
@@ -1,15 +1,112 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moodle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Robert Boloc
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-01 00:00:00.000000000 Z
12
- dependencies: []
12
+ date: 2016-03-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rest-client
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.8'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.8'
30
+ - !ruby/object:Gem::Dependency
31
+ name: hashie
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '3.4'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '3.4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: json
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.8'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.8'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '11.1'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '11.1'
78
+ - !ruby/object:Gem::Dependency
79
+ name: simplecov
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '0.11'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '0.11'
94
+ - !ruby/object:Gem::Dependency
95
+ name: mocha
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '1.1'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '1.1'
13
110
  description: Interact with Moodle from ruby
14
111
  email: robertboloc@gmail.com
15
112
  executables: []
@@ -26,6 +123,7 @@ files:
26
123
  - lib/moodle/client.rb
27
124
  - lib/moodle/helper.rb
28
125
  - lib/moodle/protocols/rest.rb
126
+ - lib/moodle/services/cohort.rb
29
127
  - lib/moodle/services/course.rb
30
128
  - lib/moodle/services/user.rb
31
129
  - lib/moodle/services/webservice.rb
@@ -37,25 +135,26 @@ files:
37
135
  homepage: http://robertboloc.github.com/moodle
38
136
  licenses:
39
137
  - MIT
40
- metadata: {}
41
138
  post_install_message:
42
139
  rdoc_options: []
43
140
  require_paths:
44
141
  - lib
45
142
  required_ruby_version: !ruby/object:Gem::Requirement
143
+ none: false
46
144
  requirements:
47
- - - '>='
145
+ - - ! '>='
48
146
  - !ruby/object:Gem::Version
49
147
  version: '0'
50
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
+ none: false
51
150
  requirements:
52
- - - '>='
151
+ - - ! '>='
53
152
  - !ruby/object:Gem::Version
54
153
  version: '0'
55
154
  requirements: []
56
155
  rubyforge_project:
57
- rubygems_version: 2.0.3
156
+ rubygems_version: 1.8.23
58
157
  signing_key:
59
- specification_version: 4
158
+ specification_version: 3
60
159
  summary: Moodle web services from ruby
61
160
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 21dada7b7c2d9a6a9f1918835cba252ad73917b4
4
- data.tar.gz: e29af8894d6d2f53d398a26b03cbf8e6c2c147a7
5
- SHA512:
6
- metadata.gz: ffa4d6d3fa5f14360e36ca981db5eec18a469db2a7b101d54c3db6ddd365ee563154ebce9d53d6dc8a93920672c888251dc0e3bb79c79a07a59272f6e303b2a4
7
- data.tar.gz: 42deb18c2d0de7258ab738ba89c3d3320ee31ee8d5178e6cc29d5f6c511255eff169238edbcbf2d13183cb3978e9a72ee20e4b85a4123fdbcbacec7a7102f2fc