polleverywhere 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1,36 @@
1
- rvm 1.9.2@polleverywhere_gem
1
+ #!/usr/bin/env bash
2
+
3
+ # Bare minimum Gems that are needed to keep a Ruby development environment in sync. This assumes
4
+ # that you use bundler in your workflow to control the installation of all other gems. If you need
5
+ # to bump the bundler or rubygem version across your team, change that here, then run bundler and
6
+ # and keep going.
7
+
8
+ RVMRC=1.9.2@polleverywhere_gem
9
+ RUBYGEM_VERSION="1.6.2"
10
+ BUNDLER_VERSION="1.0.15"
11
+
12
+ # Make this work with OS X Lion... for now...
13
+ if [[ `uname -v` =~ "Darwin Kernel Version 11" ]] ; then
14
+ export CC=/usr/bin/gcc-4.2
15
+ fi
16
+
17
+ # # Make sure we're using the right version for ruby
18
+ rvm use --create --install $RVMRC
19
+
20
+ # Enforce a version of Rubygems
21
+ if [[ `gem --version` != $RUBYGEM_VERSION ]] ; then
22
+ echo "Updating to RubyGems $RUBYGEM_VERSION..."
23
+ rvm rubygems $RUBYGEM_VERSION
24
+ fi
25
+
26
+ # Check if bundler is installed
27
+ if [[ "command -v bundle" ]] ; then
28
+ # Check if we have the right version
29
+ if [[ ! (`bundle --version` =~ $BUNDLER_VERSION) ]] ; then
30
+ echo "Updating to Bundler $BUNDLER_VERSION..."
31
+ gem install bundler -v$BUNDLER_VERSION
32
+ fi
33
+ else
34
+ echo "Installing Bundler $BUNDLER_VERSION..."
35
+ gem install bundler -v$BUNDLER_VERSION
36
+ fi
@@ -1,7 +1,11 @@
1
1
  %section#main
2
- %p This documentation assumes that you are familar with the low-level semantics of HTTP, including the use of tools like cURL, and JSON.
3
-
4
- %h1 Authentication
2
+ %h1 Getting started
3
+ %p We're really stoked that you want to integrate Poll Everywhere into your application. We built this API with goal of providing developers with a simple, reliable, and enjoyable way to integrate Poll Everywhere into applications.
4
+
5
+ %h2 We ♥ JSON
6
+ %p JSON key-value data structures are used throughout the API application to persist and modify data to the web application. Typically resources will include a root key that corresponds with the name of the name of the resource; from example, multiple choice polls all have the root key 'multiple_choice_poll'.
7
+
8
+ %h2 Authentication
5
9
  %p A Poll Everywhere username and password is used to login to the API and manipulate polls on an account. These credentials can be created at <a href="http://www.polleverywhere.com/reserve">Poll Everywhere</a>.
6
10
 
7
11
  %p The credentials can be configured on the Poll Everywhere gem or manually via HTTP Basic authentication (More information on HTTP Basic credentials an encoding can be found at <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">Wikipedia</a>).
@@ -12,9 +16,11 @@
12
16
  username "my_pollev_username"
13
17
  password "my_pollev_password"
14
18
  end
15
-
16
- %h1 Its all JSON
17
- %p JSON key-value data structures are used throughout the API application to persist and modify data to the web application. Typically resources will include a root key that corresponds with the name of the name of the resource; from example, multiple choice polls all have the root key 'multiple_choice_poll'.
19
+
20
+ %h2 Support
21
+ %p We regularly run a <a href="https://github.com/polleverywhere/polleverywhere/tree/master/spec/integration">suite of integration tests</a> against our API to make sure that our API is running smoothly.
22
+
23
+ %p Now lets roll up our sleeves and get our hands dirty!
18
24
 
19
25
  %h1 Polls
20
26
  %h2 Multiple choice polls
@@ -22,18 +28,21 @@
22
28
 
23
29
  %h3 Attributes
24
30
  %dl.attributes
25
- %dt=PollEverywhere::MultipleChoicePoll.root_key
31
+ %dt
32
+ %code=PollEverywhere::MultipleChoicePoll.root_key
26
33
  %dd Root key for multiple choice poll data.
27
34
  %dd
28
35
  %dl
29
36
  -PollEverywhere::MultipleChoicePoll.prop_set.each do |_, prop|
30
- %dt=prop.name
37
+ %dt
38
+ %code=prop.name
31
39
  %dd=prop.description
32
40
  -if prop.name == :options
33
41
  %dd
34
42
  %dl
35
43
  -PollEverywhere::MultipleChoicePoll::Option.prop_set.each do |_, prop|
36
- %dt=prop.name
44
+ %dt
45
+ %code=prop.name
37
46
  %dd=prop.description
38
47
 
39
48
  %h3 Creating a multiple choice poll
@@ -55,6 +64,11 @@
55
64
  :example
56
65
  @mcp.start
57
66
 
67
+ %h3 Clear the poll results
68
+ %p To clear out any current results on a poll, you call the clear method
69
+ :example
70
+ @mcp.clear
71
+
58
72
  %h3 Delete a multiple choice poll
59
73
  %p When you're totally finished with the poll and you want to tidy things up a bit, you can delete polls
60
74
  :example
@@ -64,12 +78,14 @@
64
78
  %p These polls are used to collect short answers or unstructured responses from participants.
65
79
  %h3 Attributes
66
80
  %dl.attributes
67
- %dt=PollEverywhere::FTP.root_key
81
+ %dt
82
+ %code=PollEverywhere::FTP.root_key
68
83
  %dd Root key for free text poll data.
69
84
  %dd
70
85
  %dl
71
86
  -PollEverywhere::FTP.prop_set.each do |_, prop|
72
- %dt=prop.name
87
+ %dt
88
+ %code=prop.name
73
89
  %dd=prop.description
74
90
 
75
91
  %h3 Create free text polls
@@ -83,6 +99,11 @@
83
99
  @ftp.title = "No really, what is the meaning of life?"
84
100
  @ftp.save
85
101
 
102
+ %h3 Clear the poll results
103
+ %p To clear out any current results on a poll, you call the clear method
104
+ :example
105
+ @ftp.clear
106
+
86
107
  %h3 Delete a free text poll
87
108
  :example
88
109
  @ftp.destroy
@@ -92,12 +113,14 @@
92
113
 
93
114
  %h2 Attributes
94
115
  %dl.attributes
95
- %dt=PollEverywhere::Participant.root_key
116
+ %dt
117
+ %code=PollEverywhere::Participant.root_key
96
118
  %dd Root key for participant data.
97
119
  %dd
98
120
  %dl
99
121
  -PollEverywhere::Participant.prop_set.each do |_, prop|
100
- %dt=prop.name
122
+ %dt
123
+ %code=prop.name
101
124
  %dd=prop.description
102
125
 
103
126
  %h2 Creating a new Participant
@@ -24,11 +24,12 @@ pre
24
24
  overflow: visible
25
25
 
26
26
  code
27
- font-family: monaco, courier
28
- font-size: $code-font-size
27
+ font:
28
+ family: monaco, courier
29
+ size: $code-font-size
29
30
  background: #eee
30
31
  line-height: $base-font-size
31
- padding: 1px
32
+ padding: 2px
32
33
 
33
34
  h1,h2,h3,h4,h5,h6
34
35
  font-weight: normal
@@ -41,10 +42,7 @@ h3,h4,h5.h6
41
42
 
42
43
  dl.attributes
43
44
  dt
44
- margin-top: 1em
45
- font-family: courier
46
- font-size: $code-font-size
47
- line-height: $base-font-size
45
+ margin: 1em auto 0.25em
48
46
  dl, dd
49
47
  margin-left: 0
50
48
  dd > dl
@@ -77,7 +77,7 @@ module PollEverywhere # :nodoc
77
77
  end
78
78
 
79
79
  prop :opened_at do
80
- description %{Data and time that the poll was started.}
80
+ description %{Date and time that the poll was started.}
81
81
  end
82
82
 
83
83
  prop :permalink do
@@ -88,6 +88,22 @@ module PollEverywhere # :nodoc
88
88
  description %{Determines whether or not a poll can recieve responses. If the state is 'closed', the poll won't receive responses from the audience. If the poll is 'opened', the poll can receive responses from the audience. If the state is 'maxed_out', the poll won't receive responses until the account is upgraded to support more poll responses.}
89
89
  end
90
90
 
91
+ prop :sms_enabled do
92
+ description %{Allow participants to respond to the poll using SMS text messages.}
93
+ end
94
+
95
+ prop :twitter_enabled do
96
+ description %{Allow participants to respond to the poll with Twitter.}
97
+ end
98
+
99
+ prop :web_enabled do
100
+ description %{Allow participants to respond to the poll with their web browsers through the poll owners PollEv.com page.}
101
+ end
102
+
103
+ prop :sharing_enabled do
104
+ description %{Allow participants to respond to the poll through the obscufated permalink.}
105
+ end
106
+
91
107
  attr_accessor :http
92
108
 
93
109
  def initialize(http=PollEverywhere.http)
@@ -139,6 +155,18 @@ module PollEverywhere # :nodoc
139
155
  end
140
156
  end
141
157
 
158
+ def clear
159
+ if persisted?
160
+ http.delete(path + "/clear").response do |response|
161
+ return true
162
+ end
163
+
164
+ return false
165
+ else
166
+ false
167
+ end
168
+ end
169
+
142
170
  def destroy
143
171
  http.delete(path).response do |response|
144
172
  self.id = self.permalink = nil
@@ -1,3 +1,3 @@
1
1
  module PollEverywhere
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -72,6 +72,11 @@ describe "API" do
72
72
  end
73
73
  end
74
74
 
75
+ it "should clear results" do
76
+ @mcp.save
77
+ @mcp.clear.should be_true
78
+ end
79
+
75
80
  it "should destroy" do
76
81
  @mcp.destroy
77
82
  @mcp.id.should be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polleverywhere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-15 00:00:00.000000000 -07:00
13
- default_executable:
12
+ date: 2011-09-07 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: json
17
- requirement: &2156434260 !ruby/object:Gem::Requirement
16
+ requirement: &70254757011980 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *2156434260
24
+ version_requirements: *70254757011980
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: rest-client
28
- requirement: &2156433200 !ruby/object:Gem::Requirement
27
+ requirement: &70254757011480 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ~>
@@ -33,7 +32,7 @@ dependencies:
33
32
  version: 1.6.3
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *2156433200
35
+ version_requirements: *70254757011480
37
36
  description: An easy way to integrate Poll Everywhere into your Ruby applications.
38
37
  email:
39
38
  - opensource@polleverywhere.com
@@ -72,7 +71,6 @@ files:
72
71
  - spec/lib/polleverywhere_spec.rb
73
72
  - spec/lib/serializable_spec.rb
74
73
  - spec/spec_helper.rb
75
- has_rdoc: true
76
74
  homepage: http://www.github.com/polleverywhere/polleverywhere
77
75
  licenses: []
78
76
  post_install_message:
@@ -93,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
91
  version: '0'
94
92
  requirements: []
95
93
  rubyforge_project: polleverywhere
96
- rubygems_version: 1.6.2
94
+ rubygems_version: 1.8.6
97
95
  signing_key:
98
96
  specification_version: 3
99
97
  summary: Integrate Poll Everywhere into your Ruby applications