BeverageScrapper 0.5.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8fcb5533ead9dda61442e37cfc5c703b0a1e7032
4
+ data.tar.gz: d22e0323058915cd7a01508c689e3b8fb3f357f0
5
+ SHA512:
6
+ metadata.gz: d2f82b65af32b309d027979b1d098e23270aae420f291b0eea6d456d4e6a827457a1b6c317a79c5c8325e21461c46484b86f076c0dac316f9dc693ce4a06af85
7
+ data.tar.gz: 3bf9e16cb362fc0e8c71bcf68b0eb6f417fc60e8c1589a59beb0d155ae218dc19aaebbaeef525c631adc4adf46dcf2e090d6e149dfaddf8c421ff32e1d96260e
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1 @@
1
+ BeverageScrapper
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build BeverageScrapper-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated file" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install BeverageScrapper-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install BeverageScrapper-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push BeverageScrapper-0.1.0.gem to Rubygems" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Ruby Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
+ <option name="GEM_APP_TEST_PATH" value="$MODULE_DIR$/test" />
8
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager">
13
+ <content url="file://$MODULE_DIR$">
14
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
15
+ <excludeFolder url="file://$MODULE_DIR$/.bundle" />
16
+ <excludeFolder url="file://$MODULE_DIR$/vendor/bundle" />
17
+ </content>
18
+ <orderEntry type="inheritedJdk" />
19
+ <orderEntry type="sourceFolder" forTests="false" />
20
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.11.2, RVM: ruby-2.2.0) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, RVM: ruby-2.2.0) [gem]" level="application" />
22
+ </component>
23
+ </module>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding">
4
+ <file url="PROJECT" charset="UTF-8" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
4
+ <OptionsSetting value="true" id="Add" />
5
+ <OptionsSetting value="true" id="Remove" />
6
+ <OptionsSetting value="true" id="Checkout" />
7
+ <OptionsSetting value="true" id="Update" />
8
+ <OptionsSetting value="true" id="Status" />
9
+ <OptionsSetting value="true" id="Edit" />
10
+ <ConfirmationsSetting value="0" id="Add" />
11
+ <ConfirmationsSetting value="0" id="Remove" />
12
+ </component>
13
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.2.0" project-jdk-type="RUBY_SDK" />
14
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/BeverageScrapper.iml" filepath="$PROJECT_DIR$/.idea/BeverageScrapper.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,526 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="888376e7-b484-4f3e-accf-b648421f8e75" name="Default" comment="" />
5
+ <ignored path="BeverageScrapper.iws" />
6
+ <ignored path=".idea/workspace.xml" />
7
+ <ignored path=".idea/dataSources.local.xml" />
8
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
+ <option name="TRACKING_ENABLED" value="true" />
10
+ <option name="SHOW_DIALOG" value="false" />
11
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
12
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
13
+ <option name="LAST_RESOLUTION" value="IGNORE" />
14
+ </component>
15
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
16
+ <component name="CreatePatchCommitExecutor">
17
+ <option name="PATCH_PATH" value="" />
18
+ </component>
19
+ <component name="FavoritesManager">
20
+ <favorites_list name="BeverageScrapper" />
21
+ </component>
22
+ <component name="FileEditorManager">
23
+ <leaf>
24
+ <file leaf-file-name="console" pinned="false" current-in-tab="false">
25
+ <entry file="file://$PROJECT_DIR$/bin/console">
26
+ <provider selected="true" editor-type-id="text-editor">
27
+ <state vertical-scroll-proportion="0.0">
28
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
29
+ <folding />
30
+ </state>
31
+ </provider>
32
+ </entry>
33
+ </file>
34
+ <file leaf-file-name="setup" pinned="false" current-in-tab="false">
35
+ <entry file="file://$PROJECT_DIR$/bin/setup">
36
+ <provider selected="true" editor-type-id="text-editor">
37
+ <state vertical-scroll-proportion="0.0">
38
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
39
+ <folding />
40
+ </state>
41
+ </provider>
42
+ </entry>
43
+ </file>
44
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
45
+ <entry file="file://$PROJECT_DIR$/lib/BeverageScrapper/version.rb">
46
+ <provider selected="true" editor-type-id="text-editor">
47
+ <state vertical-scroll-proportion="0.0">
48
+ <caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
49
+ <folding />
50
+ </state>
51
+ </provider>
52
+ </entry>
53
+ </file>
54
+ <file leaf-file-name="BeverageScrapper.gemspec" pinned="false" current-in-tab="true">
55
+ <entry file="file://$PROJECT_DIR$/BeverageScrapper.gemspec">
56
+ <provider selected="true" editor-type-id="text-editor">
57
+ <state vertical-scroll-proportion="0.36724564">
58
+ <caret line="14" column="66" selection-start-line="14" selection-start-column="66" selection-end-line="14" selection-end-column="66" />
59
+ <folding />
60
+ </state>
61
+ </provider>
62
+ </entry>
63
+ </file>
64
+ <file leaf-file-name="BeverageScrapper.rb" pinned="false" current-in-tab="false">
65
+ <entry file="file://$PROJECT_DIR$/lib/BeverageScrapper.rb">
66
+ <provider selected="true" editor-type-id="text-editor">
67
+ <state vertical-scroll-proportion="0.0">
68
+ <caret line="15" column="15" selection-start-line="15" selection-start-column="15" selection-end-line="15" selection-end-column="15" />
69
+ <folding />
70
+ </state>
71
+ </provider>
72
+ </entry>
73
+ </file>
74
+ <file leaf-file-name="subject_list.rb" pinned="false" current-in-tab="false">
75
+ <entry file="file://$PROJECT_DIR$/lib/subject_list.rb">
76
+ <provider selected="true" editor-type-id="text-editor">
77
+ <state vertical-scroll-proportion="0.0">
78
+ <caret line="13" column="9" selection-start-line="13" selection-start-column="9" selection-end-line="13" selection-end-column="9" />
79
+ <folding />
80
+ </state>
81
+ </provider>
82
+ </entry>
83
+ </file>
84
+ <file leaf-file-name="my_test.rb" pinned="false" current-in-tab="false">
85
+ <entry file="file://$PROJECT_DIR$/test/my_test.rb">
86
+ <provider selected="true" editor-type-id="text-editor">
87
+ <state vertical-scroll-proportion="0.0">
88
+ <caret line="7" column="16" selection-start-line="7" selection-start-column="16" selection-end-line="7" selection-end-column="16" />
89
+ <folding />
90
+ </state>
91
+ </provider>
92
+ </entry>
93
+ </file>
94
+ <file leaf-file-name="sentence.rb" pinned="false" current-in-tab="false">
95
+ <entry file="file://$PROJECT_DIR$/lib/sentence.rb">
96
+ <provider selected="true" editor-type-id="text-editor">
97
+ <state vertical-scroll-proportion="0.0">
98
+ <caret line="37" column="16" selection-start-line="37" selection-start-column="16" selection-end-line="37" selection-end-column="16" />
99
+ <folding />
100
+ </state>
101
+ </provider>
102
+ </entry>
103
+ </file>
104
+ <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
105
+ <entry file="file://$PROJECT_DIR$/README.md">
106
+ <provider selected="true" editor-type-id="text-editor">
107
+ <state vertical-scroll-proportion="-7.814815">
108
+ <caret line="50" column="0" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
109
+ <folding />
110
+ </state>
111
+ </provider>
112
+ </entry>
113
+ </file>
114
+ <file leaf-file-name="Gemfile.lock" pinned="false" current-in-tab="false">
115
+ <entry file="file://$PROJECT_DIR$/Gemfile.lock">
116
+ <provider selected="true" editor-type-id="text-editor">
117
+ <state vertical-scroll-proportion="0.0">
118
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
119
+ <folding />
120
+ </state>
121
+ </provider>
122
+ </entry>
123
+ </file>
124
+ </leaf>
125
+ </component>
126
+ <component name="FileTemplateManagerImpl">
127
+ <option name="RECENT_TEMPLATES">
128
+ <list>
129
+ <option value="TestUnit Test Template" />
130
+ <option value="Ruby Class Template" />
131
+ </list>
132
+ </option>
133
+ </component>
134
+ <component name="IdeDocumentHistory">
135
+ <option name="CHANGED_PATHS">
136
+ <list>
137
+ <option value="$PROJECT_DIR$/Gemfile" />
138
+ <option value="$PROJECT_DIR$/README.md" />
139
+ <option value="$PROJECT_DIR$/lib/sentence.rb" />
140
+ <option value="$PROJECT_DIR$/lib/subject_list.rb" />
141
+ <option value="$PROJECT_DIR$/lib/BeverageScrapper.rb" />
142
+ <option value="$PROJECT_DIR$/lib/BeverageScrapper/version.rb" />
143
+ <option value="$PROJECT_DIR$/BeverageScrapper.gemspec" />
144
+ </list>
145
+ </option>
146
+ </component>
147
+ <component name="JsBuildToolGruntFileManager" detection-done="true" />
148
+ <component name="JsBuildToolPackageJson" detection-done="true" />
149
+ <component name="JsGulpfileManager">
150
+ <detection-done>true</detection-done>
151
+ </component>
152
+ <component name="ProjectFrameBounds">
153
+ <option name="x" value="10" />
154
+ <option name="y" value="43" />
155
+ <option name="width" value="1260" />
156
+ <option name="height" value="686" />
157
+ </component>
158
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
159
+ <OptionsSetting value="true" id="Add" />
160
+ <OptionsSetting value="true" id="Remove" />
161
+ <OptionsSetting value="true" id="Checkout" />
162
+ <OptionsSetting value="true" id="Update" />
163
+ <OptionsSetting value="true" id="Status" />
164
+ <OptionsSetting value="true" id="Edit" />
165
+ <ConfirmationsSetting value="0" id="Add" />
166
+ <ConfirmationsSetting value="0" id="Remove" />
167
+ </component>
168
+ <component name="ProjectView">
169
+ <navigator currentView="ProjectPane" proportions="" version="1">
170
+ <flattenPackages />
171
+ <showMembers />
172
+ <showModules />
173
+ <showLibraryContents />
174
+ <hideEmptyPackages />
175
+ <abbreviatePackageNames />
176
+ <autoscrollToSource />
177
+ <autoscrollFromSource />
178
+ <sortByType />
179
+ <manualOrder />
180
+ <foldersAlwaysOnTop value="true" />
181
+ </navigator>
182
+ <panes>
183
+ <pane id="ProjectPane">
184
+ <subPane>
185
+ <PATH>
186
+ <PATH_ELEMENT>
187
+ <option name="myItemId" value="BeverageScrapper" />
188
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
189
+ </PATH_ELEMENT>
190
+ </PATH>
191
+ <PATH>
192
+ <PATH_ELEMENT>
193
+ <option name="myItemId" value="BeverageScrapper" />
194
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
195
+ </PATH_ELEMENT>
196
+ <PATH_ELEMENT>
197
+ <option name="myItemId" value="BeverageScrapper" />
198
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
199
+ </PATH_ELEMENT>
200
+ </PATH>
201
+ <PATH>
202
+ <PATH_ELEMENT>
203
+ <option name="myItemId" value="BeverageScrapper" />
204
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
205
+ </PATH_ELEMENT>
206
+ <PATH_ELEMENT>
207
+ <option name="myItemId" value="BeverageScrapper" />
208
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
209
+ </PATH_ELEMENT>
210
+ <PATH_ELEMENT>
211
+ <option name="myItemId" value="test" />
212
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
213
+ </PATH_ELEMENT>
214
+ </PATH>
215
+ <PATH>
216
+ <PATH_ELEMENT>
217
+ <option name="myItemId" value="BeverageScrapper" />
218
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
219
+ </PATH_ELEMENT>
220
+ <PATH_ELEMENT>
221
+ <option name="myItemId" value="BeverageScrapper" />
222
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
223
+ </PATH_ELEMENT>
224
+ <PATH_ELEMENT>
225
+ <option name="myItemId" value="lib" />
226
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
227
+ </PATH_ELEMENT>
228
+ </PATH>
229
+ <PATH>
230
+ <PATH_ELEMENT>
231
+ <option name="myItemId" value="BeverageScrapper" />
232
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
233
+ </PATH_ELEMENT>
234
+ <PATH_ELEMENT>
235
+ <option name="myItemId" value="BeverageScrapper" />
236
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
237
+ </PATH_ELEMENT>
238
+ <PATH_ELEMENT>
239
+ <option name="myItemId" value="lib" />
240
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
241
+ </PATH_ELEMENT>
242
+ <PATH_ELEMENT>
243
+ <option name="myItemId" value="BeverageScrapper" />
244
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
245
+ </PATH_ELEMENT>
246
+ </PATH>
247
+ <PATH>
248
+ <PATH_ELEMENT>
249
+ <option name="myItemId" value="BeverageScrapper" />
250
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
251
+ </PATH_ELEMENT>
252
+ <PATH_ELEMENT>
253
+ <option name="myItemId" value="BeverageScrapper" />
254
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
255
+ </PATH_ELEMENT>
256
+ <PATH_ELEMENT>
257
+ <option name="myItemId" value="bin" />
258
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
259
+ </PATH_ELEMENT>
260
+ </PATH>
261
+ </subPane>
262
+ </pane>
263
+ <pane id="Scope" />
264
+ <pane id="Scratches" />
265
+ </panes>
266
+ </component>
267
+ <component name="PropertiesComponent">
268
+ <property name="WebServerToolWindowFactoryState" value="false" />
269
+ <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" />
270
+ </component>
271
+ <component name="RunManager">
272
+ <configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
273
+ <predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
274
+ <module name="" />
275
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
276
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
277
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
278
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
279
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
280
+ <envs />
281
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
282
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
283
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
284
+ <COVERAGE_PATTERN ENABLED="true">
285
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
286
+ </COVERAGE_PATTERN>
287
+ </EXTENSION>
288
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
289
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
290
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
291
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
292
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
293
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
294
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
295
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
296
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
297
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
298
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
299
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
300
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
301
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
302
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
303
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
304
+ <method />
305
+ </configuration>
306
+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
307
+ <method />
308
+ </configuration>
309
+ <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
310
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
311
+ <module name="" />
312
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
313
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
314
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
315
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
316
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
317
+ <envs />
318
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
319
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
320
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
321
+ <COVERAGE_PATTERN ENABLED="true">
322
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
323
+ </COVERAGE_PATTERN>
324
+ </EXTENSION>
325
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
326
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
327
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
328
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
329
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
330
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
331
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
332
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
333
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
334
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
335
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
336
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
337
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
338
+ <method />
339
+ </configuration>
340
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
341
+ <module name="" />
342
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
343
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
344
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
345
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
346
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
347
+ <envs />
348
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
349
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
350
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
351
+ <COVERAGE_PATTERN ENABLED="true">
352
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
353
+ </COVERAGE_PATTERN>
354
+ </EXTENSION>
355
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
356
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
357
+ <method />
358
+ </configuration>
359
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
360
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
361
+ <module name="" />
362
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
363
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
364
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
365
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
366
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
367
+ <envs />
368
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
369
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
370
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
371
+ <COVERAGE_PATTERN ENABLED="true">
372
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
373
+ </COVERAGE_PATTERN>
374
+ </EXTENSION>
375
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
376
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
377
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
378
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
379
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
380
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
381
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
382
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
383
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
384
+ <method />
385
+ </configuration>
386
+ <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
387
+ <method />
388
+ </configuration>
389
+ <configuration default="true" type="js.build_tools.npm" factoryName="npm">
390
+ <command value="run-script" />
391
+ <scripts />
392
+ <envs />
393
+ <method />
394
+ </configuration>
395
+ </component>
396
+ <component name="ShelveChangesManager" show_recycled="false" />
397
+ <component name="TaskManager">
398
+ <task active="true" id="Default" summary="Default task">
399
+ <changelist id="888376e7-b484-4f3e-accf-b648421f8e75" name="Default" comment="" />
400
+ <created>1452569066321</created>
401
+ <option name="number" value="Default" />
402
+ <updated>1452569066321</updated>
403
+ </task>
404
+ <servers />
405
+ </component>
406
+ <component name="ToolWindowManager">
407
+ <frame x="10" y="43" width="1260" height="686" extended-state="0" />
408
+ <editor active="true" />
409
+ <layout>
410
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
411
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
412
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
413
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
414
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
415
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32970452" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
416
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
417
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
418
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
419
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
420
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
421
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
422
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
423
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
424
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
425
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
426
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
427
+ </layout>
428
+ </component>
429
+ <component name="VcsContentAnnotationSettings">
430
+ <option name="myLimit" value="2678400000" />
431
+ </component>
432
+ <component name="XDebuggerManager">
433
+ <breakpoint-manager />
434
+ <watches-manager />
435
+ </component>
436
+ <component name="editorHistoryManager">
437
+ <entry file="file://$PROJECT_DIR$/Gemfile">
438
+ <provider selected="true" editor-type-id="text-editor">
439
+ <state vertical-scroll-proportion="0.0">
440
+ <caret line="5" column="35" selection-start-line="5" selection-start-column="35" selection-end-line="5" selection-end-column="35" />
441
+ <folding />
442
+ </state>
443
+ </provider>
444
+ </entry>
445
+ <entry file="file://$PROJECT_DIR$/bin/setup">
446
+ <provider selected="true" editor-type-id="text-editor">
447
+ <state vertical-scroll-proportion="0.0">
448
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
449
+ <folding />
450
+ </state>
451
+ </provider>
452
+ </entry>
453
+ <entry file="file://$PROJECT_DIR$/Gemfile.lock">
454
+ <provider selected="true" editor-type-id="text-editor">
455
+ <state vertical-scroll-proportion="0.0">
456
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
457
+ <folding />
458
+ </state>
459
+ </provider>
460
+ </entry>
461
+ <entry file="file://$PROJECT_DIR$/README.md">
462
+ <provider selected="true" editor-type-id="text-editor">
463
+ <state vertical-scroll-proportion="-7.814815">
464
+ <caret line="50" column="0" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
465
+ <folding />
466
+ </state>
467
+ </provider>
468
+ </entry>
469
+ <entry file="file://$PROJECT_DIR$/test/my_test.rb">
470
+ <provider selected="true" editor-type-id="text-editor">
471
+ <state vertical-scroll-proportion="0.0">
472
+ <caret line="7" column="16" selection-start-line="7" selection-start-column="16" selection-end-line="7" selection-end-column="16" />
473
+ <folding />
474
+ </state>
475
+ </provider>
476
+ </entry>
477
+ <entry file="file://$PROJECT_DIR$/lib/sentence.rb">
478
+ <provider selected="true" editor-type-id="text-editor">
479
+ <state vertical-scroll-proportion="0.0">
480
+ <caret line="37" column="16" selection-start-line="37" selection-start-column="16" selection-end-line="37" selection-end-column="16" />
481
+ <folding />
482
+ </state>
483
+ </provider>
484
+ </entry>
485
+ <entry file="file://$PROJECT_DIR$/lib/subject_list.rb">
486
+ <provider selected="true" editor-type-id="text-editor">
487
+ <state vertical-scroll-proportion="0.0">
488
+ <caret line="13" column="9" selection-start-line="13" selection-start-column="9" selection-end-line="13" selection-end-column="9" />
489
+ <folding />
490
+ </state>
491
+ </provider>
492
+ </entry>
493
+ <entry file="file://$PROJECT_DIR$/lib/BeverageScrapper.rb">
494
+ <provider selected="true" editor-type-id="text-editor">
495
+ <state vertical-scroll-proportion="0.0">
496
+ <caret line="15" column="15" selection-start-line="15" selection-start-column="15" selection-end-line="15" selection-end-column="15" />
497
+ <folding />
498
+ </state>
499
+ </provider>
500
+ </entry>
501
+ <entry file="file://$PROJECT_DIR$/lib/BeverageScrapper/version.rb">
502
+ <provider selected="true" editor-type-id="text-editor">
503
+ <state vertical-scroll-proportion="0.0">
504
+ <caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
505
+ <folding />
506
+ </state>
507
+ </provider>
508
+ </entry>
509
+ <entry file="file://$PROJECT_DIR$/bin/console">
510
+ <provider selected="true" editor-type-id="text-editor">
511
+ <state vertical-scroll-proportion="0.0">
512
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
513
+ <folding />
514
+ </state>
515
+ </provider>
516
+ </entry>
517
+ <entry file="file://$PROJECT_DIR$/BeverageScrapper.gemspec">
518
+ <provider selected="true" editor-type-id="text-editor">
519
+ <state vertical-scroll-proportion="0.36724564">
520
+ <caret line="14" column="66" selection-start-line="14" selection-start-column="66" selection-end-line="14" selection-end-column="66" />
521
+ <folding />
522
+ </state>
523
+ </provider>
524
+ </entry>
525
+ </component>
526
+ </project>
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'BeverageScrapper/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "BeverageScrapper"
8
+ spec.version = BeverageScrapper::VERSION
9
+ spec.authors = ["Joshua Weinstein"]
10
+ spec.email = ["jweinst1@berkeley.edu"]
11
+
12
+ spec.summary = %q{A Gem API for data mining information on beverages and drinks from text.}
13
+ spec.description = %q{BeverageScrapper is a Gem that allows you to mine data about soft drinks and beverages from text. It has many features
14
+ such as giving you information on how often a drink is mentioned, if the opinion of the drink is positive or negative, and much more.\nBeverageScrapper is perfect for getting information about consumer opinions or trends about drink purchasing.
15
+ Check out the home page for more information or the documentation.}
16
+ spec.homepage = "https://github.com/jweinst1/BeverageScrapper"
17
+ spec.license = "MIT"
18
+
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.11"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ end
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in BeverageScrapper.gemspec
4
+ gemspec
5
+
6
+ gem 'BeverageScrapper', :path => ''
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Joshua Weinstein
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,85 @@
1
+ # BeverageScrapper
2
+
3
+ BeverageScrapper is an API for data mining information about soft drinks, beverages, drinks, and other information relating to opinions and data on drinks.
4
+ The Gem features many different analysis methods, such as determining the percentage of a text being about beverages, how often a specific soft drink is mentioned, and in what context, and much more.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'BeverageScrapper'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install BeverageScrapper
21
+
22
+ ##Documentation
23
+ BeverageScrapper provides different methods for statistically analyzing the beverage data in written text. Here is an overview of the main functions, as well as the core classes for parsing/searching passages.
24
+
25
+ ####`BeverageScrapper::summary(text)`:
26
+ Returns a string containing all of the core data results from the methods of the API. These include the net positivity rating(The portion of good words minus the portion of bad or critical words), the subjectivity rating(To what degree is a text about soft drinks or beverages) and the descriptor rating(How much does a text focus on describing drinks or describing experiences related to soft drinks). In addition, it will give the most commonly mentioned drink in the passage.
27
+
28
+ ###Class Wordbins
29
+ A class containing arrays of words relevant to the data mining. Examples are lists of beverage brands, types of drinks, verbs related to eating and drinking, nouns relating to purchasing and money, plus much more.
30
+
31
+ ###Class Classify
32
+ A class containing methods for determining the ratio or frequency of specific groups of words in the input passage.
33
+
34
+ ####`BeverageScrapper::Classify.beveragerating(text)`:
35
+ Out of a maximum value of 1, determines the portion of words in a text that are related to softdrinks or beverages. The words targeted with this method can be brand names of drinks, or general names, like soda and lemonade.
36
+
37
+ ####`BeverageScrapper::Classify.opinionrating(text)`:
38
+ Returns the difference of the total number of positive, descriptor words and negative, critical descriptor words in a passage. Uses terms more related to food and taste.
39
+
40
+ ####`BeverageScrapper::Classify.descriptrating(text)`:
41
+ Out of a meximum value of 1, determines the fraction or portion of words in a text that have a describing meaning. Useful for determining if the text mentions soft drinks as a side subject, or is about describing drinks and beverages, a measure of importance.
42
+
43
+ ###Class Find
44
+
45
+ A class containing methods that scan the text for specific ordering of words related to specificed subject drinks or words.
46
+
47
+ ####`BeverageScrapper::Find.afterdrink(text, drink)`:
48
+
49
+ For a specific alphanumeric word, drink, finds all the words in the text occuring directly after drink. Returns an array of strings.
50
+
51
+ ####`BeverageScrapper::Find.twoafterdrink(text, drink)`:
52
+ Does the same as `afterdrink` but returns an array of two element arrays of strings, where the first string in each subarray represents the first word after drink, and the second word represents the second word after drink.
53
+
54
+ ####`BeverageScrapper::Find.beforedrink(text, drink)`:
55
+
56
+ For a specific alphanumeric word, drink, finds all the words in the text occuring directly before drink. Returns an array of strings.
57
+
58
+ ####`BeverageScrapper::Find.drinkdescriptors(text, drink)`:
59
+
60
+ Returns an array of strings, representing the words used directly after a specific drink that are description words. For example, `coke tastes`, would have `tastes` returned. However, `coke and`, would not return `and` in the resulting array.
61
+
62
+ ####`BeverageScrapper::Find.drinkaction(text, drink)`:
63
+
64
+ Returns an array of strings, representing the words used with a specific drink that signify an action related to drinking or beverages. For example, `drank cola` would match `drank`.
65
+
66
+ ####`BeverageScrapper::Find.mostcommondrink(text, drink)`:
67
+
68
+ Returns the most commonly mentioned drink word in the text. Can either be a brand name or general name.
69
+
70
+ ## Development
71
+
72
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
73
+
74
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
75
+
76
+ ## Contributing
77
+
78
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jweinst1/BeverageScrapper.
79
+ Also, feel free to raise any issues with the gem that you might feel need improvement.
80
+
81
+
82
+ ## License
83
+
84
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
85
+
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "BeverageScrapper"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,211 @@
1
+ require "BeverageScrapper/version"
2
+
3
+ module BeverageScrapper
4
+ require "sentence"
5
+ require "subject_list"
6
+ #Makes an overall summary of the text in regards to beverages and drinks, in string form
7
+ def summary(text)
8
+ descrating = BeverageScrapper::Classify.descriptrating(text)
9
+ opinionrating = BeverageScrapper::Classify.opinionrating(text)
10
+ bevtopic = BeverageScrapper::Classify.beveragerating(text)
11
+ mostcommondrink = BeverageScrapper::Find.mostcommondrink(text)
12
+ summ = "The analyzed passage has a beverage topic rating of #{bevtopic}, the frequency of words about beverages or brands of beverages.\n"
13
+ summ += "The passage has a net positive opinion of #{opinionrating}, based on the frequency of positive and negative adjectives.\n"
14
+ summ += "The passage has a descriptive rating of #{descrating}, the proportion of words that describe a beverage.\n"
15
+ summ += "#{mostcommondrink} was the most commonly mentioned drink word in the passage.\n"
16
+ return summ
17
+
18
+ end
19
+ class Wordbins
20
+ #words concerning money
21
+ def self.money
22
+ %w(money cash coins cost dollars cents price prices expensive cheap tax)
23
+ end
24
+ #list of strings of softdrink brands
25
+ def self.brands
26
+ %w(coke sprite pepsi dr.pepper drpepper cocacola cokezero mountaindew minutemaid fanta pepsi-cola a&w 7up mug cola dasani
27
+ )
28
+ end
29
+ def self.positives
30
+ %w(refreshing cold tasty wonderful delicious yummy flavorful great fresh amazing)
31
+ end
32
+ def self.neutrals
33
+ %w(bubbly cold icy flavored strong)
34
+ end
35
+ def self.flavor
36
+ %w(bitter sweet sour tangy minty savory lemony acidic bittersweet creamy citrusy dry fizzy full-bodied nutty bland salty spicy tangy tart zesty zingy)
37
+ end
38
+ def self.negatives
39
+ %w(yucky disgusting horrid gross awful flavorless bland plain boring bad raunchy nasty tasteless
40
+ stale flat)
41
+ end
42
+ def self.generals
43
+ %w(soda sodapop lemonade water tea coffee juice pop beer wine cola cider)
44
+ end
45
+ def self.actions
46
+ %w(drink slurp sip chug drunk drank)
47
+ end
48
+ def self.pronouns
49
+ %w(i me you your they he she him her)
50
+ end
51
+ def self.stopwords
52
+ %w(the a an is was are were not there how what did do does can cant could would should it)
53
+ end
54
+ #verbs meant to be paired with drink adjectives
55
+ def self.descriptors
56
+ %w(looks feels tastes smells looks is are was seems felt tasted smelled appears flavored)
57
+ end
58
+ end
59
+ class Classify
60
+ #using bayes, determines how strong a text is about beverages
61
+ def self.beveragerating(text)
62
+ brands = BeverageScrapper::Wordbins.brands
63
+ generals = BeverageScrapper::Wordbins.generals
64
+ length = text.split(" ").size.0
65
+ counter = {brand: 0.0, drinks: 0.0}
66
+ for elem in text.split(" ")
67
+ if brands.include?(elem)
68
+ counter[:brand] += 1
69
+ elsif generals.include?(elem)
70
+ counter[:drinks] += 1
71
+ end
72
+ end
73
+ return (counter[:brand]+counter[:drinks])/length
74
+ end
75
+ #calculates the net positive rating of a text.
76
+ def self.opinionrating(text)
77
+ good = BeverageScrapper::Wordbins.positives
78
+ bad = BeverageScrapper::Wordbins.negatives
79
+ length = text.split(" ").size.0
80
+ counter = {good:0.0, bad:0.0}
81
+ for elem in text.split(" ")
82
+ if good.include?(elem)
83
+ counter[:good] += 1
84
+ elsif bad.include?(elem)
85
+ counter[:bad] += 1
86
+ end
87
+ end
88
+ return counter[:good]-counter[:bad]
89
+ end
90
+ #checks how descriptive the text is
91
+ def self.descriptrating(text)
92
+ desc = BeverageScrapper::Wordbins.descriptors
93
+ length = text.split(" ").size.0
94
+ count = 0.0
95
+ for elem in text.split(" ")
96
+ if desc.include?(elem)
97
+ count += 1
98
+ end
99
+ end
100
+ return count/length
101
+ end
102
+ end
103
+ class Find
104
+ #finds words coming after drink generals or brands in the text
105
+ def self.afterdrink(text, drink)
106
+ matches = []
107
+ patt = Regexp.new(drink + ' ([a-zA-Z0-9]+)')
108
+ for elem in text.scan(patt)
109
+ matches << elem[0]
110
+ end
111
+ return matches
112
+ end
113
+ #finds the following two words after every drink. will be in format [ "first", "second"]
114
+ def self.twoafterdirnk(text, drink)
115
+ matches = []
116
+ patt = Regexp.new(drink + ' ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)')
117
+ for elem in text.scan(patt)
118
+ matches << elem
119
+ end
120
+ return matches
121
+ end
122
+ def self.beforedrink(text, drink)
123
+ matches = []
124
+ patt = Regexp.new('([a-zA-Z0-9]+) ' + drink)
125
+ for elem in text.scan(patt)
126
+ mathces << elem[0]
127
+ end
128
+ return matches
129
+ end
130
+ #checks for instances of text where a drink's taste is described.
131
+ def self.drinkdescriptors(text, drink)
132
+ tastes = BeverageScrapper::Find.afterdrink(text, drink)
133
+ descriptions = BeverageScrapper::Wordbins.descriptors
134
+ matches = []
135
+ for elem in tastes
136
+ if descriptions.include?(elem)
137
+ matches << elem
138
+ end
139
+ end
140
+ return matches
141
+ end
142
+ #checks for instances of text where an action word is used with a drink.
143
+ def self.drinkaction(text, drink)
144
+ actions = BeverageScrapper::Wordbins.actions
145
+ matches = []
146
+ for elem in actions
147
+ pat = Regexp.new(elem+ " " +drink)
148
+ matches += text.scan(pat)
149
+ end
150
+ return matches
151
+ end
152
+ #gets the most common drink word mentioned in the text
153
+ def self.mostcommondrink(text)
154
+ drinks = BeverageScrapper::Wordbins.brands
155
+ generals = BeverageScrapper::Wordbins.generals
156
+ countdict = {}
157
+ for elem in text.split(" ")
158
+ if drinks.include?(elem)
159
+ if countdict.include?(elem)
160
+ countdict[elem] += 1
161
+ else
162
+ countdict[elem] = 1
163
+ end
164
+ elsif generals.include?(elem)
165
+ if countdict.include?(elem)
166
+ countdict[elem] += 1
167
+ else
168
+ countdict[elem] = 1
169
+ end
170
+ end
171
+ end
172
+ keylst = countdict.keys
173
+ return countdict.key(keylst.max)
174
+ end
175
+ end
176
+ class Utils
177
+
178
+ #counts all the words in a text in linear time
179
+ def self.wordcount(text)
180
+ words = text.split(' ')
181
+ wc = Hash.new
182
+ for elem in words
183
+ if wc.has_key?(elem)
184
+ wc[elem] += 1
185
+ else
186
+ wc[elem] = 1
187
+ end
188
+ end
189
+ return wc
190
+ end
191
+
192
+ #checks if any word in an array is in the text
193
+ def self.hasany(words, text)
194
+ words = text.split(' ')
195
+ for elem in words
196
+ if words.include?(elem)
197
+ return true
198
+ end
199
+ end
200
+ return false
201
+ end
202
+
203
+ def self.removestops(text)
204
+ for elem in BeverageScrapper::Wordbins.stopwords
205
+ patt = Regexp.new(" " + elem + " ")
206
+ text = text.gsub(patt, '')
207
+ end
208
+ return text
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,3 @@
1
+ module BeverageScrapper
2
+ VERSION = "0.5.0"
3
+ end
@@ -0,0 +1,40 @@
1
+ #class for searching and mining sentences
2
+
3
+ class Sentence
4
+ def initialize(text)
5
+ @words = text.split(' ')
6
+ @phrase = text
7
+ @tag = nil
8
+ end
9
+ #words accessor
10
+ def words
11
+ @words
12
+ end
13
+ #phrase accessor
14
+ def phrase
15
+ @phrase
16
+ end
17
+ def tag
18
+ @tag
19
+ end
20
+ def contains(word)
21
+ @words.include? word
22
+ end
23
+
24
+ def ismatch(exp)
25
+ @phrase =~ exp
26
+ end
27
+
28
+ def countmembers(words)
29
+ count = 0
30
+ for elem in @words
31
+ if words.include? elem
32
+ count += 1
33
+ end
34
+ end
35
+ count
36
+ end
37
+ def settag(label)
38
+ @tag = label
39
+ end
40
+ end
@@ -0,0 +1,33 @@
1
+ #object for storing informating about specific subjects
2
+ require 'set'
3
+ class SubjectList
4
+ def initialize(words=[])
5
+ @list = words
6
+ @set = Set.new
7
+ @dict = {}
8
+ for elem in @list
9
+ @dict[elem] = []
10
+ @set << elem
11
+ end
12
+ end
13
+ def list
14
+ @list
15
+ end
16
+ def dict
17
+ @dict
18
+ end
19
+ def set
20
+ @set
21
+ end
22
+ def length
23
+ @list.size
24
+ end
25
+ def contains(elem)
26
+ @set.include?(elem)
27
+ end
28
+ def add(elem)
29
+ @list << elem
30
+ @set << elem
31
+ @dict[:elem] = []
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: BeverageScrapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - Joshua Weinstein
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: |-
42
+ BeverageScrapper is a Gem that allows you to mine data about soft drinks and beverages from text. It has many features
43
+ such as giving you information on how often a drink is mentioned, if the opinion of the drink is positive or negative, and much more.\nBeverageScrapper is perfect for getting information about consumer opinions or trends about drink purchasing.
44
+ Check out the home page for more information or the documentation.
45
+ email:
46
+ - jweinst1@berkeley.edu
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".gitignore"
52
+ - ".idea/.name"
53
+ - ".idea/.rakeTasks"
54
+ - ".idea/BeverageScrapper.iml"
55
+ - ".idea/encodings.xml"
56
+ - ".idea/misc.xml"
57
+ - ".idea/modules.xml"
58
+ - ".idea/workspace.xml"
59
+ - BeverageScrapper.gemspec
60
+ - Gemfile
61
+ - LICENSE.txt
62
+ - README.md
63
+ - Rakefile
64
+ - bin/console
65
+ - bin/setup
66
+ - lib/BeverageScrapper.rb
67
+ - lib/BeverageScrapper/version.rb
68
+ - lib/sentence.rb
69
+ - lib/subject_list.rb
70
+ homepage: https://github.com/jweinst1/BeverageScrapper
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.4.6
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: A Gem API for data mining information on beverages and drinks from text.
94
+ test_files: []