polleverywhere 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6e4afe38059ccdf6bdc400ea88bf3175400f8086
4
+ data.tar.gz: 0bf3812ae15e43d9e7c6e6f173e36f5a85f84bba
5
+ SHA512:
6
+ metadata.gz: e67e60bd7f3a8e7414e90612d3878fcb147719339af90f9a8bbee784c5889d6086790d919d08e49572c3f6381bae1761eac7b30b0df4759051265ff600052627
7
+ data.tar.gz: 6e35be4fd064faeb8aa7197c2615ff29c5eb7b8205bd2156cd2fbcc8f91944e587762a852c635648e99b4a17a85c6e012cf347cdaf81f16b403b799ced4fb61d
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.4
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - ree
5
+ - 1.8.7
6
+ - 1.9.3
7
+ - 2.0.0
8
+ - 2.1.3
9
+
10
+ bundler_args: --without development
data/Gemfile CHANGED
@@ -1,13 +1,17 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in polleverywhere.gemspec
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'guard-rspec'
8
7
  gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
9
- gem 'growl'
10
- gem 'rspec'
11
- gem 'ruby-debug19'
12
8
  gem 'rake'
13
9
  end
10
+
11
+ group :test do
12
+ gem 'rspec', '~> 3'
13
+ end
14
+
15
+ group :development do
16
+ gem 'guard-rspec'
17
+ end
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The Poll Everywhere gem is the best way to integrate Poll Everywhere with your applications.
4
4
 
5
+ [![Build Status](https://travis-ci.org/polleverywhere/rubygem.svg)](https://travis-ci.org/polleverywhere/rubygem)
6
+
5
7
  ## Getting Started
6
8
 
7
9
  Install the Poll Everywhere rubygem:
@@ -15,27 +17,27 @@ If you're using bundler, add the following line to your Gemfile:
15
17
  ## Accessing your polls
16
18
 
17
19
  require 'polleverywhere'
18
-
20
+
19
21
  # Specify your username and password here
20
22
  PollEverywhere.config do
21
23
  username "my_username"
22
24
  password "my_password"
23
25
  end
24
-
26
+
25
27
  # Create a multiple choice poll
26
- ftp = PollEverywhere::MultipleChoicePoll.new
27
- ftp.title = 'Do you love numbers?'
28
- ftp.options = %w[1 2 3]
29
- ftp.save
30
-
31
- # Create a free text poll
32
- mcp = PollEverywhere::FreeTextPoll.new
33
- mcp.title = 'What is your favorite thing about vacation?'
28
+ mcp = PollEverywhere::MultipleChoicePoll.new
29
+ mcp.title = 'Do you love numbers?'
30
+ mcp.options = %w[1 2 3]
34
31
  mcp.save
35
-
32
+
33
+ # Create a free text poll
34
+ ftp = PollEverywhere::FreeTextPoll.new
35
+ ftp.title = 'What is your favorite thing about vacation?'
36
+ ftp.save
37
+
36
38
  # Now start playing! Get a list of your polls
37
39
  polls = PollEverywhere::Poll.all
38
-
40
+
39
41
  # ... or grab a specific poll
40
42
  mcp2 = PollEverywhere::MultipleChoicePoll.get(':permalink')
41
43
 
data/Rakefile CHANGED
@@ -14,4 +14,6 @@ namespace :gem do
14
14
  end
15
15
 
16
16
  # Spec tasks
17
- RSpec::Core::RakeTask.new
17
+ RSpec::Core::RakeTask.new
18
+
19
+ task :default => %w[spec]
@@ -8,12 +8,12 @@ module PollEverywhere
8
8
  autoload :Configurable, 'polleverywhere/configurable'
9
9
  autoload :Models, 'polleverywhere/models'
10
10
 
11
- # Lets make life easier for developers and provide shortcuts to module and class names.
11
+ # Lets make life easier for developers and provide shortcuts to module and class names.
12
12
  # PollEverywhere::Model::MultipleChoicePoll now becomes PollEverywhere::MCP. Cool eh? Thank me later.
13
13
  Participant = Models::Participant
14
14
  MCP = MultipleChoicePoll = Models::MultipleChoicePoll
15
15
  FTP = FreeTextPoll = Models::FreeTextPoll
16
-
16
+ Poll = Models::Poll
17
17
 
18
18
  def self.config(&block)
19
19
  @config ||= Configuration.new
@@ -24,4 +24,4 @@ module PollEverywhere
24
24
  def self.http
25
25
  HTTP::RequestBuilder.new
26
26
  end
27
- end
27
+ end
@@ -9,7 +9,7 @@ module PollEverywhere
9
9
 
10
10
  # Setup default values for configuration class as instance variables.
11
11
  def initialize
12
- self.url = "http://api.polleverywhere.com"
12
+ self.url = "https://www.polleverywhere.com"
13
13
  self.http_adapter = :sync
14
14
  end
15
15
 
@@ -24,7 +24,7 @@ module PollEverywhere
24
24
  end
25
25
 
26
26
  # Builds an HTTP Basic header for our authentication. Eventually
27
- # this form of authorization will be replaced with a token authorization
27
+ # this form of authorization will be replaced with a token authorization
28
28
  # so that a password is not required.
29
29
  def http_basic_credentials
30
30
  "Basic #{Base64.encode64("#{username}:#{password}")}".chomp
@@ -1,3 +1,3 @@
1
1
  module PollEverywhere
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "API" do
3
+ describe "API", :type => :request do
4
4
  context "polls" do
5
5
  it "should get collection from my poll" do
6
- PollEverywhere::Models::Poll.all.should have_at_least(1).items
6
+ expect(PollEverywhere::Models::Poll.all.size).to be >= 1
7
7
  end
8
8
 
9
9
  context "multiple choice" do
@@ -17,23 +17,23 @@ describe "API" do
17
17
  end
18
18
 
19
19
  it "should have id" do
20
- @mcp.id.should_not be_nil
20
+ expect(@mcp.id).not_to be_nil
21
21
  end
22
22
 
23
23
  it "should have permalink" do
24
- @mcp.permalink.should_not be_nil
24
+ expect(@mcp.permalink).not_to be_nil
25
25
  end
26
26
 
27
27
  context "options" do
28
28
  it "should have ids" do
29
29
  @mcp.options.each do |o|
30
- o.id.should_not be_nil
30
+ expect(o.id).not_to be_nil
31
31
  end
32
32
  end
33
33
 
34
34
  it "should have values" do
35
35
  @mcp.options.each do |o|
36
- o.value.should_not be_nil
36
+ expect(o.value).not_to be_nil
37
37
  end
38
38
  end
39
39
  end
@@ -42,7 +42,7 @@ describe "API" do
42
42
  context "get" do
43
43
  it "should get poll" do
44
44
  @gotten_mcp = PollEverywhere::MultipleChoicePoll.get(@mcp.permalink)
45
- @gotten_mcp.title.should eql(@mcp.title)
45
+ expect(@gotten_mcp.title).to eql(@mcp.title)
46
46
  end
47
47
  end
48
48
 
@@ -54,45 +54,45 @@ describe "API" do
54
54
  end
55
55
 
56
56
  it "should update options" do
57
- @mcp.options.first.value.should eql("MOLD SUCKS!")
57
+ expect(@mcp.options.first.value).to eql("MOLD SUCKS!")
58
58
  end
59
59
 
60
60
  it "should update title" do
61
- @mcp.title.should eql("My pita bread is moldy")
61
+ expect(@mcp.title).to eql("My pita bread is moldy")
62
62
  end
63
63
 
64
64
  it "should start" do
65
65
  @mcp.start
66
- @mcp.state.should eql("opened")
66
+ expect(@mcp.state).to eql("opened")
67
67
  end
68
68
 
69
69
  it "should stop" do
70
70
  @mcp.stop
71
- @mcp.state.should eql("closed")
71
+ expect(@mcp.state).to eql("closed")
72
72
  end
73
73
  end
74
74
 
75
75
  it "should retrieve results" do
76
76
  @mcp.save
77
77
 
78
- lambda {
78
+ expect {
79
79
  JSON.parse @mcp.results
80
- }.should_not raise_error JSON::ParserError
80
+ }.to_not raise_error
81
81
  end
82
82
 
83
83
  it "should clear results" do
84
84
  @mcp.save
85
- @mcp.clear.should be_true
85
+ expect(@mcp.clear).to be_truthy
86
86
  end
87
87
 
88
88
  it "should archive results" do
89
89
  @mcp.save
90
- @mcp.archive.should be_true
90
+ expect(@mcp.archive).to be_truthy
91
91
  end
92
92
 
93
93
  it "should destroy" do
94
94
  @mcp.destroy
95
- @mcp.id.should be_nil
95
+ expect(@mcp.id).to be_nil
96
96
  end
97
97
  end
98
98
 
@@ -107,18 +107,18 @@ describe "API" do
107
107
  end
108
108
 
109
109
  it "should have id" do
110
- @ftp.id.should_not be_nil
110
+ expect(@ftp.id).not_to be_nil
111
111
  end
112
112
 
113
113
  it "should have permalink" do
114
- @ftp.permalink.should_not be_nil
114
+ expect(@ftp.permalink).not_to be_nil
115
115
  end
116
116
  end
117
117
 
118
118
  context "get" do
119
119
  it "should get poll" do
120
120
  @gotten_ftp = PollEverywhere::FreeTextPoll.get(@ftp.permalink)
121
- @gotten_ftp.title.should eql(@ftp.title)
121
+ expect(@gotten_ftp.title).to eql(@ftp.title)
122
122
  end
123
123
  end
124
124
 
@@ -129,43 +129,43 @@ describe "API" do
129
129
  end
130
130
 
131
131
  it "should update title" do
132
- @ftp.title.should eql("My pita bread is moldy")
132
+ expect(@ftp.title).to eql("My pita bread is moldy")
133
133
  end
134
134
 
135
135
  it "should start" do
136
136
  @ftp.start
137
- @ftp.state.should eql("opened")
137
+ expect(@ftp.state).to eql("opened")
138
138
  end
139
139
 
140
140
  it "should stop" do
141
141
  @ftp.stop
142
- @ftp.state.should eql("closed")
142
+ expect(@ftp.state).to eql("closed")
143
143
  end
144
144
  end
145
145
 
146
146
  it "should retrieve results" do
147
147
  @ftp.save
148
148
 
149
- lambda {
149
+ expect {
150
150
  JSON.parse @ftp.results
151
- }.should_not raise_error JSON::ParserError
151
+ }.to_not raise_error
152
152
  end
153
153
 
154
154
  it "should clear results" do
155
155
  @ftp.save
156
- @ftp.clear.should be_true
156
+ expect(@ftp.clear).to be_truthy
157
157
  end
158
158
 
159
159
  it "should archive results" do
160
160
  @ftp.save
161
- @ftp.archive.should be_true
161
+ expect(@ftp.archive).to be_truthy
162
162
  end
163
163
 
164
164
  it "should destroy" do
165
165
  @ftp.destroy
166
- @ftp.id.should be_nil
166
+ expect(@ftp.id).to be_nil
167
167
  end
168
168
  end
169
169
 
170
170
  end
171
- end
171
+ end
@@ -7,19 +7,19 @@ describe PollEverywhere::Models::Participant do
7
7
 
8
8
  context "email path" do
9
9
  it "should have current email if not commited" do
10
- @p.path.should eql('/participants/brad@brad.com')
10
+ expect(@p.path).to eql('/participants/brad@brad.com')
11
11
  end
12
12
 
13
13
  it "should have old email if committed" do
14
14
  @p.save
15
15
  @p.email = 'super.duper@something.com'
16
- @p.path.should eql('/participants/brad@brad.com')
16
+ expect(@p.path).to eql('/participants/brad@brad.com')
17
17
  end
18
18
 
19
19
  it "should change email with old email in path" do
20
20
  @p.save
21
21
  @p.email = 'i.like.emails@something.com'
22
- @p.path.should eql('/participants/super.duper@something.com')
22
+ expect(@p.path).to eql('/participants/super.duper@something.com')
23
23
  end
24
24
  end
25
25
  end
@@ -8,24 +8,24 @@ describe "Configuration" do
8
8
  %w[username password].each do |attr|
9
9
  it "should have '#{attr}' configurable attribute" do
10
10
  @config.send(attr, "test_val")
11
- @config.send(attr).should eql("test_val")
11
+ expect(@config.send(attr)).to eql("test_val")
12
12
  end
13
13
  end
14
14
 
15
15
  context "url" do
16
- it "should default to 'http://api.polleverywhere.com'" do
17
- @config.url.to_s.should eql("http://api.polleverywhere.com")
16
+ it "should default to 'https://www.polleverywhere.com'" do
17
+ expect(@config.url.to_s).to eql("https://www.polleverywhere.com")
18
18
  end
19
19
 
20
20
  it "should have URI instance for url configurable attribute" do
21
21
  @config.url = "http://loser.com"
22
- @config.url.to_s.should eql("http://loser.com")
23
- @config.url.should be_instance_of(URI::HTTP)
22
+ expect(@config.url.to_s).to eql("http://loser.com")
23
+ expect(@config.url).to be_instance_of(URI::HTTP)
24
24
  end
25
25
  end
26
26
 
27
27
  it "should have a root configuration class" do
28
- PollEverywhere.config.should be_instance_of(PollEverywhere::Configuration)
28
+ expect(PollEverywhere.config).to be_instance_of(PollEverywhere::Configuration)
29
29
  end
30
30
  end
31
31
 
@@ -48,7 +48,7 @@ describe "Multiple Choice Poll" do
48
48
  context "serialization" do
49
49
  it "should serialize options" do
50
50
  @hash[:options].each do |value|
51
- @poll.to_hash[:multiple_choice_poll][:options].find{|o| o[:value] == value}.should_not be_nil
51
+ expect(@poll.to_hash[:multiple_choice_poll][:options].find{|o| o[:value] == value}).not_to be_nil
52
52
  end
53
53
  end
54
54
  end
@@ -61,7 +61,7 @@ describe "Multiple Choice Poll" do
61
61
  end
62
62
 
63
63
  it "should set title" do
64
- @poll.title.should eql(@hash[:title])
64
+ expect(@poll.title).to eql(@hash[:title])
65
65
  end
66
66
  end
67
67
  end
@@ -24,18 +24,18 @@ describe PollEverywhere::Serializable do
24
24
 
25
25
  context "property inheritence" do
26
26
  it "should have subclass property" do
27
- @bear.fuzzy.should be_true
27
+ expect(@bear.fuzzy).to be_truthy
28
28
  end
29
29
 
30
30
  it "should have superclass property" do
31
- @bear.color.should eql('black')
31
+ expect(@bear.color).to eql('black')
32
32
  end
33
33
  end
34
34
 
35
35
  context "property changes" do
36
36
  it "should be changed" do
37
37
  @bear.color = 'brown'
38
- @bear.should be_changed
38
+ expect(@bear).to be_changed
39
39
  end
40
40
  end
41
41
 
@@ -46,21 +46,21 @@ describe PollEverywhere::Serializable do
46
46
  end
47
47
 
48
48
  it "should not be changed after commit" do
49
- @bear.should_not be_changed
49
+ expect(@bear).not_to be_changed
50
50
  end
51
51
 
52
52
  it "should have set current value as old value" do
53
- @bear.prop(:color).was.should eql('red')
53
+ expect(@bear.prop(:color).was).to eql('red')
54
54
  end
55
55
 
56
56
  it "should have current value" do
57
- @bear.prop(:color).is.should eql('red')
57
+ expect(@bear.prop(:color).is).to eql('red')
58
58
  end
59
59
 
60
60
  it "should not modify the old value" do
61
61
  @bear.color = "green"
62
- @bear.prop('color').was.should eql('red')
63
- @bear.prop('color').is.should eql('green')
62
+ expect(@bear.prop('color').was).to eql('red')
63
+ expect(@bear.prop('color').is).to eql('green')
64
64
  end
65
65
  end
66
66
  end
@@ -77,12 +77,12 @@ describe PollEverywhere::Serializable::Property do
77
77
 
78
78
  it "should detect changes" do
79
79
  @value.current = "super fun times"
80
- @value.should be_changed
80
+ expect(@value).to be_changed
81
81
  end
82
82
 
83
83
  it "should maintain original value" do
84
84
  @value.current = "flimtastical"
85
- @value.original.should be_nil
85
+ expect(@value.original).to be_nil
86
86
  end
87
87
 
88
88
  context "after commit" do
@@ -92,15 +92,15 @@ describe PollEverywhere::Serializable::Property do
92
92
  end
93
93
 
94
94
  it "should not be changed" do
95
- @value.should_not be_changed
95
+ expect(@value).not_to be_changed
96
96
  end
97
97
 
98
98
  it "should have original value" do
99
- @value.current.should eql("dog treats")
99
+ expect(@value.current).to eql("dog treats")
100
100
  end
101
101
 
102
102
  it "should have current value" do
103
- @value.current.should eql("dog treats")
103
+ expect(@value.current).to eql("dog treats")
104
104
  end
105
105
  end
106
106
  end
@@ -112,11 +112,11 @@ describe PollEverywhere::Serializable::Property::Set do
112
112
  end
113
113
 
114
114
  it "should return properties for attributes" do
115
- @propset[:first_name].should be_instance_of(PollEverywhere::Serializable::Property)
115
+ expect(@propset[:first_name]).to be_instance_of(PollEverywhere::Serializable::Property)
116
116
  end
117
117
 
118
118
  it "should return a Value::Set" do
119
- @propset.value_set.should be_instance_of(PollEverywhere::Serializable::Property::Value::Set)
119
+ expect(@propset.value_set).to be_instance_of(PollEverywhere::Serializable::Property::Value::Set)
120
120
  end
121
121
  end
122
122
 
@@ -133,28 +133,28 @@ describe PollEverywhere::Serializable::Property::Value::Set do
133
133
  end
134
134
 
135
135
  it "should have the current value" do
136
- @value_set[:email].should eql('brad@bradgessler.com')
136
+ expect(@value_set[:email]).to eql('brad@bradgessler.com')
137
137
  end
138
138
 
139
139
  it "should have the original value" do
140
- @value_set.prop(:email).was.should be_nil
140
+ expect(@value_set.prop(:email).was).to be_nil
141
141
  end
142
142
 
143
143
  it "should have changes for property value" do
144
144
  was, is = @value_set.prop(:email).changes
145
- was.should be_nil
146
- is.should eql('brad@bradgessler.com')
145
+ expect(was).to be_nil
146
+ expect(is).to eql('brad@bradgessler.com')
147
147
  end
148
148
 
149
149
  it "should have changed" do
150
- @value_set.prop(:email).should be_changed
150
+ expect(@value_set.prop(:email)).to be_changed
151
151
  end
152
152
  end
153
153
 
154
154
  context "hash" do
155
155
  it "should return hash of changed value" do
156
156
  @value_set[:email] = 'brad@bradgessler.com'
157
- @value_set.changes[:email].should eql([nil, 'brad@bradgessler.com'])
157
+ expect(@value_set.changes[:email]).to eql([nil, 'brad@bradgessler.com'])
158
158
  end
159
159
  end
160
160
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
1
  require 'rspec'
4
2
  require 'polleverywhere'
5
3
 
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polleverywhere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
5
- prerelease:
4
+ version: 0.0.18
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brad Gessler, Steel Fu
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-22 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rest-client
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.6.3
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.6.3
46
41
  description: An easy way to integrate Poll Everywhere into your Ruby applications.
@@ -50,8 +45,9 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - .gitignore
54
- - .rbenv-version
48
+ - ".gitignore"
49
+ - ".ruby-version"
50
+ - ".travis.yml"
55
51
  - Gemfile
56
52
  - Guardfile
57
53
  - README.md
@@ -75,27 +71,26 @@ files:
75
71
  - spec/spec_helper.rb
76
72
  homepage: http://www.github.com/polleverywhere/rubygem
77
73
  licenses: []
74
+ metadata: {}
78
75
  post_install_message:
79
76
  rdoc_options: []
80
77
  require_paths:
81
78
  - lib
82
79
  required_ruby_version: !ruby/object:Gem::Requirement
83
- none: false
84
80
  requirements:
85
- - - ! '>='
81
+ - - ">="
86
82
  - !ruby/object:Gem::Version
87
83
  version: '0'
88
84
  required_rubygems_version: !ruby/object:Gem::Requirement
89
- none: false
90
85
  requirements:
91
- - - ! '>='
86
+ - - ">="
92
87
  - !ruby/object:Gem::Version
93
88
  version: '0'
94
89
  requirements: []
95
90
  rubyforge_project: polleverywhere
96
- rubygems_version: 1.8.23
91
+ rubygems_version: 2.2.2
97
92
  signing_key:
98
- specification_version: 3
93
+ specification_version: 4
99
94
  summary: Integrate Poll Everywhere into your Ruby applications
100
95
  test_files:
101
96
  - spec/integration/api_spec.rb
data/.rbenv-version DELETED
@@ -1 +0,0 @@
1
- 1.9.2-p290