ProtectedConstructor 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.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ ProtectedConstructor
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 ProtectedConstructor-1.0.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install ProtectedConstructor-1.0.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v1.0.0 and build and push ProtectedConstructor-1.0.0.gem to Rubygems" fullCmd="release" taksId="release" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /></RakeGroup></Settings>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Gem">
5
+ <configuration />
6
+ </facet>
7
+ </component>
8
+ <component name="NewModuleRootManager">
9
+ <content url="file://$MODULE_DIR$" />
10
+ <orderEntry type="inheritedJdk" />
11
+ <orderEntry type="sourceFolder" forTests="false" />
12
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.3.5, rbenv: 1.9.3-p0) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rake (v0.9.2.2, rbenv: 1.9.3-p0) [gem]" level="application" />
14
+ </component>
15
+ </module>
16
+
@@ -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
+
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="rbenv: 1.9.3-p0" 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/ProtectedConstructor.iml" filepath="$PROJECT_DIR$/.idea/ProtectedConstructor.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,26 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="Start Yard Server" type="CommandRunConfigurationType" factoryName="Gem Command" singleton="true">
3
+ <module name="ProtectedConstructor" />
4
+ <COMMAND_RUN_CONFIGURATION NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
5
+ <COMMAND_RUN_CONFIGURATION NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
6
+ <COMMAND_RUN_CONFIGURATION NAME="SHOULD_USE_SDK" VALUE="false" />
7
+ <COMMAND_RUN_CONFIGURATION NAME="ALTERN_SDK_NAME" VALUE="" />
8
+ <COMMAND_RUN_CONFIGURATION NAME="myPassParentEnvs" VALUE="true" />
9
+ <envs />
10
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
11
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
12
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
13
+ <COVERAGE_PATTERN ENABLED="true">
14
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
15
+ </COVERAGE_PATTERN>
16
+ </EXTENSION>
17
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
18
+ <COMMAND_CONFIG_SETTINGS_ID NAME="GEM_NAME" VALUE="yard" />
19
+ <COMMAND_CONFIG_SETTINGS_ID NAME="EXECUTABLE_NAME" VALUE="yard" />
20
+ <COMMAND_CONFIG_SETTINGS_ID NAME="EXECUTABLE_ARGS" VALUE="server --reload" />
21
+ <COMMAND_CONFIG_SETTINGS_ID NAME="WORKING_DIR" VALUE="server --reload" />
22
+ <RunnerSettings RunnerId="RubyRunner" />
23
+ <ConfigurationWrapper RunnerId="RubyRunner" />
24
+ <method />
25
+ </configuration>
26
+ </component>
@@ -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,546 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" name="Default" comment="">
5
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.rakeTasks" afterPath="$PROJECT_DIR$/.idea/.rakeTasks" />
6
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Rakefile" afterPath="$PROJECT_DIR$/Rakefile" />
7
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
8
+ </list>
9
+ <ignored path="ProtectedConstructor.iws" />
10
+ <ignored path=".idea/workspace.xml" />
11
+ <file path="/Dummy.txt" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373298427693" ignored="false" />
12
+ <file path="/README.md" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373302046058" ignored="false" />
13
+ <file path="/LICENSE.txt" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373293800369" ignored="false" />
14
+ <file path="/spec_helper.rb" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373297633742" ignored="false" />
15
+ <file path="/protected_constructor_spec.rb" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373298674255" ignored="false" />
16
+ <file path="/klass_factory.rb" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373297952044" ignored="false" />
17
+ <file path="/ProtectedConstructor.gemspec" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373300073743" ignored="false" />
18
+ <file path="/ProtectedConstructor.rb" changelist="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" time="1373301885305" ignored="false" />
19
+ <option name="TRACKING_ENABLED" value="true" />
20
+ <option name="SHOW_DIALOG" value="false" />
21
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
22
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
23
+ <option name="LAST_RESOLUTION" value="IGNORE" />
24
+ </component>
25
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
26
+ <component name="CreatePatchCommitExecutor">
27
+ <option name="PATCH_PATH" value="" />
28
+ </component>
29
+ <component name="DaemonCodeAnalyzer">
30
+ <disable_hints />
31
+ </component>
32
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
33
+ <component name="FavoritesManager">
34
+ <favorites_list name="ProtectedConstructor" />
35
+ </component>
36
+ <component name="FileEditorManager">
37
+ <leaf>
38
+ <file leaf-file-name="README.md" pinned="false" current="false" current-in-tab="false">
39
+ <entry file="file://$PROJECT_DIR$/README.md">
40
+ <provider selected="true" editor-type-id="text-editor">
41
+ <state line="23" column="27" selection-start="452" selection-end="452" vertical-scroll-proportion="0.0">
42
+ <folding />
43
+ </state>
44
+ </provider>
45
+ </entry>
46
+ </file>
47
+ <file leaf-file-name="Gemfile.lock" pinned="false" current="false" current-in-tab="false">
48
+ <entry file="file://$PROJECT_DIR$/Gemfile.lock">
49
+ <provider selected="true" editor-type-id="text-editor">
50
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
51
+ <folding />
52
+ </state>
53
+ </provider>
54
+ </entry>
55
+ </file>
56
+ <file leaf-file-name="Gemfile" pinned="false" current="false" current-in-tab="false">
57
+ <entry file="file://$PROJECT_DIR$/Gemfile">
58
+ <provider selected="true" editor-type-id="text-editor">
59
+ <state line="9" column="0" selection-start="197" selection-end="197" vertical-scroll-proportion="0.0">
60
+ <folding />
61
+ </state>
62
+ </provider>
63
+ </entry>
64
+ </file>
65
+ <file leaf-file-name="Rakefile" pinned="false" current="true" current-in-tab="true">
66
+ <entry file="file://$PROJECT_DIR$/Rakefile">
67
+ <provider selected="true" editor-type-id="text-editor">
68
+ <state line="13" column="0" selection-start="271" selection-end="271" vertical-scroll-proportion="0.40880504">
69
+ <folding />
70
+ </state>
71
+ </provider>
72
+ </entry>
73
+ </file>
74
+ <file leaf-file-name="ProtectedConstructor.rb" pinned="false" current="false" current-in-tab="false">
75
+ <entry file="file://$PROJECT_DIR$/lib/ProtectedConstructor.rb">
76
+ <provider selected="true" editor-type-id="text-editor">
77
+ <state line="33" column="36" selection-start="40" selection-end="647" vertical-scroll-proportion="0.0">
78
+ <folding />
79
+ </state>
80
+ </provider>
81
+ </entry>
82
+ </file>
83
+ <file leaf-file-name="protected_constructor_spec.rb" pinned="false" current="false" current-in-tab="false">
84
+ <entry file="file://$PROJECT_DIR$/spec/ProtectedConstructor/protected_constructor_spec.rb">
85
+ <provider selected="true" editor-type-id="text-editor">
86
+ <state line="15" column="37" selection-start="541" selection-end="565" vertical-scroll-proportion="0.0">
87
+ <folding />
88
+ </state>
89
+ </provider>
90
+ </entry>
91
+ </file>
92
+ </leaf>
93
+ </component>
94
+ <component name="FindManager">
95
+ <FindUsagesManager>
96
+ <setting name="OPEN_NEW_TAB" value="false" />
97
+ </FindUsagesManager>
98
+ </component>
99
+ <component name="Git.Settings">
100
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
101
+ </component>
102
+ <component name="GitLogSettings">
103
+ <option name="myDateState">
104
+ <MyDateState />
105
+ </option>
106
+ </component>
107
+ <component name="IdeDocumentHistory">
108
+ <option name="changedFiles">
109
+ <list>
110
+ <option value="$PROJECT_DIR$/ProtectedConstructor/README.md" />
111
+ <option value="$PROJECT_DIR$/LICENSE.txt" />
112
+ <option value="$PROJECT_DIR$/lib/ProtectedConstructor/version.rb" />
113
+ <option value="$PROJECT_DIR$/Gemfile" />
114
+ <option value="$PROJECT_DIR$/spec/checker/protected_constructor_spec.rb" />
115
+ <option value="$PROJECT_DIR$/spec/klass.rb" />
116
+ <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
117
+ <option value="$PROJECT_DIR$/spec/klass_factory.rb" />
118
+ <option value="$PROJECT_DIR$/spec/ProtectedConstructor/protected_constructor_spec.rb" />
119
+ <option value="$PROJECT_DIR$/ProtectedConstructor.gemspec" />
120
+ <option value="$PROJECT_DIR$/lib/ProtectedConstructor.rb" />
121
+ <option value="$PROJECT_DIR$/README.md" />
122
+ <option value="$PROJECT_DIR$/Rakefile" />
123
+ </list>
124
+ </option>
125
+ </component>
126
+ <component name="ProjectFrameBounds">
127
+ <option name="y" value="22" />
128
+ <option name="width" value="1440" />
129
+ <option name="height" value="874" />
130
+ </component>
131
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
132
+ <OptionsSetting value="true" id="Add" />
133
+ <OptionsSetting value="true" id="Remove" />
134
+ <OptionsSetting value="true" id="Checkout" />
135
+ <OptionsSetting value="true" id="Update" />
136
+ <OptionsSetting value="true" id="Status" />
137
+ <OptionsSetting value="true" id="Edit" />
138
+ <ConfirmationsSetting value="0" id="Add" />
139
+ <ConfirmationsSetting value="0" id="Remove" />
140
+ </component>
141
+ <component name="ProjectReloadState">
142
+ <option name="STATE" value="0" />
143
+ </component>
144
+ <component name="ProjectView">
145
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
146
+ <flattenPackages />
147
+ <showMembers />
148
+ <showModules />
149
+ <showLibraryContents />
150
+ <hideEmptyPackages />
151
+ <abbreviatePackageNames />
152
+ <autoscrollToSource />
153
+ <autoscrollFromSource />
154
+ <sortByType />
155
+ </navigator>
156
+ <panes>
157
+ <pane id="ProjectPane">
158
+ <subPane>
159
+ <PATH>
160
+ <PATH_ELEMENT>
161
+ <option name="myItemId" value="ProtectedConstructor" />
162
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
163
+ </PATH_ELEMENT>
164
+ <PATH_ELEMENT>
165
+ <option name="myItemId" value="External Libraries" />
166
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
167
+ </PATH_ELEMENT>
168
+ </PATH>
169
+ <PATH>
170
+ <PATH_ELEMENT>
171
+ <option name="myItemId" value="ProtectedConstructor" />
172
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
173
+ </PATH_ELEMENT>
174
+ <PATH_ELEMENT>
175
+ <option name="myItemId" value="ProtectedConstructor" />
176
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
177
+ </PATH_ELEMENT>
178
+ </PATH>
179
+ </subPane>
180
+ </pane>
181
+ <pane id="Scope" />
182
+ </panes>
183
+ </component>
184
+ <component name="PropertiesComponent">
185
+ <property name="options.splitter.main.proportions" value="0.3" />
186
+ <property name="WebServerToolWindowFactoryState" value="false" />
187
+ <property name="recentsLimit" value="5" />
188
+ <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
189
+ <property name="restartRequiresConfirmation" value="true" />
190
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
191
+ <property name="options.searchVisible" value="true" />
192
+ <property name="options.splitter.details.proportions" value="0.2" />
193
+ </component>
194
+ <component name="RecentsManager">
195
+ <key name="CopyFile.RECENT_KEYS">
196
+ <recent name="$PROJECT_DIR$/spec" />
197
+ </key>
198
+ <key name="MoveFile.RECENT_KEYS">
199
+ <recent name="$PROJECT_DIR$" />
200
+ </key>
201
+ </component>
202
+ <component name="RunManager" selected="RSpec.All specs in: spec">
203
+ <configuration default="true" type="CommandRunConfigurationType" factoryName="Gem Command">
204
+ <module name="" />
205
+ <COMMAND_RUN_CONFIGURATION NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
206
+ <COMMAND_RUN_CONFIGURATION NAME="WORK DIR" VALUE="" />
207
+ <COMMAND_RUN_CONFIGURATION NAME="SHOULD_USE_SDK" VALUE="false" />
208
+ <COMMAND_RUN_CONFIGURATION NAME="ALTERN_SDK_NAME" VALUE="" />
209
+ <COMMAND_RUN_CONFIGURATION NAME="myPassParentEnvs" VALUE="true" />
210
+ <envs />
211
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
212
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
213
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
214
+ <COVERAGE_PATTERN ENABLED="true">
215
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
216
+ </COVERAGE_PATTERN>
217
+ </EXTENSION>
218
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
219
+ <COMMAND_CONFIG_SETTINGS_ID NAME="GEM_NAME" VALUE="" />
220
+ <COMMAND_CONFIG_SETTINGS_ID NAME="EXECUTABLE_NAME" VALUE="" />
221
+ <COMMAND_CONFIG_SETTINGS_ID NAME="EXECUTABLE_ARGS" VALUE="" />
222
+ <COMMAND_CONFIG_SETTINGS_ID NAME="WORKING_DIR" VALUE="" />
223
+ <method />
224
+ </configuration>
225
+ <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
226
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
227
+ <module name="" />
228
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
229
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
230
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
231
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
232
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
233
+ <envs />
234
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
235
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
236
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
237
+ <COVERAGE_PATTERN ENABLED="true">
238
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
239
+ </COVERAGE_PATTERN>
240
+ </EXTENSION>
241
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
242
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
243
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
244
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
245
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
246
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
247
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
248
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
249
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
250
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
251
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
252
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
253
+ <method />
254
+ </configuration>
255
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
256
+ <module name="" />
257
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
258
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
259
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
260
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
261
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
262
+ <envs />
263
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
264
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
265
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
266
+ <COVERAGE_PATTERN ENABLED="true">
267
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
268
+ </COVERAGE_PATTERN>
269
+ </EXTENSION>
270
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
271
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
272
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
273
+ <method />
274
+ </configuration>
275
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
276
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
277
+ <module name="" />
278
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
279
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
280
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
281
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
282
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
283
+ <envs />
284
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
285
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
286
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
287
+ <COVERAGE_PATTERN ENABLED="true">
288
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
289
+ </COVERAGE_PATTERN>
290
+ </EXTENSION>
291
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
292
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
293
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
294
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
295
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
296
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
297
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
298
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
299
+ <method />
300
+ </configuration>
301
+ <configuration default="false" name="All specs in: spec" type="RSpecRunConfigurationType" factoryName="RSpec" singleton="true">
302
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
303
+ <module name="ProtectedConstructor" />
304
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
305
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
306
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
307
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
308
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
309
+ <envs>
310
+ <env name="JRUBY_OPTS" value="-X+O" />
311
+ </envs>
312
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
313
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
314
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
315
+ <COVERAGE_PATTERN ENABLED="true">
316
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
317
+ </COVERAGE_PATTERN>
318
+ </EXTENSION>
319
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
320
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="$PROJECT_DIR$/spec" />
321
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
322
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
323
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
324
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
325
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="ALL_IN_FOLDER" />
326
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
327
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
328
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
329
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
330
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
331
+ <RunnerSettings RunnerId="RubyRunner" />
332
+ <ConfigurationWrapper RunnerId="RubyRunner" />
333
+ <method />
334
+ </configuration>
335
+ <list size="2">
336
+ <item index="0" class="java.lang.String" itemvalue="Gem Command.Start Yard Server" />
337
+ <item index="1" class="java.lang.String" itemvalue="RSpec.All specs in: spec" />
338
+ </list>
339
+ </component>
340
+ <component name="ShelveChangesManager" show_recycled="false" />
341
+ <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="sslv3">
342
+ <option name="USER" value="" />
343
+ <option name="PASSWORD" value="" />
344
+ <option name="mySSHConnectionTimeout" value="30000" />
345
+ <option name="mySSHReadTimeout" value="30000" />
346
+ <option name="LAST_MERGED_REVISION" />
347
+ <option name="MERGE_DRY_RUN" value="false" />
348
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
349
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
350
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" />
351
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
352
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
353
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
354
+ <option name="FORCE_UPDATE" value="false" />
355
+ <option name="IGNORE_EXTERNALS" value="false" />
356
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
357
+ </component>
358
+ <component name="TaskManager">
359
+ <task active="true" id="Default" summary="Default task">
360
+ <changelist id="d8942c7f-4ad1-4925-b73d-25c4ef52dd1d" name="Default" comment="" />
361
+ <created>1373293526319</created>
362
+ <updated>1373293526319</updated>
363
+ </task>
364
+ <servers />
365
+ </component>
366
+ <component name="ToolWindowManager">
367
+ <frame x="0" y="22" width="1440" height="874" extended-state="0" />
368
+ <editor active="true" />
369
+ <layout>
370
+ <window_info id="Changes" 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" />
371
+ <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" />
372
+ <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" />
373
+ <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" />
374
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24964131" sideWeight="0.6697613" order="0" side_tool="false" content_ui="combo" />
375
+ <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" />
376
+ <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" />
377
+ <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" />
378
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33023873" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
379
+ <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" />
380
+ <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" />
381
+ <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" />
382
+ <window_info id="Find" 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" />
383
+ <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" />
384
+ <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" />
385
+ <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" />
386
+ <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" />
387
+ </layout>
388
+ </component>
389
+ <component name="VcsContentAnnotationSettings">
390
+ <option name="myLimit" value="2678400000" />
391
+ </component>
392
+ <component name="VcsManagerConfiguration">
393
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
394
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
395
+ <option name="CHECK_NEW_TODO" value="true" />
396
+ <option name="myTodoPanelSettings">
397
+ <value>
398
+ <are-packages-shown value="false" />
399
+ <are-modules-shown value="false" />
400
+ <flatten-packages value="false" />
401
+ <is-autoscroll-to-source value="false" />
402
+ </value>
403
+ </option>
404
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
405
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
406
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
407
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
408
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
409
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
410
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
411
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
412
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
413
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
414
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
415
+ <option name="SHORT_DIFF_HORIZONTALLY" value="true" />
416
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
417
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
418
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
419
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
420
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
421
+ <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
422
+ <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
423
+ <option name="LIMIT_HISTORY" value="true" />
424
+ <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
425
+ <option name="UPDATE_FILTER_SCOPE_NAME" />
426
+ <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
427
+ <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
428
+ <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
429
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
430
+ <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
431
+ <option name="LAST_COMMIT_MESSAGE" />
432
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
433
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
434
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
435
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
436
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
437
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
438
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
439
+ <option name="ACTIVE_VCS_NAME" />
440
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
441
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
442
+ <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
443
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
444
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
445
+ </component>
446
+ <component name="XDebuggerManager">
447
+ <breakpoint-manager />
448
+ </component>
449
+ <component name="editorHistoryManager">
450
+ <entry file="file://$PROJECT_DIR$/.gitignore">
451
+ <provider selected="true" editor-type-id="text-editor">
452
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
453
+ <folding />
454
+ </state>
455
+ </provider>
456
+ </entry>
457
+ <entry file="file://$PROJECT_DIR$/LICENSE.txt">
458
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider">
459
+ <state />
460
+ </provider>
461
+ <provider selected="true" editor-type-id="text-editor">
462
+ <state line="5" column="24" selection-start="147" selection-end="147" vertical-scroll-proportion="-2.7777777">
463
+ <folding />
464
+ </state>
465
+ </provider>
466
+ </entry>
467
+ <entry file="file://$PROJECT_DIR$/lib/ProtectedConstructor/version.rb">
468
+ <provider selected="true" editor-type-id="text-editor">
469
+ <state line="1" column="18" selection-start="46" selection-end="46" vertical-scroll-proportion="0.0">
470
+ <folding />
471
+ </state>
472
+ </provider>
473
+ </entry>
474
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
475
+ <provider selected="true" editor-type-id="text-editor">
476
+ <state line="2" column="18" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
477
+ <folding />
478
+ </state>
479
+ </provider>
480
+ </entry>
481
+ <entry file="file://$PROJECT_DIR$/spec/klass.rb">
482
+ <provider selected="true" editor-type-id="text-editor">
483
+ <state line="13" column="12" selection-start="0" selection-end="170" vertical-scroll-proportion="0.0">
484
+ <folding />
485
+ </state>
486
+ </provider>
487
+ </entry>
488
+ <entry file="file://$PROJECT_DIR$/ProtectedConstructor.gemspec">
489
+ <provider selected="true" editor-type-id="text-editor">
490
+ <state line="11" column="132" selection-start="566" selection-end="566" vertical-scroll-proportion="0.0">
491
+ <folding />
492
+ </state>
493
+ </provider>
494
+ </entry>
495
+ <entry file="file://$PROJECT_DIR$/spec/klass_factory.rb">
496
+ <provider selected="true" editor-type-id="text-editor">
497
+ <state line="9" column="10" selection-start="17" selection-end="127" vertical-scroll-proportion="0.28301886">
498
+ <folding />
499
+ </state>
500
+ </provider>
501
+ </entry>
502
+ <entry file="file://$PROJECT_DIR$/spec/ProtectedConstructor/protected_constructor_spec.rb">
503
+ <provider selected="true" editor-type-id="text-editor">
504
+ <state line="15" column="37" selection-start="541" selection-end="565" vertical-scroll-proportion="0.0">
505
+ <folding />
506
+ </state>
507
+ </provider>
508
+ </entry>
509
+ <entry file="file://$PROJECT_DIR$/lib/ProtectedConstructor.rb">
510
+ <provider selected="true" editor-type-id="text-editor">
511
+ <state line="33" column="36" selection-start="40" selection-end="647" vertical-scroll-proportion="0.0">
512
+ <folding />
513
+ </state>
514
+ </provider>
515
+ </entry>
516
+ <entry file="file://$PROJECT_DIR$/README.md">
517
+ <provider selected="true" editor-type-id="text-editor">
518
+ <state line="23" column="27" selection-start="452" selection-end="452" vertical-scroll-proportion="0.0">
519
+ <folding />
520
+ </state>
521
+ </provider>
522
+ </entry>
523
+ <entry file="file://$PROJECT_DIR$/Gemfile.lock">
524
+ <provider selected="true" editor-type-id="text-editor">
525
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
526
+ <folding />
527
+ </state>
528
+ </provider>
529
+ </entry>
530
+ <entry file="file://$PROJECT_DIR$/Gemfile">
531
+ <provider selected="true" editor-type-id="text-editor">
532
+ <state line="9" column="0" selection-start="197" selection-end="197" vertical-scroll-proportion="0.0">
533
+ <folding />
534
+ </state>
535
+ </provider>
536
+ </entry>
537
+ <entry file="file://$PROJECT_DIR$/Rakefile">
538
+ <provider selected="true" editor-type-id="text-editor">
539
+ <state line="13" column="0" selection-start="271" selection-end="271" vertical-scroll-proportion="0.40880504">
540
+ <folding />
541
+ </state>
542
+ </provider>
543
+ </entry>
544
+ </component>
545
+ </project>
546
+
data/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p0
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ProtectedConstructor.gemspec
4
+ gemspec
5
+
6
+ ruby '1.9.3'
7
+ gem "rspec", "~> 2.13.0"
8
+ gem "yard", "~> 0.8.6.1"
9
+ gem "redcarpet", "~> 2.3.0"
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Gene M. Angelo, Jr.
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.
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ProtectedConstructor/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ProtectedConstructor"
8
+ spec.version = ProtectedConstructor::VERSION
9
+ spec.authors = ["Gene M. Angelo, Jr."]
10
+ spec.email = ["public.gma@gmail.com"]
11
+ spec.description = %q{ProtectedConstructor Gem}
12
+ spec.summary = %q{Provides a module that may be included in a Ruby class, that protects the constructor; good for enforcing instantiation of classes using, for instance, a class factory.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # ProtectedConstructor
2
+
3
+ Provides a module that may be included in a Ruby class, that protects the constructor; good for enforcing
4
+ instantiation of classes using, for instance, a class factory.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'ProtectedConstructor'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install ProtectedConstructor
19
+
20
+ ## Usage
21
+
22
+ require 'ProtectedConstructor'
23
+
24
+ class Klass
25
+ include ProtectedConstructor
26
+
27
+ def initialize
28
+ end
29
+ end
30
+
31
+ module KlassFactory
32
+ class << self
33
+ public
34
+ def create
35
+ Klass.send(:new)
36
+ end
37
+ end
38
+ end
39
+
40
+ Constructor is not protected.
41
+ klass = Klass.new NoMethodError
42
+
43
+ Example using factory...
44
+ klass = KlassFactory::create works
45
+ klass.nil? false
46
+ klass.is_a?(Klass) true
47
+
48
+ Example just using send...
49
+ klass = Klass.send(:new) works
50
+ klass.nil? false
51
+ klass.is_a?(Klass) true
52
+
53
+ ## Contributing
54
+
55
+ 1. Fork it
56
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
57
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
58
+ 4. Push to the branch (`git push origin my-new-feature`)
59
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ rescue LoadError => e
7
+ task "spec" do
8
+ puts "RSpec not loaded - make sure it's installed and you're using bundle exec"
9
+ exit 1
10
+ end
11
+ end
12
+
13
+ task :default => :spec
@@ -0,0 +1,3 @@
1
+ module ProtectedConstructor
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,49 @@
1
+ require "ProtectedConstructor/version"
2
+
3
+ # @example
4
+ # require 'ProtectedConstructor'
5
+ #
6
+ # class Klass
7
+ # include ProtectedConstructor
8
+ #
9
+ # def initialize
10
+ # end
11
+ # end
12
+ #
13
+ # module KlassFactory
14
+ # class << self
15
+ # public
16
+ # def create
17
+ # Klass.send(:new)
18
+ # end
19
+ # end
20
+ # end
21
+ #
22
+ # # Constructor is not protected.
23
+ # klass = Klass.new # NoMethodError
24
+ #
25
+ # # Example using factory...
26
+ # klass = KlassFactory::create # works
27
+ # klass.nil? # false
28
+ # klass.is_a?(Klass) # true
29
+ #
30
+ # # Example just using #send...
31
+ # klass = Klass.send(:new) # works
32
+ # klass.nil? # false
33
+ # klass.is_a?(Klass) # true
34
+ #
35
+ module ProtectedConstructor
36
+ def self.included(klass)
37
+ klass.module_eval do
38
+ class << self
39
+ protected :new
40
+
41
+ def inherited(klass)
42
+ klass.module_eval do
43
+ def self.new(*args); super; end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,22 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe 'ProtectedConstructor' do
4
+
5
+ it 'should throw a NoMethodError exception if attempting to instantiate Klass without using the KlassFactory' do
6
+ lambda { klass = Klass.new(1) }.should raise_error NoMethodError
7
+ end
8
+
9
+ it 'should create a Klass object when using the factory' do
10
+ klass = KlassFactory::create(0)
11
+ klass.nil?.should == false
12
+ klass.is_a?(Klass).should == true
13
+ end
14
+
15
+ it 'should create a Klass object when using the factory and pass constructor parameters' do
16
+ klass = KlassFactory::create(99)
17
+ klass.nil?.should == false
18
+ klass.is_a?(Klass).should == true
19
+ klass.id.should == 99
20
+ end
21
+
22
+ end
data/spec/klass.rb ADDED
@@ -0,0 +1,13 @@
1
+ require_relative '../lib/ProtectedConstructor'
2
+
3
+ class Klass
4
+ include ProtectedConstructor
5
+
6
+ attr_reader :id
7
+
8
+ # Protected
9
+ def initialize(id)
10
+ @id = id
11
+ end
12
+
13
+ end
@@ -0,0 +1,10 @@
1
+ require 'klass'
2
+
3
+ module KlassFactory
4
+ class << self
5
+ public
6
+ def create(id)
7
+ Klass.send(:new, id)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ require 'klass'
2
+ require 'klass_factory'
3
+ require_relative '../lib/ProtectedConstructor'
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ProtectedConstructor
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Gene M. Angelo, Jr.
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
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: '1.3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
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: ProtectedConstructor Gem
47
+ email:
48
+ - public.gma@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - .idea/.name
55
+ - .idea/.rakeTasks
56
+ - .idea/ProtectedConstructor.iml
57
+ - .idea/encodings.xml
58
+ - .idea/misc.xml
59
+ - .idea/modules.xml
60
+ - .idea/runConfigurations/Start_Yard_Server.xml
61
+ - .idea/scopes/scope_settings.xml
62
+ - .idea/vcs.xml
63
+ - .idea/workspace.xml
64
+ - .rbenv-version
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - ProtectedConstructor.gemspec
68
+ - README.md
69
+ - Rakefile
70
+ - lib/ProtectedConstructor.rb
71
+ - lib/ProtectedConstructor/version.rb
72
+ - spec/ProtectedConstructor/protected_constructor_spec.rb
73
+ - spec/klass.rb
74
+ - spec/klass_factory.rb
75
+ - spec/spec_helper.rb
76
+ homepage: ''
77
+ licenses:
78
+ - MIT
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 1.8.23
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Provides a module that may be included in a Ruby class, that protects the
101
+ constructor; good for enforcing instantiation of classes using, for instance, a
102
+ class factory.
103
+ test_files:
104
+ - spec/ProtectedConstructor/protected_constructor_spec.rb
105
+ - spec/klass.rb
106
+ - spec/klass_factory.rb
107
+ - spec/spec_helper.rb
108
+ has_rdoc: