rUtilAnts 0.2.0.20101109 → 0.2.1.20101110
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +46 -0
- data/LICENSE +1 -1
- data/ReleaseInfo +3 -3
- data/lib/rUtilAnts/GUI/BugReportDialog.rb +1 -1
- data/lib/rUtilAnts/GUI.rb +1 -1
- data/lib/rUtilAnts/Logging.rb +1 -1
- data/lib/rUtilAnts/Misc.rb +1 -1
- data/lib/rUtilAnts/Platform.rb +2 -1
- data/lib/rUtilAnts/Platforms/i386-cygwin/PlatformInfo.rb +149 -0
- data/lib/rUtilAnts/Platforms/i386-linux/PlatformInfo.rb +1 -1
- data/lib/rUtilAnts/Platforms/i386-mswin32/PlatformInfo.rb +1 -1
- data/lib/rUtilAnts/Platforms/x86_64-linux/PlatformInfo.rb +1 -1
- data/lib/rUtilAnts/Plugins.rb +1 -1
- data/lib/rUtilAnts/URLAccess.rb +1 -1
- data/lib/rUtilAnts/URLCache.rb +1 -1
- data/lib/rUtilAnts/URLHandlers/DataImage.rb +1 -1
- data/lib/rUtilAnts/URLHandlers/FTP.rb +1 -1
- data/lib/rUtilAnts/URLHandlers/HTTP.rb +1 -1
- data/lib/rUtilAnts/URLHandlers/LocalFile.rb +1 -1
- metadata +5 -4
data/ChangeLog
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
= rUtilAnts Release History
|
2
2
|
|
3
|
+
== 0.2.1.20101110 (Beta)
|
4
|
+
|
5
|
+
* Changed copyright mentions.
|
6
|
+
* Platforms: Added i386-cygwin platform.
|
7
|
+
|
8
|
+
== 0.2.0.20101109 (Beta)
|
9
|
+
|
10
|
+
=== All modules
|
11
|
+
|
12
|
+
* Changed DevStatus to Beta.
|
13
|
+
* Corrected some typos when requiring rUtilAnts.
|
14
|
+
* ForeignProcess: Implemented a way to run a method in an external process with Shell commands to execute before Ruby's invocation. Useful for LD_LIBRARY_PATH settings.
|
15
|
+
|
16
|
+
=== Logging module
|
17
|
+
|
18
|
+
* Added functions to mute/unmute StdOut/StdErr
|
19
|
+
* Added API to access the initial parameters given when initializing the module.
|
20
|
+
* Added possibility to know the status of the debug mode using debugActivated? method.
|
21
|
+
* Don't log anymore if Debug logs are activated/deactivated when the status remains the same.
|
22
|
+
* Added logWarn.
|
23
|
+
* Added getLogFile.
|
24
|
+
* Bug correction: When logExc or logBug were called in a context not having any caller, an error occurred.
|
25
|
+
|
26
|
+
=== Misc module
|
27
|
+
|
28
|
+
* Added changeDir method.
|
29
|
+
|
30
|
+
=== Platforms module
|
31
|
+
|
32
|
+
* Added x86_64-linux platform.
|
33
|
+
* Better error display when Platforms can't be loaded.
|
34
|
+
* Bug correction: Windows' discrete executable extensions were not correctly listed.
|
35
|
+
* Bug correction: If the platform was not supported, logBug could not be called correctly.
|
36
|
+
* Bug correction: Platforms were not loaded correctly on case-sensitive file systems.
|
37
|
+
* Bug correction: sendMsg on Windows did not work correctly with \n and messages exzceding 255 characters.
|
38
|
+
|
39
|
+
=== URLAccess module
|
40
|
+
|
41
|
+
* Better comments.
|
42
|
+
* HTTP requests use a different User-Agent.*
|
43
|
+
* Bug correction: Since Ruby 1.8.6, it is needed to use File.expand_paht on Windows when mixing files separators.
|
44
|
+
|
45
|
+
=== URLHandlers module
|
46
|
+
|
47
|
+
* Bug correction: HTTP file names could be invalid.
|
48
|
+
|
3
49
|
== 0.1.1.20091105 (Alpha)
|
4
50
|
|
5
51
|
* Added possibility to mute stdout without muting stderr during initialization.
|
data/LICENSE
CHANGED
@@ -6,7 +6,7 @@ This list is found in the file named AUTHORS.
|
|
6
6
|
The AUTHORS and LICENSE files have to be included in any release of software
|
7
7
|
embedding source code of this package, or using it as a derivative software.
|
8
8
|
|
9
|
-
Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
9
|
+
Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
10
10
|
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
data/ReleaseInfo
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# This file has been generated by RubyPackager during a delivery.
|
3
3
|
# More info about RubyPackager: http://rubypackager.sourceforge.net
|
4
4
|
{
|
5
|
-
:Version => '0.2.
|
6
|
-
:Tags => [],
|
7
|
-
:DevStatus => '
|
5
|
+
:Version => '0.2.1.20101110',
|
6
|
+
:Tags => [ 'Beta' ],
|
7
|
+
:DevStatus => 'Beta'
|
8
8
|
}
|
data/lib/rUtilAnts/GUI.rb
CHANGED
data/lib/rUtilAnts/Logging.rb
CHANGED
data/lib/rUtilAnts/Misc.rb
CHANGED
data/lib/rUtilAnts/Platform.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
2
|
+
# Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
3
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
4
|
#++
|
5
5
|
|
@@ -10,6 +10,7 @@ module RUtilAnts
|
|
10
10
|
# OS constants
|
11
11
|
OS_WINDOWS = 0
|
12
12
|
OS_LINUX = 1
|
13
|
+
OS_CYGWIN = 2
|
13
14
|
|
14
15
|
# Initialize the platform info
|
15
16
|
def self.initializePlatform
|
@@ -0,0 +1,149 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
module RUtilAnts
|
7
|
+
|
8
|
+
module Platform
|
9
|
+
|
10
|
+
class PlatformInfo
|
11
|
+
|
12
|
+
# Return the ID of the OS
|
13
|
+
# Applications may adapt their behavior based on it.
|
14
|
+
#
|
15
|
+
# Return:
|
16
|
+
# * _Integer_: OS ID
|
17
|
+
def os
|
18
|
+
return OS_CYGWIN
|
19
|
+
end
|
20
|
+
|
21
|
+
# Return the list of directories where we look for executables
|
22
|
+
#
|
23
|
+
# Return:
|
24
|
+
# * <em>list<String></em>: List of directories
|
25
|
+
def getSystemExePath
|
26
|
+
return ENV['PATH'].split(':')
|
27
|
+
end
|
28
|
+
|
29
|
+
# Set the list of directories where we look for executables
|
30
|
+
#
|
31
|
+
# Parameters:
|
32
|
+
# * *iNewDirsList* (<em>list<String></em>): List of directories
|
33
|
+
def setSystemExePath(iNewDirsList)
|
34
|
+
ENV['PATH'] = iNewDirsList.join(':')
|
35
|
+
end
|
36
|
+
|
37
|
+
# Return the list of file extensions that might be discretely happened to executable files.
|
38
|
+
# This is the optional extensions that can be happened when invoked from a terminal.
|
39
|
+
#
|
40
|
+
# Return:
|
41
|
+
# * <em>list<String></em>: List of extensions (including .)
|
42
|
+
def getDiscreteExeExtensions
|
43
|
+
return []
|
44
|
+
end
|
45
|
+
|
46
|
+
# Return the list of directories where we look for libraries
|
47
|
+
#
|
48
|
+
# Return:
|
49
|
+
# * <em>list<String></em>: List of directories
|
50
|
+
def getSystemLibsPath
|
51
|
+
rList = ENV['PATH'].split(':')
|
52
|
+
|
53
|
+
if (ENV['LD_LIBRARY_PATH'] != nil)
|
54
|
+
rList += ENV['LD_LIBRARY_PATH'].split(':')
|
55
|
+
end
|
56
|
+
|
57
|
+
return rList
|
58
|
+
end
|
59
|
+
|
60
|
+
# Set the list of directories where we look for libraries
|
61
|
+
#
|
62
|
+
# Parameters:
|
63
|
+
# * *iNewDirsList* (<em>list<String></em>): List of directories
|
64
|
+
def setSystemLibsPath(iNewDirsList)
|
65
|
+
ENV['LD_LIBRARY_PATH'] = iNewDirsList.join(':')
|
66
|
+
end
|
67
|
+
|
68
|
+
# This method sends a message (platform dependent) to the user, without the use of wxruby
|
69
|
+
#
|
70
|
+
# Parameters:
|
71
|
+
# * *iMsg* (_String_): The message to display
|
72
|
+
def sendMsg(iMsg)
|
73
|
+
# TODO: Handle case of xmessage not installed
|
74
|
+
# Create a temporary file with the content to display
|
75
|
+
require 'tmpdir'
|
76
|
+
lTmpFileName = "#{Dir.tmpdir}/RUA_MSG"
|
77
|
+
File.open(lTmpFileName, 'w') do |oFile|
|
78
|
+
oFile.write(iMsg)
|
79
|
+
end
|
80
|
+
system("xmessage -file #{lTmpFileName}")
|
81
|
+
File.unlink(lTmpFileName)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Execute a Shell command.
|
85
|
+
# Do not wait for its termination.
|
86
|
+
#
|
87
|
+
# Parameters:
|
88
|
+
# * *iCmd* (_String_): The command to execute
|
89
|
+
# * *iInTerminal* (_Boolean_): Do we execute this command in a separate terminal ?
|
90
|
+
# Return:
|
91
|
+
# * _Exception_: Error, or nil if success
|
92
|
+
def execShellCmdNoWait(iCmd, iInTerminal)
|
93
|
+
rException = nil
|
94
|
+
|
95
|
+
if (iInTerminal)
|
96
|
+
# TODO: Handle case of xterm not installed
|
97
|
+
if (!system("xterm -e \"#{iCmd}\""))
|
98
|
+
rException = RuntimeError.new
|
99
|
+
end
|
100
|
+
else
|
101
|
+
begin
|
102
|
+
IO.popen(iCmd)
|
103
|
+
rescue Exception
|
104
|
+
rException = $!
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
return rException
|
109
|
+
end
|
110
|
+
|
111
|
+
# Execute a given URL to be launched in a browser
|
112
|
+
#
|
113
|
+
# Parameters:
|
114
|
+
# * *iURL* (_String_): The URL to launch
|
115
|
+
# Return:
|
116
|
+
# * _String_: Error message, or nil if success
|
117
|
+
def launchURL(iURL)
|
118
|
+
rError = nil
|
119
|
+
|
120
|
+
begin
|
121
|
+
IO.popen("xdg-open '#{iURL}'")
|
122
|
+
rescue Exception
|
123
|
+
rError = $!.to_s
|
124
|
+
end
|
125
|
+
|
126
|
+
return rError
|
127
|
+
end
|
128
|
+
|
129
|
+
# Get file extensions specifics to executable files
|
130
|
+
#
|
131
|
+
# Return:
|
132
|
+
# * <em>list<String></em>: List of extensions (including . character). It can be empty.
|
133
|
+
def getExecutableExtensions
|
134
|
+
return []
|
135
|
+
end
|
136
|
+
|
137
|
+
# Get prohibited characters from file names
|
138
|
+
#
|
139
|
+
# Return:
|
140
|
+
# * _String_: String of prohibited characters in file names
|
141
|
+
def getProhibitedFileNamesCharacters
|
142
|
+
return '/'
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
data/lib/rUtilAnts/Plugins.rb
CHANGED
data/lib/rUtilAnts/URLAccess.rb
CHANGED
data/lib/rUtilAnts/URLCache.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
- 20101110
|
10
|
+
version: 0.2.1.20101110
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Muriel Salvan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-10 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- lib/rUtilAnts/Platforms/i386-linux/PlatformInfo.rb
|
38
38
|
- lib/rUtilAnts/Platforms/i386-mswin32/PlatformInfo.rb
|
39
39
|
- lib/rUtilAnts/Platforms/x86_64-linux/PlatformInfo.rb
|
40
|
+
- lib/rUtilAnts/Platforms/i386-cygwin/PlatformInfo.rb
|
40
41
|
- lib/rUtilAnts/Plugins.rb
|
41
42
|
- lib/rUtilAnts/GUI.rb
|
42
43
|
- lib/rUtilAnts/Platform.rb
|