webget_ramp 1.7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data.tar.gz.sig +0 -0
  2. data/lib/webget_ramp.rb +227 -0
  3. data/lib/webget_ramp/active_record.rb +119 -0
  4. data/lib/webget_ramp/active_record/connection_adapters/abstract/schema_statements.rb +24 -0
  5. data/lib/webget_ramp/array.rb +369 -0
  6. data/lib/webget_ramp/csv.rb +52 -0
  7. data/lib/webget_ramp/date.rb +87 -0
  8. data/lib/webget_ramp/enumerable.rb +369 -0
  9. data/lib/webget_ramp/file.rb +13 -0
  10. data/lib/webget_ramp/hash.rb +195 -0
  11. data/lib/webget_ramp/integer.rb +20 -0
  12. data/lib/webget_ramp/io.rb +63 -0
  13. data/lib/webget_ramp/kernel.rb +34 -0
  14. data/lib/webget_ramp/math.rb +18 -0
  15. data/lib/webget_ramp/nil.rb +9 -0
  16. data/lib/webget_ramp/numeric.rb +94 -0
  17. data/lib/webget_ramp/object.rb +18 -0
  18. data/lib/webget_ramp/process.rb +153 -0
  19. data/lib/webget_ramp/string.rb +220 -0
  20. data/lib/webget_ramp/symbol.rb +10 -0
  21. data/lib/webget_ramp/time.rb +9 -0
  22. data/lib/webget_ramp/xml.rb +120 -0
  23. data/lib/webget_ramp/yaml.rb +32 -0
  24. data/test/webget_ramp/active_record/connection_adapters/abstract/schema_statements_test.rb +9 -0
  25. data/test/webget_ramp/active_record_test.rb +64 -0
  26. data/test/webget_ramp/array_test.rb +171 -0
  27. data/test/webget_ramp/csv_test.rb +18 -0
  28. data/test/webget_ramp/date_test.rb +60 -0
  29. data/test/webget_ramp/enumerable_test.rb +271 -0
  30. data/test/webget_ramp/file_test.rb +15 -0
  31. data/test/webget_ramp/hash_test.rb +105 -0
  32. data/test/webget_ramp/integer_test.rb +19 -0
  33. data/test/webget_ramp/io_test.rb +31 -0
  34. data/test/webget_ramp/io_test.txt +1 -0
  35. data/test/webget_ramp/kernel_test.rb +15 -0
  36. data/test/webget_ramp/math_test.rb +17 -0
  37. data/test/webget_ramp/nil_test.rb +11 -0
  38. data/test/webget_ramp/numeric_test.rb +28 -0
  39. data/test/webget_ramp/object_test.rb +12 -0
  40. data/test/webget_ramp/process_test.rb +24 -0
  41. data/test/webget_ramp/string_test.rb +125 -0
  42. data/test/webget_ramp/symbol_test.rb +26 -0
  43. data/test/webget_ramp/time_test.rb +12 -0
  44. data/test/webget_ramp/xml_test.rb +50 -0
  45. data/test/webget_ramp/xml_test_1.xml +5 -0
  46. data/test/webget_ramp/xml_test_2.xml +5 -0
  47. data/test/webget_ramp/yaml_test.rb +32 -0
  48. data/test/webget_ramp/yaml_test_1.yml +38 -0
  49. data/test/webget_ramp/yaml_test_2.yml +38 -0
  50. metadata +124 -0
  51. metadata.gz.sig +0 -0
@@ -0,0 +1,12 @@
1
+ require 'test/unit'
2
+ require 'webget_ramp'
3
+
4
+ class TimeTest < Test::Unit::TestCase
5
+
6
+ def test_log
7
+ t=Time.stamp
8
+ assert(t=~/^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/,"time format is correct")
9
+ end
10
+
11
+ end
12
+
@@ -0,0 +1,50 @@
1
+ require 'test/unit'
2
+ require 'webget_ramp'
3
+
4
+ class XMLTest < Test::Unit::TestCase
5
+
6
+ MYDIR=File.join('test','webget_ramp')
7
+ @@formatter=REXML::Formatters::Default.new
8
+
9
+ def test_load_dir_files
10
+ dirpath=File.join(MYDIR,'xml_test_*.xml')
11
+ expect=[File.join(MYDIR,'xml_test_1.xml'),File.join(MYDIR,'xml_test_2.xml')]
12
+ actual=Dir[dirpath].sort
13
+ assert_equal(expect,actual,"Dir[#{dirpath}] expects test data files")
14
+ end
15
+
16
+ def test_load_dir
17
+ dirpath=File.join(MYDIR,'xml_test_*.xml')
18
+ expect="abcdef"
19
+ actual=''
20
+ XML.load_dir(dirpath){|doc| doc.elements.each('foo/bar'){|e| actual+=e.attributes['x']}}
21
+ assert_equal(expect,actual,'XML.load_dir')
22
+ end
23
+
24
+ def test_attributes_to_hash
25
+ doc=REXML::Document.new('<foo a="b" c="d" e="f"/>')
26
+ expect={"a"=>"b","c"=>"d","e"=>"f"}
27
+ actual=doc.elements['foo'].attributes.to_hash
28
+ assert_equal(expect,actual,'XML attributes hash')
29
+ end
30
+
31
+ def test_element_remove_attributes
32
+ xml="<foo a='b' c='d'><bar e='f' g='h'>text</bar></foo>"
33
+ expect="<foo><bar e='f' g='h'>text</bar></foo>"
34
+ doc=REXML::Document.new(xml)
35
+ doc.elements[1].remove_attributes
36
+ actual=doc.to_s
37
+ assert_equal(expect,actual)
38
+ end
39
+
40
+ def test_document_remove_attributes
41
+ xml="<foo a='b' c='d'><bar e='f' g='h'>text</bar></foo>"
42
+ expect="<foo><bar>text</bar></foo>"
43
+ doc=REXML::Document.new(xml)
44
+ doc.remove_attributes
45
+ actual=doc.to_s
46
+ assert_equal(expect,actual)
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,5 @@
1
+ <foo>
2
+ <bar x="a"/>
3
+ <bar x="b"/>
4
+ <bar x="c"/>
5
+ </foo>
@@ -0,0 +1,5 @@
1
+ <foo>
2
+ <bar x="d"/>
3
+ <bar x="e"/>
4
+ <bar x="f"/>
5
+ </foo>
@@ -0,0 +1,32 @@
1
+ require 'test/unit'
2
+ require 'webget_ramp'
3
+
4
+ class YAMLTest < Test::Unit::TestCase
5
+
6
+ MYDIR=File.join('test','webget_ramp')
7
+
8
+ def test_load_dir_files
9
+ dirpath=File.join(MYDIR,'yaml_test_*.yml')
10
+ expect=[File.join(MYDIR,'yaml_test_1.yml'),File.join(MYDIR,'yaml_test_2.yml')]
11
+ actual=Dir[dirpath].sort
12
+ assert_equal(expect,actual,"Dir[#{dirpath}] expects test data files")
13
+ end
14
+
15
+ def test_load_dir
16
+ dirpath=File.join(MYDIR,'yaml_test_*.yml')
17
+ expect=[
18
+ "a:a1,a10,a2,a20,a3,a30b:b1,b10,b2,b20,b3,b30c:c1,c10,c2,c20,c3,c30",
19
+ "d:d1,d10,d2,d20,d3,d30e:e1,e10,e2,e20,e3,e30f:f1,f10,f2,f20,f3,f30",
20
+ "g:g1,g10,g2,g20,g3,g30h:h1,h10,h2,h20,h3,h30i:i1,i10,i2,i20,i3,i30",
21
+ "j:j1,j10,j2,j20,j3,j30k:k1,k10,k2,k20,k3,k30l:l1,l10,l2,l20,l3,l30",
22
+ "m:m1,m10,m2,m20,m3,m30n:n1,n10,n2,n20,n3,n30o:o1,o10,o2,o20,o3,o30",
23
+ "p:p1,p10,p2,p20,p3,p30q:q1,q10,q2,q20,q3,q30r:r1,r10,r2,r20,r3,r30",
24
+ ]
25
+ actual=[]
26
+ YAML.load_dir(dirpath){|doc| actual << doc.keys.map{|k| v=doc[k]; "#{k}:#{v.sort.join(",")}" }.join("") }
27
+ actual.sort!
28
+ assert_equal(expect,actual,'YAML.load_dir')
29
+ end
30
+
31
+ end
32
+
@@ -0,0 +1,38 @@
1
+ a:
2
+ a1: "a10"
3
+ a2: "a20"
4
+ a3: "a30"
5
+ b:
6
+ b1: "b10"
7
+ b2: "b20"
8
+ b3: "b30"
9
+ c:
10
+ c1: "c10"
11
+ c2: "c20"
12
+ c3: "c30"
13
+ ---
14
+ d:
15
+ d1: "d10"
16
+ d2: "d20"
17
+ d3: "d30"
18
+ e:
19
+ e1: "e10"
20
+ e2: "e20"
21
+ e3: "e30"
22
+ f:
23
+ f1: "f10"
24
+ f2: "f20"
25
+ f3: "f30"
26
+ ---
27
+ g:
28
+ g1: "g10"
29
+ g2: "g20"
30
+ g3: "g30"
31
+ h:
32
+ h1: "h10"
33
+ h2: "h20"
34
+ h3: "h30"
35
+ i:
36
+ i1: "i10"
37
+ i2: "i20"
38
+ i3: "i30"
@@ -0,0 +1,38 @@
1
+ j:
2
+ j1: "j10"
3
+ j2: "j20"
4
+ j3: "j30"
5
+ k:
6
+ k1: "k10"
7
+ k2: "k20"
8
+ k3: "k30"
9
+ l:
10
+ l1: "l10"
11
+ l2: "l20"
12
+ l3: "l30"
13
+ ---
14
+ m:
15
+ m1: "m10"
16
+ m2: "m20"
17
+ m3: "m30"
18
+ n:
19
+ n1: "n10"
20
+ n2: "n20"
21
+ n3: "n30"
22
+ o:
23
+ o1: "o10"
24
+ o2: "o20"
25
+ o3: "o30"
26
+ ---
27
+ p:
28
+ p1: "p10"
29
+ p2: "p20"
30
+ p3: "p30"
31
+ q:
32
+ q1: "q10"
33
+ q2: "q20"
34
+ q3: "q30"
35
+ r:
36
+ r1: "r10"
37
+ r2: "r20"
38
+ r3: "r30"
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: webget_ramp
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.7.1.1
5
+ platform: ruby
6
+ authors:
7
+ - WebGet
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDvDCCAyWgAwIBAgIJAIlSqEkDQaZIMA0GCSqGSIb3DQEBBQUAMIGbMQswCQYD
14
+ VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5j
15
+ aXNjbzETMBEGA1UEChMKV2ViR2V0LmNvbTETMBEGA1UECxMKV2ViR2V0LmNvbTET
16
+ MBEGA1UEAxMKV2ViR2V0LmNvbTEgMB4GCSqGSIb3DQEJARYRd2ViZ2V0QHdlYmdl
17
+ dC5jb20wHhcNMDkwMjI2MTk0NDU4WhcNMTExMTIzMTk0NDU4WjCBmzELMAkGA1UE
18
+ BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
19
+ Y28xEzARBgNVBAoTCldlYkdldC5jb20xEzARBgNVBAsTCldlYkdldC5jb20xEzAR
20
+ BgNVBAMTCldlYkdldC5jb20xIDAeBgkqhkiG9w0BCQEWEXdlYmdldEB3ZWJnZXQu
21
+ Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXCFYfW6hCQl0ToNjaMIXG
22
+ ZfPF6OoR20BO/Tg6V37qPi7gDSZ6vIC6Mxcs8LtEcju85cD9lnKKl/lo4S5/w9Ha
23
+ hGD2ZFFfbF8420X5Za5G2KuriS3GzRz7F5dKCTjb1NH9TPlgOc71bcrDmCwwtFJl
24
+ T+tdfBju0YxLSBiMXf4y5QIDAQABo4IBBDCCAQAwHQYDVR0OBBYEFHB1kXO/Xd4g
25
+ G+AJ2/wwh6JOWXzNMIHQBgNVHSMEgcgwgcWAFHB1kXO/Xd4gG+AJ2/wwh6JOWXzN
26
+ oYGhpIGeMIGbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQG
27
+ A1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UEChMKV2ViR2V0LmNvbTETMBEGA1UE
28
+ CxMKV2ViR2V0LmNvbTETMBEGA1UEAxMKV2ViR2V0LmNvbTEgMB4GCSqGSIb3DQEJ
29
+ ARYRd2ViZ2V0QHdlYmdldC5jb22CCQCJUqhJA0GmSDAMBgNVHRMEBTADAQH/MA0G
30
+ CSqGSIb3DQEBBQUAA4GBADzVXlwuff0/w3yK4LflGKKhtC3oChIrwmSyP6tk628N
31
+ BHokpc4Kz63xSXqzYTnBS7rFBwlYThtNalQeWmoUjGh3Z0ZR0JlhU0ln8899LuJ3
32
+ DXnLFY0cVuBnNDMOOFl8vk1qIcZjcTovhzgcixpG6Uk5qmUsKHRLQf4oQJx7TfLK
33
+ -----END CERTIFICATE-----
34
+
35
+ date: 2009-10-27 00:00:00 -07:00
36
+ default_executable:
37
+ dependencies: []
38
+
39
+ description:
40
+ email: webget@webget.com
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files: []
46
+
47
+ files:
48
+ - lib/webget_ramp.rb
49
+ - lib/webget_ramp/active_record.rb
50
+ - lib/webget_ramp/active_record/connection_adapters/abstract/schema_statements.rb
51
+ - lib/webget_ramp/array.rb
52
+ - lib/webget_ramp/csv.rb
53
+ - lib/webget_ramp/date.rb
54
+ - lib/webget_ramp/enumerable.rb
55
+ - lib/webget_ramp/file.rb
56
+ - lib/webget_ramp/hash.rb
57
+ - lib/webget_ramp/integer.rb
58
+ - lib/webget_ramp/io.rb
59
+ - lib/webget_ramp/kernel.rb
60
+ - lib/webget_ramp/math.rb
61
+ - lib/webget_ramp/nil.rb
62
+ - lib/webget_ramp/numeric.rb
63
+ - lib/webget_ramp/object.rb
64
+ - lib/webget_ramp/process.rb
65
+ - lib/webget_ramp/string.rb
66
+ - lib/webget_ramp/symbol.rb
67
+ - lib/webget_ramp/time.rb
68
+ - lib/webget_ramp/xml.rb
69
+ - lib/webget_ramp/yaml.rb
70
+ - test/webget_ramp/io_test.txt
71
+ - test/webget_ramp/xml_test_1.xml
72
+ - test/webget_ramp/xml_test_2.xml
73
+ - test/webget_ramp/yaml_test_1.yml
74
+ - test/webget_ramp/yaml_test_2.yml
75
+ has_rdoc: true
76
+ homepage: http://webget.com/ruby/gem/webget_ramp
77
+ licenses: []
78
+
79
+ post_install_message:
80
+ rdoc_options: []
81
+
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: "0"
89
+ version:
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: "0"
95
+ version:
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.3.5
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: WebGet ramp gem provides base extensions to ruby classes and rails classes.
103
+ test_files:
104
+ - test/webget_ramp/active_record_test.rb
105
+ - test/webget_ramp/active_record/connection_adapters/abstract/schema_statements_test.rb
106
+ - test/webget_ramp/array_test.rb
107
+ - test/webget_ramp/csv_test.rb
108
+ - test/webget_ramp/date_test.rb
109
+ - test/webget_ramp/enumerable_test.rb
110
+ - test/webget_ramp/file_test.rb
111
+ - test/webget_ramp/hash_test.rb
112
+ - test/webget_ramp/integer_test.rb
113
+ - test/webget_ramp/io_test.rb
114
+ - test/webget_ramp/kernel_test.rb
115
+ - test/webget_ramp/math_test.rb
116
+ - test/webget_ramp/nil_test.rb
117
+ - test/webget_ramp/numeric_test.rb
118
+ - test/webget_ramp/object_test.rb
119
+ - test/webget_ramp/process_test.rb
120
+ - test/webget_ramp/string_test.rb
121
+ - test/webget_ramp/symbol_test.rb
122
+ - test/webget_ramp/time_test.rb
123
+ - test/webget_ramp/xml_test.rb
124
+ - test/webget_ramp/yaml_test.rb
metadata.gz.sig ADDED
Binary file