loader 1.0.1 → 1.0.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 +8 -8
- data/VERSION +1 -1
- data/lib/loader.rb +3 -3
- data/lib/loader/array.rb +0 -23
- data/lib/loader/hash.rb +0 -59
- data/loader.gemspec +2 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmY4Y2U5OTMyNGY0NzI5YTA4NWVmYzcyODZmOTUzYTU1NWU1YWYwMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTcwYzNiNzQxZmViMTdiOWYzYTVmZDMzOWQ3OTgyODY4ZDY4NzJkZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGY3MWQ5YTVlNWM2ODY2N2RmYTI1NjkzMDY4NjIzNWU0YTdiOTUyYTkxZDUx
|
10
|
+
YjRmYjExYzA1NThiMzM2YWIzM2QzNGJlNzQ1ZDRlODNkMzY2NTYxNzIyMTBk
|
11
|
+
ZjJmOWVhMjcxMzBlNGY4OWU4M2M1MzAwNWJiMTQ3OTA5ODcxYmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njc2MGE2ZDQ0MGVmYmJlMTFmY2Y1ZTg1M2M4MzA2MTY5MTRkNTUwMWYyYzYw
|
14
|
+
NTI3NmZkMjc4ZTZkNWZhMzFhMmVmYTFmYjJhNTM3YzM0OWVkZWNhOWE5ZjNh
|
15
|
+
ODViYzJjMGFhNGQyNzdlZTdlMjg4MWU2YTAzYzBjMWE0YWVjNDQ=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/loader.rb
CHANGED
@@ -3,9 +3,9 @@ module Loader
|
|
3
3
|
|
4
4
|
require "yaml"
|
5
5
|
|
6
|
-
require File.join(File.dirname(__FILE__),"loader","require")
|
7
|
-
require File.join(File.dirname(__FILE__),"loader","meta")
|
8
|
-
require File.join(File.dirname(__FILE__),"loader","hash")
|
9
6
|
require File.join(File.dirname(__FILE__),"loader","array")
|
7
|
+
require File.join(File.dirname(__FILE__),"loader","hash")
|
8
|
+
require File.join(File.dirname(__FILE__),"loader","meta")
|
9
|
+
require File.join(File.dirname(__FILE__),"loader","require")
|
10
10
|
|
11
11
|
end
|
data/lib/loader/array.rb
CHANGED
@@ -1,28 +1,5 @@
|
|
1
1
|
class Array
|
2
2
|
|
3
|
-
# remove n. element from the end
|
4
|
-
# and return a new object
|
5
|
-
def pinch n=1
|
6
|
-
return self[0..(self.count-(n+1))]
|
7
|
-
end unless method_defined? :pinch
|
8
|
-
|
9
|
-
# remove n. element from the end
|
10
|
-
# and return the original object
|
11
|
-
def pinch! n=1
|
12
|
-
n.times do
|
13
|
-
self.pop
|
14
|
-
end
|
15
|
-
return self
|
16
|
-
end unless method_defined? :pinch!
|
17
|
-
|
18
|
-
# return boolean by other array
|
19
|
-
# all element included or
|
20
|
-
# not in the target array
|
21
|
-
def contain?(oth_array)#anothere array
|
22
|
-
(oth_array & self) == oth_array
|
23
|
-
end unless method_defined? :contain?
|
24
|
-
alias :contains? :contain? unless method_defined? :contain?
|
25
|
-
|
26
3
|
# generate params structure from array
|
27
4
|
# return_array
|
28
5
|
def extract_class! class_name
|
data/lib/loader/hash.rb
CHANGED
@@ -1,53 +1,5 @@
|
|
1
1
|
class Hash
|
2
2
|
|
3
|
-
# remove elements by keys,
|
4
|
-
# array of keys,
|
5
|
-
# hashTags,
|
6
|
-
# strings
|
7
|
-
def trim(*args)
|
8
|
-
|
9
|
-
args.each do |one_element|
|
10
|
-
case true
|
11
|
-
|
12
|
-
when one_element.class == Hash
|
13
|
-
begin
|
14
|
-
one_element.each do |key,value|
|
15
|
-
if self[key] == value
|
16
|
-
self.delete(key)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
when one_element.class == Array
|
22
|
-
begin
|
23
|
-
one_element.each do |one_key|
|
24
|
-
self.delete(one_key)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
when one_element.class == Symbol,
|
29
|
-
one_element.class == String
|
30
|
-
begin
|
31
|
-
self.delete(one_element)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
return self
|
37
|
-
|
38
|
-
end unless method_defined? :trim
|
39
|
-
|
40
|
-
#pass single or array of keys, which will be removed, returning the remaining hash
|
41
|
-
def remove!(*keys)
|
42
|
-
keys.each{|key| self.delete(key) }
|
43
|
-
self
|
44
|
-
end unless method_defined? :remove!
|
45
|
-
|
46
|
-
#non-destructive version
|
47
|
-
def remove(*keys)
|
48
|
-
self.dup.remove!(*keys)
|
49
|
-
end unless method_defined? :remove
|
50
|
-
|
51
3
|
# Returns a new hash with +self+ and +other_hash+ merged recursively.
|
52
4
|
#
|
53
5
|
# h1 = {:x => {:y => [4,5,6]}, :z => [7,8,9]}
|
@@ -70,15 +22,4 @@ class Hash
|
|
70
22
|
self
|
71
23
|
end unless method_defined? :deep_merge!
|
72
24
|
|
73
|
-
# return bool that does the sub hash all element include the hash who call this or not
|
74
|
-
def deep_include?(sub_hash)
|
75
|
-
sub_hash.keys.all? do |key|
|
76
|
-
self.has_key?(key) && if sub_hash[key].is_a?(Hash)
|
77
|
-
self[key].is_a?(Hash) && self[key].deep_include?(sub_hash[key])
|
78
|
-
else
|
79
|
-
self[key] == sub_hash[key]
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end unless method_defined? :deep_include?
|
83
|
-
|
84
25
|
end
|
data/loader.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.version = File.open(File.join(File.dirname(__FILE__),"VERSION")).read.split("\n")[0].chomp.gsub(' ','')
|
10
10
|
spec.authors = ["Adam Luzsi"]
|
11
11
|
spec.email = ["adamluzsi@gmail.com"]
|
12
|
-
spec.description = %q{
|
13
|
-
spec.summary = %q{
|
12
|
+
spec.description = %q{ dsl for gem helper calls such like relative folder calls that independ on the Dir.pwd or File.expand tricks and config loader stuffs, Check out the GIT! }
|
13
|
+
spec.summary = %q{DSL for helping make file loads and configuration objects }
|
14
14
|
spec.homepage = "https://github.com/adamluzsi/loader"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -19,10 +19,4 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
##=======Runtime-ENV================##
|
23
|
-
#spec.add_runtime_dependency "asdf", ['~>4.1.3']
|
24
|
-
|
25
|
-
##=======Development-ENV============##
|
26
|
-
#spec.add_development_dependency "asdf",['~>4.1.3']
|
27
|
-
|
28
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
@@ -10,8 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: ! '
|
14
|
-
and stuffs
|
13
|
+
description: ! ' dsl for gem helper calls such like relative folder calls that independ
|
14
|
+
on the Dir.pwd or File.expand tricks and config loader stuffs, Check out the GIT! '
|
15
15
|
email:
|
16
16
|
- adamluzsi@gmail.com
|
17
17
|
executables: []
|
@@ -58,7 +58,7 @@ rubyforge_project:
|
|
58
58
|
rubygems_version: 2.2.1
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
|
-
summary:
|
61
|
+
summary: DSL for helping make file loads and configuration objects
|
62
62
|
test_files:
|
63
63
|
- test/test.rb
|
64
64
|
has_rdoc:
|