urimapper 1.0.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: 1905e781a6b12ad8cfc6c3a1d395d55335fea7cf
4
+ data.tar.gz: bd30e9b02f7c38c33489be366214fff8ff9e7378
5
+ SHA512:
6
+ metadata.gz: 5d5af7fab4b60c52893807cd8b63edd0feac5304666f794f4d43d36a9ec4dcf7836b94c87b179d52e632ad228a6d61683d0256adba41d7b29ce92f139bffa7aa
7
+ data.tar.gz: f6405d9976c65b54e731e45a6d6c7c5332df06848a6349416a4fb9ea13aec7b62dcbaba6f1e2627540aa30bb24887b84e2b158105f4dd1d83ff0085aa1962078
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ # Gemfile.lock
31
+ # .ruby-version
32
+ # .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
@@ -0,0 +1 @@
1
+ urimapper
@@ -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.1.5" 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/urimapper.iml" filepath="$PROJECT_DIR$/.idea/urimapper.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,45 @@
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="" />
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
+ <orderEntry type="inheritedJdk" />
15
+ <orderEntry type="sourceFolder" forTests="false" />
16
+ <orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.8, RVM: ruby-2.1.5) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.6, RVM: ruby-2.1.5) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="celluloid (v0.16.0, RVM: ruby-2.1.5) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="coderay (v1.1.0, RVM: ruby-2.1.5) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-2.1.5) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.8, RVM: ruby-2.1.5) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="formatador (v0.2.5, RVM: ruby-2.1.5) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="guard (v2.12.5, RVM: ruby-2.1.5) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="guard-compat (v1.2.1, RVM: ruby-2.1.5) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="guard-rspec (v4.5.0, RVM: ruby-2.1.5) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="hitimes (v1.2.2, RVM: ruby-2.1.5) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="listen (v2.10.0, RVM: ruby-2.1.5) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="lumberjack (v1.0.9, RVM: ruby-2.1.5) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="method_source (v0.8.2, RVM: ruby-2.1.5) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="nenv (v0.2.0, RVM: ruby-2.1.5) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="notiffany (v0.0.6, RVM: ruby-2.1.5) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="pry (v0.10.1, RVM: ruby-2.1.5) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="rb-fsevent (v0.9.4, RVM: ruby-2.1.5) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="rb-inotify (v0.9.5, RVM: ruby-2.1.5) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.2.0, RVM: ruby-2.1.5) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.2.2, RVM: ruby-2.1.5) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.2.0, RVM: ruby-2.1.5) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.2.1, RVM: ruby-2.1.5) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.2.2, RVM: ruby-2.1.5) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="shellany (v0.0.1, RVM: ruby-2.1.5) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="slop (v3.6.0, RVM: ruby-2.1.5) [gem]" level="application" />
42
+ <orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-2.1.5) [gem]" level="application" />
43
+ <orderEntry type="library" scope="PROVIDED" name="timers (v4.0.1, RVM: ruby-2.1.5) [gem]" level="application" />
44
+ </component>
45
+ </module>
@@ -0,0 +1,6 @@
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>
@@ -0,0 +1,445 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="b160b616-dd6e-420c-b033-789784ca6dfb" name="Default" comment="">
5
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.rspec" />
6
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/lib/urimapper_spec.rb" />
7
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/urimapper/version.rb" />
8
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
9
+ </list>
10
+ <ignored path="urimapper.iws" />
11
+ <ignored path=".idea/workspace.xml" />
12
+ <ignored path=".idea/dataSources.local.xml" />
13
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
14
+ <option name="TRACKING_ENABLED" value="true" />
15
+ <option name="SHOW_DIALOG" value="false" />
16
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
17
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
18
+ <option name="LAST_RESOLUTION" value="IGNORE" />
19
+ </component>
20
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
21
+ <component name="CreatePatchCommitExecutor">
22
+ <option name="PATCH_PATH" value="" />
23
+ </component>
24
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
25
+ <component name="FavoritesManager">
26
+ <favorites_list name="urimapper" />
27
+ </component>
28
+ <component name="FileEditorManager">
29
+ <leaf>
30
+ <file leaf-file-name="urimapper.rb" pinned="false" current-in-tab="true">
31
+ <entry file="file://$PROJECT_DIR$/lib/urimapper.rb">
32
+ <provider selected="true" editor-type-id="text-editor">
33
+ <state vertical-scroll-proportion="0.48734176">
34
+ <caret line="14" column="34" selection-start-line="14" selection-start-column="34" selection-end-line="14" selection-end-column="34" />
35
+ <folding />
36
+ </state>
37
+ </provider>
38
+ </entry>
39
+ </file>
40
+ <file leaf-file-name="spec_helper.rb" pinned="false" current-in-tab="false">
41
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
42
+ <provider selected="true" editor-type-id="text-editor">
43
+ <state vertical-scroll-proportion="0.0">
44
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
45
+ <folding />
46
+ </state>
47
+ </provider>
48
+ </entry>
49
+ </file>
50
+ <file leaf-file-name="urimapper_spec.rb" pinned="false" current-in-tab="false">
51
+ <entry file="file://$PROJECT_DIR$/spec/lib/urimapper_spec.rb">
52
+ <provider selected="true" editor-type-id="text-editor">
53
+ <state vertical-scroll-proportion="0.0">
54
+ <caret line="24" column="18" selection-start-line="24" selection-start-column="18" selection-end-line="24" selection-end-column="18" />
55
+ <folding />
56
+ </state>
57
+ </provider>
58
+ </entry>
59
+ </file>
60
+ <file leaf-file-name="Gemfile" pinned="false" current-in-tab="false">
61
+ <entry file="file://$PROJECT_DIR$/Gemfile">
62
+ <provider selected="true" editor-type-id="text-editor">
63
+ <state vertical-scroll-proportion="0.0">
64
+ <caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
65
+ <folding />
66
+ </state>
67
+ </provider>
68
+ </entry>
69
+ </file>
70
+ <file leaf-file-name=".rspec" pinned="false" current-in-tab="false">
71
+ <entry file="file://$PROJECT_DIR$/.rspec">
72
+ <provider selected="true" editor-type-id="text-editor">
73
+ <state vertical-scroll-proportion="0.0">
74
+ <caret line="1" column="21" selection-start-line="1" selection-start-column="21" selection-end-line="1" selection-end-column="21" />
75
+ <folding />
76
+ </state>
77
+ </provider>
78
+ </entry>
79
+ </file>
80
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
81
+ <entry file="file://$PROJECT_DIR$/lib/urimapper/version.rb">
82
+ <provider selected="true" editor-type-id="text-editor">
83
+ <state vertical-scroll-proportion="0.0">
84
+ <caret line="1" column="25" selection-start-line="1" selection-start-column="25" selection-end-line="1" selection-end-column="25" />
85
+ <folding />
86
+ </state>
87
+ </provider>
88
+ </entry>
89
+ </file>
90
+ </leaf>
91
+ </component>
92
+ <component name="Git.Settings">
93
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
94
+ </component>
95
+ <component name="IdeDocumentHistory">
96
+ <option name="CHANGED_PATHS">
97
+ <list>
98
+ <option value="$PROJECT_DIR$/Guardfile" />
99
+ <option value="$PROJECT_DIR$/spec/lib/uri_mapper_spec.rb" />
100
+ <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
101
+ <option value="$PROJECT_DIR$/.rspec" />
102
+ <option value="$PROJECT_DIR$/lib/uri_mapper/version.rb" />
103
+ <option value="$PROJECT_DIR$/lib/uri_mapper.rb" />
104
+ <option value="$PROJECT_DIR$/spec/lib/urimapper_spec.rb" />
105
+ <option value="$PROJECT_DIR$/urimapper.gemspec" />
106
+ <option value="$PROJECT_DIR$/lib/urimapper.rb" />
107
+ </list>
108
+ </option>
109
+ </component>
110
+ <component name="JsBuildToolGruntFileManager" detection-done="true" />
111
+ <component name="JsGulpfileManager">
112
+ <detection-done>true</detection-done>
113
+ </component>
114
+ <component name="NamedScopeManager">
115
+ <order />
116
+ </component>
117
+ <component name="ProjectFrameBounds">
118
+ <option name="x" value="-2" />
119
+ <option name="y" value="23" />
120
+ <option name="width" value="1680" />
121
+ <option name="height" value="1023" />
122
+ </component>
123
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
124
+ <OptionsSetting value="true" id="Add" />
125
+ <OptionsSetting value="true" id="Remove" />
126
+ <OptionsSetting value="true" id="Checkout" />
127
+ <OptionsSetting value="true" id="Update" />
128
+ <OptionsSetting value="true" id="Status" />
129
+ <OptionsSetting value="true" id="Edit" />
130
+ <ConfirmationsSetting value="2" id="Add" />
131
+ <ConfirmationsSetting value="0" id="Remove" />
132
+ </component>
133
+ <component name="ProjectView">
134
+ <navigator currentView="ProjectPane" proportions="" version="1">
135
+ <flattenPackages />
136
+ <showMembers />
137
+ <showModules />
138
+ <showLibraryContents />
139
+ <hideEmptyPackages />
140
+ <abbreviatePackageNames />
141
+ <autoscrollToSource />
142
+ <autoscrollFromSource />
143
+ <sortByType />
144
+ </navigator>
145
+ <panes>
146
+ <pane id="ProjectPane">
147
+ <subPane>
148
+ <PATH>
149
+ <PATH_ELEMENT>
150
+ <option name="myItemId" value="urimapper" />
151
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
152
+ </PATH_ELEMENT>
153
+ </PATH>
154
+ <PATH>
155
+ <PATH_ELEMENT>
156
+ <option name="myItemId" value="urimapper" />
157
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
158
+ </PATH_ELEMENT>
159
+ <PATH_ELEMENT>
160
+ <option name="myItemId" value="urimapper" />
161
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
162
+ </PATH_ELEMENT>
163
+ </PATH>
164
+ <PATH>
165
+ <PATH_ELEMENT>
166
+ <option name="myItemId" value="urimapper" />
167
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
168
+ </PATH_ELEMENT>
169
+ <PATH_ELEMENT>
170
+ <option name="myItemId" value="urimapper" />
171
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
172
+ </PATH_ELEMENT>
173
+ <PATH_ELEMENT>
174
+ <option name="myItemId" value="spec" />
175
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
176
+ </PATH_ELEMENT>
177
+ </PATH>
178
+ <PATH>
179
+ <PATH_ELEMENT>
180
+ <option name="myItemId" value="urimapper" />
181
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
182
+ </PATH_ELEMENT>
183
+ <PATH_ELEMENT>
184
+ <option name="myItemId" value="urimapper" />
185
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
186
+ </PATH_ELEMENT>
187
+ <PATH_ELEMENT>
188
+ <option name="myItemId" value="spec" />
189
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
190
+ </PATH_ELEMENT>
191
+ <PATH_ELEMENT>
192
+ <option name="myItemId" value="lib" />
193
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
194
+ </PATH_ELEMENT>
195
+ </PATH>
196
+ <PATH>
197
+ <PATH_ELEMENT>
198
+ <option name="myItemId" value="urimapper" />
199
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
200
+ </PATH_ELEMENT>
201
+ <PATH_ELEMENT>
202
+ <option name="myItemId" value="urimapper" />
203
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
204
+ </PATH_ELEMENT>
205
+ <PATH_ELEMENT>
206
+ <option name="myItemId" value="lib" />
207
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
208
+ </PATH_ELEMENT>
209
+ </PATH>
210
+ <PATH>
211
+ <PATH_ELEMENT>
212
+ <option name="myItemId" value="urimapper" />
213
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
214
+ </PATH_ELEMENT>
215
+ <PATH_ELEMENT>
216
+ <option name="myItemId" value="urimapper" />
217
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
218
+ </PATH_ELEMENT>
219
+ <PATH_ELEMENT>
220
+ <option name="myItemId" value="lib" />
221
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
222
+ </PATH_ELEMENT>
223
+ <PATH_ELEMENT>
224
+ <option name="myItemId" value="urimapper" />
225
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
226
+ </PATH_ELEMENT>
227
+ </PATH>
228
+ </subPane>
229
+ </pane>
230
+ <pane id="Scope" />
231
+ <pane id="Scratches" />
232
+ </panes>
233
+ </component>
234
+ <component name="PropertiesComponent">
235
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
236
+ <property name="WebServerToolWindowFactoryState" value="false" />
237
+ <property name="SearchEverywhereHistoryKey" value="&#9;FILE&#9;file:///Users/sushi/github/urimapper/lib/uri_mapper/version.rb" />
238
+ </component>
239
+ <component name="RunManager">
240
+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
241
+ <method />
242
+ </configuration>
243
+ <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
244
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
245
+ <module name="" />
246
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
247
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
248
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
249
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
250
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
251
+ <envs />
252
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
253
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
254
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
255
+ <COVERAGE_PATTERN ENABLED="true">
256
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
257
+ </COVERAGE_PATTERN>
258
+ </EXTENSION>
259
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
260
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
261
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
262
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
263
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
264
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
265
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
266
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
267
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
268
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
269
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
270
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
271
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
272
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
273
+ <method />
274
+ </configuration>
275
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
276
+ <module name="" />
277
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
278
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
279
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
280
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
281
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
282
+ <envs />
283
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
284
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
285
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
286
+ <COVERAGE_PATTERN ENABLED="true">
287
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
288
+ </COVERAGE_PATTERN>
289
+ </EXTENSION>
290
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
291
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
292
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
293
+ <method />
294
+ </configuration>
295
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
296
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
297
+ <module name="" />
298
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
299
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
300
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
301
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
302
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
303
+ <envs />
304
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
305
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
306
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
307
+ <COVERAGE_PATTERN ENABLED="true">
308
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
309
+ </COVERAGE_PATTERN>
310
+ </EXTENSION>
311
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
312
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
313
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
314
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
315
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
316
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
317
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
318
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
319
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
320
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
321
+ <method />
322
+ </configuration>
323
+ <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
324
+ <method />
325
+ </configuration>
326
+ </component>
327
+ <component name="ShelveChangesManager" show_recycled="false" />
328
+ <component name="TaskManager">
329
+ <task active="true" id="Default" summary="Default task">
330
+ <changelist id="b160b616-dd6e-420c-b033-789784ca6dfb" name="Default" comment="" />
331
+ <created>1430315375963</created>
332
+ <option name="number" value="Default" />
333
+ <updated>1430315375963</updated>
334
+ </task>
335
+ <servers />
336
+ </component>
337
+ <component name="ToolWindowManager">
338
+ <frame x="-2" y="23" width="1680" height="1023" extended-state="0" />
339
+ <editor active="true" />
340
+ <layout>
341
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
342
+ <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" />
343
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
344
+ <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
345
+ <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="-1" side_tool="false" content_ui="tabs" />
346
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32959184" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
347
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
348
+ <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" />
349
+ <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="false" content_ui="tabs" />
350
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
351
+ <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="-1" side_tool="true" content_ui="tabs" />
352
+ <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" />
353
+ <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" />
354
+ <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" />
355
+ <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" />
356
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
357
+ <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" />
358
+ <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" />
359
+ </layout>
360
+ </component>
361
+ <component name="UnknownFeatures">
362
+ <option featureType="com.intellij.fileTypeFactory" implementationName="*.md" />
363
+ </component>
364
+ <component name="VcsContentAnnotationSettings">
365
+ <option name="myLimit" value="2678400000" />
366
+ </component>
367
+ <component name="XDebuggerManager">
368
+ <breakpoint-manager />
369
+ <watches-manager />
370
+ </component>
371
+ <component name="editorHistoryManager">
372
+ <entry file="file://$PROJECT_DIR$/README.md">
373
+ <provider selected="true" editor-type-id="text-editor">
374
+ <state vertical-scroll-proportion="0.278481">
375
+ <caret line="8" column="12" selection-start-line="8" selection-start-column="12" selection-end-line="8" selection-end-column="12" />
376
+ <folding />
377
+ </state>
378
+ </provider>
379
+ </entry>
380
+ <entry file="file://$PROJECT_DIR$/Guardfile">
381
+ <provider selected="true" editor-type-id="text-editor">
382
+ <state vertical-scroll-proportion="0.31329113">
383
+ <caret line="9" column="20" selection-start-line="9" selection-start-column="20" selection-end-line="9" selection-end-column="20" />
384
+ <folding />
385
+ </state>
386
+ </provider>
387
+ </entry>
388
+ <entry file="file://$PROJECT_DIR$/Gemfile">
389
+ <provider selected="true" editor-type-id="text-editor">
390
+ <state vertical-scroll-proportion="0.0">
391
+ <caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
392
+ <folding />
393
+ </state>
394
+ </provider>
395
+ </entry>
396
+ <entry file="file://$PROJECT_DIR$/.rspec">
397
+ <provider selected="true" editor-type-id="text-editor">
398
+ <state vertical-scroll-proportion="0.0">
399
+ <caret line="1" column="21" selection-start-line="1" selection-start-column="21" selection-end-line="1" selection-end-column="21" />
400
+ <folding />
401
+ </state>
402
+ </provider>
403
+ </entry>
404
+ <entry file="file://$PROJECT_DIR$/lib/urimapper/version.rb">
405
+ <provider selected="true" editor-type-id="text-editor">
406
+ <state vertical-scroll-proportion="0.0">
407
+ <caret line="1" column="25" selection-start-line="1" selection-start-column="25" selection-end-line="1" selection-end-column="25" />
408
+ <folding />
409
+ </state>
410
+ </provider>
411
+ </entry>
412
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
413
+ <provider selected="true" editor-type-id="text-editor">
414
+ <state vertical-scroll-proportion="0.0">
415
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
416
+ <folding />
417
+ </state>
418
+ </provider>
419
+ </entry>
420
+ <entry file="file://$PROJECT_DIR$/spec/lib/urimapper_spec.rb">
421
+ <provider selected="true" editor-type-id="text-editor">
422
+ <state vertical-scroll-proportion="0.0">
423
+ <caret line="24" column="18" selection-start-line="24" selection-start-column="18" selection-end-line="24" selection-end-column="18" />
424
+ <folding />
425
+ </state>
426
+ </provider>
427
+ </entry>
428
+ <entry file="file://$PROJECT_DIR$/urimapper.gemspec">
429
+ <provider selected="true" editor-type-id="text-editor">
430
+ <state vertical-scroll-proportion="0.6613924">
431
+ <caret line="19" column="29" selection-start-line="19" selection-start-column="29" selection-end-line="19" selection-end-column="29" />
432
+ <folding />
433
+ </state>
434
+ </provider>
435
+ </entry>
436
+ <entry file="file://$PROJECT_DIR$/lib/urimapper.rb">
437
+ <provider selected="true" editor-type-id="text-editor">
438
+ <state vertical-scroll-proportion="0.48734176">
439
+ <caret line="14" column="34" selection-start-line="14" selection-start-column="34" selection-end-line="14" selection-end-column="34" />
440
+ <folding />
441
+ </state>
442
+ </provider>
443
+ </entry>
444
+ </component>
445
+ </project>
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
@@ -0,0 +1,74 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ urimapper (1.0.0)
5
+ addressable (~> 2.3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.3.8)
11
+ celluloid (0.16.0)
12
+ timers (~> 4.0.0)
13
+ coderay (1.1.0)
14
+ diff-lcs (1.2.5)
15
+ ffi (1.9.8)
16
+ formatador (0.2.5)
17
+ guard (2.12.5)
18
+ formatador (>= 0.2.4)
19
+ listen (~> 2.7)
20
+ lumberjack (~> 1.0)
21
+ nenv (~> 0.1)
22
+ notiffany (~> 0.0)
23
+ pry (>= 0.9.12)
24
+ shellany (~> 0.0)
25
+ thor (>= 0.18.1)
26
+ guard-compat (1.2.1)
27
+ guard-rspec (4.5.0)
28
+ guard (~> 2.1)
29
+ guard-compat (~> 1.1)
30
+ rspec (>= 2.99.0, < 4.0)
31
+ hitimes (1.2.2)
32
+ listen (2.10.0)
33
+ celluloid (~> 0.16.0)
34
+ rb-fsevent (>= 0.9.3)
35
+ rb-inotify (>= 0.9)
36
+ lumberjack (1.0.9)
37
+ method_source (0.8.2)
38
+ nenv (0.2.0)
39
+ notiffany (0.0.6)
40
+ nenv (~> 0.1)
41
+ shellany (~> 0.0)
42
+ pry (0.10.1)
43
+ coderay (~> 1.1.0)
44
+ method_source (~> 0.8.1)
45
+ slop (~> 3.4)
46
+ rb-fsevent (0.9.4)
47
+ rb-inotify (0.9.5)
48
+ ffi (>= 0.5.0)
49
+ rspec (3.2.0)
50
+ rspec-core (~> 3.2.0)
51
+ rspec-expectations (~> 3.2.0)
52
+ rspec-mocks (~> 3.2.0)
53
+ rspec-core (3.2.2)
54
+ rspec-support (~> 3.2.0)
55
+ rspec-expectations (3.2.0)
56
+ diff-lcs (>= 1.2.0, < 2.0)
57
+ rspec-support (~> 3.2.0)
58
+ rspec-mocks (3.2.1)
59
+ diff-lcs (>= 1.2.0, < 2.0)
60
+ rspec-support (~> 3.2.0)
61
+ rspec-support (3.2.2)
62
+ shellany (0.0.1)
63
+ slop (3.6.0)
64
+ thor (0.19.1)
65
+ timers (4.0.1)
66
+ hitimes
67
+
68
+ PLATFORMS
69
+ ruby
70
+
71
+ DEPENDENCIES
72
+ guard-rspec (~> 4.4)
73
+ rspec (~> 3.1)
74
+ urimapper!
@@ -0,0 +1,21 @@
1
+ guard :rspec, cmd: "bundle exec rspec" do
2
+ require "ostruct"
3
+
4
+ # Generic Ruby apps
5
+ rspec = OpenStruct.new
6
+ rspec.spec = ->(m) { "spec/#{m}_spec.rb" }
7
+ rspec.spec_dir = "spec"
8
+ rspec.spec_helper = "spec/spec_helper.rb"
9
+
10
+ watch(%r{^spec/.+_spec\.rb$})
11
+ watch(%r{^lib/(.+)\.rb$}) { |m|
12
+ rspec.spec.("lib/#{m[1]}")
13
+ }
14
+ watch(%r{^lib/uri_mapper/(.+)\.rb$}) { |m|
15
+ rspec.spec.("lib/uri_mapper/#{m[1]}")
16
+ rspec.spec.("lib/uri_mapper")
17
+ }
18
+
19
+ watch(rspec.spec_helper) { rspec.spec_dir }
20
+
21
+ end
@@ -0,0 +1,20 @@
1
+ UriMapper
2
+ ==============
3
+
4
+ A small utility to parse canonical urls and set up deterministic hashes
5
+
6
+ Requirements
7
+ -----------------
8
+
9
+ * Addressable
10
+
11
+ Installation
12
+ -----------------
13
+
14
+ gem install urimapper
15
+
16
+
17
+ Getting Started
18
+ -----------------
19
+
20
+ Start coding.
@@ -0,0 +1,76 @@
1
+ require "urimapper/version"
2
+ require "addressable/uri"
3
+
4
+ fail "Skeevy #{UriMapper::VERSION} requires Ruby 2.1 or later." if RUBY_VERSION < '2.1.0'
5
+
6
+ module UriMapper
7
+
8
+ RE_WWW = Regexp.new(/^www\./)
9
+ RE_SLASH = Regexp.new(/(\/)+$/)
10
+ RE_WHITE = Regexp.new(/\s+/)
11
+
12
+ class << self
13
+ def parse(where)
14
+ where.freeze
15
+ if where.nil? || where.empty?
16
+ raise_error where
17
+ end
18
+ unless where.include?('.'.freeze)
19
+ raise_error where
20
+ end
21
+ fqdn = where
22
+ if where.slice(0, 2) == '//'.freeze
23
+ fqdn = "http:#{where}"
24
+ elsif where.slice(0, 4) != 'http'.freeze
25
+ fqdn = "http://#{where}"
26
+ end
27
+ uri = nil
28
+ fqdn = fqdn.strip
29
+ begin
30
+ uri = ::Addressable::URI.parse(fqdn).to_hash
31
+ rescue Exception => e
32
+ raise_error e.message
33
+ end
34
+
35
+ path = uri[:path].sub(RE_SLASH, ''.freeze).strip
36
+ path = (path.empty?) ? '/'.freeze : path
37
+ query = uri[:query].to_s.strip
38
+ fragment = uri[:fragment].to_s.strip
39
+ host = uri[:host].strip
40
+ domain = host.gsub(RE_WWW, ''.freeze).gsub(RE_WHITE, ''.freeze).chomp('.'.freeze)
41
+ ssl = (uri[:scheme] == 'https'.freeze) ? true : false
42
+ port = uri[:port] || ((ssl) ? 443 : 80)
43
+ logical_port = (ssl) ? ((port == 443) ? ''.freeze : ":#{port}") : ((port == 80) ? ''.freeze : ":#{port}")
44
+ canon = "#{domain}#{logical_port}#{path}"
45
+ canon += "?#{query}" unless query.empty?
46
+ canon += "##{fragment}" unless fragment.empty?
47
+ www = (host.slice(0, 4)=='www.'.freeze) ? true : false
48
+ {
49
+ domain: domain,
50
+ www: www,
51
+ ssl: ssl,
52
+ path: path,
53
+ port: port,
54
+ fragment: fragment,
55
+ logical_port: logical_port,
56
+ query: query,
57
+ canonical: canon,
58
+ raw: "#{www ? 'www.'.freeze : ''.freeze}#{domain}#{logical_port}",
59
+ hash: Digest::SHA1.hexdigest(canon)
60
+ }
61
+ end
62
+
63
+ def raise_error(where)
64
+ raise ArgumentError, "Invalid URL passed to parser: '#{where}'", []
65
+ end
66
+
67
+ def calculate_hash(what)
68
+ Digest::SHA1.hexdigest(what)
69
+ end
70
+
71
+ def inspect
72
+ "UriMapper #{UriMapper::VERSION}"
73
+ end
74
+ end
75
+
76
+ end
@@ -0,0 +1,3 @@
1
+ module UriMapper
2
+ VERSION = "1.0.0".freeze
3
+ end
@@ -0,0 +1,101 @@
1
+ RSpec.describe UriMapper do
2
+
3
+ let(:o) { described_class }
4
+ let(:ssl) { "https://www.terakeet.com" }
5
+ let(:plain) { "http://cnn.com" }
6
+ let(:pathy) { "http://www.terakeet.com/about/team" }
7
+ let(:pathy_canon_hash) { "4735a7ac7a668b4b22d56f40c6d4a028032ae1b2" }
8
+ let(:fraggy) { "http://www.terakeet.com/thing1/#about" }
9
+ let(:query) { "http://www.terakeet.com/index.php?id=102" }
10
+ let(:long_query) { "http://www.terakeet.com/index.php?id=102&example=yes" }
11
+ let(:fq) { "http://www.terakeet.com/index.php?id=102#thefrag" }
12
+ let(:fraggy_canon_hash) { "c29fa81b36969ed3f09bc5c6226349085d440cf2" }
13
+ let(:invalid_proto) { "ftp://nofrigginway" }
14
+ let(:invalid_all) { "wtf://whoa" }
15
+ let(:what) { o.parse(plain) }
16
+ let(:difficult) { "http://www.bignewsabout.com/asbestos cancer law lawsuit mesothelioma settlement.php" }
17
+ let(:odd) { "http://wwv.rapidprototypingonline.com:8567/Commercial_Service_Providers.htm" }
18
+ let(:make_valid) { [
19
+ ["http:// mommybloghoppers.blogspot.com /", "mommybloghoppers.blogspot.com"],
20
+ ["http:// www.liveandlocalenc.com. /", "liveandlocalenc.com"]
21
+ ]
22
+ }
23
+
24
+ it "explodes when the url to parse is missing" do
25
+ expect{o.parse(nil)}.to raise_error ArgumentError
26
+ expect{o.parse("")}.to raise_error ArgumentError
27
+ end
28
+
29
+ it "parses the correct domain" do
30
+ expect(o.parse(ssl)[:domain]).to eq("terakeet.com")
31
+ expect(o.parse(ssl)[:www]).to eq(true)
32
+ end
33
+ it "detects ssl" do
34
+ expect(o.parse(ssl)[:ssl]).to eq(true)
35
+ end
36
+
37
+ it "keeps the correct proto and simple domain" do
38
+ expect(what[:ssl]).to eq(false)
39
+ expect(what[:domain]).to eq("cnn.com")
40
+ expect(what[:www]).to eq(false)
41
+ end
42
+
43
+ describe ".parse" do
44
+ it "finds paths and fragments" do
45
+ expect(o.parse(pathy)[:path]).to eq("/about/team")
46
+ expect(o.parse(query)[:query]).to eq("id=102")
47
+ expect(o.parse(long_query)[:query]).to eq("id=102&example=yes")
48
+ expect(o.parse(fq)[:fragment]).to eq("thefrag")
49
+ expect(o.parse(fq)[:query]).to eq("id=102")
50
+ end
51
+
52
+ it "handles odd paths" do
53
+ expect(o.parse(odd)).to eq({domain: "wwv.rapidprototypingonline.com", port: 8567, ssl: false,
54
+ www: false, path: "/Commercial_Service_Providers.htm",
55
+ query: "", hash: "cbf7d54f1a97dd34c2f8123b2c15c52e5e9e8e54",
56
+ canonical: "wwv.rapidprototypingonline.com:8567/Commercial_Service_Providers.htm",
57
+ fragment: "", logical_port: ":8567",
58
+ raw: "wwv.rapidprototypingonline.com:8567"
59
+ })
60
+ end
61
+
62
+ it "handles validating partially futzed domain names" do
63
+ make_valid.each { |ary|
64
+ expect(o.parse(ary[0])[:domain]).to eq(ary[1])
65
+ }
66
+ end
67
+
68
+ it "produces canonical paths from full urls" do
69
+ expect(o.parse(pathy)[:canonical]).to eq("terakeet.com/about/team")
70
+ expect(o.parse(fraggy)[:canonical]).to eq("terakeet.com/thing1#about")
71
+ expect(o.parse(query)[:canonical]).to eq("terakeet.com/index.php?id=102")
72
+ expect(o.parse(fq)[:canonical]).to eq("terakeet.com/index.php?id=102#thefrag")
73
+ expect(o.parse(long_query)[:canonical]).to eq("terakeet.com/index.php?id=102&example=yes")
74
+ end
75
+
76
+ it "produces canonical paths from domains only" do
77
+ expect(o.parse("terakeet.com")[:canonical]).to eq("terakeet.com/")
78
+ end
79
+
80
+ it "errors appropriately" do
81
+ expect { o.parse("SSSFFFPPEW::@#>@#$??@??//") }.to raise_error(ArgumentError, /invalid/i)
82
+ end
83
+
84
+ it "produces proper sha1 hashes" do
85
+ expect(o.parse(pathy)[:hash]).to eq(pathy_canon_hash)
86
+ end
87
+
88
+ it "doesn't fail on complex URIs" do
89
+ expect { o.parse(difficult) }.to_not raise_error
90
+ end
91
+
92
+ end
93
+
94
+ describe '.inspect' do
95
+ it 'outputs the proper string' do
96
+ expect(UriMapper.inspect).to eq "UriMapper #{UriMapper::VERSION}"
97
+ end
98
+ end
99
+
100
+
101
+ end
@@ -0,0 +1,12 @@
1
+ Bundler.require(:default)
2
+
3
+ RSpec.configure do |config|
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
+ end
11
+
12
+ end
@@ -0,0 +1,24 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
2
+ require "urimapper/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'urimapper'
6
+ s.version = UriMapper::VERSION.dup
7
+ s.date = '2015-04-29'
8
+ s.summary = "UriMapper"
9
+ s.description = "A utility to parse urls into canonical paths and deterministic hashes"
10
+ s.authors = ["Craig Waterman"]
11
+ s.email = 'craigwaterman@gmail.com'
12
+ s.homepage =
13
+ 'http://rubygems.org/gems/urimapper'
14
+ s.license = 'MIT'
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.require_paths = ['lib']
19
+
20
+ s.add_runtime_dependency 'addressable', '~> 2.3'
21
+
22
+ s.add_development_dependency 'rspec', '~> 3.1'
23
+ s.add_development_dependency 'guard-rspec', '~> 4.4'
24
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: urimapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Craig Waterman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: addressable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.4'
55
+ description: A utility to parse urls into canonical paths and deterministic hashes
56
+ email: craigwaterman@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - ".idea/.name"
63
+ - ".idea/misc.xml"
64
+ - ".idea/modules.xml"
65
+ - ".idea/urimapper.iml"
66
+ - ".idea/vcs.xml"
67
+ - ".idea/workspace.xml"
68
+ - ".rspec"
69
+ - Gemfile
70
+ - Gemfile.lock
71
+ - Guardfile
72
+ - README.md
73
+ - lib/urimapper.rb
74
+ - lib/urimapper/version.rb
75
+ - spec/lib/urimapper_spec.rb
76
+ - spec/spec_helper.rb
77
+ - urimapper.gemspec
78
+ homepage: http://rubygems.org/gems/urimapper
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.4.3
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: UriMapper
102
+ test_files:
103
+ - spec/lib/urimapper_spec.rb
104
+ - spec/spec_helper.rb