yukon 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/yukon/version.rb +1 -1
- data/lib/yukon.rb +26 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19c670e1ced93d67fcd15488af0c05a8ab878339
|
4
|
+
data.tar.gz: 9728177bb7a0757a67c0fd30c84eb4218adcc29d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878205418f1a6310b0b26a5022ac1a7a7c97f30a6410cbc2deaa17d97e91c9700d3e95fd6c381fb2c6564ff6899c072351fa1de112dc2dc6ce868d808b44d8cb
|
7
|
+
data.tar.gz: e4f2b9ba53e712d415e84904e4609a970ee676b204d3c6d18945071d6bf9206375b1475fd9e01cc8b91e984e5057e8139a1e340f8fd96960149e54d6865e6ebc
|
data/lib/yukon/version.rb
CHANGED
data/lib/yukon.rb
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
require "yukon/version"
|
2
|
-
|
2
|
+
|
3
|
+
module Configuration
|
4
|
+
def configuration
|
5
|
+
yield self
|
6
|
+
end
|
7
|
+
|
8
|
+
def define_setting(name, default = nil)
|
9
|
+
class_variable_set("@@#{name}", default)
|
10
|
+
|
11
|
+
define_class_method "#{name}=" do |value|
|
12
|
+
class_variable_set("@@#{name}", value)
|
13
|
+
end
|
14
|
+
|
15
|
+
define_class_method name do
|
16
|
+
class_variable_get("@@#{name}")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def define_class_method(name, &block)
|
23
|
+
(class << self; self; end).instance_eval do
|
24
|
+
define_method name, &block
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
3
28
|
|
4
29
|
module Yukon
|
5
30
|
extend Configuration
|