buzzcore 0.6.4 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/buzzcore/string_utils.rb +16 -1
- data/lib/buzzcore/xml_utils.rb +5 -2
- metadata +45 -63
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: daffa739b235d713ac044155cfc7313718203ca6
|
4
|
+
data.tar.gz: 4d1ef59d85139640f70fdf5b04e0d419476981dd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9fa814dfe59742763b3a90f67b8963519ffc5a60b3d79697afe4355adcba8dba0952bb2a3ed3ebf99b4b0f342c41d75e32299787d124e025cb88503c70f3b042
|
7
|
+
data.tar.gz: e7a039527d174c4baffecafb04e24972e550d1b890351d6a6b90c6d89f5113b9648cc475364c7403fce047afc30e783ecd89b6d15f553b8379b49d81c6505442
|
@@ -18,7 +18,22 @@ module StringUtils
|
|
18
18
|
result = (match ? match.pre_match : aText)
|
19
19
|
result
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
|
+
# given ('abcdefg','c.*?e') returns ['ab','cde','fg'] so you can manipulate the head, match and tail seperately, and potentially rejoin
|
23
|
+
def split3(aPattern,aOccurence=0)
|
24
|
+
aString = self
|
25
|
+
matches = aString.scan_md(aPattern)
|
26
|
+
match = matches[aOccurence]
|
27
|
+
parts = (match ? [match.pre_match,match.to_s,match.post_match] : [aString,nil,''])
|
28
|
+
|
29
|
+
if !block_given? # return head,match,tail
|
30
|
+
parts
|
31
|
+
else # return string
|
32
|
+
parts[1] = yield *parts if match
|
33
|
+
parts.join
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
22
37
|
def self.random_word(min,max)
|
23
38
|
len = min + rand(max-min+1)
|
24
39
|
result = ' '*len
|
data/lib/buzzcore/xml_utils.rb
CHANGED
@@ -102,8 +102,11 @@ module XmlUtils
|
|
102
102
|
|
103
103
|
def self.read_simple_items(aRoot,aParentXPath=nil)
|
104
104
|
result = {}
|
105
|
-
|
106
|
-
|
105
|
+
items = if aParentXPath
|
106
|
+
aRoot.get_elements(aParentXPath + '/Item')
|
107
|
+
else
|
108
|
+
aRoot.elements.to_a
|
109
|
+
end
|
107
110
|
items.each do |item|
|
108
111
|
next unless item.name=='Item' || item.name=='item'
|
109
112
|
name = (item.attribute('name')||item.attribute('Name')).to_s
|
metadata
CHANGED
@@ -1,61 +1,52 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: buzzcore
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 4
|
10
|
-
version: 0.6.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.6
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- buzzware
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2011-07-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: POpen4
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
32
20
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: shoulda
|
36
21
|
prerelease: false
|
37
|
-
|
38
|
-
|
39
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: shoulda
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
40
31
|
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
46
34
|
type: :development
|
47
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
48
41
|
description: buzzcore is the ruby core library developed and used by Buzzware Solutions.
|
49
42
|
email: contact@buzzware.com.au
|
50
43
|
executables: []
|
51
|
-
|
52
44
|
extensions: []
|
53
|
-
|
54
|
-
extra_rdoc_files:
|
45
|
+
extra_rdoc_files:
|
55
46
|
- LICENSE
|
56
47
|
- README.rdoc
|
57
|
-
files:
|
58
|
-
- .gitignore
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
59
50
|
- LICENSE
|
60
51
|
- README.rdoc
|
61
52
|
- Rakefile
|
@@ -86,38 +77,29 @@ files:
|
|
86
77
|
- test/test_helper.rb
|
87
78
|
homepage: http://github.com/buzzware/buzzcore
|
88
79
|
licenses: []
|
89
|
-
|
80
|
+
metadata: {}
|
90
81
|
post_install_message:
|
91
|
-
rdoc_options:
|
92
|
-
- --charset=UTF-8
|
93
|
-
require_paths:
|
82
|
+
rdoc_options:
|
83
|
+
- "--charset=UTF-8"
|
84
|
+
require_paths:
|
94
85
|
- lib
|
95
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
-
|
97
|
-
requirements:
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
98
88
|
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
version: "0"
|
104
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
107
93
|
- - ">="
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
version: "0"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
113
96
|
requirements: []
|
114
|
-
|
115
97
|
rubyforge_project:
|
116
|
-
rubygems_version:
|
98
|
+
rubygems_version: 2.2.2
|
117
99
|
signing_key:
|
118
100
|
specification_version: 3
|
119
101
|
summary: buzzcore is the ruby core library developed and used by Buzzware Solutions.
|
120
|
-
test_files:
|
102
|
+
test_files:
|
121
103
|
- test/buzzcore_test.rb
|
122
104
|
- test/config_test.rb
|
123
105
|
- test/credentials_test.rb
|