google_forms 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google_form.rb +5 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac8065484bf64be707159c0525e865336672991ed37325d7a9bf7e02bf4cd16f
4
- data.tar.gz: 22555253d4c4ed60939e7448784303474873caaa57e6f103d8e1815b38879faa
3
+ metadata.gz: de9bb56cb059ef151d9eeba10deb0f6894987c2abb49ffedb66e7438ae05c4bf
4
+ data.tar.gz: 3b506415322f67192cf453c4046a30db0891c1daae8956ccb190c71bd5b78a5a
5
5
  SHA512:
6
- metadata.gz: 14121db7fa919144dec6ec5115d425825fd7d22745f4fc4f070405b6aa1ad1010c1554cc9da70a171e5a07cccc77eb27cfba4aff364cf41d6c9e9fc048cf59f5
7
- data.tar.gz: 030c0043b60eb14665862e73e27566523fe5c95f42d10e46b31f63974881cd52a870917bb55bff8f527df1b43ce11261b9b72ea289552bea9d4aa3f11c21c7fb
6
+ metadata.gz: 591c3b9021b54eff71fe3ab2150d250bc1b023fb5e023baa8cb791402b3925477f87f1f41679cf6de4052a38afeb63af9e071acd1cfa08b3a0667bd5fe4b84a0
7
+ data.tar.gz: bfd19d237654ea518539e98a62aaa7608b37514b4494ba257b86b8d83503403eff74370490316d45c367333a53c404ba5b16e0eb2aedc724abec4e5a4bba4eb0
@@ -25,13 +25,15 @@ class GoogleForm
25
25
  def inputs
26
26
  input_nodes = nokogiri_doc
27
27
  .css('form input')
28
- .reject { |i| i.attribute('aria-label').nil? }
28
+ .reject { |i| i.attribute('type').value == 'hidden' }
29
29
 
30
30
  @inputs ||= input_nodes.map do |i|
31
+ container = i.ancestors('.freebirdFormviewerViewNumberedItemContainer')
32
+
31
33
  GoogleFormInput.new(
32
34
  i.attribute('type').value,
33
- i.attribute('aria-label').value,
34
- i.attribute('name').value
35
+ container.css('.freebirdFormviewerComponentsQuestionBaseHeader').text,
36
+ "entry.#{container.css('[@jsmodel]').attribute('data-params').value[/\[.*\]/].delete('[]').split(',')[4]}"
35
37
  )
36
38
  end
37
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Venediktov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2020-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubygems_version: 3.1.2
69
+ rubygems_version: 3.0.8
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Posting to Google Forms from your ruby scripts