polleverywhere 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,68 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: polleverywhere
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
4
5
  prerelease:
5
- version: 0.0.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Brad Gessler, Steel Fu
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-27 00:00:00 -06:00
12
+ date: 2011-07-03 00:00:00.000000000 -06:00
14
13
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: json
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2156899600 !ruby/object:Gem::Requirement
20
18
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
25
23
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rest-client
29
24
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2156899600
26
+ - !ruby/object:Gem::Dependency
27
+ name: rest-client
28
+ requirement: &2156899080 !ruby/object:Gem::Requirement
31
29
  none: false
32
- requirements:
30
+ requirements:
33
31
  - - ~>
34
- - !ruby/object:Gem::Version
32
+ - !ruby/object:Gem::Version
35
33
  version: 1.6.3
36
34
  type: :runtime
37
- version_requirements: *id002
35
+ prerelease: false
36
+ version_requirements: *2156899080
38
37
  description: An easy way to integrate Poll Everywhere into your Ruby applications.
39
- email:
38
+ email:
40
39
  - opensource@polleverywhere.com
41
40
  executables: []
42
-
43
41
  extensions: []
44
-
45
42
  extra_rdoc_files: []
46
-
47
- files:
43
+ files:
48
44
  - .gitignore
49
45
  - .rvmrc
50
46
  - Gemfile
51
47
  - Guardfile
52
48
  - README.md
53
49
  - Rakefile
54
- - api/build/index.html
55
50
  - api/config.rb
56
51
  - api/config.ru
52
+ - api/public/favicon.ico
53
+ - api/public/javascripts/jquery-1.6.2.min.js
54
+ - api/public/javascripts/jquery.tableofcontents.js
57
55
  - api/views/index.html.haml
58
56
  - api/views/layout.haml
59
57
  - api/views/stylesheets/site.css.sass
60
- - docs/api.haml
61
58
  - lib/polleverywhere.rb
62
- - lib/polleverywhere/api.rb
63
59
  - lib/polleverywhere/configurable.rb
64
60
  - lib/polleverywhere/configuration.rb
65
61
  - lib/polleverywhere/core_ext.rb
62
+ - lib/polleverywhere/haml.rb
66
63
  - lib/polleverywhere/http.rb
67
64
  - lib/polleverywhere/http/adapter.rb
68
65
  - lib/polleverywhere/http/request_builder.rb
@@ -76,32 +73,29 @@ files:
76
73
  has_rdoc: true
77
74
  homepage: http://www.github.com/polleverywhere/polleverywhere
78
75
  licenses: []
79
-
80
76
  post_install_message:
81
77
  rdoc_options: []
82
-
83
- require_paths:
78
+ require_paths:
84
79
  - lib
85
- required_ruby_version: !ruby/object:Gem::Requirement
80
+ required_ruby_version: !ruby/object:Gem::Requirement
86
81
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
91
- required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
87
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: "0"
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
97
92
  requirements: []
98
-
99
93
  rubyforge_project: polleverywhere
100
- rubygems_version: 1.5.2
94
+ rubygems_version: 1.6.2
101
95
  signing_key:
102
96
  specification_version: 3
103
97
  summary: Integrate Poll Everywhere into your Ruby applications
104
- test_files:
98
+ test_files:
105
99
  - spec/integration/api_spec.rb
106
100
  - spec/lib/polleverywhere_spec.rb
107
101
  - spec/spec_helper.rb
data/api/build/index.html DELETED
File without changes
data/docs/api.haml DELETED
@@ -1,112 +0,0 @@
1
- !!! html
2
- %html
3
- %head
4
- %title Poll Everywhere API
5
- %body
6
- %header
7
- %h1 Poll Everywhere API Documentation
8
-
9
- %section
10
- %p This API assumes that you are familar with the low-level semantics of HTTP, including the use of tools like cURL, and JSON.
11
-
12
- %h1 Authentication
13
- %p HTTP Basic authentication is currently used for logging into Poll Everywhere accounts. More information can be found at <a href="http://en.wikipedia.org/HTTP Basic">Wikipedia</a>.
14
-
15
- %h1 We use JSON
16
- %p Simple 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'.
17
-
18
- %h1 Polls
19
- %h2 Multiple choice polls
20
- %p These polls are great for collecting structured information from audiences if you want to define a set of answers that participants may choose from.
21
-
22
- %h3 Attributes
23
- %dl.attributes
24
- %dt=PollEverywhere::MultipleChoicePoll.root_key
25
- %dd Root key for multiple choice poll data.
26
- %dd
27
- %dl
28
- -PollEverywhere::MultipleChoicePoll.props.each do |_, prop|
29
- %dt=prop.name
30
- %dd=prop.description
31
- -if prop.name == :options
32
- %dd
33
- %dl
34
- -PollEverywhere::MultipleChoicePoll::Option.props.each do |_, prop|
35
- %dt=prop.name
36
- %dd=prop.description
37
- %h3 Creating a multiple choice poll
38
- :ruby
39
- example do
40
- @mcp = PollEverywhere::MultipleChoicePoll.from_hash(:title => 'Hey dude!', :options => %w[red blue green]).save
41
- end
42
-
43
- %h3 Changing the title of a multiple choice poll
44
- :ruby
45
- example do
46
- @mcp.title = "I like different titles"
47
- @mcp.save
48
- end
49
-
50
- %h3 Closing and opening multiple choice polls
51
- %p To close a poll, change the state to "closed"
52
- :ruby
53
- example do
54
- @mcp.stop
55
- end
56
-
57
- %p To open it back up (and allow responses to come on through) change the state to "opened"
58
- :ruby
59
- example do
60
- @mcp.start
61
- end
62
-
63
- %h3 Delete a multiple choice poll
64
- %p When you're totally finished with the poll and you want to tidy things up a bit, you can delete polls
65
- :ruby
66
- example do
67
- @mcp.destroy
68
- end
69
-
70
- %h2 Free text polls
71
- %p These polls are used to collect short answers or unstructured responses from participants.
72
- %h3 Attributes
73
- %dl.attributes
74
- %dt=PollEverywhere::FTP.root_key
75
- %dd Root key for free text poll data.
76
- %dd
77
- %dl
78
- -PollEverywhere::FTP.props.each do |_, prop|
79
- %dt=prop.name
80
- %dd=prop.description
81
-
82
- %h3 Create free text polls
83
- %p Creating a free text poll is similar to building a multiple choice poll, just without the options attribute.
84
- :ruby
85
- example do
86
- @ftp = PollEverywhere::FreeTextPoll.from_hash(:title => "What is the meaning of life?").save
87
- end
88
-
89
- %h3 Modify a free text poll
90
- %p Change the title attribute to change the poll
91
- :ruby
92
- example do
93
- @ftp.state = "opened"
94
- @ftp.save
95
- end
96
-
97
- %h3 Delete a free text poll
98
- :ruby
99
- example do
100
- @ftp.destroy
101
- end
102
-
103
- %footer
104
- %p
105
- This documentation was automatically generated by the Poll Everywhere rubygem at
106
- =succeed '.' do
107
- %a(href="http://github.com/polleverywhere/polleverywhere") http://github.com/polleverywhere/polleverywhere
108
- Community support for the API is available on the
109
- %a(href="http://groups.google.com/group/polleverywhere-dev") Poll Everywhere Developer mailing list
110
- and paid professional support at
111
- =succeed '.' do
112
- %a(href="http://www.polleverywhere.com/professional-support") Poll Everywhere
@@ -1,37 +0,0 @@
1
- # require 'sourcify'
2
- require 'haml'
3
-
4
- module PollEverywhere
5
- module API
6
- # Generates API integration documentation from HAML
7
- class Documentation
8
- attr_reader :template
9
-
10
- def initialize(template)
11
- @template = template
12
- end
13
-
14
- # Generates API documentation
15
- def generate
16
- Haml::Engine.new(template, :format => :html5).render(self)
17
- end
18
-
19
- # Generate the HAML documentation from the default docs path
20
- def self.generate(path=File.expand_path('../../../docs/api.haml', __FILE__))
21
- new(File.read(path)).generate
22
- end
23
-
24
- def examples(model)
25
- model.http.adapter.request.to_curl
26
- end
27
-
28
- def example(&block)
29
- formats = {}
30
- block.call
31
- # formats[:ruby] = block.to_source(:strip_enclosure => true)
32
- formats[:curl] = PollEverywhere.config.http_adapter.last_requests.map(&:to_curl).join("\n\n")
33
- puts formats.map{ |format, example| %(<pre class="#{format}">#{example}</pre>) }.join
34
- end
35
- end
36
- end
37
- end