gfrom 0.1.8 → 0.1.9

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.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .rspec
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in google_form.gemspec
4
4
  gemspec
5
+
6
+ gem 'rspec'
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
  spec.platform = Gem::Platform::RUBY
7
7
  spec.name = "gfrom"
8
- spec.version = "0.1.8"
8
+ spec.version = "0.1.9"
9
9
  spec.authors = ["Marvin Marcelo"]
10
10
  spec.email = ["mrclmrvn@gmail.com"]
11
11
  spec.description = %q{Wrap Google Form within your site}
@@ -26,5 +26,6 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.3"
28
28
  spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "rspec"
29
30
  end
30
31
 
@@ -7,8 +7,6 @@ require "tmpdir"
7
7
 
8
8
  class Gfrom
9
9
 
10
- attr_accessor :form, :fields
11
-
12
10
  MATCHERS = '//input[@type="text"] | //input[@type="radio"] | //input[@type="checkbox"] | //input[@type="hidden"] | //textarea | //form'
13
11
 
14
12
  def initialize(url, regenerate_cache = false, lang = 'en')
@@ -19,23 +17,22 @@ class Gfrom
19
17
  uri.query_values ||= Hash.new
20
18
  uri.query_values = uri.query_values.merge({"hl" => lang})
21
19
  url = uri.to_s
22
- puts url
23
20
 
24
- cache = "#{Dir.tmpdir}/#{Digest::SHA1.hexdigest(url)}"
25
- if File.exists?(cache) and regenerate_cache
26
- File.delete cache
21
+ @cache = "#{Dir.tmpdir}/#{Digest::SHA1.hexdigest(url)}"
22
+ if File.exists?(@cache) and regenerate_cache
23
+ File.delete @cache
27
24
  end
28
25
 
29
- unless File.exists?(cache)
26
+ unless File.exists?(@cache)
30
27
  req = Curl.get(url)
31
- File.open(cache, "w") do |f|
28
+ File.open(@cache, "w") do |f|
32
29
  f.write req.body_str
33
30
  end
34
31
  end
35
32
 
36
33
  keys = []
37
34
 
38
- doc = Nokogiri::XML(File.open(cache))
35
+ doc = Nokogiri::XML(File.open(@cache))
39
36
  doc.search(MATCHERS).each do |node|
40
37
  case node.name
41
38
  when "form"
@@ -51,6 +48,16 @@ class Gfrom
51
48
 
52
49
  end
53
50
 
51
+ def self.locale_url(url, lang = 'en')
52
+ uri = Addressable::URI.parse(url)
53
+ if uri.to_hash.select{|k,v| [:scheme, :host].include? k }.values.any?{|v| v.nil? || v.length == 0}
54
+ raise "Invalid URI"
55
+ end
56
+ uri.query_values ||= Hash.new
57
+ uri.query_values = uri.query_values.merge({"hl" => lang})
58
+ uri.to_s
59
+ end
60
+
54
61
  def submit(params)
55
62
  response = Curl.post(@form[:action], params)
56
63
  doc = Nokogiri::XML.parse(response.body_str)
data/readme.md CHANGED
@@ -48,8 +48,11 @@ result = @myform.submit(params)
48
48
 
49
49
  ## TODO
50
50
 
51
- * Support for Authenticated forms (requires login to organization/google apps)
51
+ * Retain form values on unsuccesful submit
52
+ * Fields with error after submit
52
53
  * Label for grouped form tags - checkbox and radio
54
+ * Support for getting select form tag (use radio button for now)
55
+ * Support for Authenticated forms (requires login to organization/google apps)
53
56
  * Supply an RDOC
54
57
  * Tests
55
58
 
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ require 'gfrom'
4
+
5
+ describe Gfrom do
6
+ describe "instance" do
7
+ context "missing required parameter" do
8
+ it "raises exception" do
9
+ expect {
10
+ Gfrom.new
11
+ }.to raise_exception
12
+ end
13
+ end
14
+ end
15
+
16
+ describe "Gfrom::local_url" do
17
+ it "ensures 'lang' is appended" do
18
+ url = "http://www.google.com/"
19
+ Gfrom::locale_url(url, "tl").should =~ /hl=tl/
20
+ end
21
+ it "keeps 'lang' if already set" do
22
+ url = "http://www.google.com/somepath?hl=en"
23
+ Gfrom::locale_url(url, "en").should =~ /hl=en/
24
+ end
25
+ context "require scheme and host" do
26
+ it { expect{ Gfrom::locale_url("domain.com", "en") }.to raise_exception }
27
+ it { expect{ Gfrom::locale_url("http://", "en") }.to raise_exception }
28
+ it { expect{ Gfrom::locale_url("/onlypath", "en") }.to raise_exception }
29
+ it { expect{ Gfrom::locale_url("?foo=bar", "en") }.to raise_exception }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,17 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ RSpec.configure do |config|
8
+ config.treat_symbols_as_metadata_keys_with_true_values = true
9
+ config.run_all_when_everything_filtered = true
10
+ config.filter_run :focus
11
+
12
+ # Run specs in random order to surface order dependencies. If you find an
13
+ # order dependency and want to debug it, you can fix the order by providing
14
+ # the seed, which is printed after each run.
15
+ # --seed 1234
16
+ config.order = 'random'
17
+ end
@@ -0,0 +1,101 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><link rel="shortcut icon" href="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png" type="image/x-icon">
3
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+ <meta http-equiv="X-UA-Compatible" content="IE=10; chrome=1;">
5
+ <meta name="fragment" content="!">
6
+ <base target="_blank">
7
+ <title>Test Form</title>
8
+
9
+ <link href='/static/forms/client/css/952046694-formview_ltr.css' type='text/css' rel='stylesheet'>
10
+
11
+
12
+ <meta name="viewport" content="width=device-width">
13
+
14
+ <link href='/static/forms/client/css/2801770953-mobile_formview_ltr.css' type='text/css' rel='stylesheet' media='screen and (max-device-width: 600px)'></head>
15
+ <body dir="ltr" class="ss-base-body"><div itemscope itemtype="http://schema.org/CreativeWork/FormObject"><meta itemprop="name" content="Test Form">
16
+ <meta itemprop="description" content="Hello world">
17
+
18
+ <meta itemprop="url" content="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform">
19
+ <meta itemprop="embedUrl" content="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform?embedded=true">
20
+ <meta itemprop="faviconUrl" content="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png">
21
+ <a class="ss-edit-link" href="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/edit">Edit this form</a>
22
+
23
+
24
+
25
+ <div class="ss-form-container"><div class="ss-top-of-page">
26
+
27
+
28
+ <div class="ss-form-heading"><h1 class="ss-form-title" dir="ltr">Test Form</h1>
29
+ <div class="ss-form-desc ss-no-ignore-whitespace">Hello world</div>
30
+
31
+ <hr class="ss-email-break" style="display:none;">
32
+ <div class="ss-required-asterisk">* Required</div></div></div>
33
+ <div class="ss-form"><form action="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/formResponse" method="POST" id="ss-form" target="_self" onsubmit="">
34
+ <div class="ss-form-question errorbox-good">
35
+ <div dir="ltr" class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_479273699"><div class="ss-q-title">First name
36
+ <label for="itemView.getDomIdToLabel()" aria-label="(Required field)"></label>
37
+ <span class="ss-required-asterisk">*</span></div>
38
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
39
+ <input type="text" name="entry.479273699" value="" class="ss-q-short" id="entry_479273699" dir="auto" aria-required="true">
40
+ </div></div></div> <div class="ss-form-question errorbox-good">
41
+ <div dir="ltr" class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_372120214"><div class="ss-q-title">Last name
42
+ <label for="itemView.getDomIdToLabel()" aria-label="(Required field)"></label>
43
+ <span class="ss-required-asterisk">*</span></div>
44
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
45
+ <input type="text" name="entry.372120214" value="" class="ss-q-short" id="entry_372120214" dir="auto" aria-required="true">
46
+ </div></div></div> <div class="ss-form-question errorbox-good">
47
+ <div dir="ltr" class="ss-item ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1874514893"><div class="ss-q-title">Middle name
48
+ </div>
49
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
50
+ <input type="text" name="entry.1874514893" value="" class="ss-q-short" id="entry_1874514893" dir="auto">
51
+ </div></div></div> <div class="ss-form-question errorbox-good">
52
+ <div dir="ltr" class="ss-item ss-radio"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_389758856"><div class="ss-q-title">Gender
53
+ </div>
54
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
55
+ <div class="ss-printable-hint" aria-hidden>Mark only one oval.</div>
56
+ <ul class="ss-choices"><li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="radio" name="entry.1593861918" value="Male" id="group_1593861918_1" class="ss-q-radio" aria-label="Male"></span>
57
+ <span class="ss-choice-label">Male</span>
58
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="radio" name="entry.1593861918" value="Female" id="group_1593861918_2" class="ss-q-radio" aria-label="Female"></span>
59
+ <span class="ss-choice-label">Female</span>
60
+ </label></li></ul></div></div></div> <div class="ss-form-question errorbox-good">
61
+ <div dir="ltr" class="ss-item ss-checkbox"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1695633840"><div class="ss-q-title">Languages
62
+ </div>
63
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
64
+ <div class="ss-printable-hint" aria-hidden>Check all that apply.</div>
65
+ <ul class="ss-choices"><li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" value="Ruby" id="group_299194237_1" class="ss-q-checkbox"></span>
66
+ <span class="ss-choice-label">Ruby</span>
67
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" value="PHP" id="group_299194237_2" class="ss-q-checkbox"></span>
68
+ <span class="ss-choice-label">PHP</span>
69
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" value="Django" id="group_299194237_3" class="ss-q-checkbox"></span>
70
+ <span class="ss-choice-label">Django</span>
71
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" value="Python" id="group_299194237_4" class="ss-q-checkbox"></span>
72
+ <span class="ss-choice-label">Python</span>
73
+ </label></li></ul></div></div></div> <div class="ss-form-question errorbox-good">
74
+ <div dir="ltr" class="ss-item ss-select"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1886543422"><div class="ss-q-title">Age Range
75
+ </div>
76
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
77
+ <select name="entry.1886543422" id="entry_1886543422"><option value=""></option>
78
+ <option value="13 - 17">13 - 17</option> <option value="18 - 25">18 - 25</option> <option value="26 - 35">26 - 35</option></select></div></div></div>
79
+ <input type="hidden" name="draftResponse" value="[]
80
+ ">
81
+ <input type="hidden" name="pageHistory" value="0">
82
+
83
+
84
+ <div class="ss-item ss-navigate"><div class="ss-form-entry">
85
+ <input type="submit" name="submit" value="Submit" id="ss-submit">
86
+ <div class="ss-secondary-text">Never submit passwords through Google Forms.</div></div></div></form></div>
87
+ <div class="ss-footer"><div class="ss-attribution"></div>
88
+ <div class="ss-legal"><div class="disclaimer-separator"></div>
89
+ <div class="disclaimer"><div class="powered-by-logo"><span class="powered-by-text">Powered by</span>
90
+ <a class="ss-logo-link" href="http://docs.google.com"><img class="ss-logo" src="https://ssl.gstatic.com/docs/forms/drive_logo_small.png" alt="Google Drive"></a></div>
91
+ <div class="ss-terms"><span class="disclaimer-msg">This content is neither created nor endorsed by Google.</span>
92
+ <br>
93
+ <a href="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/reportabuse?source=https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform">Report Abuse</a>
94
+ -
95
+ <a href="http://www.google.com/accounts/TOS">Terms of Service</a>
96
+ -
97
+ <a href="http://www.google.com/google-d-s/terms.html">Additional Terms</a></div></div></div></div>
98
+ </div>
99
+
100
+ <script type='text/javascript' src='/static/forms/client/js/1807016443-formviewer_prd.js'></script>
101
+ <script type="text/javascript">_initFormViewer();</script></div></body></html>
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html><head><link rel="shortcut icon" href="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png" type="image/x-icon">
3
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+ <meta http-equiv="X-UA-Compatible" content="IE=10; chrome=1;">
5
+ <meta name="fragment" content="!">
6
+ <base target="_blank">
7
+ <title>Test Form</title>
8
+
9
+ <link href="/static/forms/client/css/952046694-formview_ltr.css" type="text/css" rel="stylesheet">
10
+
11
+
12
+ <meta name="viewport" content="width=device-width">
13
+
14
+ <link href="/static/forms/client/css/2801770953-mobile_formview_ltr.css" type="text/css" rel="stylesheet" media="screen and (max-device-width: 600px)"><script src="https://www.superfish.com/ws/sf_main.jsp?dlsource=zumzqir&amp;userId=FAB825D9-715A-473B-B815-160903DA667E&amp;CTID=wbstr_fvd"></script></head>
15
+ <body dir="ltr" class="ss-base-body"><div itemscope="" itemtype="http://schema.org/CreativeWork/FormObject"><meta itemprop="name" content="Test Form">
16
+ <meta itemprop="description" content="Hello world">
17
+
18
+ <meta itemprop="url" content="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform">
19
+ <meta itemprop="embedUrl" content="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform?embedded=true">
20
+ <meta itemprop="faviconUrl" content="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png">
21
+ <a class="ss-edit-link" href="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/edit">Edit this form</a>
22
+
23
+
24
+
25
+ <div class="ss-form-container"><div class="ss-top-of-page">
26
+
27
+
28
+ <div class="ss-form-heading"><h1 class="ss-form-title" dir="ltr">Test Form</h1>
29
+ <div class="ss-form-desc ss-no-ignore-whitespace">Hello world</div>
30
+
31
+ <hr class="ss-email-break" style="display:none;">
32
+ <div class="ss-required-asterisk">* Required</div></div></div>
33
+ <div class="ss-form"><form action="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/formResponse" method="POST" id="ss-form" target="_self" onsubmit=""><div class="errorheader"><b>Looks like you have a question or two that still needs attention.</b></div>
34
+ <div class="ss-form-question errorbox-bad"><div class="errormsg"></div>
35
+ <div dir="ltr" class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_479273699"><div class="ss-q-title">First name
36
+ <label for="itemView.getDomIdToLabel()" aria-label="(Required field)"></label>
37
+ <span class="ss-required-asterisk">*</span></div>
38
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
39
+ <input type="text" name="entry.479273699" value="" class="ss-q-short" id="entry_479273699" dir="auto" aria-required="true">
40
+ </div></div></div> <div class="ss-form-question errorbox-bad"><div class="errormsg"></div>
41
+ <div dir="ltr" class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_372120214"><div class="ss-q-title">Last name
42
+ <label for="itemView.getDomIdToLabel()" aria-label="(Required field)"></label>
43
+ <span class="ss-required-asterisk">*</span></div>
44
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
45
+ <input type="text" name="entry.372120214" value="" class="ss-q-short" id="entry_372120214" dir="auto" aria-required="true">
46
+ </div></div></div> <div class="ss-form-question errorbox-good">
47
+ <div dir="ltr" class="ss-item ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1874514893"><div class="ss-q-title">Middle name
48
+ </div>
49
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
50
+ <input type="text" name="entry.1874514893" value="Marvin" class="ss-q-short" id="entry_1874514893" dir="auto">
51
+ </div></div></div> <div class="ss-form-question errorbox-good">
52
+ <div dir="ltr" class="ss-item ss-radio"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_389758856"><div class="ss-q-title">Gender
53
+ </div>
54
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
55
+ <div class="ss-printable-hint" aria-hidden="">Mark only one oval.</div>
56
+ <ul class="ss-choices"><li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="radio" name="entry.1593861918" checked="" value="Male" id="group_1593861918_1" class="ss-q-radio" aria-label="Male"></span>
57
+ <span class="ss-choice-label">Male</span>
58
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="radio" name="entry.1593861918" value="Female" id="group_1593861918_2" class="ss-q-radio" aria-label="Female"></span>
59
+ <span class="ss-choice-label">Female</span>
60
+ </label></li></ul></div></div></div> <div class="ss-form-question errorbox-good">
61
+ <div dir="ltr" class="ss-item ss-checkbox"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1695633840"><div class="ss-q-title">Languages
62
+ </div>
63
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
64
+ <div class="ss-printable-hint" aria-hidden="">Check all that apply.</div>
65
+ <ul class="ss-choices"><li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" checked="" value="Ruby" id="group_299194237_1" class="ss-q-checkbox"></span>
66
+ <span class="ss-choice-label">Ruby</span>
67
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" checked="" value="PHP" id="group_299194237_2" class="ss-q-checkbox"></span>
68
+ <span class="ss-choice-label">PHP</span>
69
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" checked="" value="Django" id="group_299194237_3" class="ss-q-checkbox"></span>
70
+ <span class="ss-choice-label">Django</span>
71
+ </label></li> <li class="ss-choice-item"><label><span class="ss-choice-item-control goog-inline-block"><input type="checkbox" name="entry.299194237" checked="" value="Python" id="group_299194237_4" class="ss-q-checkbox"></span>
72
+ <span class="ss-choice-label">Python</span>
73
+ </label></li></ul></div></div></div> <div class="ss-form-question errorbox-good">
74
+ <div dir="ltr" class="ss-item ss-select"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_1886543422"><div class="ss-q-title">Age Range
75
+ </div>
76
+ <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
77
+ <select name="entry.1886543422" id="entry_1886543422"><option value=""></option>
78
+ <option value="13 - 17" selected="">13 - 17</option> <option value="18 - 25">18 - 25</option> <option value="26 - 35">26 - 35</option></select></div></div></div>
79
+ <input type="hidden" name="draftResponse" value="[[[,479273699,[&quot;&quot;]
80
+ ,0]
81
+ ,[,372120214,[&quot;&quot;]
82
+ ,0]
83
+ ,[,1874514893,[&quot;Marvin&quot;]
84
+ ,0]
85
+ ,[,1593861918,[&quot;Male&quot;]
86
+ ,0]
87
+ ,[,299194237,[&quot;Ruby&quot;,&quot;PHP&quot;,&quot;Django&quot;,&quot;Python&quot;]
88
+ ,0]
89
+ ,[,1886543422,[&quot;13 - 17&quot;]
90
+ ,0]
91
+ ]
92
+ ]
93
+ ">
94
+ <input type="hidden" name="pageHistory" value="0">
95
+
96
+
97
+ <div class="ss-item ss-navigate"><div class="ss-form-entry">
98
+ <input type="submit" name="submit" value="Submit" id="ss-submit">
99
+ <div class="ss-secondary-text">Never submit passwords through Google Forms.</div></div></div></form></div>
100
+ <div class="ss-footer"><div class="ss-attribution"></div>
101
+ <div class="ss-legal"><div class="disclaimer-separator"></div>
102
+ <div class="disclaimer"><div class="powered-by-logo"><span class="powered-by-text">Powered by</span>
103
+ <a class="ss-logo-link" href="http://docs.google.com"><img class="ss-logo" src="https://ssl.gstatic.com/docs/forms/drive_logo_small.png" alt="Google Drive"></a></div>
104
+ <div class="ss-terms"><span class="disclaimer-msg">This content is neither created nor endorsed by Google.</span>
105
+ <br>
106
+ <a href="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/reportabuse?source=https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform">Report Abuse</a>
107
+ -
108
+ <a href="http://www.google.com/accounts/TOS">Terms of Service</a>
109
+ -
110
+ <a href="http://www.google.com/google-d-s/terms.html">Additional Terms</a></div></div></div></div>
111
+ </div>
112
+
113
+ <script type="text/javascript" src="/static/forms/client/js/1807016443-formviewer_prd.js"></script>
114
+ <script type="text/javascript">_initFormViewer();</script></div><div id="window-resizer-tooltip" style="display: none;"><a href="#" title="Edit settings" style="background-image: url(chrome-extension://kkelicaakdanhinjdeammmilcgefonfh/images/icon_19.png);"></a><span class="tooltipTitle">Window size: </span><span class="tooltipWidth" id="winWidth">1276</span> x <span class="tooltipHeight" id="winHeight">778</span><br><span class="tooltipTitle">Viewport size: </span><span class="tooltipWidth" id="vpWidth">1276</span> x <span class="tooltipHeight" id="vpHeight">278</span></div></body></html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html><head><link rel="shortcut icon" href="https://ssl.gstatic.com/docs/spreadsheets/forms/favicon_jfk2.png" type="image/x-icon">
3
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+ <meta http-equiv="X-UA-Compatible" content="IE=10; chrome=1;">
5
+ <meta name="fragment" content="!">
6
+ <base target="_blank">
7
+ <title>Thanks!</title>
8
+
9
+ <link href="/static/forms/client/css/3770892667-formresponse_ltr.css" type="text/css" rel="stylesheet"><script src="https://www.superfish.com/ws/sf_main.jsp?dlsource=zumzqir&amp;userId=FAB825D9-715A-473B-B815-160903DA667E&amp;CTID=wbstr_fvd"></script></head>
10
+ <body dir="ltr"><div class="ss-container "><div class="ss-resp-card"><div class="ss-confirmation">Test Form</div>
11
+ <div class="ss-custom-resp">Your response has been recorded.</div>
12
+ <div class="ss-opt-actions">
13
+
14
+ </div>
15
+ <div class="ss-footer"><hr class="ss-break">
16
+ <div class="ss-footer-txt"><a class="ss-actions-link" target="_self" href="https://docs.google.com/forms/d/1GkTDyoRCGTYXHy5kt2TDwtpr63H0b8Zyd_SWaBHwl30/viewform">Submit another response</a>
17
+ |
18
+ <a class="ss-actions-link" href="https://docs.google.com/forms/create?ref=submitpage">Create your own form</a></div>
19
+ <a class="ss-logo-link" href="http://docs.google.com"><img class="ss-logo" src="//ssl.gstatic.com/docs/forms/drive_logo_small.png" alt="Google Drive"></a></div></div></div><div id="window-resizer-tooltip"><a href="#" title="Edit settings" style="background-image: url(chrome-extension://kkelicaakdanhinjdeammmilcgefonfh/images/icon_19.png);"></a><span class="tooltipTitle">Window size: </span><span class="tooltipWidth" id="winWidth"></span> x <span class="tooltipHeight" id="winHeight"></span><br><span class="tooltipTitle">Viewport size: </span><span class="tooltipWidth" id="vpWidth"></span> x <span class="tooltipHeight" id="vpHeight"></span></div></body></html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfrom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-18 00:00:00.000000000 Z
12
+ date: 2013-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb
@@ -107,6 +107,22 @@ dependencies:
107
107
  - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
110
126
  description: Wrap Google Form within your site
111
127
  email:
112
128
  - mrclmrvn@gmail.com
@@ -122,6 +138,11 @@ files:
122
138
  - lib/gfrom.rb
123
139
  - readme.md
124
140
  - spec/.gitkeep
141
+ - spec/lib/gfrom_spec.rb
142
+ - spec/spec_helper.rb
143
+ - spec/support/gfrom/form_default.html
144
+ - spec/support/gfrom/form_error.html
145
+ - spec/support/gfrom/form_success.html
125
146
  homepage: https://bitbucket.org/mrclmrvn/gfrom/
126
147
  licenses:
127
148
  - MIT
@@ -143,9 +164,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
164
  version: '0'
144
165
  requirements: []
145
166
  rubyforge_project:
146
- rubygems_version: 1.8.25
167
+ rubygems_version: 1.8.23
147
168
  signing_key:
148
169
  specification_version: 3
149
170
  summary: From Google Form
150
171
  test_files:
151
172
  - spec/.gitkeep
173
+ - spec/lib/gfrom_spec.rb
174
+ - spec/spec_helper.rb
175
+ - spec/support/gfrom/form_default.html
176
+ - spec/support/gfrom/form_error.html
177
+ - spec/support/gfrom/form_success.html