ddollar-preferences 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/preferences.rb +47 -3
- metadata +2 -10
data/lib/preferences.rb
CHANGED
@@ -1,7 +1,51 @@
|
|
1
|
+
# Equivalent to a header guard in C/C++
|
2
|
+
# Used to prevent the class/module from being loaded more than once
|
3
|
+
unless defined? Preferences
|
4
|
+
|
1
5
|
module Preferences
|
2
|
-
|
6
|
+
|
7
|
+
class EnvironmentException < Exception; end
|
8
|
+
|
9
|
+
# :stopdoc:
|
10
|
+
VERSION = '0.1.3'
|
11
|
+
LIBPATH = File.expand_path(File.dirname(__FILE__)) + File::SEPARATOR
|
12
|
+
PATH = File.dirname(LIBPATH) + File::SEPARATOR
|
13
|
+
# :startdoc:
|
14
|
+
|
15
|
+
# Returns the version string for the library.
|
16
|
+
#
|
17
|
+
def self.version
|
18
|
+
VERSION
|
3
19
|
end
|
20
|
+
|
21
|
+
# Returns the library path for the module. If any arguments are given,
|
22
|
+
# they will be joined to the end of the libray path using
|
23
|
+
# <tt>File.join</tt>.
|
24
|
+
#
|
25
|
+
def self.libpath( *args )
|
26
|
+
args.empty? ? LIBPATH : ::File.join(LIBPATH, *args)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns the lpath for the module. If any arguments are given,
|
30
|
+
# they will be joined to the end of the path using
|
31
|
+
# <tt>File.join</tt>.
|
32
|
+
#
|
33
|
+
def self.path( *args )
|
34
|
+
args.empty? ? PATH : ::File.join(PATH, *args)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Utility method used to rquire all files ending in .rb that lie in the
|
38
|
+
# directory below this file that has the same name as the filename passed
|
39
|
+
# in. Optionally, a specific _directory_ name can be passed in such that
|
40
|
+
# the _filename_ does not have to be equivalent to the directory.
|
41
|
+
#
|
42
|
+
def self.require_all_libs_relative_to(fname)
|
43
|
+
search_me = File.expand_path(File.join(File.dirname(fname), '**', '*.rb'))
|
44
|
+
Dir.glob(search_me).sort.each { |rb| require rb }
|
45
|
+
end
|
46
|
+
|
4
47
|
end
|
5
48
|
|
6
|
-
|
7
|
-
|
49
|
+
Preferences.require_all_libs_relative_to __FILE__
|
50
|
+
|
51
|
+
end # unless defined?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddollar-preferences
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Dollar
|
@@ -22,21 +22,13 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README
|
24
24
|
files:
|
25
|
-
- doc/output
|
26
|
-
- doc/output/coverage
|
27
|
-
- doc/output/coverage/index.html
|
28
|
-
- doc/output/coverage/lib-preferences-manager_rb.html
|
29
|
-
- doc/output/coverage/lib-preferences-platform_rb.html
|
30
|
-
- doc/output/coverage/lib-preferences_rb.html
|
31
|
-
- doc/output/coverage/spec-manager_spec_rb.html
|
32
|
-
- doc/output/coverage/spec-platform_spec_rb.html
|
33
25
|
- lib/preferences
|
34
26
|
- lib/preferences/manager.rb
|
35
27
|
- lib/preferences/platform.rb
|
36
28
|
- lib/preferences.rb
|
37
29
|
- README
|
38
30
|
has_rdoc: true
|
39
|
-
homepage: http://peervoice.com/software/
|
31
|
+
homepage: http://peervoice.com/software/preferences
|
40
32
|
post_install_message:
|
41
33
|
rdoc_options: []
|
42
34
|
|