GMaps_Places 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ test.rb
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ gmaps_Gem
data/.idea/.rakeTasks ADDED
@@ -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 gmaps_Gem-0.0.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install gmaps_Gem-0.0.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.0.1 and build and push gmaps_Gem-0.0.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.1.3, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
8
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
9
+ <orderEntry type="library" scope="PROVIDED" name="json (v1.7.3, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
10
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v2.10.0, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.10.1, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.10.0, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.10.1, RVM: ruby-1.9.3-p194 [task_manager_gem]) [gem]" level="application" />
14
+ </component>
15
+ </module>
16
+
data/.idea/misc.xml ADDED
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.3-p194 [task_manager_gem]" project-jdk-type="RUBY_SDK" />
4
+ </project>
5
+
data/.idea/modules.xml ADDED
@@ -0,0 +1,9 @@
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/gmaps_Gem.iml" filepath="$PROJECT_DIR$/.idea/gmaps_Gem.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,5 @@
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
@@ -0,0 +1,470 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="a4ce5108-7a8b-496b-b8ad-6172c6d071bd" name="Default" comment="">
5
+ <change type="DELETED" beforePath="$PROJECT_DIR$/gmaps_Gem.gemspec" afterPath="" />
6
+ <change type="DELETED" beforePath="$PROJECT_DIR$/lib/gmaps_Gem.rb" afterPath="" />
7
+ <change type="DELETED" beforePath="$PROJECT_DIR$/lib/gmaps_Gem/version.rb" afterPath="" />
8
+ <change type="DELETED" beforePath="$PROJECT_DIR$/spec/gmaps_Gem_spec.rb" afterPath="" />
9
+ </list>
10
+ <ignored path="gmaps_Gem.iws" />
11
+ <ignored path=".idea/workspace.xml" />
12
+ <option name="TRACKING_ENABLED" value="true" />
13
+ <option name="SHOW_DIALOG" value="false" />
14
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
15
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
16
+ <option name="LAST_RESOLUTION" value="IGNORE" />
17
+ </component>
18
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
19
+ <component name="CreatePatchCommitExecutor">
20
+ <option name="PATCH_PATH" value="" />
21
+ </component>
22
+ <component name="DaemonCodeAnalyzer">
23
+ <disable_hints />
24
+ </component>
25
+ <component name="FileEditorManager">
26
+ <leaf>
27
+ <file leaf-file-name="GMaps_Places.gemspec" pinned="false" current="true" current-in-tab="true">
28
+ <entry file="file://$PROJECT_DIR$/GMaps_Places.gemspec">
29
+ <provider selected="true" editor-type-id="text-editor">
30
+ <state line="18" column="67" selection-start="749" selection-end="749" vertical-scroll-proportion="0.6081081">
31
+ <folding />
32
+ </state>
33
+ </provider>
34
+ </entry>
35
+ </file>
36
+ <file leaf-file-name="LICENSE" pinned="false" current="false" current-in-tab="false">
37
+ <entry file="file://$PROJECT_DIR$/LICENSE">
38
+ <provider selected="true" editor-type-id="text-editor">
39
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
40
+ <folding />
41
+ </state>
42
+ </provider>
43
+ </entry>
44
+ </file>
45
+ <file leaf-file-name="Rakefile" pinned="false" current="false" current-in-tab="false">
46
+ <entry file="file://$PROJECT_DIR$/Rakefile">
47
+ <provider selected="true" editor-type-id="text-editor">
48
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
49
+ <folding />
50
+ </state>
51
+ </provider>
52
+ </entry>
53
+ </file>
54
+ <file leaf-file-name="README.md" pinned="false" current="false" current-in-tab="false">
55
+ <entry file="file://$PROJECT_DIR$/README.md">
56
+ <provider selected="true" editor-type-id="text-editor">
57
+ <state line="16" column="30" selection-start="277" selection-end="277" vertical-scroll-proportion="0.0">
58
+ <folding />
59
+ </state>
60
+ </provider>
61
+ </entry>
62
+ </file>
63
+ </leaf>
64
+ </component>
65
+ <component name="FindManager">
66
+ <FindUsagesManager>
67
+ <setting name="OPEN_NEW_TAB" value="false" />
68
+ </FindUsagesManager>
69
+ </component>
70
+ <component name="Git.Settings">
71
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
72
+ </component>
73
+ <component name="IdeDocumentHistory">
74
+ <option name="changedFiles">
75
+ <list>
76
+ <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
77
+ <option value="$PROJECT_DIR$/gmaps_Gem.gemspec" />
78
+ <option value="$PROJECT_DIR$/lib/gmaps_Gem/version.rb" />
79
+ <option value="$PROJECT_DIR$/lib/test.rb" />
80
+ <option value="$PROJECT_DIR$/spec/gmaps_Gem_spec.rb" />
81
+ <option value="$PROJECT_DIR$/lib/gmaps_Gem.rb" />
82
+ <option value="$PROJECT_DIR$/README.md" />
83
+ <option value="$PROJECT_DIR$/GMaps_Places.gemspec" />
84
+ </list>
85
+ </option>
86
+ </component>
87
+ <component name="ProjectFrameBounds">
88
+ <option name="x" value="-1" />
89
+ <option name="y" value="-5" />
90
+ <option name="width" value="1026" />
91
+ <option name="height" value="605" />
92
+ </component>
93
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
94
+ <OptionsSetting value="true" id="Add" />
95
+ <OptionsSetting value="true" id="Remove" />
96
+ <OptionsSetting value="true" id="Checkout" />
97
+ <OptionsSetting value="true" id="Update" />
98
+ <OptionsSetting value="true" id="Status" />
99
+ <OptionsSetting value="true" id="Edit" />
100
+ <ConfirmationsSetting value="0" id="Add" />
101
+ <ConfirmationsSetting value="0" id="Remove" />
102
+ </component>
103
+ <component name="ProjectReloadState">
104
+ <option name="STATE" value="0" />
105
+ </component>
106
+ <component name="ProjectView">
107
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
108
+ <flattenPackages />
109
+ <showMembers />
110
+ <showModules />
111
+ <showLibraryContents />
112
+ <hideEmptyPackages />
113
+ <abbreviatePackageNames />
114
+ <autoscrollToSource />
115
+ <autoscrollFromSource />
116
+ <sortByType />
117
+ </navigator>
118
+ <panes>
119
+ <pane id="Scope" />
120
+ <pane id="ProjectPane">
121
+ <subPane>
122
+ <PATH>
123
+ <PATH_ELEMENT>
124
+ <option name="myItemId" value="gmaps_Gem" />
125
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
126
+ </PATH_ELEMENT>
127
+ </PATH>
128
+ <PATH>
129
+ <PATH_ELEMENT>
130
+ <option name="myItemId" value="gmaps_Gem" />
131
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
132
+ </PATH_ELEMENT>
133
+ <PATH_ELEMENT>
134
+ <option name="myItemId" value="GMaps_Places" />
135
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
136
+ </PATH_ELEMENT>
137
+ </PATH>
138
+ <PATH>
139
+ <PATH_ELEMENT>
140
+ <option name="myItemId" value="gmaps_Gem" />
141
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
142
+ </PATH_ELEMENT>
143
+ <PATH_ELEMENT>
144
+ <option name="myItemId" value="GMaps_Places" />
145
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
146
+ </PATH_ELEMENT>
147
+ <PATH_ELEMENT>
148
+ <option name="myItemId" value="spec" />
149
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
150
+ </PATH_ELEMENT>
151
+ </PATH>
152
+ <PATH>
153
+ <PATH_ELEMENT>
154
+ <option name="myItemId" value="gmaps_Gem" />
155
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
156
+ </PATH_ELEMENT>
157
+ <PATH_ELEMENT>
158
+ <option name="myItemId" value="GMaps_Places" />
159
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
160
+ </PATH_ELEMENT>
161
+ <PATH_ELEMENT>
162
+ <option name="myItemId" value="lib" />
163
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
164
+ </PATH_ELEMENT>
165
+ </PATH>
166
+ </subPane>
167
+ </pane>
168
+ </panes>
169
+ </component>
170
+ <component name="PropertiesComponent">
171
+ <property name="WebServerToolWindowFactoryState" value="false" />
172
+ </component>
173
+ <component name="RunManager">
174
+ <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
175
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
176
+ <module name="" />
177
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
178
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
179
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
180
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
181
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
182
+ <envs />
183
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
184
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
185
+ <COVERAGE_PATTERN ENABLED="true">
186
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
187
+ </COVERAGE_PATTERN>
188
+ </EXTENSION>
189
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
190
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
191
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
192
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
193
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
194
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
195
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
196
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
197
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
198
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
199
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
200
+ <method />
201
+ </configuration>
202
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
203
+ <module name="" />
204
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
205
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
206
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
207
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
208
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
209
+ <envs />
210
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
211
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
212
+ <COVERAGE_PATTERN ENABLED="true">
213
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
214
+ </COVERAGE_PATTERN>
215
+ </EXTENSION>
216
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
217
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
218
+ <method />
219
+ </configuration>
220
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
221
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
222
+ <module name="" />
223
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
224
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
225
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
226
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
227
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
228
+ <envs />
229
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
230
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
231
+ <COVERAGE_PATTERN ENABLED="true">
232
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
233
+ </COVERAGE_PATTERN>
234
+ </EXTENSION>
235
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
236
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
237
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
238
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
239
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
240
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
241
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
242
+ <method />
243
+ </configuration>
244
+ <configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
245
+ <predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
246
+ <module name="" />
247
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
248
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
249
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
250
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
251
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
252
+ <envs>
253
+ <env name="ANSICON" value="" />
254
+ </envs>
255
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
256
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
257
+ <COVERAGE_PATTERN ENABLED="true">
258
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
259
+ </COVERAGE_PATTERN>
260
+ </EXTENSION>
261
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
262
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
263
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
264
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
265
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
266
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
267
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
268
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
269
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
270
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
271
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
272
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
273
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
274
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
275
+ <method />
276
+ </configuration>
277
+ <list size="0" />
278
+ </component>
279
+ <component name="ShelveChangesManager" show_recycled="false" />
280
+ <component name="TaskManager">
281
+ <task active="true" id="Default" summary="Default task">
282
+ <changelist id="a4ce5108-7a8b-496b-b8ad-6172c6d071bd" name="Default" comment="" />
283
+ <created>1343922142563</created>
284
+ <updated>1343922142563</updated>
285
+ </task>
286
+ <servers />
287
+ </component>
288
+ <component name="ToolWindowManager">
289
+ <frame x="-1" y="-5" width="1026" height="605" extended-state="6" />
290
+ <editor active="true" />
291
+ <layout>
292
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32980973" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
293
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
294
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
295
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
296
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.28028747" sideWeight="0.6701903" order="0" side_tool="false" content_ui="combo" />
297
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
298
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
299
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32980973" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
300
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
301
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32980973" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
302
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
303
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
304
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
305
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32980973" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
306
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
307
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
308
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
309
+ </layout>
310
+ </component>
311
+ <component name="VcsContentAnnotationSettings">
312
+ <option name="myLimit" value="2678400000" />
313
+ </component>
314
+ <component name="VcsManagerConfiguration">
315
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
316
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
317
+ <option name="CHECK_NEW_TODO" value="true" />
318
+ <option name="myTodoPanelSettings">
319
+ <value>
320
+ <are-packages-shown value="false" />
321
+ <are-modules-shown value="false" />
322
+ <flatten-packages value="false" />
323
+ <is-autoscroll-to-source value="false" />
324
+ </value>
325
+ </option>
326
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
327
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
328
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
329
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
330
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
331
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
332
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
333
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
334
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
335
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
336
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
337
+ <option name="SHORT_DIFF_HORISONTALLY" value="true" />
338
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
339
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
340
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
341
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
342
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
343
+ <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
344
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
345
+ <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
346
+ <option name="LAST_COMMIT_MESSAGE" />
347
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
348
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
349
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
350
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
351
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
352
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
353
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
354
+ <option name="ACTIVE_VCS_NAME" />
355
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
356
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
357
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
358
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
359
+ </component>
360
+ <component name="XDebuggerManager">
361
+ <breakpoint-manager />
362
+ </component>
363
+ <component name="editorHistoryManager">
364
+ <entry file="file://$USER_HOME$/.rvm/gems/ruby-1.9.3-p194@task_manager_gem/gems/rspec-mocks-2.10.1/lib/rspec/mocks/message_expectation.rb">
365
+ <provider selected="true" editor-type-id="text-editor">
366
+ <state line="112" column="10" selection-start="4189" selection-end="4189" vertical-scroll-proportion="0.7494199" />
367
+ </provider>
368
+ </entry>
369
+ <entry file="file://$USER_HOME$/.rvm/gems/ruby-1.9.3-p194@task_manager_gem/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/kernel.rb">
370
+ <provider selected="true" editor-type-id="text-editor">
371
+ <state line="10" column="6" selection-start="373" selection-end="373" vertical-scroll-proportion="0.33178654" />
372
+ </provider>
373
+ </entry>
374
+ <entry file="file://$USER_HOME$/.rvm/gems/ruby-1.9.3-p194@task_manager_gem/gems/rspec-expectations-2.10.0/lib/rspec/matchers.rb">
375
+ <provider selected="true" editor-type-id="text-editor">
376
+ <state line="227" column="8" selection-start="7749" selection-end="7749" vertical-scroll-proportion="1.3758701" />
377
+ </provider>
378
+ </entry>
379
+ <entry file="file://$USER_HOME$/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb">
380
+ <provider selected="true" editor-type-id="text-editor">
381
+ <state line="477" column="13" selection-start="15228" selection-end="15228" vertical-scroll-proportion="0.33178654" />
382
+ </provider>
383
+ </entry>
384
+ <entry file="file://$PROJECT_DIR$/lib/GMaps_Places.rb">
385
+ <provider selected="true" editor-type-id="text-editor">
386
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
387
+ <folding />
388
+ </state>
389
+ </provider>
390
+ </entry>
391
+ <entry file="file://$PROJECT_DIR$/lib/test.rb">
392
+ <provider selected="true" editor-type-id="text-editor">
393
+ <state line="29" column="43" selection-start="1479" selection-end="1479" vertical-scroll-proportion="0.7911833">
394
+ <folding />
395
+ </state>
396
+ </provider>
397
+ </entry>
398
+ <entry file="file://$PROJECT_DIR$/spec/GMaps_Places_spec.rb">
399
+ <provider selected="true" editor-type-id="text-editor">
400
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
401
+ <folding />
402
+ </state>
403
+ </provider>
404
+ </entry>
405
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
406
+ <provider selected="true" editor-type-id="text-editor">
407
+ <state line="1" column="19" selection-start="38" selection-end="38" vertical-scroll-proportion="0.033783782">
408
+ <folding />
409
+ </state>
410
+ </provider>
411
+ </entry>
412
+ <entry file="file://$PROJECT_DIR$/.gitignore">
413
+ <provider selected="true" editor-type-id="text-editor">
414
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
415
+ <folding />
416
+ </state>
417
+ </provider>
418
+ </entry>
419
+ <entry file="file://$PROJECT_DIR$/Gemfile">
420
+ <provider selected="true" editor-type-id="text-editor">
421
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
422
+ <folding />
423
+ </state>
424
+ </provider>
425
+ </entry>
426
+ <entry file="file://$PROJECT_DIR$/Gemfile.lock">
427
+ <provider selected="true" editor-type-id="text-editor">
428
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
429
+ <folding />
430
+ </state>
431
+ </provider>
432
+ </entry>
433
+ <entry file="file://$APPLICATION_HOME_DIR$/rubystubs193/file.rb">
434
+ <provider selected="true" editor-type-id="text-editor">
435
+ <state line="463" column="13" selection-start="23161" selection-end="23161" vertical-scroll-proportion="0.33178654">
436
+ <folding />
437
+ </state>
438
+ </provider>
439
+ </entry>
440
+ <entry file="file://$PROJECT_DIR$/LICENSE">
441
+ <provider selected="true" editor-type-id="text-editor">
442
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
443
+ <folding />
444
+ </state>
445
+ </provider>
446
+ </entry>
447
+ <entry file="file://$PROJECT_DIR$/README.md">
448
+ <provider selected="true" editor-type-id="text-editor">
449
+ <state line="16" column="30" selection-start="277" selection-end="277" vertical-scroll-proportion="0.0">
450
+ <folding />
451
+ </state>
452
+ </provider>
453
+ </entry>
454
+ <entry file="file://$PROJECT_DIR$/Rakefile">
455
+ <provider selected="true" editor-type-id="text-editor">
456
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
457
+ <folding />
458
+ </state>
459
+ </provider>
460
+ </entry>
461
+ <entry file="file://$PROJECT_DIR$/GMaps_Places.gemspec">
462
+ <provider selected="true" editor-type-id="text-editor">
463
+ <state line="18" column="67" selection-start="749" selection-end="749" vertical-scroll-proportion="0.6081081">
464
+ <folding />
465
+ </state>
466
+ </provider>
467
+ </entry>
468
+ </component>
469
+ </project>
470
+
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/GMaps_Places/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Alexandr Kovtunov"]
6
+ gem.email = ["1sasha.sasha1@gmail.com"]
7
+ gem.description = %q{GMaps_Places Gem for rbGarage courses}
8
+ gem.summary = %q{A small gem for Google Places API}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "GMaps_Places"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = GMaps_Places::VERSION
17
+
18
+ gem.add_development_dependency "rspec"
19
+ gem.add_development_dependency "json"
20
+ end
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in GMaps_Places.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Alexandr Kovtunov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # GMaps_Places
2
+
3
+ A small gem for Google Places API. It was made as a task for Ruby Garage courses.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'GMaps_Places'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install GMaps_Places
18
+
19
+ ## Usage
20
+
21
+ ###All usage was written in tests. But at first, you must add you own Google Developer key (from Google Console).
22
+ Sample of usage:
23
+ place = GMaps_Places::Places.new('YOUR_GOOGLE_API_KEY')
24
+ puts "What we are looking for?"
25
+ r = place.search(:text, gets.to_s)
26
+ or r=place.search(:place, -33.8670522, 151.1957362, 500, "food")
27
+ r.each {|result|
28
+ place.details(result["reference"], "name", "address_components")#, "formatted_phone_number", "rating", "reviews", "geometry", "address_components", "events" )
29
+ puts "Reference: #{place.reference}"
30
+ puts "Status: #{place.status}"
31
+ puts "Place name: #{place.name}"
32
+ puts " Place rating: #{place.rating}"
33
+ puts " Place geo latitude #{place.geometry.lat}"
34
+ place.reviews.each {
35
+ |review|
36
+ puts " Review author #{review.author_name}"
37
+ puts " Review Rating #{review.rating}"
38
+ puts " Review text #{review.text}\n"
39
+ }
40
+ puts " Place country is: #{place.address_components.country}"
41
+ puts " Events_id's: #{place.events[0].event_id}"
42
+
43
+ }
44
+
45
+ if place.errors.length > 0
46
+ puts "WHERE ARE #{place.errors.length} ERRORS CATCHED:"
47
+ place.errors.each {|error|
48
+ puts "\n #{error.message} IN : \n #{error.backtrace.inspect}"}
49
+ end
50
+
51
+
52
+ ## Contributing
53
+
54
+ 1. Fork it
55
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
56
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
57
+ 4. Push to the branch (`git push origin my-new-feature`)
58
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,157 @@
1
+ require 'json'
2
+ require 'net/http'
3
+ module GMaps_Places
4
+ class Places
5
+ attr_reader :key
6
+ attr_accessor :status, :errors, :geometry, :name, :icon, :reference, :events, :vicinity, :types, :id, :formatted_phone_number, :international_phone_number, :formatted_address, :address_components, :street_number, :street, :city, :region, :postal_code, :country, :rating, :url, :cid, :website, :reviews
7
+
8
+ def initialize (api_key, *smth)
9
+ @key = api_key
10
+ @errors = Array.new
11
+ end
12
+
13
+ def search (type, *args)
14
+ url = "https://maps.googleapis.com/maps/api/place/"
15
+ case type
16
+ when :text
17
+ url+= "textsearch/json?key=#{key}&sensor=false&query="+args.map{|str| str.scan(/([a-zA-Z0-9]+)/)}.join("+")
18
+ uri = URI.parse(url)
19
+ connection = Net::HTTP.new(uri.host, 443)
20
+ connection.use_ssl = true
21
+ resp = connection.request_get(uri.path+'?'+uri.query)
22
+ result= JSON.parse(resp.body)
23
+ if result["status"] == "OK"
24
+ result["results"]
25
+ else
26
+ raise result["status"].inspect
27
+ end
28
+ when :place
29
+ url+="search/json?key=#{@key}&sensor=false&location=#{args[0]},#{args[1]}&radius=#{args[2]}&keyword="+args[3..args.length].map{|str| str.scan(/([a-zA-Z0-9]+)/)}.join("+")
30
+ uri = URI.parse(url)
31
+ connection = Net::HTTP.new(uri.host, 443)
32
+ connection.use_ssl = true
33
+ resp = connection.request_get(uri.path+'?'+uri.query)
34
+ result= JSON.parse(resp.body)
35
+ if result["status"] == "OK"
36
+ result["results"]
37
+ else
38
+ raise result["status"].inspect
39
+ end
40
+ else
41
+ raise ArgumentError
42
+ end
43
+ end
44
+
45
+ def details (reference, *args)
46
+ if reference.empty? == false
47
+ url = "https://maps.googleapis.com/maps/api/place/details/json?key=#{key}&sensor=false&reference=#{reference}"
48
+ uri = URI.parse(url)
49
+ connection = Net::HTTP.new(uri.host, 443)
50
+ connection.use_ssl = true
51
+ resp = connection.request_get(uri.path+'?'+uri.query)
52
+ result= JSON.parse(resp.body)
53
+ @status = result["status"]
54
+ if @status == "OK"
55
+ args.each { |param|
56
+ begin #catching errors
57
+ result_w_param = result["result"][param]
58
+ case param
59
+ when "address_components"
60
+ address = Address.new(
61
+ result_w_param[0]["long_name"].nil? ? result_w_param[0]["short_name"] : result_w_param[0]["long_name"],
62
+ result_w_param[1]["long_name"].nil? ? result_w_param[1]["short_name"] : result_w_param[1]["long_name"],
63
+ result_w_param[2]["long_name"].nil? ? result_w_param[2]["short_name"] : result_w_param[2]["long_name"],
64
+ result_w_param[3]["long_name"].nil? ? result_w_param[3]["short_name"] : result_w_param[3]["long_name"],
65
+ result_w_param[4]["long_name"].nil? ? result_w_param[4]["short_name"] : result_w_param[4]["long_name"],
66
+ result_w_param[5]["long_name"].nil? ? result_w_param[5]["short_name"] : result_w_param[5]["long_name"]
67
+ )
68
+ instance_variable_set("@#{param}".to_sym, address)
69
+ when "geometry"
70
+ geo = Geometry.new(result_w_param["location"]["lat"],
71
+ result_w_param["location"]["lng"])
72
+ instance_variable_set("@#{param}".to_sym, geo)
73
+ when "reviews"
74
+ reviews = Array.new
75
+ result_w_param.each {|review|
76
+ reviews << Review.new(review["aspects"][0]["type"],
77
+ review["aspects"][0]["rating"],
78
+ review["author_name"],
79
+ review["author_url"],
80
+ review["text"],
81
+ review["time"])
82
+ }
83
+ instance_variable_set("@#{param}".to_sym, reviews)
84
+ when "events"
85
+ events = Array.new
86
+ if result_w_param.nil? == true
87
+ events << Events.new("No_events", "No_events", "No_events", "No_events")
88
+ instance_variable_set("@#{param}".to_sym, events)
89
+ else
90
+ result_w_param.each{|event|
91
+ events << Events.new(event["event_id"], event["start_time"], event["summary"], event["url"])
92
+ }
93
+ instance_variable_set("@#{param}".to_sym, events)
94
+ end
95
+ else
96
+ instance_variable_set("@#{param}".to_sym, result["result"]["#{param}"])
97
+ end
98
+ rescue Exception => e
99
+ @errors << e
100
+ #some places throwing errors in reviews and countries. dont know why. :\
101
+ #for example "South Steyne Function & Special events centre", AU
102
+ end
103
+ }
104
+ else
105
+ raise @status.inspect
106
+ end
107
+ else
108
+ raise ArgumentError
109
+ end
110
+ end
111
+ end
112
+
113
+ class Geometry
114
+ attr_accessor :lat, :lng
115
+ def initialize(lat, lng)
116
+ @lat = lat
117
+ @lng = lng
118
+ end
119
+ end
120
+
121
+ class Review
122
+ attr_accessor :type, :rating, :author_name, :author_url, :text, :time
123
+ def initialize(type, rating, author_name, author_url, text, time)
124
+ @type = type
125
+ @rating = rating
126
+ @author_name = author_name
127
+ @author_url = author_url
128
+ @text = text
129
+ @time = time
130
+ end
131
+ end
132
+
133
+ class Address
134
+ attr_accessor :street_number, :route, :locality, :administrative_area_level_1, :country, :postal_code
135
+ def initialize(street_number, route, locality, administrative_area_level_1, country, postal_code)
136
+ @street_number = street_number
137
+ @route = route
138
+ @locality = locality
139
+ @administrative_area_level_1 = administrative_area_level_1
140
+ @country = country
141
+ @postal_code = postal_code
142
+ end
143
+ end
144
+
145
+ class Events
146
+ attr_accessor :event_id, :start_time, :summary, :url
147
+ def initialize(event_id, start_time, summary, url)
148
+ @event_id = event_id
149
+ @start_time = start_time
150
+ @summary = summary
151
+ @url = url
152
+ end
153
+ end
154
+
155
+ end
156
+
157
+
@@ -0,0 +1,3 @@
1
+ module GMaps_Places
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,111 @@
1
+ require 'spec_helper'
2
+
3
+ shared_examples_for "any_search_answer" do
4
+ it "should return value" do
5
+ @search_result.should_not be_nil
6
+ end
7
+ it "should be an collection of hashes" do
8
+ @search_result.should be_a_kind_of Array
9
+ @search_result.each {|result| result.should be_a_kind_of Hash}
10
+ end
11
+ end
12
+
13
+ describe GMaps_Places do
14
+ before (:all) do
15
+ @place = GMaps_Places::Places.new('PUT_YOUR_OWN_KEY_HERE')
16
+ end
17
+ context "#key" do
18
+ it "should return key value" do
19
+ @place.key.length.should > 8
20
+ end
21
+ it "should be string" do
22
+ @place.key.should be_a_kind_of String
23
+ end
24
+ end
25
+ context "#search" do
26
+ context "By text" do
27
+ before(:all) {@search_result = @place.search(:text, "Australia Food")}
28
+ it_behaves_like "any_search_answer"
29
+ end
30
+ context "By longitude and latitude" do
31
+ before(:all) {@search_result = @place.search(:place, -33.8670522, 151.1957362, 500, "food")}
32
+ it_behaves_like "any_search_answer"
33
+ end
34
+ context "Any other" do
35
+ it "should rise an error" do
36
+ lambda {@place.search()}.should raise_error(ArgumentError)
37
+ end
38
+ end
39
+ end
40
+ context "#details" do
41
+ before (:all) do
42
+ @reference = "CmRYAAAAciqGsTRX1mXRvuXSH2ErwW-jCINE1aLiwP64MCWDN5vkXvXoQGPKldMfmdGyqWSpm7BEYCgDm-iv7Kc2PF7QA7brMAwBbAcqMr5i1f4PwTpaovIZjysCEZTry8Ez30wpEhCNCXpynextCld2EBsDkRKsGhSLayuRyFsex6JA6NPh9dyupoTH3g"
43
+ end
44
+ it "must have reference in args" do
45
+ lambda{@place.details()}.should raise_error(ArgumentError)
46
+ end
47
+ it "must rise an error if arguments are invalid" do
48
+ lambda{@place.details("oh_lol,_it's_reference!","some_args")}.should raise_error(RuntimeError)
49
+ end
50
+ it "should check status of an answer" do
51
+ @place.details(@reference)
52
+ @place.status.should be_a_kind_of String
53
+ @place.status.inspect.should_not be_empty
54
+ end
55
+ it "should show me name if i want it" do
56
+ @place.details(@reference, "name")
57
+ @place.name.should_not be_empty
58
+ end
59
+ it "should show me as many items, as i want" do
60
+ @place.details(@reference, "name", "rating", "formatted_phone_number")
61
+ @place.name.should_not be_empty
62
+ @place.rating.should_not be_nil
63
+ @place.formatted_phone_number.should_not be_empty
64
+ end
65
+ it "also should give me access to address details packed in own class Address" do
66
+ @place.details(@reference, "name", "address_components")
67
+ @place.address_components.should be_a_kind_of GMaps_Places::Address
68
+ @place.address_components.country.should_not be_empty
69
+ @place.address_components.route.should_not be_empty
70
+ @place.address_components.street_number.should_not be_empty
71
+ end
72
+ it "even to user's reviews!" do
73
+ @place.details(@reference, "reviews")
74
+ @place.reviews[1].author_name.should_not be_empty
75
+ @place.reviews[1].text.should_not be_empty
76
+ end
77
+ it "should return reviews as an array of classes" do
78
+ @place.details(@reference, "reviews")
79
+ @place.reviews.should be_a_kind_of Array
80
+ @place.reviews.each {|review|
81
+ review.should be_a_kind_of GMaps_Places::Review
82
+ }
83
+ end
84
+ it "should show us geometry data of object, packed in class Geometry" do
85
+ @place.details(@reference, "geometry")
86
+ @place.geometry.lat.should_not be_nil
87
+ @place.geometry.lng.should_not be_nil
88
+ @place.geometry.should be_a_kind_of GMaps_Places::Geometry
89
+ end
90
+ it "should show us events, as array Events class" do
91
+ @place.details(@reference, "events")
92
+ @place.events.should be_a_kind_of Array
93
+ @place.events[0].event_id.should_not be_nil
94
+ @place.events[0].start_time.should_not be_nil
95
+ @place.events[0].should be_a_kind_of GMaps_Places::Events
96
+ end
97
+ it "should catch all of the errors in variable and show the as an array" do
98
+ @place.errors.should be_a_kind_of Array
99
+ end
100
+ end
101
+ context "#add" do
102
+ xit "should add place" do
103
+
104
+ end
105
+ end
106
+ context "#delete" do
107
+ xit "should delete place" do
108
+
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'GMaps_Places'
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: GMaps_Places
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alexandr Kovtunov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: GMaps_Places Gem for rbGarage courses
47
+ email:
48
+ - 1sasha.sasha1@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - .idea/.name
55
+ - .idea/.rakeTasks
56
+ - .idea/encodings.xml
57
+ - .idea/gmaps_Gem.iml
58
+ - .idea/misc.xml
59
+ - .idea/modules.xml
60
+ - .idea/scopes/scope_settings.xml
61
+ - .idea/vcs.xml
62
+ - .idea/workspace.xml
63
+ - GMaps_Places.gemspec
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - lib/GMaps_Places.rb
69
+ - lib/GMaps_Places/version.rb
70
+ - spec/GMaps_Places_spec.rb
71
+ - spec/spec_helper.rb
72
+ homepage: ''
73
+ licenses: []
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 1.8.23
93
+ signing_key:
94
+ specification_version: 3
95
+ summary: A small gem for Google Places API
96
+ test_files:
97
+ - spec/GMaps_Places_spec.rb
98
+ - spec/spec_helper.rb