Displaying 5 results from an estimated 5 matches for "valid_".
Did you mean:
valid
2008 Jan 11
5
Missing methods
...om implementation of the Mother Object idea. It''s inside
of a module, basically like this:
module Factory
%w(account friendship person invitation message asset email_address
birth).each do |klass|
eval <<-EOF
def self.create_#{klass}(attributes = {})
default_attributes = valid_#{klass}_attributes
#{klass.camelize}.create! default_attributes.merge(attributes)
end
EOF
end
def valid_message_attributes(options = {})
{
#some message options
}
end
#more valid_x_attributes methods
end
When I require this file in a spec file, Factory.create_person works
fine...
2016 Dec 24
0
[PATCH] lib: Use a common function to validate strings.
...f --git a/src/appliance-kcmdline.c b/src/appliance-kcmdline.c
index 6771668..c5bc65f 100644
--- a/src/appliance-kcmdline.c
+++ b/src/appliance-kcmdline.c
@@ -36,23 +36,8 @@
* Check that the $TERM environment variable is reasonable before
* we pass it through to the appliance.
*/
-static bool
-valid_term (const char *term)
-{
- size_t len = strlen (term);
-
- if (len == 0 || len > 16)
- return false;
-
- while (len > 0) {
- char c = *term++;
- len--;
- if (!c_isalnum (c) && c != '-' && c != '_')
- return false;
- }
-
- return true;
-}...
2016 Dec 24
2
[PATCH] lib: Use a common function to validate strings.
As discussed in the thread on validating $TERM, it would be good to
have a common function to do this. This is such a function.
The main advantage is it includes unit tests which the previous
functions did not.
Rich.
2017 Jan 20
5
[PATCH 0/5] Rename src/ to lib/ and move common code to common/
This patch series moves some files and directories around but is only
code motion (or supposed to be).
A new directory, common/, is created for all of the common code which
is currently shared in random ways between parts of the project.
And src/ becomes lib/ (the largest change, but mostly mechanical).
In full this series makes the following changes:
src/libprotocol -> common/protocol
2017 Jan 25
10
[PATCH v2 0/7] Rename src/ to lib/ and move common code to common/
Previous patch series was posted here:
https://www.redhat.com/archives/libguestfs/2017-January/msg00059.html
v2 simply extends this patch series to cover the extra directories
common/edit, common/progress, common/windows and common/parallel.
The only remaining item is to consider whether we should rename mllib
to something else, mlcommon was my suggestion.
Rich.