sermonaudio 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +4 -2
- data/.travis.yml +7 -2
- data/Gemfile +3 -2
- data/Gemfile.lock +57 -43
- data/LICENSE.txt +21 -0
- data/README.md +64 -4
- data/Rakefile +2 -2
- data/lib/sermonaudio.rb +2 -6
- data/lib/sermonaudio/actions.rb +9 -12
- data/lib/sermonaudio/client.rb +2 -0
- data/lib/sermonaudio/configuration.rb +76 -24
- data/lib/sermonaudio/utils.rb +7 -0
- data/lib/sermonaudio/version.rb +1 -1
- data/sermonaudio.gemspec +12 -12
- data/spec/actions_spec.rb +1 -1
- data/spec/client_spec.rb +1 -1
- data/spec/configuration_spec.rb +30 -15
- data/spec/spec_helper.rb +21 -5
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c3f60a192b95f60bc860220e2756575aa1f875a
|
4
|
+
data.tar.gz: 4a8a640c3bc4f606ec7af8baa09be67330805067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75844daa9c0ce3483b9199c43329620f23e214ae1f4b9fe61555dfdcc79cbc87d6e4c7135705d8429b5845ddd2f33ead2ea62933c31e909c09792378a26e3125
|
7
|
+
data.tar.gz: 372d38005b79bda0fe24862c27ce323358c4852995c1e7532d3c825b60944d735cdda92ce9cbe5c099109b5d404d1f51079f5cba64efcdbd7dfb398acd51a0db
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -2,10 +2,15 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 1.9.3
|
4
4
|
- 2.0.0
|
5
|
-
- 2.1
|
5
|
+
- 2.1.1
|
6
|
+
- 2.2.2
|
7
|
+
- jruby-19mode
|
8
|
+
- rbx-2
|
6
9
|
env: SERMONAUDIO_MEMBER_ID=example SERMONAUDIO_PASSWORD=example
|
7
10
|
before_install:
|
8
|
-
- gem install nokogiri -v 1.6.2
|
11
|
+
- gem install nokogiri -v 1.6.6.2 -- --use-system-libraries
|
9
12
|
bundler_args: --without development
|
13
|
+
cache: bundler
|
14
|
+
script: bundle exec rspec
|
10
15
|
notifications:
|
11
16
|
email: false
|
data/Gemfile
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in sermonaudio-savon.gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
6
|
gem 'ruby2ruby'
|
7
|
-
gem '
|
7
|
+
gem 'pry-byebug', platform: [:mri, :jruby]
|
8
8
|
end
|
9
9
|
|
10
10
|
group :development, :test do
|
11
11
|
gem 'rake'
|
12
12
|
gem 'pry'
|
13
|
+
gem 'rubyntlm'
|
13
14
|
gem 'rubocop', require: false
|
14
15
|
end
|
15
16
|
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,51 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sermonaudio (0.1.
|
5
|
-
nokogiri (= 1.6.2
|
6
|
-
savon (~> 2.0)
|
4
|
+
sermonaudio (0.1.1)
|
5
|
+
nokogiri (= 1.6.7.2)
|
6
|
+
savon (~> 2.11.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
11
|
addressable (2.3.6)
|
12
|
-
akami (1.
|
12
|
+
akami (1.3.1)
|
13
13
|
gyoku (>= 0.4.0)
|
14
14
|
nokogiri
|
15
15
|
ast (2.0.0)
|
16
16
|
builder (3.2.2)
|
17
|
+
byebug (2.7.0)
|
18
|
+
columnize (~> 0.3)
|
19
|
+
debugger-linecache (~> 1.2)
|
17
20
|
coderay (1.1.0)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
columnize (0.8.9)
|
22
|
+
coveralls (0.8.1)
|
23
|
+
json (~> 1.8)
|
24
|
+
rest-client (>= 1.6.8, < 2)
|
25
|
+
simplecov (~> 0.10.0)
|
26
|
+
term-ansicolor (~> 1.3)
|
27
|
+
thor (~> 0.19.1)
|
24
28
|
crack (0.4.2)
|
25
29
|
safe_yaml (~> 1.0.0)
|
30
|
+
debugger-linecache (1.2.0)
|
26
31
|
diff-lcs (1.2.5)
|
27
|
-
|
32
|
+
docile (1.1.5)
|
33
|
+
domain_name (0.5.24)
|
34
|
+
unf (>= 0.0.5, < 1.0.0)
|
35
|
+
gyoku (1.3.1)
|
28
36
|
builder (>= 2.1.2)
|
29
|
-
|
37
|
+
http-cookie (1.0.2)
|
38
|
+
domain_name (~> 0.5)
|
39
|
+
httpi (2.4.1)
|
30
40
|
rack
|
31
|
-
json (1.8.
|
32
|
-
macaddr (1.7.1)
|
33
|
-
systemu (~> 2.6.2)
|
41
|
+
json (1.8.2)
|
34
42
|
method_source (0.8.2)
|
35
|
-
mime-types (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
nori (2.4.0)
|
43
|
+
mime-types (2.5)
|
44
|
+
mini_portile2 (2.0.0)
|
45
|
+
netrc (0.10.3)
|
46
|
+
nokogiri (1.6.7.2)
|
47
|
+
mini_portile2 (~> 2.0.0.rc2)
|
48
|
+
nori (2.6.0)
|
42
49
|
parser (2.2.0.pre.3)
|
43
50
|
ast (>= 1.1, < 3.0)
|
44
51
|
slop (~> 3.4, >= 3.4.5)
|
@@ -47,10 +54,14 @@ GEM
|
|
47
54
|
coderay (~> 1.1.0)
|
48
55
|
method_source (~> 0.8.1)
|
49
56
|
slop (~> 3.4)
|
50
|
-
|
57
|
+
pry-byebug (1.3.3)
|
58
|
+
byebug (~> 2.7)
|
59
|
+
pry (~> 0.10)
|
60
|
+
rack (1.6.4)
|
51
61
|
rainbow (2.0.0)
|
52
62
|
rake (10.3.2)
|
53
|
-
rest-client (1.
|
63
|
+
rest-client (1.8.0)
|
64
|
+
http-cookie (>= 1.0.2, < 2.0)
|
54
65
|
mime-types (>= 1.16, < 3.0)
|
55
66
|
netrc (~> 0.7)
|
56
67
|
rspec (3.0.0)
|
@@ -78,34 +89,33 @@ GEM
|
|
78
89
|
ruby_parser (3.6.2)
|
79
90
|
sexp_processor (~> 4.1)
|
80
91
|
rubyntlm (0.4.0)
|
81
|
-
safe_yaml (1.0.
|
82
|
-
savon (2.
|
83
|
-
akami (~> 1.2
|
92
|
+
safe_yaml (1.0.4)
|
93
|
+
savon (2.11.1)
|
94
|
+
akami (~> 1.2)
|
84
95
|
builder (>= 2.1.2)
|
85
|
-
gyoku (~> 1.
|
86
|
-
httpi (~> 2.
|
96
|
+
gyoku (~> 1.2)
|
97
|
+
httpi (~> 2.3)
|
87
98
|
nokogiri (>= 1.4.0)
|
88
|
-
nori (~> 2.4
|
89
|
-
|
90
|
-
wasabi (~> 3.3.0)
|
99
|
+
nori (~> 2.4)
|
100
|
+
wasabi (~> 3.4)
|
91
101
|
sexp_processor (4.4.3)
|
92
|
-
simplecov (0.
|
93
|
-
|
94
|
-
|
95
|
-
|
102
|
+
simplecov (0.10.0)
|
103
|
+
docile (~> 1.1.0)
|
104
|
+
json (~> 1.8)
|
105
|
+
simplecov-html (~> 0.10.0)
|
106
|
+
simplecov-html (0.10.0)
|
96
107
|
slop (3.6.0)
|
97
|
-
systemu (2.6.4)
|
98
108
|
term-ansicolor (1.3.0)
|
99
109
|
tins (~> 1.0)
|
100
110
|
thor (0.19.1)
|
101
|
-
tins (1.
|
102
|
-
|
103
|
-
|
111
|
+
tins (1.5.1)
|
112
|
+
unf (0.1.4)
|
113
|
+
unf_ext
|
114
|
+
unf_ext (0.0.7.1)
|
104
115
|
vcr (2.9.2)
|
105
|
-
wasabi (3.
|
116
|
+
wasabi (3.5.0)
|
106
117
|
httpi (~> 2.0)
|
107
|
-
|
108
|
-
nokogiri (>= 1.4.0)
|
118
|
+
nokogiri (>= 1.4.2)
|
109
119
|
webmock (1.15.2)
|
110
120
|
addressable (>= 2.2.7)
|
111
121
|
crack (>= 0.3.2)
|
@@ -116,6 +126,7 @@ PLATFORMS
|
|
116
126
|
DEPENDENCIES
|
117
127
|
coveralls
|
118
128
|
pry
|
129
|
+
pry-byebug
|
119
130
|
rake
|
120
131
|
rspec
|
121
132
|
rubocop
|
@@ -125,3 +136,6 @@ DEPENDENCIES
|
|
125
136
|
simplecov
|
126
137
|
vcr
|
127
138
|
webmock
|
139
|
+
|
140
|
+
BUNDLED WITH
|
141
|
+
1.10.6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Matt Bridges
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -2,10 +2,17 @@
|
|
2
2
|
|
3
3
|
The SermonAudio gem enables church ruby developers who need easily access sermons and information right from SermonAudio without having to configure any SOAP clients.
|
4
4
|
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![
|
8
|
-
[![
|
5
|
+
- [![Quality](http://img.shields.io/codeclimate/github/mattdbridges/sermonaudio.svg?style=flat-square)](https://codeclimate.com/github/mattdbridges/sermonaudio)
|
6
|
+
- [![Coverage](https://img.shields.io/coveralls/mattdbridges/sermonaudio/master.svg?style=flat-square)](https://coveralls.io/r/mattdbridges/sermonaudio)
|
7
|
+
- [![Build](http://img.shields.io/travis-ci/mattdbridges/sermonaudio.svg?style=flat-square)](https://travis-ci.org/mattdbridges/sermonaudio)
|
8
|
+
- [![Dependencies](http://img.shields.io/gemnasium/mattdbridges/sermonaudio.svg?style=flat-square)](https://gemnasium.com/mattdbridges/sermonaudio)
|
9
|
+
- [![Downloads](http://img.shields.io/gem/dtv/sermonaudio.svg?style=flat-square)](https://rubygems.org/gems/sermonaudio)
|
10
|
+
- [![Tags](http://img.shields.io/github/tag/mattdbridges/sermonaudio.svg?style=flat-square)](http://github.com/mattdbridges/sermonaudio/tags)
|
11
|
+
- [![Releases](http://img.shields.io/github/release/mattdbridges/sermonaudio.svg?style=flat-square)](http://github.com/mattdbridges/sermonaudio/releases)
|
12
|
+
- [![Issues](http://img.shields.io/github/issues/mattdbridges/sermonaudio.svg?style=flat-square)](http://github.com/mattdbridges/sermonaudio/issues)
|
13
|
+
- [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT)
|
14
|
+
- [![Version](http://img.shields.io/gem/v/sermonaudio.svg?style=flat-square)](https://rubygems.org/gems/sermonaudio)
|
15
|
+
- [![Inline docs](http://inch-ci.org/github/mattdbridges/sermonaudio.png?branch=master)](http://inch-ci.org/github/mattdbridges/sermonaudio)
|
9
16
|
|
10
17
|
## Installation
|
11
18
|
|
@@ -17,6 +24,59 @@ Then run bundle to install it:
|
|
17
24
|
|
18
25
|
bundle install
|
19
26
|
|
27
|
+
## Configuration
|
28
|
+
|
29
|
+
You can configure SermonAudio in one of two ways.
|
30
|
+
|
31
|
+
* Environment variables
|
32
|
+
* Ruby
|
33
|
+
|
34
|
+
### Environment Variables
|
35
|
+
|
36
|
+
There are three environment variables SermonAudio responds to:
|
37
|
+
|
38
|
+
* `SERMONAUDIO_MEMBER_ID`
|
39
|
+
* `SERMONAUDIO_PASSWORD`
|
40
|
+
* `SERMONAUDIO_API_KEY` (Note: Not yet used. Only for JSON endpoints)
|
41
|
+
|
42
|
+
Example Usage:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
$ SERMONAUDIO_MEMBER_ID=example irb -r sermonaudio
|
46
|
+
irb(main):001:0> SermonAudio.member_id
|
47
|
+
=> "example"
|
48
|
+
irb(main):002:0> SermonAudio.password
|
49
|
+
=> nil
|
50
|
+
irb(main):003:0> ENV["SERMONAUDIO_PASSWORD"] = "password"
|
51
|
+
=> "password"
|
52
|
+
irb(main):004:0> SermonAudio.password
|
53
|
+
=> "password"
|
54
|
+
```
|
55
|
+
|
56
|
+
### Ruby
|
57
|
+
|
58
|
+
Setting the equivalent values in Ruby will be overridden by their `ENV` values
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
$ irb -r sermonaudio
|
62
|
+
irb(main):001:0> SermonAudio.member_id
|
63
|
+
=> nil
|
64
|
+
irb(main):002:0> SermonAudio.password
|
65
|
+
=> nil
|
66
|
+
irb(main):003:0> SermonAudio.member_id = "example_member_id"
|
67
|
+
=> "example_member_id"
|
68
|
+
irb(main):004:0> SermonAudio.password = "password"
|
69
|
+
=> "password"
|
70
|
+
irb(main):005:0> SermonAudio.member_id
|
71
|
+
=> "example_member_id"
|
72
|
+
irb(main):006:0> SermonAudio.password
|
73
|
+
=> "password"
|
74
|
+
irb(main):003:0> ENV["SERMONAUDIO_PASSWORD"] = "password2"
|
75
|
+
=> "password2"
|
76
|
+
irb(main):006:0> SermonAudio.password
|
77
|
+
=> "password2"
|
78
|
+
```
|
79
|
+
|
20
80
|
## General Use
|
21
81
|
|
22
82
|
### `#submit_sermon`
|
data/Rakefile
CHANGED
data/lib/sermonaudio.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
-
$LOAD_PATH.push File.expand_path('../../lib', __FILE__)
|
2
|
-
require 'sermonaudio/version' # Always require version
|
3
|
-
require 'savon'
|
4
|
-
|
5
1
|
# Load SermonAudio specific files
|
2
|
+
require 'sermonaudio/client'
|
6
3
|
require 'sermonaudio/configuration'
|
7
4
|
require 'sermonaudio/actions'
|
8
|
-
require 'sermonaudio/client'
|
9
5
|
|
10
6
|
module SermonAudio
|
11
7
|
extend Actions
|
12
|
-
|
8
|
+
extend Configuration
|
13
9
|
end
|
data/lib/sermonaudio/actions.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'sermonaudio/configuration'
|
2
|
+
require 'sermonaudio/utils'
|
2
3
|
|
3
4
|
module SermonAudio
|
4
5
|
# Actions that the SermonAudio module can call to
|
@@ -17,19 +18,19 @@ module SermonAudio
|
|
17
18
|
'MemberID' => SermonAudio.member_id,
|
18
19
|
'Password' => SermonAudio.password,
|
19
20
|
'SermonID' => sermon_id
|
20
|
-
|
21
|
+
)
|
21
22
|
end
|
22
23
|
|
23
24
|
def favorite_sermons
|
24
|
-
get_favorite(__callee__,
|
25
|
+
get_favorite(__callee__, within: :sermon)
|
25
26
|
end
|
26
27
|
|
27
28
|
def favorite_speakers
|
28
|
-
get_favorite(__callee__,
|
29
|
+
get_favorite(__callee__, within: :speaker)
|
29
30
|
end
|
30
31
|
|
31
32
|
def favorite_broadcasters
|
32
|
-
get_favorite(__callee__,
|
33
|
+
get_favorite(__callee__, within: :member)
|
33
34
|
end
|
34
35
|
|
35
36
|
def get_series_by_member_id(member_id)
|
@@ -79,21 +80,17 @@ module SermonAudio
|
|
79
80
|
|
80
81
|
private
|
81
82
|
|
82
|
-
def execute_call(name,
|
83
|
-
response = SermonAudio.client.call(name, message:
|
83
|
+
def execute_call(name, message = {})
|
84
|
+
response = SermonAudio.client.call(name, message: message)
|
84
85
|
response.body[:"#{name}_response"][:"#{name}_result"]
|
85
86
|
end
|
86
87
|
|
87
|
-
def array_wrap(obj)
|
88
|
-
obj.is_a?(Hash) ? [obj] : Array(obj)
|
89
|
-
end
|
90
|
-
|
91
88
|
def get_favorite(action, opts = {})
|
92
89
|
response = execute_call(action,
|
93
90
|
'MemberID' => SermonAudio.member_id,
|
94
91
|
'Password' => SermonAudio.password
|
95
|
-
|
96
|
-
array_wrap(response[opts.fetch(:
|
92
|
+
)
|
93
|
+
Utils.array_wrap(response[opts.fetch(:within)]).compact
|
97
94
|
end
|
98
95
|
end
|
99
96
|
end
|
data/lib/sermonaudio/client.rb
CHANGED
@@ -1,36 +1,88 @@
|
|
1
1
|
module SermonAudio
|
2
2
|
module Configuration
|
3
|
-
class MissingConfiguration <
|
3
|
+
class MissingConfiguration < StandardError; end
|
4
4
|
|
5
|
-
|
6
|
-
base.extend ClassMethods
|
7
|
-
end
|
5
|
+
attr_writer :member_id, :password, :api_key
|
8
6
|
|
9
|
-
|
10
|
-
|
7
|
+
# Returns the specified SermonAudio.com Member ID.
|
8
|
+
#
|
9
|
+
# This can be defined explicitly via the writer method.
|
10
|
+
# If it is not specified, it will return the value from
|
11
|
+
# the `SERMONAUDIO_API_KEY` environment variable.
|
12
|
+
#
|
13
|
+
# Example:
|
14
|
+
#
|
15
|
+
# SermonAudio.api_key
|
16
|
+
# # => SermonAudio::Configuration::MissingConfiguration
|
17
|
+
# ENV['SERMONAUDIO_API_KEY'] = 'example'
|
18
|
+
# # => 'example'
|
19
|
+
# SermonAudio.api_key
|
20
|
+
# # => 'example'
|
21
|
+
# SermonAudio.api_key = 'other'
|
22
|
+
# # => 'other'
|
23
|
+
# SermonAudio.api_key
|
24
|
+
# # => 'other'
|
25
|
+
def api_key
|
26
|
+
defined_or_env :api_key
|
27
|
+
end
|
11
28
|
|
12
|
-
|
13
|
-
|
14
|
-
|
29
|
+
# Returns the specified SermonAudio.com Member ID.
|
30
|
+
#
|
31
|
+
# This can be defined explicitly via the writer method.
|
32
|
+
# If it is not specified, it will return the value from
|
33
|
+
# the `SERMONAUDIO_MEMBER_ID` environment variable.
|
34
|
+
#
|
35
|
+
# Example:
|
36
|
+
#
|
37
|
+
# SermonAudio.member_id
|
38
|
+
# # => SermonAudio::Configuration::MissingConfiguration
|
39
|
+
# ENV['SERMONAUDIO_MEMBER_ID'] = 'example'
|
40
|
+
# # => 'example'
|
41
|
+
# SermonAudio.member_id
|
42
|
+
# # => 'example'
|
43
|
+
# SermonAudio.member_id = 'other'
|
44
|
+
# # => 'other'
|
45
|
+
# SermonAudio.member_id
|
46
|
+
# # => 'other'
|
47
|
+
def member_id
|
48
|
+
defined_or_env :member_id
|
49
|
+
end
|
15
50
|
|
16
|
-
|
17
|
-
|
18
|
-
|
51
|
+
# Returns the specified SermonAudio.com password.
|
52
|
+
#
|
53
|
+
# This can be defined explicitly via the writer method.
|
54
|
+
# If it is not specified, it will return the value from
|
55
|
+
# the `SERMONAUDIO_PASSWORD` environment variable.
|
56
|
+
#
|
57
|
+
# Example:
|
58
|
+
#
|
59
|
+
# SermonAudio.password
|
60
|
+
# # => SermonAudio::Configuration::MissingConfiguration
|
61
|
+
# ENV['SERMONAUDIO_PASSWORD'] = 'example'
|
62
|
+
# # => 'example'
|
63
|
+
# SermonAudio.password
|
64
|
+
# # => 'example'
|
65
|
+
# SermonAudio.password = 'other'
|
66
|
+
# # => 'other'
|
67
|
+
# SermonAudio.password
|
68
|
+
# # => 'other'
|
69
|
+
def password
|
70
|
+
defined_or_env :password
|
71
|
+
end
|
19
72
|
|
20
|
-
|
73
|
+
private
|
21
74
|
|
22
|
-
|
23
|
-
|
24
|
-
|
75
|
+
def defined_or_env(value)
|
76
|
+
instance_variable_get("@#{value}") || environment_value(value)
|
77
|
+
end
|
25
78
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
79
|
+
def environment_value(name)
|
80
|
+
ENV.fetch("SERMONAUDIO_#{name.upcase}") do
|
81
|
+
message = (<<-MSG).gsub(/\s+/, ' ')
|
82
|
+
You must define a configuration.#{name}=(:value) or
|
83
|
+
set environment 'SERMONAUDIO_#{name.upcase}'.
|
84
|
+
MSG
|
85
|
+
fail MissingConfiguration, message
|
34
86
|
end
|
35
87
|
end
|
36
88
|
end
|
data/lib/sermonaudio/version.rb
CHANGED
data/sermonaudio.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'sermonaudio/version'
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
|
-
s.name =
|
5
|
+
s.name = 'sermonaudio'
|
6
6
|
s.version = SermonAudio::Version::VERSION
|
7
|
-
s.authors = [
|
8
|
-
s.email = [
|
9
|
-
s.homepage =
|
10
|
-
s.summary =
|
11
|
-
s.description =
|
7
|
+
s.authors = ['Matt Bridges']
|
8
|
+
s.email = ['mbridges.91@gmail.com']
|
9
|
+
s.homepage = 'https://github.com/mattdbridges/sermonaudio'
|
10
|
+
s.summary = 'SermonAudio API interface for Ruby.'
|
11
|
+
s.description = 'sermonaudio uses the Savon gem to interface with SermonAudio as easily as possible.'
|
12
12
|
|
13
13
|
s.rubyforge_project = s.name
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
-
s.require_paths = [
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
|
+
s.require_paths = ['lib']
|
19
19
|
|
20
|
-
s.add_dependency "savon", "~> 2.0"
|
21
|
-
s.add_dependency "nokogiri", "1.6.2
|
20
|
+
s.add_dependency "savon", "~> 2.11.0"
|
21
|
+
s.add_dependency "nokogiri", "1.6.7.2"
|
22
22
|
end
|
data/spec/actions_spec.rb
CHANGED
data/spec/client_spec.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -1,42 +1,57 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
|
3
4
|
module SermonAudio
|
4
|
-
describe Configuration do
|
5
|
-
subject {
|
5
|
+
RSpec.describe Configuration do
|
6
|
+
subject(:config) {
|
6
7
|
Class.new do
|
7
|
-
|
8
|
+
extend(Configuration)
|
8
9
|
end
|
9
10
|
}
|
10
11
|
|
11
12
|
it "should allow for member_id and password to be set" do
|
12
|
-
expect(
|
13
|
-
expect(
|
13
|
+
expect(config).to respond_to :member_id
|
14
|
+
expect(config).to respond_to :password
|
15
|
+
expect(config).to respond_to :api_key
|
14
16
|
end
|
15
17
|
|
16
18
|
it "should default to environment variables if they are provided" do
|
17
19
|
env("SERMONAUDIO_MEMBER_ID" => "example") do
|
18
|
-
expect(
|
20
|
+
expect(config.member_id).to eq "example"
|
19
21
|
end
|
20
22
|
|
21
23
|
env("SERMONAUDIO_PASSWORD" => "example") do
|
22
|
-
expect(
|
24
|
+
expect(config.password).to eq "example"
|
25
|
+
end
|
26
|
+
|
27
|
+
env("SERMONAUDIO_API_KEY" => "example") do
|
28
|
+
expect(config.api_key).to eq "example"
|
23
29
|
end
|
24
30
|
end
|
25
31
|
|
26
32
|
it "should allow member_id and password to be explicitly set" do
|
27
|
-
|
28
|
-
|
33
|
+
config.member_id = "other_id"
|
34
|
+
config.password = "other_password"
|
35
|
+
config.api_key = "default_key"
|
29
36
|
|
30
|
-
env("SERMONAUDIO_MEMBER_ID" => "example",
|
31
|
-
|
32
|
-
|
37
|
+
env("SERMONAUDIO_MEMBER_ID" => "example",
|
38
|
+
"SERMONAUDIO_PASSWORD" => "p",
|
39
|
+
"SERMONAUDIO_API_KEY" => "other_key",
|
40
|
+
) do
|
41
|
+
expect(config.member_id).to eq "other_id"
|
42
|
+
expect(config.password).to eq "other_password"
|
43
|
+
expect(config.api_key).to eq "default_key"
|
33
44
|
end
|
34
45
|
end
|
35
46
|
|
36
47
|
it "should raise and error if no values are set" do
|
37
|
-
env("SERMONAUDIO_MEMBER_ID" => nil,
|
38
|
-
|
39
|
-
|
48
|
+
env("SERMONAUDIO_MEMBER_ID" => nil,
|
49
|
+
"SERMONAUDIO_PASSWORD" => nil,
|
50
|
+
"SERMONAUDIO_API_KEY" => nil,
|
51
|
+
) do
|
52
|
+
expect { config.member_id }.to raise_error Configuration::MissingConfiguration, /configuration\.member_id/
|
53
|
+
expect { config.password }.to raise_error Configuration::MissingConfiguration, /configuration\.password/
|
54
|
+
expect { config.api_key }.to raise_error Configuration::MissingConfiguration, /configuration\.api_key/
|
40
55
|
end
|
41
56
|
end
|
42
57
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,11 +3,16 @@ require 'bundler/setup'
|
|
3
3
|
require 'simplecov'
|
4
4
|
require 'coveralls'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
7
|
+
|
8
|
+
if ENV["TRAVIS"]
|
9
|
+
formatters << Coveralls::SimpleCov::Formatter
|
10
|
+
end
|
11
|
+
|
12
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
|
13
|
+
SimpleCov.start do
|
14
|
+
add_filter "/spec/"
|
15
|
+
end
|
11
16
|
|
12
17
|
require 'pry' unless ENV["TRAVIS"]
|
13
18
|
require 'vcr'
|
@@ -38,9 +43,20 @@ VCR.configure do |c|
|
|
38
43
|
c.hook_into :webmock # or :fakeweb
|
39
44
|
c.configure_rspec_metadata!
|
40
45
|
c.filter_sensitive_data('<SA_PASSWORD>') { ENV["SERMONAUDIO_PASSWORD"] }
|
46
|
+
c.filter_sensitive_data('<SA_API_KEY>') { ENV["SERMONAUDIO_API_KEY"] }
|
41
47
|
end
|
42
48
|
|
43
49
|
RSpec.configure do |config|
|
44
50
|
# some (optional) config here
|
51
|
+
config.mock_with :rspec do |mocks|
|
52
|
+
|
53
|
+
# This option should be set when all dependencies are being loaded
|
54
|
+
# before a spec run, as is the case in a typical spec helper. It will
|
55
|
+
# cause any verifying double instantiation for a class that does not
|
56
|
+
# exist to raise, protecting against incorrectly spelt names.
|
57
|
+
mocks.verify_doubled_constant_names = true
|
58
|
+
|
59
|
+
end
|
60
|
+
config.disable_monkey_patching!
|
45
61
|
config.mock_framework = :rspec
|
46
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sermonaudio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Bridges
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.11.0
|
20
20
|
type: :runtime
|
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:
|
26
|
+
version: 2.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.6.2
|
33
|
+
version: 1.6.7.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.6.2
|
40
|
+
version: 1.6.7.2
|
41
41
|
description: sermonaudio uses the Savon gem to interface with SermonAudio as easily
|
42
42
|
as possible.
|
43
43
|
email:
|
@@ -51,12 +51,14 @@ files:
|
|
51
51
|
- ".travis.yml"
|
52
52
|
- Gemfile
|
53
53
|
- Gemfile.lock
|
54
|
+
- LICENSE.txt
|
54
55
|
- README.md
|
55
56
|
- Rakefile
|
56
57
|
- lib/sermonaudio.rb
|
57
58
|
- lib/sermonaudio/actions.rb
|
58
59
|
- lib/sermonaudio/client.rb
|
59
60
|
- lib/sermonaudio/configuration.rb
|
61
|
+
- lib/sermonaudio/utils.rb
|
60
62
|
- lib/sermonaudio/version.rb
|
61
63
|
- sermonaudio.gemspec
|
62
64
|
- spec/actions_spec.rb
|
@@ -102,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
104
|
version: '0'
|
103
105
|
requirements: []
|
104
106
|
rubyforge_project: sermonaudio
|
105
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.4.5.1
|
106
108
|
signing_key:
|
107
109
|
specification_version: 4
|
108
110
|
summary: SermonAudio API interface for Ruby.
|
@@ -131,4 +133,3 @@ test_files:
|
|
131
133
|
- spec/fixtures/update_sermon.xml
|
132
134
|
- spec/fixtures/wsdl.xml
|
133
135
|
- spec/spec_helper.rb
|
134
|
-
has_rdoc:
|