mitel_oig 0.0.1 → 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: 0e835bc59d08f79c3ab98b9eeec4e3a55e5bbdef
4
- data.tar.gz: c47ebd38f7ac04ef07f2ae904772f086b98629ed
3
+ metadata.gz: 369937cb7430072a4ed6d04a5d3feaa0122b15ef
4
+ data.tar.gz: c55d636471d2a9cce0b88b48cbe78e06fa3da2ce
5
5
  SHA512:
6
- metadata.gz: 85fca323b6d56a645630b080cd6ecdf200b24294f0048efab66c670d12897e5d4b981d3e313f8d50bc2fd90f382ae431d11a528e906f446d36e76c3843314d11
7
- data.tar.gz: 8a8dae7dcac9c2a415c67cea7833aecb88ec70a3990ca77647afd19345db0781e902315b235e2df16010cbfc6ab249664296415217772a6bd18ffee00491fa2d
6
+ metadata.gz: b13c9b64bf9dcb333496cdbe44268f7690250967bb99a36c238b5066c11662f5e411b2b527e0b254e26cc26a809a9689d3641f0ff530c25bcd2f943355b5c877
7
+ data.tar.gz: cb39f92ef2f141a57a666c7e58c4dd38642252ded59d13e78df00cb13c9e1965bfe3daf5704bc7189877e77818d0946d4dc5aeb41138b840fc1f433d770801b0
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,65 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
6
+ - 2.1.1
7
+ - 2.1.2
8
+ - 2.1.3
9
+ - 2.1.4
10
+ - jruby
11
+ jdk:
12
+ - openjdk6
13
+ - openjdk7
14
+ - oraclejdk7
15
+ - oraclejdk8
16
+ branches:
17
+ only:
18
+ - master
19
+ matrix:
20
+ exclude:
21
+ - rvm: 1.9.3
22
+ jdk: openjdk6
23
+ - rvm: 1.9.3
24
+ jdk: oraclejdk7
25
+ - rvm: 1.9.3
26
+ jdk: oraclejdk8
27
+ - rvm: 2.0.0
28
+ jdk: openjdk6
29
+ - rvm: 2.0.0
30
+ jdk: oraclejdk7
31
+ - rvm: 2.0.0
32
+ jdk: oraclejdk8
33
+ - rvm: 2.1.0
34
+ jdk: openjdk6
35
+ - rvm: 2.1.0
36
+ jdk: oraclejdk7
37
+ - rvm: 2.1.0
38
+ jdk: oraclejdk8
39
+ - rvm: 2.1.1
40
+ jdk: openjdk6
41
+ - rvm: 2.1.1
42
+ jdk: oraclejdk7
43
+ - rvm: 2.1.1
44
+ jdk: oraclejdk8
45
+ - rvm: 2.1.2
46
+ jdk: openjdk6
47
+ - rvm: 2.1.2
48
+ jdk: oraclejdk7
49
+ - rvm: 2.1.2
50
+ jdk: oraclejdk8
51
+ - rvm: 2.1.3
52
+ jdk: openjdk6
53
+ - rvm: 2.1.3
54
+ jdk: oraclejdk7
55
+ - rvm: 2.1.3
56
+ jdk: oraclejdk8
57
+ - rvm: 2.1.4
58
+ jdk: openjdk6
59
+ - rvm: 2.1.4
60
+ jdk: oraclejdk7
61
+ - rvm: 2.1.4
62
+ jdk: oraclejdk8
63
+ addons:
64
+ code_climate:
65
+ repo_token: 87dd0b9f07405e5835164de6f246b33f1baf908e72b4c493db23cd71da7da60f
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Mitel::OIG
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/plainprogrammer/mitel_oig/badges/gpa.svg)](https://codeclimate.com/github/plainprogrammer/mitel_oig)
4
+ [![Test Coverage](https://codeclimate.com/github/plainprogrammer/mitel_oig/badges/coverage.svg)](https://codeclimate.com/github/plainprogrammer/mitel_oig)
5
+ [![Build Status](https://travis-ci.org/plainprogrammer/mitel_oig.svg)](https://travis-ci.org/plainprogrammer/mitel_oig)
6
+
3
7
  This gem provides a client library for working with the Open Integration Gateway
4
8
  provided by Mitel phone systems. The library makes use of both the SOAP and REST
5
9
  interfaces to try to expose as much of the available functionality as possible.
@@ -25,7 +29,26 @@ Or install it yourself as:
25
29
 
26
30
  ## Usage
27
31
 
28
- TODO: Write usage instructions here
32
+ ### Configuration
33
+
34
+ Before being able to use any of the Mitel::OIG classes to interact with OIG
35
+ services, you will need to setup a valid configuration. The code package already
36
+ incorporates the various WSDLs for the OIG services, but configuration for where
37
+ to access your specific endpoint is necessary. Configuration is handled globally
38
+ by the Mitel::OIG::Configuration class and you can set it up like so:
39
+
40
+ ```ruby
41
+ Mitel::OIG::Configuration.set(:endpoint, 'https://192.168.0.1:8080')
42
+ Mitel::OIG::Configuration.set(:application_name, 'MyOIGApp')
43
+ Mitel::OIG::Configuration.set(:application_password, 'secret')
44
+ Mitel::OIG::Configuration.set(:company_name, 'MyCompany')
45
+ Mitel::OIG::Configuration.set(:local_password, 'secret')
46
+ ```
47
+
48
+ All the options described above are required to properly authenticate your
49
+ application with the OIG services. All these credentials are shared globally
50
+ within your application and are automatically accessible to the classes provided
51
+ by this gem.
29
52
 
30
53
  ## Contributing
31
54
 
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
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,48 @@
1
+ require 'singleton'
2
+
3
+ module Mitel
4
+ module OIG
5
+ class Configuration
6
+ include Singleton
7
+
8
+ def self.set(option, value)
9
+ instance.set(option, value)
10
+ instance
11
+ end
12
+
13
+ def set(option, value)
14
+ options
15
+ @options[option.to_sym] = value
16
+ setup_accessors(option)
17
+ self
18
+ end
19
+
20
+ def self.clear(option)
21
+ instance.clear(option)
22
+ instance
23
+ end
24
+
25
+ def clear(option)
26
+ options
27
+ @options[option.to_sym] = nil
28
+ self
29
+ end
30
+
31
+ def self.options
32
+ instance.options
33
+ end
34
+
35
+ def options
36
+ @options ||= {}
37
+ end
38
+
39
+ def self.method_missing(method_sym, *_arguments, &_block)
40
+ instance.send(method_sym, _arguments, _block)
41
+ end
42
+
43
+ def method_missing(method_sym, *_arguments, &_block)
44
+ options[method_sym]
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module Mitel
2
2
  module OIG
3
- VERSION = "0.0.1"
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -1,5 +1,7 @@
1
1
  require 'mitel/oig/version'
2
2
 
3
+ require 'mitel/oig/configuration'
4
+
3
5
  module Mitel
4
6
  module OIG
5
7
  # Your code goes here...
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = %w{lib}
20
20
 
21
- spec.add_development_dependency 'bundler', '~> 1.7'
21
+ spec.add_development_dependency 'bundler', '~> 1.5'
22
22
  spec.add_development_dependency 'rake', '~> 10.0'
23
23
  spec.add_development_dependency 'rspec', '~> 3.1.0'
24
24
  spec.add_development_dependency 'simplecov'
25
+ spec.add_development_dependency 'codeclimate-test-reporter'
25
26
 
26
27
  spec.add_dependency 'savon', '~> 2.0'
27
28
  end
@@ -0,0 +1,49 @@
1
+ RSpec.describe Mitel::OIG::Configuration do
2
+ it 'responds to .set' do
3
+ expect(Mitel::OIG::Configuration).to respond_to(:set)
4
+ end
5
+
6
+ it 'responds to .clear' do
7
+ expect(Mitel::OIG::Configuration).to respond_to(:clear)
8
+ end
9
+
10
+ it 'responds to .options' do
11
+ expect(Mitel::OIG::Configuration).to respond_to(:options)
12
+ end
13
+
14
+ describe '.set' do
15
+ it 'sets the option' do
16
+ Mitel::OIG::Configuration.set(:endpoint, 'http://localhost')
17
+ expect(Mitel::OIG::Configuration.options[:endpoint]).to eq('http://localhost')
18
+ end
19
+
20
+ it 'exposes option as a method' do
21
+ Mitel::OIG::Configuration.set(:endpoint, 'http://localhost')
22
+ expect(Mitel::OIG::Configuration.endpoint).to eq('http://localhost')
23
+ end
24
+ end
25
+
26
+ describe '.clear' do
27
+ before(:each) do
28
+ Mitel::OIG::Configuration.set(:endpoint, 'http://localhost')
29
+ end
30
+
31
+ it 'clears the option' do
32
+ Mitel::OIG::Configuration.clear(:endpoint)
33
+ expect(Mitel::OIG::Configuration.options[:endpoint]).to eq(nil)
34
+ expect(Mitel::OIG::Configuration.endpoint).to eq(nil)
35
+ end
36
+ end
37
+
38
+ describe '.options' do
39
+ let(:subject) { Mitel::OIG::Configuration.options }
40
+
41
+ before(:each) do
42
+ Mitel::OIG::Configuration.set(:endpoint, 'http://localhost')
43
+ end
44
+
45
+ it 'exposes options as Hash' do
46
+ expect(subject[:endpoint]).to eq('http://localhost')
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,82 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ Bundler.require(:default)
5
+
6
+ if ENV['CI']
7
+ require 'codeclimate-test-reporter'
8
+ CodeClimate::TestReporter.start
9
+ else
10
+ require 'simplecov'
11
+ SimpleCov.start
12
+ end
13
+
14
+ RSpec.configure do |config|
15
+ # rspec-expectations config goes here. You can use an alternate
16
+ # assertion/expectation library such as wrong or the stdlib/minitest
17
+ # assertions if you prefer.
18
+ config.expect_with :rspec do |expectations|
19
+ # This option will default to `true` in RSpec 4. It makes the `description`
20
+ # and `failure_message` of custom matchers include text for helper methods
21
+ # defined using `chain`, e.g.:
22
+ # be_bigger_than(2).and_smaller_than(4).description
23
+ # # => "be bigger than 2 and smaller than 4"
24
+ # ...rather than:
25
+ # # => "be bigger than 2"
26
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
27
+ end
28
+
29
+ # rspec-mocks config goes here. You can use an alternate test double
30
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
31
+ config.mock_with :rspec do |mocks|
32
+ # Prevents you from mocking or stubbing a method that does not exist on
33
+ # a real object. This is generally recommended, and will default to
34
+ # `true` in RSpec 4.
35
+ mocks.verify_partial_doubles = true
36
+ end
37
+
38
+ # These two settings work together to allow you to limit a spec run
39
+ # to individual examples or groups you care about by tagging them with
40
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
41
+ # get run.
42
+ #config.filter_run :focus
43
+ #config.run_all_when_everything_filtered = true
44
+
45
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
46
+ # For more details, see:
47
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
48
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
49
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
50
+ config.disable_monkey_patching!
51
+
52
+ # This setting enables warnings. It's recommended, but in some cases may
53
+ # be too noisy due to issues in dependencies.
54
+ config.warnings = true
55
+
56
+ # Many RSpec users commonly either run the entire suite or an individual
57
+ # file, and it's useful to allow more verbose output when running an
58
+ # individual spec file.
59
+ if config.files_to_run.one?
60
+ # Use the documentation formatter for detailed output,
61
+ # unless a formatter has already been configured
62
+ # (e.g. via a command-line flag).
63
+ config.default_formatter = 'doc'
64
+ end
65
+
66
+ # Print the 10 slowest examples and example groups at the
67
+ # end of the spec run, to help surface which specs are running
68
+ # particularly slow.
69
+ config.profile_examples = 3
70
+
71
+ # Run specs in random order to surface order dependencies. If you find an
72
+ # order dependency and want to debug it, you can fix the order by providing
73
+ # the seed, which is printed after each run.
74
+ # --seed 1234
75
+ config.order = :random
76
+
77
+ # Seed global randomization in this process using the `--seed` CLI option.
78
+ # Setting this allows you to use `--seed` to deterministically reproduce
79
+ # test failures related to randomization by passing the same `--seed` value
80
+ # as the one that triggered the failure.
81
+ Kernel.srand config.seed
82
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitel_oig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: savon
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -88,15 +102,20 @@ extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
90
104
  - ".gitignore"
105
+ - ".rspec"
91
106
  - ".ruby-gemset"
92
107
  - ".ruby-version"
108
+ - ".travis.yml"
93
109
  - Gemfile
94
110
  - LICENSE.txt
95
111
  - README.md
96
112
  - Rakefile
113
+ - lib/mitel/oig/configuration.rb
97
114
  - lib/mitel/oig/version.rb
98
115
  - lib/mitel_oig.rb
99
116
  - mitel_oig.gemspec
117
+ - spec/mitel/oig/configuration_spec.rb
118
+ - spec/spec_helper.rb
100
119
  homepage: https://github.com/plainprogrammer/mitel_oig
101
120
  licenses:
102
121
  - MIT
@@ -121,4 +140,6 @@ rubygems_version: 2.4.2
121
140
  signing_key:
122
141
  specification_version: 4
123
142
  summary: A client library for Mitel's OIG service.
124
- test_files: []
143
+ test_files:
144
+ - spec/mitel/oig/configuration_spec.rb
145
+ - spec/spec_helper.rb