bit_player 0.4.9 → 0.4.10

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: 9a7e4605f9077016c7cafc9231c5e904b8b9c3e0
4
- data.tar.gz: ceb523c187fdf1576d3528e5b8a6d8ba4f8674fd
3
+ metadata.gz: bc06cd2696c212003de66e9ba194627ca77a6af9
4
+ data.tar.gz: beea1e487fd23333f326465a94cbcee8fde0b865
5
5
  SHA512:
6
- metadata.gz: d5fe18a2a3e5a11f93241e132ced19f0a18badff9d60b49bb273721fda9d082b12912f20db07772ffa396d865f0c041d254e2bf607b89fd75c4f5d8706e64657
7
- data.tar.gz: 64fa0de3d1dbe29dbe4cdb17ac0b48cdd981c4c2b180ba49b8bf38b6b78e1622f0a9f2e408d0270fb7854d54b0f4f22aa62e07d64ca1fc5aa9ba3df572469841
6
+ metadata.gz: 55aff1e7c90d479885f9ee6480294f71654f29d2f1c8087a900c4b735d8c74757dced988da32f258d57e5bdf44042a608f20cebd44b8fb96c282871e2dfb0589
7
+ data.tar.gz: b6ebd9245cc6187473c3250f717f986bf78a4249ea31a749c7c22095f440469173bd0de373dc44c4fe754df42158fbc33d7e07cc4d9a924aa7b76d9a6748d3f5
@@ -45,9 +45,11 @@ module BitPlayer
45
45
  end
46
46
 
47
47
  def fetch_next_content
48
- if current_content_provider.exists?(content_position + 1)
48
+ if content_position &&
49
+ current_content_provider.exists?(content_position + 1)
49
50
  @status.increment_content_position
50
- elsif current_module.provider_exists?(provider_position + 1)
51
+ elsif provider_position &&
52
+ current_module.provider_exists?(provider_position + 1)
51
53
  @status.increment_provider_position
52
54
  else
53
55
  initialize_context(context)
@@ -1,4 +1,4 @@
1
1
  # nodoc
2
2
  module BitPlayer
3
- VERSION = "0.4.9"
3
+ VERSION = "0.4.10"
4
4
  end
@@ -14,13 +14,16 @@
14
14
  # Configure Using Gemfile
15
15
  # gem 'pg'
16
16
  #
17
- development:
17
+ default: &default
18
18
  adapter: postgresql
19
19
  encoding: unicode
20
- database: dummy_development
20
+ # For details on connection pooling, see rails configuration guide
21
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
21
22
  pool: 5
22
- username: postgres
23
- password:
23
+
24
+ development:
25
+ <<: *default
26
+ database: dummy_development
24
27
 
25
28
  # Connect on a TCP socket. Omitted by default since the client uses a
26
29
  # domain socket that doesn't need configuration. Windows does not have
@@ -44,17 +47,30 @@ development:
44
47
  # re-generated from your development database when you run "rake".
45
48
  # Do not set this db to the same as development or production.
46
49
  test:
47
- adapter: postgresql
48
- encoding: unicode
50
+ <<: *default
49
51
  database: dummy_test
50
- pool: 5
51
- username: postgres
52
- password:
53
52
 
53
+ # As with config/secrets.yml, you never want to store sensitive information,
54
+ # like your database password, in your source code. If your source code is
55
+ # ever seen by anyone, they now have access to your database.
56
+ #
57
+ # Instead, provide the password as a unix environment variable when you boot
58
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
59
+ # for a full rundown on how to provide these environment variables in a
60
+ # production deployment.
61
+ #
62
+ # On Heroku and other platform providers, you may have a full connection URL
63
+ # available as an environment variable. For example:
64
+ #
65
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
66
+ #
67
+ # You can use this database configuration with:
68
+ #
69
+ # production:
70
+ # url: <%= ENV['DATABASE_URL'] %>
71
+ #
54
72
  production:
55
- adapter: postgresql
56
- encoding: unicode
73
+ <<: *default
57
74
  database: dummy_production
58
- pool: 5
59
- username: postgres
60
- password:
75
+ username: dummy
76
+ password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
@@ -2,32 +2,61 @@ require "spec_helper"
2
2
  require "bit_core"
3
3
 
4
4
  describe BitPlayer::Navigator do
5
- let(:status) do
6
- double(
7
- "status",
8
- context: "a",
9
- module_position: 1,
10
- provider_position: 2,
11
- content_position: 3
12
- )
13
- end
14
5
  let(:arm) { double("arm") }
15
6
  let(:group) { double("group", arm: arm) }
16
- let(:participant) do
17
- double("participant", navigation_status: status, active_group: group)
18
- end
19
- let(:view_context) { double("context", current_participant: participant) }
20
7
  let(:provider) { double("provider") }
21
- let(:nav) { BitPlayer::Navigator.new(participant) }
22
-
23
- before do
24
- allow(arm).to receive_message_chain(:bit_core_tools, :find_by_title)
25
- .and_return(double("tool", id: 1))
26
- end
27
8
 
28
9
  describe "#render_current_content" do
10
+ let(:status) do
11
+ double(
12
+ "status",
13
+ context: "a",
14
+ module_position: 1,
15
+ provider_position: 2,
16
+ content_position: 3
17
+ )
18
+ end
19
+ let(:participant) do
20
+ double("participant", navigation_status: status, active_group: group)
21
+ end
22
+ let(:view_context) { double("context", current_participant: participant) }
23
+ let(:nav) { BitPlayer::Navigator.new(participant) }
24
+
25
+ before do
26
+ allow(arm).to receive_message_chain(:bit_core_tools, :find_by_title)
27
+ .and_return(double("tool", id: 1))
28
+ end
29
+
29
30
  it "should render the content from the current provider" do
30
31
  expect(nav.render_current_content(view_context)).to match(/Oops/)
31
32
  end
32
33
  end
34
+
35
+ describe "#fetch_next_content" do
36
+ let(:status) do
37
+ double(
38
+ "status",
39
+ context: "a",
40
+ module_position: 1,
41
+ provider_position: nil,
42
+ content_position: nil
43
+ )
44
+ end
45
+ let(:participant) do
46
+ double("participant", navigation_status: status, active_group: group)
47
+ end
48
+ let(:view_context) { double("context", current_participant: participant) }
49
+ let(:nav) { BitPlayer::Navigator.new(participant) }
50
+
51
+ before do
52
+ allow(arm).to receive_message_chain(:bit_core_tools, :find_by_title)
53
+ .and_return(double("tool", id: 1))
54
+ end
55
+
56
+ it "should initialize context if content_position and "\
57
+ "provider_position is nil" do
58
+ expect(status).to receive(:initialize_context)
59
+ nav.fetch_next_content
60
+ end
61
+ end
33
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bit_player
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes